diff -Nru sumo-1.11.0/build/debian/changelog sumo-1.12.0/build/debian/changelog --- sumo-1.11.0/build/debian/changelog 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/build/debian/changelog 2022-01-24 20:43:50.000000000 +0000 @@ -1,3 +1,21 @@ +sumo (1.11.0-4) focal; urgency=medium + + * fixing example runner + + -- Michael Behrisch Sun, 26 Dec 2021 10:43:24 +0100 + +sumo (1.11.0-1) focal; urgency=medium + + * new upstream version + + -- Michael Behrisch Tue, 23 Nov 2021 08:20:04 +0100 + +sumo (1.10.0+dfsg1-1~xenial) xenial; urgency=medium + + * new upstream version + + -- Michael Behrisch Tue, 17 Aug 2021 09:27:20 +0200 + sumo (1.9.1+dfsg1-1) focal; urgency=medium * new upstream version diff -Nru sumo-1.11.0/build/debian/patches/10_python_example_runner.patch sumo-1.12.0/build/debian/patches/10_python_example_runner.patch --- sumo-1.11.0/build/debian/patches/10_python_example_runner.patch 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/build/debian/patches/10_python_example_runner.patch 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,57 @@ +Index: sumo-1.11.0/docs/examples/runAll.py +=================================================================== +--- sumo-1.11.0.orig/docs/examples/runAll.py ++++ sumo-1.11.0/docs/examples/runAll.py +@@ -87,19 +87,19 @@ for d, p in [ + (r"sumo/sublane_model", subprocess.Popen([join(SUMO_HOME, "bin", "sumo"), "--write-license", "--default.speeddev", "0", "--no-step-log", "--net-file=net.net.xml", "--routes=input_routes.rou.xml", "--lateral-resolution", "0.64", "--tripinfo-output", "tripinfos.xml", "--duration-log.statistics"], cwd=join(THIS_DIR, r"sumo/sublane_model"))), + (r"sumo/sublane_model", subprocess.Popen([join(SUMO_HOME, "bin", "sumo"), "--write-license", "--default.speeddev", "0", "--step-method.ballistic", "--no-step-log", "--net-file=net.net.xml", "--routes=input_routes.rou.xml", "--lateral-resolution", "0.64", "--tripinfo-output", "tripinfos.xml", "--duration-log.statistics"], cwd=join(THIS_DIR, r"sumo/sublane_model"))), + (r"sumo/model_railroad", subprocess.Popen([join(SUMO_HOME, "bin", "sumo"), "--write-license", "--default.speeddev", "0", "--railsignal-block-output", "railsignal_blocks.xml", "-c", "sumo.sumocfg", "-e", "3600"], cwd=join(THIS_DIR, r"sumo/model_railroad"))), +- (r"tools/dua-iterate", subprocess.Popen(["python", join(SUMO_HOME, "tools/assign/duaIterate.py"), "-n", "input_net.net.xml", "-t", "input_trips.trips.xml", "-l", "5"], cwd=join(THIS_DIR, r"tools/dua-iterate"))), +- (r"tools/flowrouter", subprocess.Popen(["python", join(SUMO_HOME, "tools/detector/flowrouter.py"), "-n", "input_net.net.xml", "-d", "input_detectors.det.xml", "-f", "input_flows.txt", "--verbose"], cwd=join(THIS_DIR, r"tools/flowrouter"))), +- (r"tools/traceExporter", subprocess.Popen(["python", join(SUMO_HOME, "tools/traceExporter.py"), "-i", "fcd.xml", "-n", "net.net.xml", "--ns2mobility-output", "mobilityfile.tcl"], cwd=join(THIS_DIR, r"tools/traceExporter"))), +- (r"tutorial/circles", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/circles"))), +- (r"tutorial/city_mobil", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/city_mobil"))), +- (r"tutorial/hello", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/hello"))), +- (r"tutorial/manhattan", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/manhattan"))), +- (r"tutorial/output_parsing", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/output_parsing"))), +- (r"tutorial/quickstart", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/quickstart"))), +- (r"tutorial/sumolympics", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/sumolympics"))), +- (r"tutorial/traci_pedestrian_crossing", subprocess.Popen(["python", "./runner.py", "--nogui"], cwd=join(THIS_DIR, r"../tutorial/traci_pedestrian_crossing"))), +- (r"tutorial/traci_taxi", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/traci_taxi"))), +- (r"tutorial/traci_tls", subprocess.Popen(["python", "./runner.py", "--nogui"], cwd=join(THIS_DIR, r"../tutorial/traci_tls"))), ++ (r"tools/dua-iterate", subprocess.Popen([sys.executable, join(SUMO_HOME, "tools/assign/duaIterate.py"), "-n", "input_net.net.xml", "-t", "input_trips.trips.xml", "-l", "5"], cwd=join(THIS_DIR, r"tools/dua-iterate"))), ++ (r"tools/flowrouter", subprocess.Popen([sys.executable, join(SUMO_HOME, "tools/detector/flowrouter.py"), "-n", "input_net.net.xml", "-d", "input_detectors.det.xml", "-f", "input_flows.txt", "--verbose"], cwd=join(THIS_DIR, r"tools/flowrouter"))), ++ (r"tools/traceExporter", subprocess.Popen([sys.executable, join(SUMO_HOME, "tools/traceExporter.py"), "-i", "fcd.xml", "-n", "net.net.xml", "--ns2mobility-output", "mobilityfile.tcl"], cwd=join(THIS_DIR, r"tools/traceExporter"))), ++ (r"tutorial/circles", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/circles"))), ++ (r"tutorial/city_mobil", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/city_mobil"))), ++ (r"tutorial/hello", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/hello"))), ++ (r"tutorial/manhattan", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/manhattan"))), ++ (r"tutorial/output_parsing", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/output_parsing"))), ++ (r"tutorial/quickstart", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/quickstart"))), ++ (r"tutorial/sumolympics", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/sumolympics"))), ++ (r"tutorial/traci_pedestrian_crossing", subprocess.Popen([sys.executable, "./runner.py", "--nogui"], cwd=join(THIS_DIR, r"../tutorial/traci_pedestrian_crossing"))), ++ (r"tutorial/traci_taxi", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/traci_taxi"))), ++ (r"tutorial/traci_tls", subprocess.Popen([sys.executable, "./runner.py", "--nogui"], cwd=join(THIS_DIR, r"../tutorial/traci_tls"))), + ]: + if p.wait() != 0: + print("Error: '%s' failed for '%s'!" % (" ".join(p.args), d)) +Index: sumo-1.11.0/docs/tutorial/city_mobil/runner.py +=================================================================== +--- sumo-1.11.0.orig/docs/tutorial/city_mobil/runner.py ++++ sumo-1.11.0/docs/tutorial/city_mobil/runner.py +@@ -20,10 +20,11 @@ from __future__ import absolute_import + from __future__ import print_function + + import os ++import sys + import subprocess + + os.chdir('data') +-subprocess.call(["python", "createNet.py"]) +-subprocess.call(["python", "simpleManager.py", "-t"]) +-subprocess.call(["python", "agentManager.py", "-t"]) +-subprocess.call(["python", "createNetTaxi.py"]) ++subprocess.call([sys.executable, "createNet.py"]) ++subprocess.call([sys.executable, "simpleManager.py", "-t"]) ++subprocess.call([sys.executable, "agentManager.py", "-t"]) ++subprocess.call([sys.executable, "createNetTaxi.py"]) diff -Nru sumo-1.11.0/build/debian/patches/series sumo-1.12.0/build/debian/patches/series --- sumo-1.11.0/build/debian/patches/series 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/build/debian/patches/series 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1 @@ +10_python_example_runner.patch diff -Nru sumo-1.11.0/build/macos/netedit/build/netedit-launcher.zsh sumo-1.12.0/build/macos/netedit/build/netedit-launcher.zsh --- sumo-1.11.0/build/macos/netedit/build/netedit-launcher.zsh 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/build/macos/netedit/build/netedit-launcher.zsh 2022-01-24 20:43:50.000000000 +0000 @@ -2,7 +2,7 @@ # **************************************************************************** # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/build/macos/netedit/netedit.app/Contents/document.wflow sumo-1.12.0/build/macos/netedit/netedit.app/Contents/document.wflow --- sumo-1.11.0/build/macos/netedit/netedit.app/Contents/document.wflow 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/build/macos/netedit/netedit.app/Contents/document.wflow 2022-01-24 20:43:50.000000000 +0000 @@ -63,7 +63,7 @@ # **************************************************************************** # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/build/macos/osm-web-wizard/build/osm-web-wizard-launcher.zsh sumo-1.12.0/build/macos/osm-web-wizard/build/osm-web-wizard-launcher.zsh --- sumo-1.11.0/build/macos/osm-web-wizard/build/osm-web-wizard-launcher.zsh 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/build/macos/osm-web-wizard/build/osm-web-wizard-launcher.zsh 2022-01-24 20:43:50.000000000 +0000 @@ -2,7 +2,7 @@ # **************************************************************************** # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2001-2022 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/ diff -Nru "/tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/build/macos/osm-web-wizard/OSM Web Wizard.app/Contents/document.wflow" "/tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/build/macos/osm-web-wizard/OSM Web Wizard.app/Contents/document.wflow" --- "/tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/build/macos/osm-web-wizard/OSM Web Wizard.app/Contents/document.wflow" 2021-11-22 20:09:36.000000000 +0000 +++ "/tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/build/macos/osm-web-wizard/OSM Web Wizard.app/Contents/document.wflow" 2022-01-24 20:43:50.000000000 +0000 @@ -63,7 +63,7 @@ # **************************************************************************** # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/build/macos/sumo-gui/build/sumo-gui-launcher.zsh sumo-1.12.0/build/macos/sumo-gui/build/sumo-gui-launcher.zsh --- sumo-1.11.0/build/macos/sumo-gui/build/sumo-gui-launcher.zsh 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/build/macos/sumo-gui/build/sumo-gui-launcher.zsh 2022-01-24 20:43:50.000000000 +0000 @@ -2,7 +2,7 @@ # **************************************************************************** # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/build/macos/sumo-gui/sumo-gui.app/Contents/document.wflow sumo-1.12.0/build/macos/sumo-gui/sumo-gui.app/Contents/document.wflow --- sumo-1.11.0/build/macos/sumo-gui/sumo-gui.app/Contents/document.wflow 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/build/macos/sumo-gui/sumo-gui.app/Contents/document.wflow 2022-01-24 20:43:50.000000000 +0000 @@ -63,7 +63,7 @@ # **************************************************************************** # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/build/package/sumo.metainfo.xml sumo-1.12.0/build/package/sumo.metainfo.xml --- sumo-1.11.0/build/package/sumo.metainfo.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/build/package/sumo.metainfo.xml 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,46 @@ + + + org.eclipse.sumo + org.eclipse.sumo.desktop + SUMO + A Microscopic Traffic Simulation + CC0-1.0 + EPL-2.0 OR GPL-2.0-or-later + +

+ SUMO allows modelling of intermodal traffic systems including road vehicles, public transport and pedestrians. + Included with SUMO is a wealth of supporting tools which handle tasks such as route finding, visualization, + network import and emission calculation. SUMO can be enhanced with custom models and provides various APIs + to remotely control the simulation. +

+
+ https://www.eclipse.org/sumo/ + https://sumo.dlr.de/docs/ + https://github.com/eclipse/sumo/issues + German Aerospace Center and contributors + + + https://www.eclipse.org/sumo/images/screenshots/screenshot1.png + + + https://www.eclipse.org/sumo/images/screenshots/screenshot2.png + + + https://www.eclipse.org/sumo/images/screenshots/screenshot3.png + + + https://www.eclipse.org/sumo/images/screenshots/screenshot4.png + + + https://www.eclipse.org/sumo/images/screenshots/screenshot5.png + + + https://www.eclipse.org/sumo/images/screenshots/screenshot6.png + + + + + + +
+ diff -Nru sumo-1.11.0/build/wix/CPL.TXT sumo-1.12.0/build/wix/CPL.TXT --- sumo-1.11.0/build/wix/CPL.TXT 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/build/wix/CPL.TXT 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,1949 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Wix3.6Toolset/CPL.TXT at master · AnalogJ/Wix3.6Toolset · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Skip to content + + + + + + + + + + +
+ +
+ + + + + + + +
+ + + +
+ + + + + + + + + + +
+
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + +
+ + + + + Permalink + + +
+ +
+
+ + + master + + + + +
+
+
+ Switch branches/tags + +
+ + + +
+ +
+ +
+ + +
+ +
+ + + + + + + + + + + + + + + + +
+ + +
+
+
+
+ +
+ +
+ + + + Go to file + + +
+ + + + +
+
+
+ + + + +
+ +
+
+ + + + +
+ + Latest commit + 13d8774 + May 22, 2012 + + + + + + History + + +
+
+ +
+ +
+
+ + + 1 + + contributor + + +
+ +

+ Users who have contributed to this file +

+
+ + + + + + +
+
+
+
+ + + + + + + +
+ +
+ + +
+ + 94 lines (44 sloc) + + 11.3 KB +
+ +
+ + + + + +
+ +
+ +
+
+ + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Common Public License Version 1.0
+
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+
1. DEFINITIONS
+
"Contribution" means:
+
a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
+
b) in the case of each subsequent Contributor:
+
i) changes to the Program, and
+
ii) additions to the Program;
+
where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
+
"Contributor" means any person or entity that distributes the Program.
+
"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
+
"Program" means the Contributions distributed in accordance with this Agreement.
+
"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
+
+
2. GRANT OF RIGHTS
+
a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
+
b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
+
c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
+
d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
+
+
3. REQUIREMENTS
+
A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
+
a) it complies with the terms and conditions of this Agreement; and
+
b) its license agreement:
+
i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
+
ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
+
iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
+
iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
+
When the Program is made available in source code form:
+
a) it must be made available under this Agreement; and
+
b) a copy of this Agreement must be included with each copy of the Program.
+
Contributors may not remove or alter any copyright notices contained within the Program.
+
Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
+
+
4. COMMERCIAL DISTRIBUTION
+
Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
+
For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
+
+
5. NO WARRANTY
+
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement, including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
+
+
6. DISCLAIMER OF LIABILITY
+
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
7. GENERAL
+
If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
+
If Recipient institutes patent litigation against a Contributor with respect to a patent applicable to software (including a cross-claim or counterclaim in a lawsuit), then any patent licenses granted by that Contributor to such Recipient under this Agreement shall terminate as of the date such litigation is filed. In addition, if Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
+
All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
+
Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. IBM is the initial Agreement Steward. IBM may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
+
This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+
+ + + +
+ +
+ + + + +
+ + +
+ + +
+
+ + +
+ + + +
+
+ +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-1.11.0/build/wix/gpl-2.0.rtf sumo-1.12.0/build/wix/gpl-2.0.rtf --- sumo-1.11.0/build/wix/gpl-2.0.rtf 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/build/wix/gpl-2.0.rtf 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,213 @@ +{\rtf1\ansi\deff3\adeflang1025 +{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Liberation Serif{\*\falt Times New Roman};}{\f4\fswiss\fprq2\fcharset0 Liberation Sans{\*\falt Arial};}{\f5\froman\fprq0\fcharset128 Helvetica{\*\falt Arial};}{\f6\froman\fprq0\fcharset128 Courier{\*\falt Courier New};}{\f7\fnil\fprq2\fcharset0 Droid Sans Fallback;}{\f8\fnil\fprq2\fcharset0 FreeSans;}{\f9\fswiss\fprq0\fcharset128 FreeSans;}} +{\colortbl;\red0\green0\blue0;\red0\green0\blue128;\red128\green128\blue128;} +{\stylesheet{\s0\snext0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033 Normal;} +{\*\cs15\snext15\cf2\ul\ulc0\langfe255\alang255\lang255 Internet Link;} +{\s16\sbasedon0\snext17\sb240\sa120\keepn\dbch\af7\dbch\af8\afs28\loch\f4\fs28 Heading;} +{\s17\sbasedon0\snext17\sl288\slmult1\sb0\sa140 Text Body;} +{\s18\sbasedon17\snext18\sl288\slmult1\sb0\sa140\dbch\af9 List;} +{\s19\sbasedon0\snext19\sb120\sa120\noline\i\dbch\af9\afs24\ai\fs24 Caption;} +{\s20\sbasedon0\snext20\noline\dbch\af9 Index;} +}{\info{\creatim\yr0\mo0\dy0\hr0\min0}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment LibreOffice}{\vern67241986}}\deftab720 +\viewscale100 +{\*\pgdsctbl +{\pgdsc0\pgdscuse451\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\pgdscnxt0 Default Style;}} +\formshade{\*\pgdscno0}\paperh15840\paperw12240\margl1800\margr1800\margt1440\margb1440\sectd\sbknone\sectunlocked1\pgndec\pgwsxn12240\pghsxn15840\marglsxn1800\margrsxn1800\margtsxn1440\margbsxn1440\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc +\pgndec\pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\ul\ulc0\b\rtlch \ltrch\loch\fs28\loch\f5 +GNU GENERAL PUBLIC LICENSE} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +Version 2, June 1991} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f6 +Copyright (C) 1989, 1991 Free Software Foundation, Inc. }{\rtlch \ltrch\loch +\line }{\rtlch \ltrch\loch\loch\f6 +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA}{\rtlch \ltrch\loch +\line \line }{\rtlch \ltrch\loch\loch\f6 +Everyone is permitted to copy and distribute verbatim copies}{\rtlch \ltrch\loch +\line }{\rtlch \ltrch\loch\loch\f6 +of this license document, but changing it is not allowed.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\ul\ulc0\b\rtlch \ltrch\loch\fs28\loch\f5 +Preamble} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +The precise terms and conditions for copying, distribution and modification follow.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\ul\ulc0\b\rtlch \ltrch\loch\fs28\loch\f5 +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180\rtlch \ltrch\loch + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\loch\f5 +0.}{\rtlch \ltrch\loch\loch\f5 + This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180\rtlch \ltrch\loch + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\loch\f5 +1.}{\rtlch \ltrch\loch\loch\f5 + You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180\rtlch \ltrch\loch + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\loch\f5 +2.}{\rtlch \ltrch\loch\loch\f5 + You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa0\rtlch \ltrch\loch\loch\f5 + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi0\sb0\sa0{\b\rtlch \ltrch\loch\loch\f5 +a)}{\rtlch \ltrch\loch\loch\f5 + You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa0\rtlch \ltrch\loch\loch\f5 + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi0\sb0\sa0{\b\rtlch \ltrch\loch\loch\f5 +b)}{\rtlch \ltrch\loch\loch\f5 + You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa0\rtlch \ltrch\loch\loch\f5 + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi0\sb0\sa0{\b\rtlch \ltrch\loch\loch\f5 +c)}{\rtlch \ltrch\loch\loch\f5 + If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180\rtlch \ltrch\loch + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\loch\f5 +3.}{\rtlch \ltrch\loch\loch\f5 + You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa0\rtlch \ltrch\loch\loch\f5 + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi0\sb0\sa0{\b\rtlch \ltrch\loch\loch\f5 +a)}{\rtlch \ltrch\loch\loch\f5 + Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa0\rtlch \ltrch\loch\loch\f5 + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi0\sb0\sa0{\b\rtlch \ltrch\loch\loch\f5 +b)}{\rtlch \ltrch\loch\loch\f5 + Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa0\rtlch \ltrch\loch\loch\f5 + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li360\ri0\lin360\rin0\fi0\sb0\sa0{\b\rtlch \ltrch\loch\loch\f5 +c)}{\rtlch \ltrch\loch\loch\f5 + Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180\rtlch \ltrch\loch + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\loch\f5 +4.}{\rtlch \ltrch\loch\loch\f5 + You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180\rtlch \ltrch\loch + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\loch\f5 +5.}{\rtlch \ltrch\loch\loch\f5 + You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180\rtlch \ltrch\loch + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\loch\f5 +6.}{\rtlch \ltrch\loch\loch\f5 + Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180\rtlch \ltrch\loch + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\loch\f5 +7.}{\rtlch \ltrch\loch\loch\f5 + If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180\rtlch \ltrch\loch + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\loch\f5 +8.}{\rtlch \ltrch\loch\loch\f5 + If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180\rtlch \ltrch\loch + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\loch\f5 +9.}{\rtlch \ltrch\loch\loch\f5 + The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180\rtlch \ltrch\loch + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\loch\f5 +10.}{\rtlch \ltrch\loch\loch\f5 + If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180\rtlch \ltrch\loch + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\loch\f5 +NO WARRANTY} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\loch\f5 +11.}{\rtlch \ltrch\loch\loch\f5 + BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180\rtlch \ltrch\loch + +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\loch\f5 +12.}{\rtlch \ltrch\loch\loch\f5 + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\b\rtlch \ltrch\loch\fs28\loch\f5 +END OF TERMS AND CONDITIONS} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\ul\ulc0\b\rtlch \ltrch\loch\fs28\loch\f5 +How to Apply These Terms to Your New Programs} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f6 +one line to give the program's name and an idea of what it does.}{\rtlch \ltrch\loch +\line }{\rtlch \ltrch\loch\loch\f6 +Copyright (C) yyyy name of author}{\rtlch \ltrch\loch +\line \line }{\rtlch \ltrch\loch\loch\f6 +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.}{\rtlch \ltrch\loch +\line \line }{\rtlch \ltrch\loch\loch\f6 +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.}{\rtlch \ltrch\loch +\line \line }{\rtlch \ltrch\loch\loch\f6 +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +Also add information on how to contact you by electronic and paper mail.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +If the program is interactive, make it output a short notice like this when it starts in an interactive mode:} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f6 +Gnomovision version 69, Copyright (C) year name of author}{\rtlch \ltrch\loch +\line }{\rtlch \ltrch\loch\loch\f6 +Gnomovision comes with ABSOLUTELY NO WARRANTY; for details}{\rtlch \ltrch\loch +\line }{\rtlch \ltrch\loch\loch\f6 +type `show w'. This is free software, and you are welcome}{\rtlch \ltrch\loch +\line }{\rtlch \ltrch\loch\loch\f6 +to redistribute it under certain conditions; type `show c' }{\rtlch \ltrch\loch +\line }{\rtlch \ltrch\loch\loch\f6 +for details.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f6 +Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.}{\rtlch \ltrch\loch +\line \line }{\rtlch \ltrch\loch\loch\f6 +signature of Ty Coon, 1 April 1989}{\rtlch \ltrch\loch +\line }{\rtlch \ltrch\loch\loch\f6 +Ty Coon, President of Vice} +\par \pard\plain \s0\nowidctlpar{\*\hyphen2\hyphlead2\hyphtrail2\hyphmax0}\cf0\kerning1\dbch\af7\langfe2052\dbch\af8\afs24\alang1081\loch\f3\fs24\lang1033\ql\li0\ri0\lin0\rin0\fi0\sb0\sa180{\rtlch \ltrch\loch\loch\f5 +This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the }{{\field{\*\fldinst HYPERLINK "https://www.gnu.org/licenses/lgpl.html" }{\fldrslt {\cf2\ul\ulc0\langfe255\alang255\lang255\ul\ulc0\rtlch \ltrch\loch\loch\f5 +GNU Lesser General Public License}{}}}\rtlch \ltrch\loch\loch\f5 + instead of this License.} +\par } diff -Nru sumo-1.11.0/build/wix/gpl-2.0.txt sumo-1.12.0/build/wix/gpl-2.0.txt --- sumo-1.11.0/build/wix/gpl-2.0.txt 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/build/wix/gpl-2.0.txt 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff -Nru sumo-1.11.0/build/wix/SUMOInstallDirDlg.wxs sumo-1.12.0/build/wix/SUMOInstallDirDlg.wxs --- sumo-1.11.0/build/wix/SUMOInstallDirDlg.wxs 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/build/wix/SUMOInstallDirDlg.wxs 2022-01-24 20:43:50.000000000 +0000 @@ -1,11 +1,14 @@ @@ -26,7 +29,7 @@ - + diff -Nru sumo-1.11.0/build/wix/SUMOWixUI_InstallDir.wxs sumo-1.12.0/build/wix/SUMOWixUI_InstallDir.wxs --- sumo-1.11.0/build/wix/SUMOWixUI_InstallDir.wxs 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/build/wix/SUMOWixUI_InstallDir.wxs 2022-01-24 20:43:50.000000000 +0000 @@ -1,11 +1,15 @@ + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MODIFYENV - - - - - MODIFYENV - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + MODIFYENV + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MODIFYENV + + + + + MODIFYENV + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-1.11.0/CMakeLists.txt sumo-1.12.0/CMakeLists.txt --- sumo-1.11.0/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -29,13 +29,37 @@ endif () project(SUMO CXX C) -set(PACKAGE_VERSION "1.11.0") -cmake_minimum_required(VERSION 3.1) +set(PACKAGE_VERSION "1.12.0") +cmake_minimum_required(VERSION 3.9) -find_program(CCACHE_FOUND "ccache") -if (CCACHE_FOUND AND CCACHE_SUPPORT) - message(STATUS "Enabling ccache") - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "ccache") +# Check if libraries have to be found, depending on SUMO_LIBRARIES +set(SUMO_LIBRARIES "$ENV{SUMO_LIBRARIES}" CACHE PATH "Location of SUMOLibraries dependencies") + +# some user place SUMOLibraries in the same SUMO folder +if (NOT SUMO_LIBRARIES AND EXISTS "${CMAKE_SOURCE_DIR}/../SUMOLibraries") + set(SUMO_LIBRARIES "${CMAKE_SOURCE_DIR}/../SUMOLibraries") +endif () + +if (CCACHE_SUPPORT) + find_program(CCACHE_PROGRAM ccache) + file(GLOB SCCACHE_ROOT "${SUMO_LIBRARIES}/sccache-*") + find_program(SCCACHE_PROGRAM sccache ${SCCACHE_ROOT}) + if (CCACHE_PROGRAM) + message(STATUS "Found ccache: ${CCACHE_PROGRAM}") + set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") + set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") + elseif (SCCACHE_PROGRAM) + message(STATUS "Found sccache: ${SCCACHE_PROGRAM}") + set(CMAKE_C_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}") + set(CMAKE_CXX_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}") + if (CMAKE_BUILD_TYPE STREQUAL "Debug") + string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") + elseif (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") + string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") + endif() + endif() endif() set(CMAKE_COLOR_MAKEFILE ON) @@ -181,14 +205,6 @@ set(MINGW32 1) endif () -# Check if libraries have to be found, depending on SUMO_LIBRARIES -set(SUMO_LIBRARIES "$ENV{SUMO_LIBRARIES}" CACHE PATH "Location of SUMOLibraries dependencies") - -# some user place SUMOLibraries in the same SUMO folder -if (NOT SUMO_LIBRARIES AND EXISTS "${CMAKE_SOURCE_DIR}/../SUMOLibraries") - set(SUMO_LIBRARIES "${CMAKE_SOURCE_DIR}/../SUMOLibraries") -endif () - # check if SUMOLibraries was found (Only in Windows) if (SUMO_LIBRARIES AND WIN32) # set option for install debug and release runtime dlls @@ -394,17 +410,28 @@ set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMake") # installation -if (NOT MSVC) +if (MSVC) + if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(CMAKE_INSTALL_PREFIX "sumo-${PACKAGE_VERSION}") + endif() +else () include(GNUInstallDirs) endif () -if (SKBUILD) +if (SKBUILD OR MSVC) set(DATA_PATH "") else () set(DATA_PATH "share/sumo/") endif () +if (SKBUILD) + set(EXCLUDE_LIBSUMO "libsumo") + set(EXCLUDE_LIBTRACI "libtraci") +endif () install(DIRECTORY bin/ DESTINATION bin - FILES_MATCHING PATTERN "*.dll" + FILES_MATCHING + PATTERN "*.bat" + PATTERN "*.dll" PATTERN "*d.dll" EXCLUDE + PATTERN "gtest*.dll" EXCLUDE PATTERN "FOXDLLD-1.6.dll" EXCLUDE) install(DIRECTORY data/ DESTINATION ${DATA_PATH}data) install(DIRECTORY tools/ DESTINATION ${DATA_PATH}tools @@ -414,10 +441,13 @@ PATTERN "lisum-core" EXCLUDE PATTERN "lisum-gui" EXCLUDE PATTERN "sumolib4matlab/src" EXCLUDE + PATTERN "${EXCLUDE_LIBSUMO}" EXCLUDE + PATTERN "${EXCLUDE_LIBTRACI}" EXCLUDE PATTERN "traas" EXCLUDE PATTERN "traci4matlab/src" EXCLUDE PATTERN "__pycache__" EXCLUDE PATTERN "*.pyc" EXCLUDE + PATTERN "*.egg-info" EXCLUDE PATTERN ".git" EXCLUDE) if (DATA_PATH) install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ../../bin \$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/${DATA_PATH}bin)") @@ -433,42 +463,29 @@ endif () if (SUMO_LIBRARIES AND WIN32) - # filter release DLLs - execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/build/filterDebugDLL.py ${SUMO_LIBRARIES_DLL} OUTPUT_VARIABLE SUMO_LIBRARIES_RELEASE_DLL) + # filter release DLLs + execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/build/filterDebugDLL.py ${SUMO_LIBRARIES_DLL} + OUTPUT_VARIABLE SUMO_LIBRARIES_RELEASE_DLL) # copy debug dlls - foreach(DEBUG_DLL ${SUMO_LIBRARIES_DLL} ${GTEST_DLL}) - get_filename_component(DLL_BASENAME ${DEBUG_DLL} NAME) - set(TARGET_DEBUG_DLL ${CMAKE_SOURCE_DIR}/bin/${DLL_BASENAME}) - list(FIND TARGET_DEBUG_DLLS ${TARGET_DEBUG_DLL} DLL_KNOWN) - list(FIND GTEST_DLL ${DEBUG_DLL} IS_TEST_DLL) + foreach(DLL_PATH ${SUMO_LIBRARIES_DLL} ${GTEST_DLL}) + get_filename_component(DLL_BASENAME ${DLL_PATH} NAME) + set(TARGET_DLL ${CMAKE_SOURCE_DIR}/bin/${DLL_BASENAME}) + list(FIND TARGET_ALL_DLLS ${TARGET_DLL} DLL_KNOWN) + list(FIND SUMO_LIBRARIES_RELEASE_DLL ${DLL_PATH} IS_RELEASE_DLL) + list(FIND GTEST_DLL ${DLL_PATH} IS_TEST_DLL) if (DLL_KNOWN EQUAL -1) - add_custom_command(OUTPUT ${TARGET_DEBUG_DLL} - COMMAND ${CMAKE_COMMAND} -E copy ${DEBUG_DLL} ${TARGET_DEBUG_DLL} - DEPENDS ${DEBUG_DLL}) - if (IS_TEST_DLL EQUAL -1) - list(APPEND TARGET_DEBUG_DLLS ${TARGET_DEBUG_DLL}) + add_custom_command(OUTPUT ${TARGET_DLL} + COMMAND ${CMAKE_COMMAND} -E copy ${DLL_PATH} ${TARGET_DLL} + DEPENDS ${DLL_PATH}) + if (IS_TEST_DLL GREATER -1) + list(APPEND TARGET_TEST_DLLS ${TARGET_DLL}) + elseif (IS_RELEASE_DLL GREATER -1) + list(APPEND TARGET_ALL_DLLS ${TARGET_DLL}) else () - list(APPEND TARGET_TEST_DLLS ${TARGET_DEBUG_DLL}) + list(APPEND TARGET_ALL_DLLS $<$:${TARGET_DLL}>) endif () endif() - endforeach(DEBUG_DLL) - # copy release dlls - foreach(RELEASE_DLL ${SUMO_LIBRARIES_RELEASE_DLL} ${GTEST_DLL}) - get_filename_component(DLL_BASENAME ${RELEASE_DLL} NAME) - set(TARGET_RELEASE_DLL ${CMAKE_SOURCE_DIR}/bin/${DLL_BASENAME}) - list(FIND TARGET_RELEASE_DLLS ${TARGET_RELEASE_DLL} DLL_KNOWN) - list(FIND GTEST_DLL ${RELEASE_DLL} IS_TEST_DLL) - if (DLL_KNOWN EQUAL -1) - add_custom_command(OUTPUT ${TARGET_RELEASE_DLL} - COMMAND ${CMAKE_COMMAND} -E copy ${RELEASE_DLL} ${TARGET_RELEASE_DLL} - DEPENDS ${RELEASE_DLL}) - if (IS_TEST_DLL EQUAL -1) - list(APPEND TARGET_RELEASE_DLLS ${TARGET_RELEASE_DLL}) - else () - list(APPEND TARGET_TEST_DLLS ${TARGET_RELEASE_DLL}) - endif () - endif() - endforeach(RELEASE_DLL) + endforeach(DLL_PATH) # copy OSG dlls if (HAVE_OSG) file(GLOB OSG_DLL "${OSG_PATH}/bin/*osg.dll") @@ -484,17 +501,12 @@ COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJ_PATH}/share/proj ${CMAKE_SOURCE_DIR}/share/proj DEPENDS ${PROJ_PATH}/share/proj/proj.db) install(DIRECTORY share/ DESTINATION ${DATA_PATH}share) - # set install dll targets - add_custom_target(install_debug_dll ALL DEPENDS ${TARGET_DEBUG_DLLS} ${OSG_TARGET} ${PROJ_DATA}) - add_custom_target(install_release_dll ALL DEPENDS ${TARGET_RELEASE_DLLS} ${OSG_TARGET} ${PROJ_DATA}) - add_custom_target(install_test_dll DEPENDS ${TARGET_TEST_DLLS}) - # set in DLL folders - set_property(TARGET install_debug_dll PROPERTY FOLDER "DLLs") - set_property(TARGET install_release_dll PROPERTY FOLDER "DLLs") - set_property(TARGET install_test_dll PROPERTY FOLDER "DLLs") -else () - add_custom_target(install_test_dll) # dummy target for non-Windows -endif () +endif() +# set install dll targets, for non-Windows they depend on nothing +add_custom_target(install_dll DEPENDS ${TARGET_ALL_DLLS} ${OSG_TARGET} ${PROJ_DATA}) +add_custom_target(install_test_dll DEPENDS ${TARGET_TEST_DLLS}) +set_property(TARGET install_dll PROPERTY FOLDER "CMake") +set_property(TARGET install_test_dll PROPERTY FOLDER "CMake") # java targets find_program(MVN_EXECUTABLE mvn) @@ -635,7 +647,7 @@ find_package(Git) if (GIT_FOUND) add_custom_target(dist - COMMAND rm -rf sumo-${PACKAGE_VERSION} sumo-${PACKAGE_VERSION}.zip sumo-src-${PACKAGE_VERSION}.tar.gz sumo-src-${PACKAGE_VERSION}.zip sumo-all-${PACKAGE_VERSION}.tar.gz sumo-all-${PACKAGE_VERSION}.zip sumo-gui-macos-${PACKAGE_VERSION}.zip + COMMAND rm -rf sumo-${PACKAGE_VERSION} sumo-${PACKAGE_VERSION}.zip sumo-src-${PACKAGE_VERSION}.tar.gz sumo-src-${PACKAGE_VERSION}.zip sumo-gui-macos-${PACKAGE_VERSION}.zip COMMAND ${GIT_EXECUTABLE} archive --prefix sumo-${PACKAGE_VERSION}/ -o sumo-${PACKAGE_VERSION}.zip HEAD COMMAND unzip -q sumo-${PACKAGE_VERSION}.zip COMMAND cp -a docs/tutorial docs/examples sumo-${PACKAGE_VERSION}/docs @@ -645,11 +657,9 @@ COMMAND zip -rq sumo-src-${PACKAGE_VERSION}.zip sumo-${PACKAGE_VERSION} COMMAND tar -czf sumo-src-${PACKAGE_VERSION}.tar.gz sumo-${PACKAGE_VERSION} COMMAND cp -a docs/userdoc docs/pydoc docs/javadoc docs/man sumo-${PACKAGE_VERSION}/docs + COMMAND rm -r sumo-${PACKAGE_VERSION}/docs/web/docs/images + COMMAND ln -s ../../userdoc/images sumo-${PACKAGE_VERSION}/docs/web/docs/images COMMAND tar -czf sumo_${PACKAGE_VERSION}.orig.tar.gz --exclude "*.jar" sumo-${PACKAGE_VERSION} - COMMAND cp bin/*.jar sumo-${PACKAGE_VERSION}/bin - COMMAND cp -a tests sumo-${PACKAGE_VERSION} - COMMAND zip -rq sumo-all-${PACKAGE_VERSION}.zip sumo-${PACKAGE_VERSION} - COMMAND tar -czf sumo-all-${PACKAGE_VERSION}.tar.gz sumo-${PACKAGE_VERSION} COMMAND mkdir sumo-${PACKAGE_VERSION}/sumo-gui-macos COMMAND cp -a build/macos/*/*.app sumo-${PACKAGE_VERSION}/sumo-gui-macos COMMAND zip -rq sumo-gui-macos-${PACKAGE_VERSION}.zip sumo-${PACKAGE_VERSION}/sumo-gui-macos/*.app diff -Nru sumo-1.11.0/data/emissions/MMPEVEM/BMW_i3.xml sumo-1.12.0/data/emissions/MMPEVEM/BMW_i3.xml --- sumo-1.11.0/data/emissions/MMPEVEM/BMW_i3.xml 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/data/emissions/MMPEVEM/BMW_i3.xml 2022-01-24 20:43:50.000000000 +0000 @@ -25,7 +25,6 @@ - diff -Nru sumo-1.11.0/data/emissions/MMPEVEM/SUV.xml sumo-1.12.0/data/emissions/MMPEVEM/SUV.xml --- sumo-1.11.0/data/emissions/MMPEVEM/SUV.xml 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/data/emissions/MMPEVEM/SUV.xml 2022-01-24 20:43:50.000000000 +0000 @@ -25,7 +25,6 @@ - diff -Nru sumo-1.11.0/data/emissions/MMPEVEM/VW_eUp.xml sumo-1.12.0/data/emissions/MMPEVEM/VW_eUp.xml --- sumo-1.11.0/data/emissions/MMPEVEM/VW_eUp.xml 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/data/emissions/MMPEVEM/VW_eUp.xml 2022-01-24 20:43:50.000000000 +0000 @@ -25,7 +25,6 @@ - diff -Nru sumo-1.11.0/data/emissions/MMPEVEM/VW_ID3.xml sumo-1.12.0/data/emissions/MMPEVEM/VW_ID3.xml --- sumo-1.11.0/data/emissions/MMPEVEM/VW_ID3.xml 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/data/emissions/MMPEVEM/VW_ID3.xml 2022-01-24 20:43:50.000000000 +0000 @@ -25,7 +25,6 @@ - diff -Nru sumo-1.11.0/data/emissions/MMPEVEM/VW_ID4.xml sumo-1.12.0/data/emissions/MMPEVEM/VW_ID4.xml --- sumo-1.11.0/data/emissions/MMPEVEM/VW_ID4.xml 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/data/emissions/MMPEVEM/VW_ID4.xml 2022-01-24 20:43:50.000000000 +0000 @@ -25,7 +25,6 @@ - diff -Nru sumo-1.11.0/data/typemap/osmNetconvertAirport.typ.xml sumo-1.12.0/data/typemap/osmNetconvertAirport.typ.xml --- sumo-1.11.0/data/typemap/osmNetconvertAirport.typ.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/data/typemap/osmNetconvertAirport.typ.xml 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,9 @@ + + + + + + + + + diff -Nru sumo-1.11.0/data/xsd/additional_file.xsd sumo-1.12.0/data/xsd/additional_file.xsd --- sumo-1.11.0/data/xsd/additional_file.xsd 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/data/xsd/additional_file.xsd 2022-01-24 20:43:50.000000000 +0000 @@ -602,6 +602,7 @@ + diff -Nru sumo-1.11.0/data/xsd/baseTypes.xsd sumo-1.12.0/data/xsd/baseTypes.xsd --- sumo-1.11.0/data/xsd/baseTypes.xsd 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/data/xsd/baseTypes.xsd 2022-01-24 20:43:50.000000000 +0000 @@ -221,6 +221,7 @@ + @@ -241,6 +242,13 @@ + + + + + + + @@ -259,6 +267,11 @@ + + + + + diff -Nru sumo-1.11.0/data/xsd/det_e1meso_file.xsd sumo-1.12.0/data/xsd/det_e1meso_file.xsd --- sumo-1.11.0/data/xsd/det_e1meso_file.xsd 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/data/xsd/det_e1meso_file.xsd 2022-01-24 20:43:50.000000000 +0000 @@ -28,6 +28,7 @@ + @@ -48,6 +49,7 @@ + diff -Nru sumo-1.11.0/data/xsd/duarouterConfiguration.xsd sumo-1.12.0/data/xsd/duarouterConfiguration.xsd --- sumo-1.11.0/data/xsd/duarouterConfiguration.xsd 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/data/xsd/duarouterConfiguration.xsd 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ - @@ -50,6 +50,7 @@ + diff -Nru sumo-1.11.0/data/xsd/meandataTypes.xsd sumo-1.12.0/data/xsd/meandataTypes.xsd --- sumo-1.11.0/data/xsd/meandataTypes.xsd 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/data/xsd/meandataTypes.xsd 2022-01-24 20:43:50.000000000 +0000 @@ -34,6 +34,7 @@ + diff -Nru sumo-1.11.0/data/xsd/netconvertConfiguration.xsd sumo-1.12.0/data/xsd/netconvertConfiguration.xsd --- sumo-1.11.0/data/xsd/netconvertConfiguration.xsd 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/data/xsd/netconvertConfiguration.xsd 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ - @@ -276,6 +276,7 @@ + @@ -316,6 +317,7 @@ + @@ -334,6 +336,7 @@ + @@ -377,6 +380,8 @@ + + diff -Nru sumo-1.11.0/data/xsd/net_file.xsd sumo-1.12.0/data/xsd/net_file.xsd --- sumo-1.11.0/data/xsd/net_file.xsd 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/data/xsd/net_file.xsd 2022-01-24 20:43:50.000000000 +0000 @@ -49,6 +49,7 @@ + diff -Nru sumo-1.11.0/data/xsd/netgenerateConfiguration.xsd sumo-1.12.0/data/xsd/netgenerateConfiguration.xsd --- sumo-1.11.0/data/xsd/netgenerateConfiguration.xsd 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/data/xsd/netgenerateConfiguration.xsd 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ - @@ -233,6 +233,7 @@ + diff -Nru sumo-1.11.0/data/xsd/routeTypes.xsd sumo-1.12.0/data/xsd/routeTypes.xsd --- sumo-1.11.0/data/xsd/routeTypes.xsd 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/data/xsd/routeTypes.xsd 2022-01-24 20:43:50.000000000 +0000 @@ -552,7 +552,7 @@ - + @@ -676,6 +676,8 @@ + + diff -Nru sumo-1.11.0/data/xsd/sumoConfiguration.xsd sumo-1.12.0/data/xsd/sumoConfiguration.xsd --- sumo-1.11.0/data/xsd/sumoConfiguration.xsd 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/data/xsd/sumoConfiguration.xsd 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ - @@ -452,6 +452,7 @@ + diff -Nru sumo-1.11.0/debian/changelog sumo-1.12.0/debian/changelog --- sumo-1.11.0/debian/changelog 2021-12-26 09:43:24.000000000 +0000 +++ sumo-1.12.0/debian/changelog 2022-01-26 08:21:33.000000000 +0000 @@ -1,4 +1,10 @@ -sumo (1.11.0-4~hirsute) hirsute; urgency=medium +sumo (1.12.0-1~hirsute) hirsute; urgency=medium + + * new upstream version + + -- Michael Behrisch Wed, 26 Jan 2022 09:21:33 +0100 + +sumo (1.11.0-4) focal; urgency=medium * fixing example runner diff -Nru sumo-1.11.0/debian/patches/10_python_example_runner.patch sumo-1.12.0/debian/patches/10_python_example_runner.patch --- sumo-1.11.0/debian/patches/10_python_example_runner.patch 2021-12-26 09:43:24.000000000 +0000 +++ sumo-1.12.0/debian/patches/10_python_example_runner.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,57 +0,0 @@ -Index: sumo-1.11.0/docs/examples/runAll.py -=================================================================== ---- sumo-1.11.0.orig/docs/examples/runAll.py -+++ sumo-1.11.0/docs/examples/runAll.py -@@ -87,19 +87,19 @@ for d, p in [ - (r"sumo/sublane_model", subprocess.Popen([join(SUMO_HOME, "bin", "sumo"), "--write-license", "--default.speeddev", "0", "--no-step-log", "--net-file=net.net.xml", "--routes=input_routes.rou.xml", "--lateral-resolution", "0.64", "--tripinfo-output", "tripinfos.xml", "--duration-log.statistics"], cwd=join(THIS_DIR, r"sumo/sublane_model"))), - (r"sumo/sublane_model", subprocess.Popen([join(SUMO_HOME, "bin", "sumo"), "--write-license", "--default.speeddev", "0", "--step-method.ballistic", "--no-step-log", "--net-file=net.net.xml", "--routes=input_routes.rou.xml", "--lateral-resolution", "0.64", "--tripinfo-output", "tripinfos.xml", "--duration-log.statistics"], cwd=join(THIS_DIR, r"sumo/sublane_model"))), - (r"sumo/model_railroad", subprocess.Popen([join(SUMO_HOME, "bin", "sumo"), "--write-license", "--default.speeddev", "0", "--railsignal-block-output", "railsignal_blocks.xml", "-c", "sumo.sumocfg", "-e", "3600"], cwd=join(THIS_DIR, r"sumo/model_railroad"))), -- (r"tools/dua-iterate", subprocess.Popen(["python", join(SUMO_HOME, "tools/assign/duaIterate.py"), "-n", "input_net.net.xml", "-t", "input_trips.trips.xml", "-l", "5"], cwd=join(THIS_DIR, r"tools/dua-iterate"))), -- (r"tools/flowrouter", subprocess.Popen(["python", join(SUMO_HOME, "tools/detector/flowrouter.py"), "-n", "input_net.net.xml", "-d", "input_detectors.det.xml", "-f", "input_flows.txt", "--verbose"], cwd=join(THIS_DIR, r"tools/flowrouter"))), -- (r"tools/traceExporter", subprocess.Popen(["python", join(SUMO_HOME, "tools/traceExporter.py"), "-i", "fcd.xml", "-n", "net.net.xml", "--ns2mobility-output", "mobilityfile.tcl"], cwd=join(THIS_DIR, r"tools/traceExporter"))), -- (r"tutorial/circles", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/circles"))), -- (r"tutorial/city_mobil", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/city_mobil"))), -- (r"tutorial/hello", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/hello"))), -- (r"tutorial/manhattan", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/manhattan"))), -- (r"tutorial/output_parsing", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/output_parsing"))), -- (r"tutorial/quickstart", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/quickstart"))), -- (r"tutorial/sumolympics", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/sumolympics"))), -- (r"tutorial/traci_pedestrian_crossing", subprocess.Popen(["python", "./runner.py", "--nogui"], cwd=join(THIS_DIR, r"../tutorial/traci_pedestrian_crossing"))), -- (r"tutorial/traci_taxi", subprocess.Popen(["python", "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/traci_taxi"))), -- (r"tutorial/traci_tls", subprocess.Popen(["python", "./runner.py", "--nogui"], cwd=join(THIS_DIR, r"../tutorial/traci_tls"))), -+ (r"tools/dua-iterate", subprocess.Popen([sys.executable, join(SUMO_HOME, "tools/assign/duaIterate.py"), "-n", "input_net.net.xml", "-t", "input_trips.trips.xml", "-l", "5"], cwd=join(THIS_DIR, r"tools/dua-iterate"))), -+ (r"tools/flowrouter", subprocess.Popen([sys.executable, join(SUMO_HOME, "tools/detector/flowrouter.py"), "-n", "input_net.net.xml", "-d", "input_detectors.det.xml", "-f", "input_flows.txt", "--verbose"], cwd=join(THIS_DIR, r"tools/flowrouter"))), -+ (r"tools/traceExporter", subprocess.Popen([sys.executable, join(SUMO_HOME, "tools/traceExporter.py"), "-i", "fcd.xml", "-n", "net.net.xml", "--ns2mobility-output", "mobilityfile.tcl"], cwd=join(THIS_DIR, r"tools/traceExporter"))), -+ (r"tutorial/circles", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/circles"))), -+ (r"tutorial/city_mobil", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/city_mobil"))), -+ (r"tutorial/hello", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/hello"))), -+ (r"tutorial/manhattan", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/manhattan"))), -+ (r"tutorial/output_parsing", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/output_parsing"))), -+ (r"tutorial/quickstart", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/quickstart"))), -+ (r"tutorial/sumolympics", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/sumolympics"))), -+ (r"tutorial/traci_pedestrian_crossing", subprocess.Popen([sys.executable, "./runner.py", "--nogui"], cwd=join(THIS_DIR, r"../tutorial/traci_pedestrian_crossing"))), -+ (r"tutorial/traci_taxi", subprocess.Popen([sys.executable, "./runner.py"], cwd=join(THIS_DIR, r"../tutorial/traci_taxi"))), -+ (r"tutorial/traci_tls", subprocess.Popen([sys.executable, "./runner.py", "--nogui"], cwd=join(THIS_DIR, r"../tutorial/traci_tls"))), - ]: - if p.wait() != 0: - print("Error: '%s' failed for '%s'!" % (" ".join(p.args), d)) -Index: sumo-1.11.0/docs/tutorial/city_mobil/runner.py -=================================================================== ---- sumo-1.11.0.orig/docs/tutorial/city_mobil/runner.py -+++ sumo-1.11.0/docs/tutorial/city_mobil/runner.py -@@ -20,10 +20,11 @@ from __future__ import absolute_import - from __future__ import print_function - - import os -+import sys - import subprocess - - os.chdir('data') --subprocess.call(["python", "createNet.py"]) --subprocess.call(["python", "simpleManager.py", "-t"]) --subprocess.call(["python", "agentManager.py", "-t"]) --subprocess.call(["python", "createNetTaxi.py"]) -+subprocess.call([sys.executable, "createNet.py"]) -+subprocess.call([sys.executable, "simpleManager.py", "-t"]) -+subprocess.call([sys.executable, "agentManager.py", "-t"]) -+subprocess.call([sys.executable, "createNetTaxi.py"]) diff -Nru sumo-1.11.0/debian/patches/series sumo-1.12.0/debian/patches/series --- sumo-1.11.0/debian/patches/series 2021-12-26 09:40:44.000000000 +0000 +++ sumo-1.12.0/debian/patches/series 2022-01-26 08:21:33.000000000 +0000 @@ -1 +0,0 @@ -10_python_example_runner.patch diff -Nru sumo-1.11.0/debian/rules sumo-1.12.0/debian/rules --- sumo-1.11.0/debian/rules 2021-12-26 09:42:19.000000000 +0000 +++ sumo-1.12.0/debian/rules 2022-01-24 20:43:50.000000000 +0000 @@ -30,6 +30,7 @@ rm -rf ./tools/contributed/traas/license.txt rm -rf ./tools/contributed/traci4matlab/license.txt rm -rf ./tools/game/sounds/license.txt + sed -i '/traas/d' ./docs/examples/runAll.py # Fix shebangs find ./tools -name '*.py' -print0 | xargs -0 sed -i 's,^#!/usr/bin/env python2,#!/usr/bin/python2,' find ./tools -name '*.py' -print0 | xargs -0 sed -i 's,^#!/usr/bin/env python3,#!/usr/bin/python3,' diff -Nru sumo-1.11.0/docs/examples/dfrouter/test.dfrocfg sumo-1.12.0/docs/examples/dfrouter/test.dfrocfg --- sumo-1.11.0/docs/examples/dfrouter/test.dfrocfg 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/examples/dfrouter/test.dfrocfg 2022-01-24 23:05:50.000000000 +0000 @@ -1,6 +1,6 @@ - - + All Classes (traas 1.1 API) - + diff -Nru sumo-1.11.0/docs/javadoc/traas/allclasses-index.html sumo-1.12.0/docs/javadoc/traas/allclasses-index.html --- sumo-1.11.0/docs/javadoc/traas/allclasses-index.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/allclasses-index.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + All Classes (traas 1.1 API) - + @@ -571,7 +571,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/allpackages-index.html sumo-1.12.0/docs/javadoc/traas/allpackages-index.html --- sumo-1.11.0/docs/javadoc/traas/allpackages-index.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/allpackages-index.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + All Packages (traas 1.1 API) - + @@ -193,7 +193,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/constant-values.html sumo-1.12.0/docs/javadoc/traas/constant-values.html --- sumo-1.11.0/docs/javadoc/traas/constant-values.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/constant-values.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Constant Field Values (traas 1.1 API) - + @@ -3844,7 +3844,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Edge.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Edge.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Edge.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Edge.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.cmd.Edge (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Gui.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Gui.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Gui.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Gui.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.cmd.Gui (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Inductionloop.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Inductionloop.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Inductionloop.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Inductionloop.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.cmd.Inductionloop (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Junction.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Junction.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Junction.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Junction.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.cmd.Junction (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lanearea.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lanearea.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lanearea.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lanearea.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.cmd.Lanearea (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lane.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lane.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lane.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lane.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.cmd.Lane (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Multientryexit.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Multientryexit.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Multientryexit.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Multientryexit.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.cmd.Multientryexit (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Person.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Person.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Person.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Person.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.cmd.Person (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Poi.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Poi.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Poi.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Poi.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.cmd.Poi (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Polygon.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Polygon.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Polygon.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Polygon.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.cmd.Polygon (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Route.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Route.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Route.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Route.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.cmd.Route (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Simulation.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Simulation.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Simulation.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Simulation.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.cmd.Simulation (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Trafficlight.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Trafficlight.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Trafficlight.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Trafficlight.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.cmd.Trafficlight (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicle.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicle.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicle.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicle.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.cmd.Vehicle (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicletype.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicletype.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicletype.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicletype.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.cmd.Vehicletype (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Edge.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Edge.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Edge.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Edge.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Edge (traas 1.1 API) - + @@ -1034,7 +1034,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Gui.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Gui.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Gui.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Gui.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Gui (traas 1.1 API) - + @@ -582,7 +582,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Inductionloop.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Inductionloop.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Inductionloop.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Inductionloop.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Inductionloop (traas 1.1 API) - + @@ -581,7 +581,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Junction.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Junction.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Junction.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Junction.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Junction (traas 1.1 API) - + @@ -379,7 +379,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Lanearea.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Lanearea.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Lanearea.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Lanearea.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Lanearea (traas 1.1 API) - + @@ -563,7 +563,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Lane.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Lane.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Lane.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Lane.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Lane (traas 1.1 API) - + @@ -1142,7 +1142,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Multientryexit.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Multientryexit.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Multientryexit.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Multientryexit.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Multientryexit (traas 1.1 API) - + @@ -435,7 +435,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/package-summary.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/package-summary.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/package-summary.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/package-summary.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + de.tudresden.sumo.cmd (traas 1.1 API) - + @@ -239,7 +239,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/package-tree.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/package-tree.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/package-tree.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/package-tree.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + de.tudresden.sumo.cmd Class Hierarchy (traas 1.1 API) - + @@ -172,7 +172,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/package-use.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/package-use.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/package-use.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/package-use.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Package de.tudresden.sumo.cmd (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Person.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Person.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Person.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Person.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Person (traas 1.1 API) - + @@ -1285,7 +1285,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Poi.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Poi.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Poi.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Poi.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Poi (traas 1.1 API) - + @@ -615,7 +615,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Polygon.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Polygon.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Polygon.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Polygon.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Polygon (traas 1.1 API) - + @@ -651,7 +651,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Route.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Route.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Route.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Route.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Route (traas 1.1 API) - + @@ -438,7 +438,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Simulation.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Simulation.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Simulation.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Simulation.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Simulation (traas 1.1 API) - + @@ -1212,7 +1212,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Trafficlight.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Trafficlight.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Trafficlight.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Trafficlight.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Trafficlight (traas 1.1 API) - + @@ -798,7 +798,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicle.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicle.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicle.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicle.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Vehicle (traas 1.1 API) - + @@ -3631,7 +3631,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicletype.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicletype.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicletype.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicletype.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Vehicletype (traas 1.1 API) - + @@ -1395,7 +1395,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/config/class-use/Constants.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/config/class-use/Constants.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/config/class-use/Constants.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/config/class-use/Constants.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.config.Constants (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/config/Constants.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/config/Constants.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/config/Constants.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/config/Constants.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + Constants (traas 1.1 API) - + @@ -9741,7 +9741,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/config/package-summary.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/config/package-summary.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/config/package-summary.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/config/package-summary.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + de.tudresden.sumo.config (traas 1.1 API) - + @@ -161,7 +161,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/config/package-tree.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/config/package-tree.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/config/package-tree.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/config/package-tree.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + de.tudresden.sumo.config Class Hierarchy (traas 1.1 API) - + @@ -158,7 +158,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/config/package-use.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/config/package-use.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/config/package-use.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/config/package-use.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Package de.tudresden.sumo.config (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoBestLanes.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoBestLanes.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoBestLanes.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoBestLanes.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoBestLanes (traas 1.1 API) - + @@ -191,7 +191,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoBestLanes.SumoBestLane.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoBestLanes.SumoBestLane.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoBestLanes.SumoBestLane.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoBestLanes.SumoBestLane.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoBestLanes.SumoBestLane (traas 1.1 API) - + @@ -187,7 +187,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoBoundingBox.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoBoundingBox.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoBoundingBox.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoBoundingBox.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoBoundingBox (traas 1.1 API) - + @@ -191,7 +191,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoColor.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoColor.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoColor.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoColor.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoColor (traas 1.1 API) - + @@ -280,7 +280,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoGeometry.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoGeometry.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoGeometry.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoGeometry.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoGeometry (traas 1.1 API) - + @@ -224,7 +224,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoLeader.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoLeader.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoLeader.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoLeader.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoLeader (traas 1.1 API) - + @@ -191,7 +191,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoLink.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoLink.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoLink.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoLink.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoLink (traas 1.1 API) - + @@ -320,7 +320,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoLinkList.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoLinkList.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoLinkList.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoLinkList.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoLinkList (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoNextTLS.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoNextTLS.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoNextTLS.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoNextTLS.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoNextTLS (traas 1.1 API) - + @@ -191,7 +191,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoNextTLS.NextTLS.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoNextTLS.NextTLS.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoNextTLS.NextTLS.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoNextTLS.NextTLS.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoNextTLS.NextTLS (traas 1.1 API) - + @@ -187,7 +187,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoObject.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoObject.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoObject.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoObject.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Interface de.tudresden.sumo.objects.SumoObject (traas 1.1 API) - + @@ -552,7 +552,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoPosition2D.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoPosition2D.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoPosition2D.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoPosition2D.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoPosition2D (traas 1.1 API) - + @@ -232,7 +232,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoPosition3D.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoPosition3D.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoPosition3D.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoPosition3D.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoPosition3D (traas 1.1 API) - + @@ -191,7 +191,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoPrimitive.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoPrimitive.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoPrimitive.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoPrimitive.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoPrimitive (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoRoadPosition.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoRoadPosition.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoRoadPosition.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoRoadPosition.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoRoadPosition (traas 1.1 API) - + @@ -191,7 +191,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoStage.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoStage.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoStage.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoStage.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoStage (traas 1.1 API) - + @@ -217,7 +217,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoStopFlags.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoStopFlags.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoStopFlags.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoStopFlags.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoStopFlags (traas 1.1 API) - + @@ -226,7 +226,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoStringList.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoStringList.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoStringList.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoStringList.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoStringList (traas 1.1 API) - + @@ -269,7 +269,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTLSController.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTLSController.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTLSController.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTLSController.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoTLSController (traas 1.1 API) - + @@ -191,7 +191,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTLSPhase.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTLSPhase.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTLSPhase.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTLSPhase.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoTLSPhase (traas 1.1 API) - + @@ -232,7 +232,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTLSProgram.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTLSProgram.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTLSProgram.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTLSProgram.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoTLSProgram (traas 1.1 API) - + @@ -276,7 +276,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTrafficLightType.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTrafficLightType.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTrafficLightType.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoTrafficLightType.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoTrafficLightType (traas 1.1 API) - + @@ -197,7 +197,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleData.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleData.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleData.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleData.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoVehicleData (traas 1.1 API) - + @@ -191,7 +191,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleData.VehicleData.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleData.VehicleData.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleData.VehicleData.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleData.VehicleData.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoVehicleData.VehicleData (traas 1.1 API) - + @@ -187,7 +187,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleSignal.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleSignal.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleSignal.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleSignal.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoVehicleSignal (traas 1.1 API) - + @@ -191,7 +191,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleSignalState.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleSignalState.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleSignalState.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/class-use/SumoVehicleSignalState.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.objects.SumoVehicleSignalState (traas 1.1 API) - + @@ -212,7 +212,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/package-summary.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/package-summary.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/package-summary.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/package-summary.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + de.tudresden.sumo.objects (traas 1.1 API) - + @@ -275,7 +275,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/package-tree.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/package-tree.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/package-tree.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/package-tree.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + de.tudresden.sumo.objects Class Hierarchy (traas 1.1 API) - + @@ -201,7 +201,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/package-use.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/package-use.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/package-use.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/package-use.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Package de.tudresden.sumo.objects (traas 1.1 API) - + @@ -390,7 +390,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoBestLanes.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoBestLanes.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoBestLanes.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoBestLanes.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoBestLanes (traas 1.1 API) - + @@ -407,7 +407,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoBestLanes.SumoBestLane.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoBestLanes.SumoBestLane.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoBestLanes.SumoBestLane.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoBestLanes.SumoBestLane.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoBestLanes.SumoBestLane (traas 1.1 API) - + @@ -389,7 +389,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoBoundingBox.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoBoundingBox.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoBoundingBox.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoBoundingBox.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoBoundingBox (traas 1.1 API) - + @@ -421,7 +421,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoColor.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoColor.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoColor.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoColor.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoColor (traas 1.1 API) - + @@ -421,7 +421,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoGeometry.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoGeometry.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoGeometry.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoGeometry.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoGeometry (traas 1.1 API) - + @@ -388,7 +388,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoLeader.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoLeader.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoLeader.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoLeader.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoLeader (traas 1.1 API) - + @@ -390,7 +390,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoLink.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoLink.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoLink.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoLink.html 2022-01-24 23:05:54.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoLink (traas 1.1 API) - + @@ -531,7 +531,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoLinkList.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoLinkList.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoLinkList.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoLinkList.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoLinkList (traas 1.1 API) - + @@ -802,7 +802,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoNextTLS.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoNextTLS.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoNextTLS.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoNextTLS.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoNextTLS (traas 1.1 API) - + @@ -403,7 +403,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoNextTLS.NextTLS.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoNextTLS.NextTLS.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoNextTLS.NextTLS.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoNextTLS.NextTLS.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoNextTLS.NextTLS (traas 1.1 API) - + @@ -315,7 +315,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoObject.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoObject.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoObject.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoObject.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoObject (traas 1.1 API) - + @@ -189,7 +189,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoPosition2D.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoPosition2D.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoPosition2D.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoPosition2D.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoPosition2D (traas 1.1 API) - + @@ -389,7 +389,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoPosition3D.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoPosition3D.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoPosition3D.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoPosition3D.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoPosition3D (traas 1.1 API) - + @@ -405,7 +405,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoPrimitive.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoPrimitive.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoPrimitive.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoPrimitive.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoPrimitive (traas 1.1 API) - + @@ -324,7 +324,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoRoadPosition.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoRoadPosition.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoRoadPosition.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoRoadPosition.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoRoadPosition (traas 1.1 API) - + @@ -346,7 +346,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoStage.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoStage.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoStage.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoStage.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoStage (traas 1.1 API) - + @@ -486,7 +486,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoStopFlags.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoStopFlags.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoStopFlags.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoStopFlags.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoStopFlags (traas 1.1 API) - + @@ -479,7 +479,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoStringList.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoStringList.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoStringList.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoStringList.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoStringList (traas 1.1 API) - + @@ -802,7 +802,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTLSController.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTLSController.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTLSController.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTLSController.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoTLSController (traas 1.1 API) - + @@ -388,7 +388,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTLSPhase.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTLSPhase.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTLSPhase.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTLSPhase.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoTLSPhase (traas 1.1 API) - + @@ -485,7 +485,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTLSProgram.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTLSProgram.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTLSProgram.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTLSProgram.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoTLSProgram (traas 1.1 API) - + @@ -463,7 +463,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTrafficLightType.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTrafficLightType.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTrafficLightType.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoTrafficLightType.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoTrafficLightType (traas 1.1 API) - + @@ -543,7 +543,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleData.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleData.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleData.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleData.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoVehicleData (traas 1.1 API) - + @@ -383,7 +383,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleData.VehicleData.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleData.VehicleData.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleData.VehicleData.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleData.VehicleData.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoVehicleData.VehicleData (traas 1.1 API) - + @@ -373,7 +373,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleSignal.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleSignal.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleSignal.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleSignal.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoVehicleSignal (traas 1.1 API) - + @@ -314,7 +314,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleSignalState.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleSignalState.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleSignalState.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/objects/SumoVehicleSignalState.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoVehicleSignalState (traas 1.1 API) - + @@ -548,7 +548,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ContextSubscription.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ContextSubscription.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ContextSubscription.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ContextSubscription.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.subscription.ContextSubscription (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ResponseType.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ResponseType.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ResponseType.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ResponseType.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.subscription.ResponseType (traas 1.1 API) - + @@ -246,7 +246,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscribtionVariable.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscribtionVariable.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscribtionVariable.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscribtionVariable.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.subscription.SubscribtionVariable (traas 1.1 API) - + @@ -213,7 +213,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionContext.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionContext.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionContext.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionContext.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.subscription.SubscriptionContext (traas 1.1 API) - + @@ -230,7 +230,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/Subscription.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/Subscription.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/Subscription.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/Subscription.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Interface de.tudresden.sumo.subscription.Subscription (traas 1.1 API) - + @@ -246,7 +246,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionObject.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionObject.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionObject.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionObject.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.subscription.SubscriptionObject (traas 1.1 API) - + @@ -193,7 +193,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SumoDomain.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SumoDomain.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SumoDomain.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SumoDomain.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.subscription.SumoDomain (traas 1.1 API) - + @@ -230,7 +230,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/VariableSubscription.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/VariableSubscription.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/VariableSubscription.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/VariableSubscription.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.subscription.VariableSubscription (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/ContextSubscription.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/ContextSubscription.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/ContextSubscription.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/ContextSubscription.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + ContextSubscription (traas 1.1 API) - + @@ -473,7 +473,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/package-summary.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/package-summary.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/package-summary.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/package-summary.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + de.tudresden.sumo.subscription (traas 1.1 API) - + @@ -211,7 +211,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/package-tree.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/package-tree.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/package-tree.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/package-tree.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + de.tudresden.sumo.subscription Class Hierarchy (traas 1.1 API) - + @@ -183,7 +183,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/package-use.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/package-use.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/package-use.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/package-use.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Package de.tudresden.sumo.subscription (traas 1.1 API) - + @@ -240,7 +240,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/ResponseType.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/ResponseType.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/ResponseType.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/ResponseType.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + ResponseType (traas 1.1 API) - + @@ -792,7 +792,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscribtionVariable.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscribtionVariable.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscribtionVariable.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscribtionVariable.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SubscribtionVariable (traas 1.1 API) - + @@ -556,7 +556,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionContext.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionContext.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionContext.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionContext.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SubscriptionContext (traas 1.1 API) - + @@ -556,7 +556,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/Subscription.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/Subscription.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/Subscription.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/Subscription.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Subscription (traas 1.1 API) - + @@ -249,7 +249,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionObject.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionObject.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionObject.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionObject.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SubscriptionObject (traas 1.1 API) - + @@ -440,7 +440,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SumoDomain.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SumoDomain.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SumoDomain.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/SumoDomain.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoDomain (traas 1.1 API) - + @@ -465,7 +465,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/VariableSubscription.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/VariableSubscription.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/subscription/VariableSubscription.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/subscription/VariableSubscription.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + VariableSubscription (traas 1.1 API) - + @@ -427,7 +427,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/CommandProcessor.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/CommandProcessor.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/CommandProcessor.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/CommandProcessor.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.util.CommandProcessor (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observable.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observable.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observable.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observable.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.util.Observable (traas 1.1 API) - + @@ -236,7 +236,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observer.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observer.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observer.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observer.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Interface de.tudresden.sumo.util.Observer (traas 1.1 API) - + @@ -215,7 +215,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Query.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Query.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Query.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Query.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.util.Query (traas 1.1 API) - + @@ -213,7 +213,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/SumoCommand.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/SumoCommand.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/SumoCommand.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/class-use/SumoCommand.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.sumo.util.SumoCommand (traas 1.1 API) - + @@ -3460,7 +3460,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/CommandProcessor.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/CommandProcessor.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/CommandProcessor.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/CommandProcessor.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + CommandProcessor (traas 1.1 API) - + @@ -489,7 +489,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/Observable.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/Observable.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/Observable.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/Observable.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Observable (traas 1.1 API) - + @@ -319,7 +319,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/Observer.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/Observer.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/Observer.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/Observer.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Observer (traas 1.1 API) - + @@ -247,7 +247,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/package-summary.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/package-summary.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/package-summary.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/package-summary.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + de.tudresden.sumo.util (traas 1.1 API) - + @@ -190,7 +190,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/package-tree.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/package-tree.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/package-tree.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/package-tree.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + de.tudresden.sumo.util Class Hierarchy (traas 1.1 API) - + @@ -173,7 +173,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/package-use.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/package-use.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/package-use.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/package-use.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Package de.tudresden.sumo.util (traas 1.1 API) - + @@ -248,7 +248,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/Query.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/Query.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/Query.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/Query.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Query (traas 1.1 API) - + @@ -663,7 +663,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/SumoCommand.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/SumoCommand.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/sumo/util/SumoCommand.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/sumo/util/SumoCommand.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoCommand (traas 1.1 API) - + @@ -517,7 +517,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBestLanes.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBestLanes.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBestLanes.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBestLanes.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoBestLanes (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBoundingBox.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBoundingBox.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBoundingBox.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBoundingBox.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoBoundingBox (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoColor.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoColor.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoColor.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoColor.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoColor (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoGeometry.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoGeometry.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoGeometry.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoGeometry.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoGeometry (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLeader.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLeader.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLeader.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLeader.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoLeader (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLink.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLink.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLink.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLink.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoLink (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoNextTLS.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoNextTLS.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoNextTLS.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoNextTLS.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoNextTLS (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition2D.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition2D.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition2D.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition2D.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoPosition2D (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition3D.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition3D.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition3D.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition3D.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoPosition3D (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoRoadPosition.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoRoadPosition.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoRoadPosition.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoRoadPosition.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoRoadPosition (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStage.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStage.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStage.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStage.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoStage (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStopFlags.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStopFlags.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStopFlags.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStopFlags.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoStopFlags (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSController.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSController.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSController.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSController.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoTLSController (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSPhase.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSPhase.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSPhase.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSPhase.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoTLSPhase (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSProgram.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSProgram.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSProgram.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSProgram.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoTLSProgram (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTrafficLightType.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTrafficLightType.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTrafficLightType.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTrafficLightType.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoTrafficLightType (traas 1.1 API) - + @@ -199,7 +199,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleData.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleData.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleData.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleData.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoVehicleData (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignal.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignal.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignal.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignal.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoVehicleSignal (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignalState.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignalState.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignalState.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignalState.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.tudresden.ws.container.SumoVehicleSignalState (traas 1.1 API) - + @@ -199,7 +199,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/package-summary.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/package-summary.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/package-summary.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/package-summary.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + de.tudresden.ws.container (traas 1.1 API) - + @@ -282,7 +282,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/package-tree.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/package-tree.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/package-tree.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/package-tree.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + de.tudresden.ws.container Class Hierarchy (traas 1.1 API) - + @@ -257,7 +257,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/package-use.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/package-use.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/package-use.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/package-use.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Package de.tudresden.ws.container (traas 1.1 API) - + @@ -190,7 +190,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoBestLanes.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoBestLanes.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoBestLanes.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoBestLanes.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoBestLanes (traas 1.1 API) - + @@ -323,7 +323,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoBoundingBox.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoBoundingBox.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoBoundingBox.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoBoundingBox.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoBoundingBox (traas 1.1 API) - + @@ -306,7 +306,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoColor.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoColor.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoColor.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoColor.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoColor (traas 1.1 API) - + @@ -312,7 +312,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoGeometry.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoGeometry.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoGeometry.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoGeometry.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoGeometry (traas 1.1 API) - + @@ -306,7 +306,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoLeader.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoLeader.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoLeader.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoLeader.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoLeader (traas 1.1 API) - + @@ -308,7 +308,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoLink.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoLink.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoLink.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoLink.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoLink (traas 1.1 API) - + @@ -340,7 +340,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoNextTLS.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoNextTLS.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoNextTLS.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoNextTLS.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoNextTLS (traas 1.1 API) - + @@ -323,7 +323,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition2D.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition2D.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition2D.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition2D.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoPosition2D (traas 1.1 API) - + @@ -306,7 +306,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition3D.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition3D.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition3D.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition3D.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoPosition3D (traas 1.1 API) - + @@ -306,7 +306,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoRoadPosition.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoRoadPosition.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoRoadPosition.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoRoadPosition.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoRoadPosition (traas 1.1 API) - + @@ -299,7 +299,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoStage.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoStage.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoStage.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoStage.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoStage (traas 1.1 API) - + @@ -299,7 +299,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoStopFlags.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoStopFlags.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoStopFlags.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoStopFlags.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoStopFlags (traas 1.1 API) - + @@ -334,7 +334,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSController.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSController.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSController.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSController.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoTLSController (traas 1.1 API) - + @@ -306,7 +306,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSPhase.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSPhase.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSPhase.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSPhase.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoTLSPhase (traas 1.1 API) - + @@ -306,7 +306,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSProgram.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSProgram.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSProgram.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSProgram.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoTLSProgram (traas 1.1 API) - + @@ -310,7 +310,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTrafficLightType.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTrafficLightType.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTrafficLightType.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoTrafficLightType.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoTrafficLightType (traas 1.1 API) - + @@ -595,7 +595,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleData.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleData.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleData.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleData.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoVehicleData (traas 1.1 API) - + @@ -323,7 +323,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignal.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignal.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignal.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignal.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoVehicleSignal (traas 1.1 API) - + @@ -289,7 +289,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignalState.html sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignalState.html --- sumo-1.11.0/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignalState.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignalState.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoVehicleSignalState (traas 1.1 API) - + @@ -600,7 +600,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/class-use/Storage.html sumo-1.12.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/class-use/Storage.html --- sumo-1.11.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/class-use/Storage.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/class-use/Storage.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class de.uniluebeck.itm.tcpip.Storage (traas 1.1 API) - + @@ -263,7 +263,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-summary.html sumo-1.12.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-summary.html --- sumo-1.11.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-summary.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-summary.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + de.uniluebeck.itm.tcpip (traas 1.1 API) - + @@ -161,7 +161,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-tree.html sumo-1.12.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-tree.html --- sumo-1.11.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-tree.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-tree.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + de.uniluebeck.itm.tcpip Class Hierarchy (traas 1.1 API) - + @@ -158,7 +158,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-use.html sumo-1.12.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-use.html --- sumo-1.11.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-use.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-use.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Package de.uniluebeck.itm.tcpip (traas 1.1 API) - + @@ -199,7 +199,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/Storage.html sumo-1.12.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/Storage.html --- sumo-1.11.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/Storage.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/de/uniluebeck/itm/tcpip/Storage.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Storage (traas 1.1 API) - + @@ -1036,7 +1036,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/deprecated-list.html sumo-1.12.0/docs/javadoc/traas/deprecated-list.html --- sumo-1.11.0/docs/javadoc/traas/deprecated-list.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/deprecated-list.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Deprecated List (traas 1.1 API) - + @@ -294,7 +294,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/help-doc.html sumo-1.12.0/docs/javadoc/traas/help-doc.html --- sumo-1.11.0/docs/javadoc/traas/help-doc.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/help-doc.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + API Help (traas 1.1 API) - + @@ -275,7 +275,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/index-all.html sumo-1.12.0/docs/javadoc/traas/index-all.html --- sumo-1.11.0/docs/javadoc/traas/index-all.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/index-all.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Index (traas 1.1 API) - + @@ -4707,7 +4707,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/index.html sumo-1.12.0/docs/javadoc/traas/index.html --- sumo-1.11.0/docs/javadoc/traas/index.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/index.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Overview (traas 1.1 API) - + @@ -189,7 +189,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/CloseQuery.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/CloseQuery.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/CloseQuery.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/CloseQuery.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class it.polito.appeal.traci.CloseQuery (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/SumoTraciConnection.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/SumoTraciConnection.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/SumoTraciConnection.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/SumoTraciConnection.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class it.polito.appeal.traci.SumoTraciConnection (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class it.polito.appeal.traci.TraCIException (traas 1.1 API) - + @@ -197,7 +197,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedData.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedData.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedData.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedData.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class it.polito.appeal.traci.TraCIException.UnexpectedData (traas 1.1 API) - + @@ -258,7 +258,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedDatatype.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedDatatype.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedDatatype.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedDatatype.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class it.polito.appeal.traci.TraCIException.UnexpectedDatatype (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedResponse.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedResponse.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedResponse.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedResponse.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class it.polito.appeal.traci.TraCIException.UnexpectedResponse (traas 1.1 API) - + @@ -143,7 +143,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/CloseQuery.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/CloseQuery.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/CloseQuery.html 2021-11-22 23:05:54.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/CloseQuery.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + CloseQuery (traas 1.1 API) - + @@ -335,7 +335,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/package-summary.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/package-summary.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/package-summary.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/package-summary.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + it.polito.appeal.traci (traas 1.1 API) - + @@ -195,7 +195,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/package-tree.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/package-tree.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/package-tree.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/package-tree.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + it.polito.appeal.traci Class Hierarchy (traas 1.1 API) - + @@ -189,7 +189,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/package-use.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/package-use.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/package-use.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/package-use.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Package it.polito.appeal.traci (traas 1.1 API) - + @@ -203,7 +203,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/Command.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/Command.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/Command.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/Command.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class it.polito.appeal.traci.protocol.Command (traas 1.1 API) - + @@ -381,7 +381,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/RequestMessage.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/RequestMessage.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/RequestMessage.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/RequestMessage.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class it.polito.appeal.traci.protocol.RequestMessage (traas 1.1 API) - + @@ -197,7 +197,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseContainer.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseContainer.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseContainer.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseContainer.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class it.polito.appeal.traci.protocol.ResponseContainer (traas 1.1 API) - + @@ -224,7 +224,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseMessage.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseMessage.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseMessage.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseMessage.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class it.polito.appeal.traci.protocol.ResponseMessage (traas 1.1 API) - + @@ -197,7 +197,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/StatusResponse.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/StatusResponse.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/StatusResponse.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/StatusResponse.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Class it.polito.appeal.traci.protocol.StatusResponse (traas 1.1 API) - + @@ -215,7 +215,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/Command.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/Command.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/Command.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/Command.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Command (traas 1.1 API) - + @@ -419,7 +419,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-summary.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-summary.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-summary.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-summary.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + it.polito.appeal.traci.protocol (traas 1.1 API) - + @@ -186,7 +186,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-tree.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-tree.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-tree.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-tree.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + it.polito.appeal.traci.protocol Class Hierarchy (traas 1.1 API) - + @@ -162,7 +162,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-use.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-use.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-use.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-use.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Uses of Package it.polito.appeal.traci.protocol (traas 1.1 API) - + @@ -255,7 +255,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/RequestMessage.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/RequestMessage.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/RequestMessage.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/RequestMessage.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + RequestMessage (traas 1.1 API) - + @@ -361,7 +361,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseContainer.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseContainer.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseContainer.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseContainer.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + ResponseContainer (traas 1.1 API) - + @@ -395,7 +395,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseMessage.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseMessage.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseMessage.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseMessage.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + ResponseMessage (traas 1.1 API) - + @@ -380,7 +380,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/StatusResponse.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/StatusResponse.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/StatusResponse.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/protocol/StatusResponse.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + StatusResponse (traas 1.1 API) - + @@ -391,7 +391,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/SumoTraciConnection.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/SumoTraciConnection.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/SumoTraciConnection.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/SumoTraciConnection.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + SumoTraciConnection (traas 1.1 API) - + @@ -811,7 +811,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + TraCIException (traas 1.1 API) - + @@ -343,7 +343,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedData.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedData.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedData.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedData.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + TraCIException.UnexpectedData (traas 1.1 API) - + @@ -327,7 +327,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedDatatype.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedDatatype.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedDatatype.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedDatatype.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + TraCIException.UnexpectedDatatype (traas 1.1 API) - + @@ -326,7 +326,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

diff -Nru sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedResponse.html sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedResponse.html --- sumo-1.11.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedResponse.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedResponse.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + TraCIException.UnexpectedResponse (traas 1.1 API) - + @@ -326,7 +326,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/docs/javadoc/traas/member-search-index.zip and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/docs/javadoc/traas/member-search-index.zip differ diff -Nru sumo-1.11.0/docs/javadoc/traas/overview-summary.html sumo-1.12.0/docs/javadoc/traas/overview-summary.html --- sumo-1.11.0/docs/javadoc/traas/overview-summary.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/overview-summary.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,7 +2,7 @@ - + traas 1.1 API diff -Nru sumo-1.11.0/docs/javadoc/traas/overview-tree.html sumo-1.12.0/docs/javadoc/traas/overview-tree.html --- sumo-1.11.0/docs/javadoc/traas/overview-tree.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/overview-tree.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Class Hierarchy (traas 1.1 API) - + @@ -344,7 +344,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/docs/javadoc/traas/package-search-index.zip and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/docs/javadoc/traas/package-search-index.zip differ diff -Nru sumo-1.11.0/docs/javadoc/traas/serialized-form.html sumo-1.12.0/docs/javadoc/traas/serialized-form.html --- sumo-1.11.0/docs/javadoc/traas/serialized-form.html 2021-11-22 23:05:55.000000000 +0000 +++ sumo-1.12.0/docs/javadoc/traas/serialized-form.html 2022-01-24 23:05:55.000000000 +0000 @@ -2,10 +2,10 @@ - + Serialized Form (traas 1.1 API) - + @@ -255,7 +255,7 @@ -

Copyright © 2021. All rights reserved.

+

Copyright © 2022. All rights reserved.

Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/docs/javadoc/traas/type-search-index.zip and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/docs/javadoc/traas/type-search-index.zip differ diff -Nru sumo-1.11.0/docs/man/activitygen.1 sumo-1.12.0/docs/man/activitygen.1 --- sumo-1.11.0/docs/man/activitygen.1 2021-11-22 23:05:51.000000000 +0000 +++ sumo-1.12.0/docs/man/activitygen.1 2022-01-24 23:05:52.000000000 +0000 @@ -1,14 +1,14 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ECLIPSE "1" "November 2021" "Eclipse 1.11.0" "User Commands" +.TH ECLIPSE "1" "January 2022" "Eclipse 1.12.0" "User Commands" .SH NAME Eclipse SUMO activitygen Version \- Generates routes of persons throughout a day for the microscopic traffic simulation SUMO .SH SYNOPSIS .B activitygen [\fI\,OPTION\/\fR]\fI\,*\/\fR .SH DESCRIPTION -Eclipse SUMO activitygen Version 1.11.0 +Eclipse SUMO activitygen Version 1.12.0 .IP -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de Copyright (C) 2010\-2012 Technische Universitaet Muenchen .PP Generates trips of persons throughout a day for the microscopic, multi\-modal @@ -143,14 +143,14 @@ Get in contact via . .IP .br -Build features: Linux\-5.4.0\-89\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG +Build features: Linux\-5.4.0\-94\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG .br -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .br Copyright (C) 2010\-2012 Technische Universitaet Muenchen .PP .br -Eclipse SUMO activitygen Version 1.11.0 is part of SUMO. +Eclipse SUMO activitygen Version 1.12.0 is part of SUMO. .br This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 diff -Nru sumo-1.11.0/docs/man/dfrouter.1 sumo-1.12.0/docs/man/dfrouter.1 --- sumo-1.11.0/docs/man/dfrouter.1 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/man/dfrouter.1 2022-01-24 23:05:51.000000000 +0000 @@ -1,14 +1,14 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ECLIPSE "1" "November 2021" "Eclipse 1.11.0" "User Commands" +.TH ECLIPSE "1" "January 2022" "Eclipse 1.12.0" "User Commands" .SH NAME Eclipse SUMO dfrouter Version \- Builds vehicle routes for SUMO using detector values .SH SYNOPSIS .B dfrouter [\fI\,OPTION\/\fR]\fI\,*\/\fR .SH DESCRIPTION -Eclipse SUMO dfrouter Version 1.11.0 +Eclipse SUMO dfrouter Version 1.12.0 .IP -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP Builds vehicle routes for SUMO using detector values. .SS "Configuration Options:" @@ -287,12 +287,12 @@ Get in contact via . .IP .br -Build features: Linux\-5.4.0\-89\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG +Build features: Linux\-5.4.0\-94\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG .br -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP .br -Eclipse SUMO dfrouter Version 1.11.0 is part of SUMO. +Eclipse SUMO dfrouter Version 1.12.0 is part of SUMO. .br This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 diff -Nru sumo-1.11.0/docs/man/duarouter.1 sumo-1.12.0/docs/man/duarouter.1 --- sumo-1.11.0/docs/man/duarouter.1 2021-11-22 23:05:51.000000000 +0000 +++ sumo-1.12.0/docs/man/duarouter.1 2022-01-24 23:05:51.000000000 +0000 @@ -1,14 +1,14 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ECLIPSE "1" "November 2021" "Eclipse 1.11.0" "User Commands" +.TH ECLIPSE "1" "January 2022" "Eclipse 1.12.0" "User Commands" .SH NAME Eclipse SUMO duarouter Version \- Shortest path router and DUE computer for the microscopic traffic simulation SUMO .SH SYNOPSIS .B duarouter [\fI\,OPTION\/\fR]\fI\,*\/\fR .SH DESCRIPTION -Eclipse SUMO duarouter Version 1.11.0 +Eclipse SUMO duarouter Version 1.12.0 .IP -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP Shortest path router and DUE computer for the microscopic, multi\-modal traffic .IP @@ -125,6 +125,10 @@ Write trips with fromJunction and toJunction .TP +\fB\-\-write\-costs\fR +Include the cost attribute in route +output +.TP \fB\-\-exit\-times\fR Write exit times (weights) for each edge .TP @@ -410,12 +414,12 @@ Get in contact via . .IP .br -Build features: Linux\-5.4.0\-89\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG +Build features: Linux\-5.4.0\-94\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG .br -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP .br -Eclipse SUMO duarouter Version 1.11.0 is part of SUMO. +Eclipse SUMO duarouter Version 1.12.0 is part of SUMO. .br This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 diff -Nru sumo-1.11.0/docs/man/emissionsDrivingCycle.1 sumo-1.12.0/docs/man/emissionsDrivingCycle.1 --- sumo-1.11.0/docs/man/emissionsDrivingCycle.1 2021-11-22 23:05:52.000000000 +0000 +++ sumo-1.12.0/docs/man/emissionsDrivingCycle.1 2022-01-24 23:05:53.000000000 +0000 @@ -1,14 +1,14 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ECLIPSE "1" "November 2021" "Eclipse 1.11.0" "User Commands" +.TH ECLIPSE "1" "January 2022" "Eclipse 1.12.0" "User Commands" .SH NAME Eclipse SUMO emissionsDrivingCycle Version \- Computes emissions by driving a time line using SUMO's emission models .SH SYNOPSIS .B emissionsDrivingCycle [\fI\,OPTION\/\fR]\fI\,*\/\fR .SH DESCRIPTION -Eclipse SUMO emissionsDrivingCycle Version 1.11.0 +Eclipse SUMO emissionsDrivingCycle Version 1.12.0 .IP -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP Computes emissions by driving a time line using SUMO's emission models. .SS "Configuration Options:" @@ -45,9 +45,17 @@ Defines the netstate, route and trajectory files to read the driving cycles from. .TP +\fB\-\-additional\-files\fR FILE +Load emission parameters (vTypes) from +FILE(s) +.TP \fB\-e\fR, \fB\-\-emission\-class\fR STR Defines for which emission class the emissions shall be generated. +.TP +\fB\-\-vtype\fR STR +Defines the vehicle type to use for emission +parameters. .SS "Processing Options:" .TP \fB\-a\fR, \fB\-\-compute\-a\fR @@ -78,6 +86,12 @@ \fB\-\-slope\fR FLOAT Sets a global slope (in deg) that is used if the file does not contain slope information. +.TP +\fB\-\-begin\fR TIME +Defines the begin time in seconds; +.TP +\fB\-\-end\fR TIME +Defines the end time in seconds; .SS "Output Options:" .TP \fB\-o\fR, \fB\-\-output\fR STR @@ -160,12 +174,12 @@ Get in contact via . .IP .br -Build features: Linux\-5.4.0\-89\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG +Build features: Linux\-5.4.0\-94\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG .br -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP .br -Eclipse SUMO emissionsDrivingCycle Version 1.11.0 is part of SUMO. +Eclipse SUMO emissionsDrivingCycle Version 1.12.0 is part of SUMO. .br This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 diff -Nru sumo-1.11.0/docs/man/emissionsMap.1 sumo-1.12.0/docs/man/emissionsMap.1 --- sumo-1.11.0/docs/man/emissionsMap.1 2021-11-22 23:05:52.000000000 +0000 +++ sumo-1.12.0/docs/man/emissionsMap.1 2022-01-24 23:05:53.000000000 +0000 @@ -1,14 +1,14 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ECLIPSE "1" "November 2021" "Eclipse 1.11.0" "User Commands" +.TH ECLIPSE "1" "January 2022" "Eclipse 1.12.0" "User Commands" .SH NAME Eclipse SUMO emissionsMap Version \- Builds and writes an emissions map for SUMO's emission models .SH SYNOPSIS .B emissionsMap [\fI\,OPTION\/\fR]\fI\,*\/\fR .SH DESCRIPTION -Eclipse SUMO emissionsMap Version 1.11.0 +Eclipse SUMO emissionsMap Version 1.12.0 .IP -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP Builds and writes an emissions map for SUMO's emission models. .SS "Configuration Options:" @@ -143,12 +143,12 @@ Get in contact via . .IP .br -Build features: Linux\-5.4.0\-89\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG +Build features: Linux\-5.4.0\-94\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG .br -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP .br -Eclipse SUMO emissionsMap Version 1.11.0 is part of SUMO. +Eclipse SUMO emissionsMap Version 1.12.0 is part of SUMO. .br This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 diff -Nru sumo-1.11.0/docs/man/jtrrouter.1 sumo-1.12.0/docs/man/jtrrouter.1 --- sumo-1.11.0/docs/man/jtrrouter.1 2021-11-22 23:05:51.000000000 +0000 +++ sumo-1.12.0/docs/man/jtrrouter.1 2022-01-24 23:05:51.000000000 +0000 @@ -1,14 +1,14 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ECLIPSE "1" "November 2021" "Eclipse 1.11.0" "User Commands" +.TH ECLIPSE "1" "January 2022" "Eclipse 1.12.0" "User Commands" .SH NAME Eclipse SUMO jtrrouter Version \- Router for the microscopic traffic simulation SUMO based on junction turning ratios .SH SYNOPSIS .B jtrrouter [\fI\,OPTION\/\fR]\fI\,*\/\fR .SH DESCRIPTION -Eclipse SUMO jtrrouter Version 1.11.0 +Eclipse SUMO jtrrouter Version 1.12.0 .IP -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP Router for the microscopic, multi\-modal traffic simulation SUMO based on .IP @@ -295,12 +295,12 @@ Get in contact via . .IP .br -Build features: Linux\-5.4.0\-89\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG +Build features: Linux\-5.4.0\-94\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG .br -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP .br -Eclipse SUMO jtrrouter Version 1.11.0 is part of SUMO. +Eclipse SUMO jtrrouter Version 1.12.0 is part of SUMO. .br This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 diff -Nru sumo-1.11.0/docs/man/marouter.1 sumo-1.12.0/docs/man/marouter.1 --- sumo-1.11.0/docs/man/marouter.1 2021-11-22 23:05:51.000000000 +0000 +++ sumo-1.12.0/docs/man/marouter.1 2022-01-24 23:05:52.000000000 +0000 @@ -1,14 +1,14 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ECLIPSE "1" "November 2021" "Eclipse 1.11.0" "User Commands" +.TH ECLIPSE "1" "January 2022" "Eclipse 1.12.0" "User Commands" .SH NAME Eclipse SUMO marouter Version \- Import O/D-matrices and trips using macroscopic traffic assignment for SUMO .SH SYNOPSIS .B marouter [\fI\,OPTION\/\fR]\fI\,*\/\fR .SH DESCRIPTION -Eclipse SUMO marouter Version 1.11.0 +Eclipse SUMO marouter Version 1.12.0 .IP -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP Import O/D\-matrices for macroscopic traffic assignment to generate SUMO routes .SS "Configuration Options:" @@ -349,12 +349,12 @@ Get in contact via . .IP .br -Build features: Linux\-5.4.0\-89\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG +Build features: Linux\-5.4.0\-94\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG .br -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP .br -Eclipse SUMO marouter Version 1.11.0 is part of SUMO. +Eclipse SUMO marouter Version 1.12.0 is part of SUMO. .br This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 diff -Nru sumo-1.11.0/docs/man/netconvert.1 sumo-1.12.0/docs/man/netconvert.1 --- sumo-1.11.0/docs/man/netconvert.1 2021-11-22 23:05:51.000000000 +0000 +++ sumo-1.12.0/docs/man/netconvert.1 2022-01-24 23:05:52.000000000 +0000 @@ -1,14 +1,14 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ECLIPSE "1" "November 2021" "Eclipse 1.11.0" "User Commands" +.TH ECLIPSE "1" "January 2022" "Eclipse 1.12.0" "User Commands" .SH NAME Eclipse SUMO netconvert Version \- Road network importer / builder for the traffic simulation SUMO .SH SYNOPSIS .B netconvert [\fI\,OPTION\/\fR]\fI\,*\/\fR .SH DESCRIPTION -Eclipse SUMO netconvert Version 1.11.0 +Eclipse SUMO netconvert Version 1.12.0 .IP -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP Network importer / builder for the microscopic, multi\-modal traffic simulation .IP @@ -842,6 +842,10 @@ outgoing edge speed on junction instead of average .TP +\fB\-\-internal\-junctions\fR.vehicle\-width FLOAT +Assumed vehicle width for computing +internal junction positions +.TP \fB\-\-rectangular\-lane\-cut\fR Forces rectangular cuts between lanes and intersections @@ -950,6 +954,10 @@ Set edge priority values based on estimated main direction .TP +\fB\-\-railway\fR.topology.extend\-priority +Extend loaded edge priority values based +on estimated main direction +.TP \fB\-\-railway\fR.access\-distance FLOAT The search radius for finding suitable road accesses for rail stops @@ -1004,6 +1012,10 @@ \fB\-\-osm\fR.sidewalks Import sidewalks .TP +\fB\-\-osm\fR.turn\-lanes +Import turning arrows from OSM to help +with connection building +.TP \fB\-\-osm\fR.stop\-output.length FLOAT The default length of a public transport stop in FLOAT m @@ -1156,6 +1168,14 @@ .TP \fB\-\-opendrive\fR.internal\-shapes Import internal lane shapes +.TP +\fB\-\-opendrive\fR.position\-ids +Sets edge\-id based on road\-id and offset +in m (legacy) +.TP +\fB\-\-opendrive\fR.lane\-shapes +Use custom lane shapes to compensate +discarded lane types .SS "Report Options:" .TP \fB\-v\fR, \fB\-\-verbose\fR @@ -1232,12 +1252,12 @@ Get in contact via . .IP .br -Build features: Linux\-5.4.0\-89\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG +Build features: Linux\-5.4.0\-94\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG .br -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP .br -Eclipse SUMO netconvert Version 1.11.0 is part of SUMO. +Eclipse SUMO netconvert Version 1.12.0 is part of SUMO. .br This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 diff -Nru sumo-1.11.0/docs/man/netedit.1 sumo-1.12.0/docs/man/netedit.1 --- sumo-1.11.0/docs/man/netedit.1 2021-11-22 23:05:52.000000000 +0000 +++ sumo-1.12.0/docs/man/netedit.1 2022-01-24 23:05:52.000000000 +0000 @@ -1,14 +1,14 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ECLIPSE "1" "November 2021" "Eclipse 1.11.0" "User Commands" +.TH ECLIPSE "1" "January 2022" "Eclipse 1.12.0" "User Commands" .SH NAME Eclipse SUMO netedit Version \- Road network editor for the traffic simulation SUMO .SH SYNOPSIS .B netedit [\fI\,OPTION\/\fR]\fI\,*\/\fR .SH DESCRIPTION -Eclipse SUMO netedit Version 1.11.0 +Eclipse SUMO netedit Version 1.12.0 .IP -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP Graphical editor for SUMO networks. .SS "Configuration Options:" @@ -843,6 +843,10 @@ outgoing edge speed on junction instead of average .TP +\fB\-\-internal\-junctions\fR.vehicle\-width FLOAT +Assumed vehicle width for computing +internal junction positions +.TP \fB\-\-rectangular\-lane\-cut\fR Forces rectangular cuts between lanes and intersections @@ -951,6 +955,10 @@ Set edge priority values based on estimated main direction .TP +\fB\-\-railway\fR.topology.extend\-priority +Extend loaded edge priority values based +on estimated main direction +.TP \fB\-\-railway\fR.access\-distance FLOAT The search radius for finding suitable road accesses for rail stops @@ -1005,6 +1013,10 @@ \fB\-\-osm\fR.sidewalks Import sidewalks .TP +\fB\-\-osm\fR.turn\-lanes +Import turning arrows from OSM to help +with connection building +.TP \fB\-\-osm\fR.stop\-output.length FLOAT The default length of a public transport stop in FLOAT m @@ -1157,6 +1169,14 @@ .TP \fB\-\-opendrive\fR.internal\-shapes Import internal lane shapes +.TP +\fB\-\-opendrive\fR.position\-ids +Sets edge\-id based on road\-id and offset +in m (legacy) +.TP +\fB\-\-opendrive\fR.lane\-shapes +Use custom lane shapes to compensate +discarded lane types .SS "Netedit Options:" .TP \fB\-a\fR, \fB\-\-additional\-files\fR FILE @@ -1192,11 +1212,77 @@ prefix for node naming .TP \fB\-\-edge\-prefix\fR STR -prefix for edge naming naming +prefix for edge naming .TP \fB\-\-edge\-infix\fR STR enable edge\-infix () +.TP +\fB\-\-busStop\-prefix\fR STR +prefix for busStop naming +.TP +\fB\-\-trainStop\-prefix\fR STR +prefix for trainStop naming +.TP +\fB\-\-containerStop\-prefix\fR STR +prefix for containerStop naming +.TP +\fB\-\-chargingStation\-prefix\fR STR +prefix for chargingStation naming +.TP +\fB\-\-parkingArea\-prefix\fR STR +prefix for parkingArea naming +.TP +\fB\-\-e1Detector\-prefix\fR STR +prefix for e1Detector naming +.TP +\fB\-\-e2Detector\-prefix\fR STR +prefix for e2Detector naming +.TP +\fB\-\-e3Detector\-prefix\fR STR +prefix for e3Detector naming +.TP +\fB\-\-e1InstantDetector\-prefix\fR STR +prefix for e1InstantDetector naming +.TP +\fB\-\-rerouter\-prefix\fR STR +prefix for rerouter naming +.TP +\fB\-\-calibrator\-prefix\fR STR +prefix for calibrator naming +.TP +\fB\-\-routeProbe\-prefix\fR STR +prefix for routeProbe naming +.TP +\fB\-\-vss\-prefix\fR STR +prefix for vss naming +.TP +\fB\-\-polygon\-prefix\fR STR +prefix for polygon naming +.TP +\fB\-\-poi\-prefix\fR STR +prefix for poi naming +.TP +\fB\-\-route\-prefix\fR STR +prefix for route naming +.TP +\fB\-\-vType\-prefix\fR STR +prefix for vType naming +.TP +\fB\-\-vehicle\-prefix\fR STR +prefix for vehicle naming +.TP +\fB\-\-trip\-prefix\fR STR +prefix for trip naming +.TP +\fB\-\-flow\-prefix\fR STR +prefix for flow naming +.TP +\fB\-\-person\-prefix\fR STR +prefix for person naming +.TP +\fB\-\-container\-prefix\fR STR +prefix for container naming .SS "Visualisation Options:" .TP \fB\-\-disable\-laneIcons\fR @@ -1326,12 +1412,12 @@ Get in contact via . .IP .br -Build features: Linux\-5.4.0\-89\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG +Build features: Linux\-5.4.0\-94\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG .br -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP .br -Eclipse SUMO netedit Version 1.11.0 is part of SUMO. +Eclipse SUMO netedit Version 1.12.0 is part of SUMO. .br This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 diff -Nru sumo-1.11.0/docs/man/netgenerate.1 sumo-1.12.0/docs/man/netgenerate.1 --- sumo-1.11.0/docs/man/netgenerate.1 2021-11-22 23:05:52.000000000 +0000 +++ sumo-1.12.0/docs/man/netgenerate.1 2022-01-24 23:05:53.000000000 +0000 @@ -1,14 +1,14 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ECLIPSE "1" "November 2021" "Eclipse 1.11.0" "User Commands" +.TH ECLIPSE "1" "January 2022" "Eclipse 1.12.0" "User Commands" .SH NAME Eclipse SUMO netgenerate Version \- Road network generator for the microscopic traffic simulation SUMO .SH SYNOPSIS .B netgenerate [\fI\,OPTION\/\fR]\fI\,*\/\fR .SH DESCRIPTION -Eclipse SUMO netgenerate Version 1.11.0 +Eclipse SUMO netgenerate Version 1.12.0 .IP -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP Synthetic network generator for the microscopic, multi\-modal traffic simulation .IP @@ -675,6 +675,10 @@ outgoing edge speed on junction instead of average .TP +\fB\-\-internal\-junctions\fR.vehicle\-width FLOAT +Assumed vehicle width for computing +internal junction positions +.TP \fB\-\-rectangular\-lane\-cut\fR Forces rectangular cuts between lanes and intersections @@ -816,12 +820,12 @@ Get in contact via . .IP .br -Build features: Linux\-5.4.0\-89\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG +Build features: Linux\-5.4.0\-94\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG .br -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP .br -Eclipse SUMO netgenerate Version 1.11.0 is part of SUMO. +Eclipse SUMO netgenerate Version 1.12.0 is part of SUMO. .br This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 diff -Nru sumo-1.11.0/docs/man/od2trips.1 sumo-1.12.0/docs/man/od2trips.1 --- sumo-1.11.0/docs/man/od2trips.1 2021-11-22 23:05:51.000000000 +0000 +++ sumo-1.12.0/docs/man/od2trips.1 2022-01-24 23:05:52.000000000 +0000 @@ -1,14 +1,14 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ECLIPSE "1" "November 2021" "Eclipse 1.11.0" "User Commands" +.TH ECLIPSE "1" "January 2022" "Eclipse 1.12.0" "User Commands" .SH NAME Eclipse SUMO od2trips Version \- Importer of O/D-matrices for the traffic simulation SUMO .SH SYNOPSIS .B od2trips [\fI\,OPTION\/\fR]\fI\,*\/\fR .SH DESCRIPTION -Eclipse SUMO od2trips Version 1.11.0 +Eclipse SUMO od2trips Version 1.12.0 .IP -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP Importer of O/D\-matrices for the microscopic, multi\-modal traffic simulation .IP @@ -212,12 +212,12 @@ Get in contact via . .IP .br -Build features: Linux\-5.4.0\-89\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG +Build features: Linux\-5.4.0\-94\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG .br -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP .br -Eclipse SUMO od2trips Version 1.11.0 is part of SUMO. +Eclipse SUMO od2trips Version 1.12.0 is part of SUMO. .br This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 diff -Nru sumo-1.11.0/docs/man/polyconvert.1 sumo-1.12.0/docs/man/polyconvert.1 --- sumo-1.11.0/docs/man/polyconvert.1 2021-11-22 23:05:52.000000000 +0000 +++ sumo-1.12.0/docs/man/polyconvert.1 2022-01-24 23:05:53.000000000 +0000 @@ -1,14 +1,14 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ECLIPSE "1" "November 2021" "Eclipse 1.11.0" "User Commands" +.TH ECLIPSE "1" "January 2022" "Eclipse 1.12.0" "User Commands" .SH NAME Eclipse SUMO polyconvert Version \- Importer of polygons and POIs for the traffic simulation SUMO .SH SYNOPSIS .B polyconvert [\fI\,OPTION\/\fR]\fI\,*\/\fR .SH DESCRIPTION -Eclipse SUMO polyconvert Version 1.11.0 +Eclipse SUMO polyconvert Version 1.12.0 .IP -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP Importer of polygons and POIs for the microscopic, multi\-modal traffic .IP @@ -272,12 +272,12 @@ Get in contact via . .IP .br -Build features: Linux\-5.4.0\-89\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG +Build features: Linux\-5.4.0\-94\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG .br -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP .br -Eclipse SUMO polyconvert Version 1.11.0 is part of SUMO. +Eclipse SUMO polyconvert Version 1.12.0 is part of SUMO. .br This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 diff -Nru sumo-1.11.0/docs/man/sumo.1 sumo-1.12.0/docs/man/sumo.1 --- sumo-1.11.0/docs/man/sumo.1 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/man/sumo.1 2022-01-24 23:05:51.000000000 +0000 @@ -1,14 +1,14 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ECLIPSE "1" "November 2021" "Eclipse 1.11.0" "User Commands" +.TH ECLIPSE "1" "January 2022" "Eclipse 1.12.0" "User Commands" .SH NAME Eclipse SUMO sumo Version \- A microscopic, multi-modal traffic simulation .SH SYNOPSIS .B sumo [\fI\,OPTION\/\fR]\fI\,*\/\fR .SH DESCRIPTION -Eclipse SUMO sumo Version 1.11.0 +Eclipse SUMO sumo Version 1.12.0 .IP -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP A microscopic, multi\-modal traffic simulation. .SS "Configuration Options:" @@ -1321,6 +1321,11 @@ \fB\-\-meso\-lane\-queue\fR Enable separate queues for every lane .TP +\fB\-\-meso\-ignore\-lanes\-by\-vclass\fR STR[] +Do not build queues (or reduce capacity) +for lanes allowing only the given +vclasses +.TP \fB\-\-meso\-junction\-control\fR Enable mesoscopic traffic light and priority junction handling @@ -1453,12 +1458,12 @@ Get in contact via . .IP .br -Build features: Linux\-5.4.0\-89\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG +Build features: Linux\-5.4.0\-94\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG .br -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP .br -Eclipse SUMO sumo Version 1.11.0 is part of SUMO. +Eclipse SUMO sumo Version 1.12.0 is part of SUMO. .br This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 diff -Nru sumo-1.11.0/docs/man/sumo-gui.1 sumo-1.12.0/docs/man/sumo-gui.1 --- sumo-1.11.0/docs/man/sumo-gui.1 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/man/sumo-gui.1 2022-01-24 23:05:51.000000000 +0000 @@ -1,14 +1,14 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH ECLIPSE "1" "November 2021" "Eclipse 1.11.0" "User Commands" +.TH ECLIPSE "1" "January 2022" "Eclipse 1.12.0" "User Commands" .SH NAME Eclipse SUMO GUI Version \- GUI version of the simulation SUMO .SH SYNOPSIS .B sumo-gui [\fI\,OPTION\/\fR]\fI\,*\/\fR .SH DESCRIPTION -Eclipse SUMO GUI Version 1.11.0 +Eclipse SUMO GUI Version 1.12.0 .IP -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP GUI version of the microscopic, multi\-modal traffic simulation SUMO. .SS "Configuration Options:" @@ -1321,6 +1321,11 @@ \fB\-\-meso\-lane\-queue\fR Enable separate queues for every lane .TP +\fB\-\-meso\-ignore\-lanes\-by\-vclass\fR STR[] +Do not build queues (or reduce capacity) +for lanes allowing only the given +vclasses +.TP \fB\-\-meso\-junction\-control\fR Enable mesoscopic traffic light and priority junction handling @@ -1453,12 +1458,12 @@ Get in contact via . .IP .br -Build features: Linux\-5.4.0\-89\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG +Build features: Linux\-5.4.0\-94\-generic x86_64 GNU 9.3.0 Release Proj GUI SWIG .br -Copyright (C) 2001\-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de +Copyright (C) 2001\-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de .PP .br -Eclipse SUMO GUI Version 1.11.0 is part of SUMO. +Eclipse SUMO GUI Version 1.12.0 is part of SUMO. .br This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 diff -Nru sumo-1.11.0/docs/man/TraCITestClient.1 sumo-1.12.0/docs/man/TraCITestClient.1 --- sumo-1.11.0/docs/man/TraCITestClient.1 2021-11-22 23:05:52.000000000 +0000 +++ sumo-1.12.0/docs/man/TraCITestClient.1 2022-01-24 23:05:53.000000000 +0000 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.13. -.TH USAGE: "1" "November 2021" "Usage: name>]" "User Commands" +.TH USAGE: "1" "January 2022" "Usage: name>]" "User Commands" .SH NAME Usage: TraCITestClient -def -p [-h ] [-o index
/home/delphi/gcc/sumo/tools/sumolib/color.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2012-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2012-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.files.additional.html sumo-1.12.0/docs/pydoc/sumolib.files.additional.html --- sumo-1.11.0/docs/pydoc/sumolib.files.additional.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.files.additional.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/files/additional.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.files.html sumo-1.12.0/docs/pydoc/sumolib.files.html --- sumo-1.11.0/docs/pydoc/sumolib.files.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.files.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/files/__init__.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2012-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2012-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.files.selection.html sumo-1.12.0/docs/pydoc/sumolib.files.selection.html --- sumo-1.11.0/docs/pydoc/sumolib.files.selection.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.files.selection.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/files/selection.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.fpdiff.html sumo-1.12.0/docs/pydoc/sumolib.fpdiff.html --- sumo-1.11.0/docs/pydoc/sumolib.fpdiff.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.fpdiff.html 2022-01-24 23:05:51.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/fpdiff.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.geomhelper.html sumo-1.12.0/docs/pydoc/sumolib.geomhelper.html --- sumo-1.11.0/docs/pydoc/sumolib.geomhelper.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.geomhelper.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/geomhelper.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2013-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2013-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.html sumo-1.12.0/docs/pydoc/sumolib.html --- sumo-1.11.0/docs/pydoc/sumolib.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.html 2022-01-24 23:05:51.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/__init__.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.miscutils.html sumo-1.12.0/docs/pydoc/sumolib.miscutils.html --- sumo-1.11.0/docs/pydoc/sumolib.miscutils.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.miscutils.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/miscutils.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2012-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2012-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.net.connection.html sumo-1.12.0/docs/pydoc/sumolib.net.connection.html --- sumo-1.11.0/docs/pydoc/sumolib.net.connection.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.net.connection.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/net/connection.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.net.edge.html sumo-1.12.0/docs/pydoc/sumolib.net.edge.html --- sumo-1.11.0/docs/pydoc/sumolib.net.edge.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.net.edge.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/net/edge.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
@@ -124,7 +124,7 @@ Returns False if edge's function is 'normal', else False, e.g. for
internal edges or connector edges
-

is_fringe(self, connections=None)
true if this edge has no incoming or no outgoing connections (except turnarounds)
+
is_fringe(self, connections=None, checkJunctions=False)
true if this edge has no incoming or no outgoing connections (except turnarounds)
If connections is given, only those connections are considered
rebuildShape(self)
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.net.lane.html sumo-1.12.0/docs/pydoc/sumolib.net.lane.html --- sumo-1.11.0/docs/pydoc/sumolib.net.lane.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.net.lane.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/net/lane.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.net.node.html sumo-1.12.0/docs/pydoc/sumolib.net.node.html --- sumo-1.11.0/docs/pydoc/sumolib.net.node.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.net.node.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/net/node.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
@@ -63,6 +63,8 @@

getCoord3D(self)
+
getFringe(self)
+
getID(self)
getIncoming(self)
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.net.roundabout.html sumo-1.12.0/docs/pydoc/sumolib.net.roundabout.html --- sumo-1.11.0/docs/pydoc/sumolib.net.roundabout.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.net.roundabout.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/net/roundabout.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.options.html sumo-1.12.0/docs/pydoc/sumolib.options.html --- sumo-1.11.0/docs/pydoc/sumolib.options.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.options.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/options.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2012-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2012-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.output.convert.fcdfilter.html sumo-1.12.0/docs/pydoc/sumolib.output.convert.fcdfilter.html --- sumo-1.11.0/docs/pydoc/sumolib.output.convert.fcdfilter.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.output.convert.fcdfilter.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/output/convert/fcdfilter.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2017-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2017-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.output.convert.gpsdat.html sumo-1.12.0/docs/pydoc/sumolib.output.convert.gpsdat.html --- sumo-1.11.0/docs/pydoc/sumolib.output.convert.gpsdat.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.output.convert.gpsdat.html 2022-01-24 23:05:51.000000000 +0000 @@ -19,8 +19,7 @@        
datetime
-
sumolib
-

+

 
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.output.convert.html sumo-1.12.0/docs/pydoc/sumolib.output.convert.html --- sumo-1.11.0/docs/pydoc/sumolib.output.convert.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.output.convert.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >
index
/home/delphi/gcc/sumo/tools/sumolib/output/convert/__init__.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2012-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2012-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.output.dump.html sumo-1.12.0/docs/pydoc/sumolib.output.dump.html --- sumo-1.11.0/docs/pydoc/sumolib.output.dump.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.output.dump.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/output/dump.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.output.html sumo-1.12.0/docs/pydoc/sumolib.output.html --- sumo-1.11.0/docs/pydoc/sumolib.output.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.output.html 2022-01-24 23:05:51.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/output/__init__.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.output.inductionloop.html sumo-1.12.0/docs/pydoc/sumolib.output.inductionloop.html --- sumo-1.11.0/docs/pydoc/sumolib.output.inductionloop.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.output.inductionloop.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/output/inductionloop.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.route.html sumo-1.12.0/docs/pydoc/sumolib.route.html --- sumo-1.11.0/docs/pydoc/sumolib.route.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.route.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/route.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2009-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2009-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.sensors.html sumo-1.12.0/docs/pydoc/sumolib.sensors.html --- sumo-1.11.0/docs/pydoc/sumolib.sensors.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.sensors.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/sensors/__init__.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2012-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2012-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.shapes.html sumo-1.12.0/docs/pydoc/sumolib.shapes.html --- sumo-1.11.0/docs/pydoc/sumolib.shapes.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.shapes.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/shapes/__init__.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2012-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2012-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.shapes.poi.html sumo-1.12.0/docs/pydoc/sumolib.shapes.poi.html --- sumo-1.11.0/docs/pydoc/sumolib.shapes.poi.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.shapes.poi.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/shapes/poi.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2010-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2010-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.shapes.polygon.html sumo-1.12.0/docs/pydoc/sumolib.shapes.polygon.html --- sumo-1.11.0/docs/pydoc/sumolib.shapes.polygon.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.shapes.polygon.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/shapes/polygon.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2012-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2012-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.statistics.html sumo-1.12.0/docs/pydoc/sumolib.statistics.html --- sumo-1.11.0/docs/pydoc/sumolib.statistics.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.statistics.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/statistics.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2012-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2012-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.vehicletype.html sumo-1.12.0/docs/pydoc/sumolib.vehicletype.html --- sumo-1.11.0/docs/pydoc/sumolib.vehicletype.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.vehicletype.html 2022-01-24 23:05:51.000000000 +0000 @@ -10,7 +10,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/vehicletype.py

# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/sumolib.xml.html sumo-1.12.0/docs/pydoc/sumolib.xml.html --- sumo-1.11.0/docs/pydoc/sumolib.xml.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/sumolib.xml.html 2022-01-24 23:05:51.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/sumolib/xml.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
@@ -80,6 +80,13 @@ @Note: The element must be on its own line and the attributes must appear in
the given order.
@Example: parse_fast_nested('fcd.xml', 'timestep', ['time'], 'vehicle', ['id', 'speed', 'lane']):

+
parse_fast_structured(xmlfile, element_name, attrnames, nested, warn=False, optional=False, encoding='utf8')
Parses the given attrnames from all elements with element_name and nested elements of level 1.
+Unlike parse_fast_nested this function can handle multiple different child elements and
+returns objects where the child elements can be accessed by name (e.g. timestep.vehicle[0])
+as with the parse method. The returned object is not modifiable though.
+@Note: Every element must be on its own line and the attributes must appear in the given order.
+@Example: parse_fast_structured('fcd.xml', 'timestep', ['time'],
+                                {'vehicle': ['id', 'speed', 'lane'], 'person': ['id', 'speed', 'edge']}):
quoteattr(val)
reduce(...)
reduce(function, sequence[, initial]) -> value
 
diff -Nru sumo-1.11.0/docs/pydoc/traci._busstop.html sumo-1.12.0/docs/pydoc/traci._busstop.html --- sumo-1.11.0/docs/pydoc/traci._busstop.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._busstop.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_busstop.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._calibrator.html sumo-1.12.0/docs/pydoc/traci._calibrator.html --- sumo-1.11.0/docs/pydoc/traci._calibrator.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._calibrator.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_calibrator.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._chargingstation.html sumo-1.12.0/docs/pydoc/traci._chargingstation.html --- sumo-1.11.0/docs/pydoc/traci._chargingstation.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._chargingstation.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_chargingstation.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci.connection.html sumo-1.12.0/docs/pydoc/traci.connection.html --- sumo-1.11.0/docs/pydoc/traci.connection.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci.connection.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/connection.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci.domain.html sumo-1.12.0/docs/pydoc/traci.domain.html --- sumo-1.11.0/docs/pydoc/traci.domain.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci.domain.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/domain.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._edge.html sumo-1.12.0/docs/pydoc/traci._edge.html --- sumo-1.11.0/docs/pydoc/traci._edge.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._edge.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_edge.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci.exceptions.html sumo-1.12.0/docs/pydoc/traci.exceptions.html --- sumo-1.11.0/docs/pydoc/traci.exceptions.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci.exceptions.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/exceptions.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._gui.html sumo-1.12.0/docs/pydoc/traci._gui.html --- sumo-1.11.0/docs/pydoc/traci._gui.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._gui.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_gui.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
@@ -113,7 +113,7 @@  
Set the current zoom factor for the given view.

-
toggleSelection(self, objID, objType='vehicle')
toggleSelection(string, string) -> int
+
toggleSelection(self, objID, objType='vehicle')
toggleSelection(string, string) -> None
Toggle selection status for the object of the given type and id
track(self, objID, viewID='View #0')
track(string, string) -> None
diff -Nru sumo-1.11.0/docs/pydoc/traci.html sumo-1.12.0/docs/pydoc/traci.html --- sumo-1.11.0/docs/pydoc/traci.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/__init__.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._inductionloop.html sumo-1.12.0/docs/pydoc/traci._inductionloop.html --- sumo-1.11.0/docs/pydoc/traci._inductionloop.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._inductionloop.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_inductionloop.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._junction.html sumo-1.12.0/docs/pydoc/traci._junction.html --- sumo-1.11.0/docs/pydoc/traci._junction.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._junction.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_junction.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._lanearea.html sumo-1.12.0/docs/pydoc/traci._lanearea.html --- sumo-1.11.0/docs/pydoc/traci._lanearea.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._lanearea.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_lanearea.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._lane.html sumo-1.12.0/docs/pydoc/traci._lane.html --- sumo-1.11.0/docs/pydoc/traci._lane.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._lane.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_lane.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci.main.html sumo-1.12.0/docs/pydoc/traci.main.html --- sumo-1.11.0/docs/pydoc/traci.main.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci.main.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/main.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._meandata.html sumo-1.12.0/docs/pydoc/traci._meandata.html --- sumo-1.11.0/docs/pydoc/traci._meandata.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._meandata.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_meandata.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._multientryexit.html sumo-1.12.0/docs/pydoc/traci._multientryexit.html --- sumo-1.11.0/docs/pydoc/traci._multientryexit.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._multientryexit.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_multientryexit.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._overheadwire.html sumo-1.12.0/docs/pydoc/traci._overheadwire.html --- sumo-1.11.0/docs/pydoc/traci._overheadwire.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._overheadwire.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_overheadwire.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._parkingarea.html sumo-1.12.0/docs/pydoc/traci._parkingarea.html --- sumo-1.11.0/docs/pydoc/traci._parkingarea.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._parkingarea.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_parkingarea.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._person.html sumo-1.12.0/docs/pydoc/traci._person.html --- sumo-1.11.0/docs/pydoc/traci._person.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._person.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_person.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._poi.html sumo-1.12.0/docs/pydoc/traci._poi.html --- sumo-1.11.0/docs/pydoc/traci._poi.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._poi.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_poi.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._polygon.html sumo-1.12.0/docs/pydoc/traci._polygon.html --- sumo-1.11.0/docs/pydoc/traci._polygon.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._polygon.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_polygon.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._rerouter.html sumo-1.12.0/docs/pydoc/traci._rerouter.html --- sumo-1.11.0/docs/pydoc/traci._rerouter.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._rerouter.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_rerouter.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._route.html sumo-1.12.0/docs/pydoc/traci._route.html --- sumo-1.11.0/docs/pydoc/traci._route.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._route.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_route.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._routeprobe.html sumo-1.12.0/docs/pydoc/traci._routeprobe.html --- sumo-1.11.0/docs/pydoc/traci._routeprobe.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._routeprobe.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_routeprobe.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._simulation.html sumo-1.12.0/docs/pydoc/traci._simulation.html --- sumo-1.11.0/docs/pydoc/traci._simulation.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._simulation.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_simulation.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci.storage.html sumo-1.12.0/docs/pydoc/traci.storage.html --- sumo-1.11.0/docs/pydoc/traci.storage.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci.storage.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/storage.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._trafficlight.html sumo-1.12.0/docs/pydoc/traci._trafficlight.html --- sumo-1.11.0/docs/pydoc/traci._trafficlight.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._trafficlight.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_trafficlight.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
@@ -188,6 +188,10 @@ Returns the links controlled by the traffic light, sorted by the signal index and described by giving
the incoming, outgoing, and via lane.

+
getNemaPhaseCalls(self, tlsID)
getNemaPhaseCalls(string) -> list(string)
+Get the vehicle calls for the phases.
+The output is vehicle calls (coming from the detectors) for the phases.
+
getNextSwitch(self, tlsID)
getNextSwitch(string) -> double
 
Returns the absolute simulation time at which the traffic light is
diff -Nru sumo-1.11.0/docs/pydoc/traci._variablespeedsign.html sumo-1.12.0/docs/pydoc/traci._variablespeedsign.html --- sumo-1.11.0/docs/pydoc/traci._variablespeedsign.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._variablespeedsign.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_variablespeedsign.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/pydoc/traci._vehicle.html sumo-1.12.0/docs/pydoc/traci._vehicle.html --- sumo-1.11.0/docs/pydoc/traci._vehicle.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._vehicle.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_vehicle.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2011-2022 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/
@@ -376,7 +376,13 @@ minGap of the vehicle.
The dist parameter defines the minimum lookahead, 0 calculates a lookahead from the brake gap.
Note that the returned leader may be further away than the given dist and that the vehicle
-will only look on its current best lanes and not look beyond the end of its final route edge.

+will only look on its current best lanes and not look beyond the end of its final route edge.

+In the case where no leader is found, the function returns 'None'.
+This special case is deprecated. The future behavior is to return the
+pair ("", -1) when no leader is found.
+The function 'traci.setLegacyGetLeader(bool) can be used to switch
+between both behaviors.
getLeftFollowers(self, vehID, blockingOnly=False)
bool -> list(pair(string, double))
Convenience method, see getNeighbors()
diff -Nru sumo-1.11.0/docs/pydoc/traci._vehicletype.html sumo-1.12.0/docs/pydoc/traci._vehicletype.html --- sumo-1.11.0/docs/pydoc/traci._vehicletype.html 2021-11-22 23:05:50.000000000 +0000 +++ sumo-1.12.0/docs/pydoc/traci._vehicletype.html 2022-01-24 23:05:50.000000000 +0000 @@ -11,7 +11,7 @@ >index
/home/delphi/gcc/sumo/tools/traci/_vehicletype.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
-# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others.
+# Copyright (C) 2008-2022 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/
diff -Nru sumo-1.11.0/docs/tutorial/circles/runner.py sumo-1.12.0/docs/tutorial/circles/runner.py --- sumo-1.11.0/docs/tutorial/circles/runner.py 2021-01-20 23:01:27.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/circles/runner.py 2022-01-14 07:15:12.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/city_mobil/data/agentManager.py sumo-1.12.0/docs/tutorial/city_mobil/data/agentManager.py --- sumo-1.11.0/docs/tutorial/city_mobil/data/agentManager.py 2021-11-22 23:05:52.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/city_mobil/data/agentManager.py 2022-01-24 23:05:53.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/city_mobil/data/constants.py sumo-1.12.0/docs/tutorial/city_mobil/data/constants.py --- sumo-1.11.0/docs/tutorial/city_mobil/data/constants.py 2021-11-22 23:05:52.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/city_mobil/data/constants.py 2022-01-24 23:05:53.000000000 +0000 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/city_mobil/data/createNet.py sumo-1.12.0/docs/tutorial/city_mobil/data/createNet.py --- sumo-1.11.0/docs/tutorial/city_mobil/data/createNet.py 2021-11-22 23:05:52.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/city_mobil/data/createNet.py 2022-01-24 23:05:53.000000000 +0000 @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/city_mobil/data/createNetTaxi.py sumo-1.12.0/docs/tutorial/city_mobil/data/createNetTaxi.py --- sumo-1.11.0/docs/tutorial/city_mobil/data/createNetTaxi.py 2021-11-22 23:05:52.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/city_mobil/data/createNetTaxi.py 2022-01-24 23:05:53.000000000 +0000 @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/city_mobil/data/simpleManager.py sumo-1.12.0/docs/tutorial/city_mobil/data/simpleManager.py --- sumo-1.11.0/docs/tutorial/city_mobil/data/simpleManager.py 2021-11-22 23:05:52.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/city_mobil/data/simpleManager.py 2022-01-24 23:05:53.000000000 +0000 @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/city_mobil/data/statistics.py sumo-1.12.0/docs/tutorial/city_mobil/data/statistics.py --- sumo-1.11.0/docs/tutorial/city_mobil/data/statistics.py 2021-11-22 23:05:52.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/city_mobil/data/statistics.py 2022-01-24 23:05:53.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/city_mobil/data/vehicleControl.py sumo-1.12.0/docs/tutorial/city_mobil/data/vehicleControl.py --- sumo-1.11.0/docs/tutorial/city_mobil/data/vehicleControl.py 2021-11-22 23:05:52.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/city_mobil/data/vehicleControl.py 2022-01-24 23:05:53.000000000 +0000 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/city_mobil/runner.py sumo-1.12.0/docs/tutorial/city_mobil/runner.py --- sumo-1.11.0/docs/tutorial/city_mobil/runner.py 2021-02-18 23:01:23.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/city_mobil/runner.py 2022-01-14 07:15:12.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2011-2022 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/ @@ -20,10 +20,11 @@ from __future__ import print_function import os +import sys import subprocess os.chdir('data') -subprocess.call(["python", "createNet.py"]) -subprocess.call(["python", "simpleManager.py", "-t"]) -subprocess.call(["python", "agentManager.py", "-t"]) -subprocess.call(["python", "createNetTaxi.py"]) +subprocess.call([sys.executable, "createNet.py"]) +subprocess.call([sys.executable, "simpleManager.py", "-t"]) +subprocess.call([sys.executable, "agentManager.py", "-t"]) +subprocess.call([sys.executable, "createNetTaxi.py"]) diff -Nru sumo-1.11.0/docs/tutorial/hello/runner.py sumo-1.12.0/docs/tutorial/hello/runner.py --- sumo-1.11.0/docs/tutorial/hello/runner.py 2021-01-20 23:01:27.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/hello/runner.py 2022-01-14 07:15:12.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/manhattan/runner.py sumo-1.12.0/docs/tutorial/manhattan/runner.py --- sumo-1.11.0/docs/tutorial/manhattan/runner.py 2021-01-20 23:01:27.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/manhattan/runner.py 2022-01-14 07:15:12.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/output_parsing/runner.py sumo-1.12.0/docs/tutorial/output_parsing/runner.py --- sumo-1.11.0/docs/tutorial/output_parsing/runner.py 2021-01-20 23:01:27.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/output_parsing/runner.py 2022-01-14 07:15:12.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/public_transport/data/net.net.xml sumo-1.12.0/docs/tutorial/public_transport/data/net.net.xml --- sumo-1.11.0/docs/tutorial/public_transport/data/net.net.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/public_transport/data/net.net.xml 2022-01-24 23:05:53.000000000 +0000 @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-1.11.0/docs/tutorial/public_transport/data/persons.rou.xml sumo-1.12.0/docs/tutorial/public_transport/data/persons.rou.xml --- sumo-1.11.0/docs/tutorial/public_transport/data/persons.rou.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/public_transport/data/persons.rou.xml 2022-01-24 23:05:53.000000000 +0000 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -Nru sumo-1.11.0/docs/tutorial/public_transport/data/pt.rou.xml sumo-1.12.0/docs/tutorial/public_transport/data/pt.rou.xml --- sumo-1.11.0/docs/tutorial/public_transport/data/pt.rou.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/public_transport/data/pt.rou.xml 2022-01-24 23:05:53.000000000 +0000 @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-1.11.0/docs/tutorial/public_transport/data/run.sumocfg sumo-1.12.0/docs/tutorial/public_transport/data/run.sumocfg --- sumo-1.11.0/docs/tutorial/public_transport/data/run.sumocfg 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/public_transport/data/run.sumocfg 2022-01-24 23:05:53.000000000 +0000 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + diff -Nru sumo-1.11.0/docs/tutorial/public_transport/data/stops.add.xml sumo-1.12.0/docs/tutorial/public_transport/data/stops.add.xml --- sumo-1.11.0/docs/tutorial/public_transport/data/stops.add.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/public_transport/data/stops.add.xml 2022-01-24 23:05:53.000000000 +0000 @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-1.11.0/docs/tutorial/public_transport/runner.py sumo-1.12.0/docs/tutorial/public_transport/runner.py --- sumo-1.11.0/docs/tutorial/public_transport/runner.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/public_transport/runner.py 2022-01-14 07:15:12.000000000 +0000 @@ -0,0 +1,38 @@ +#!/usr/bin/env python +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2008-2022 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 runner.py +# @author Daniel Krajzewicz +# @author Michael Behrisch +# @date 2007-10-25 + +from __future__ import absolute_import +from __future__ import print_function + + +import os +import subprocess +import sys +if 'SUMO_HOME' in os.environ: + tools = os.path.join(os.environ['SUMO_HOME'], 'tools') + sys.path.append(tools) +else: + sys.exit("please declare environment variable 'SUMO_HOME'") +from sumolib import checkBinary # noqa +sumoBinary = checkBinary('sumo') +# run simulation +retcode = subprocess.call( + [sumoBinary, "-c", "data/run.sumocfg", "--no-step-log", "-t", + "--stop-output", "stopinfos.xml"], stdout=sys.stdout, stderr=sys.stderr) +print(">> Simulation closed with status %s" % retcode) +sys.stdout.flush() diff -Nru sumo-1.11.0/docs/tutorial/public_transport/test.bat sumo-1.12.0/docs/tutorial/public_transport/test.bat --- sumo-1.11.0/docs/tutorial/public_transport/test.bat 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/public_transport/test.bat 2022-01-24 23:05:53.000000000 +0000 @@ -0,0 +1 @@ +python runner.py \ No newline at end of file diff -Nru sumo-1.11.0/docs/tutorial/public_transport/test.sh sumo-1.12.0/docs/tutorial/public_transport/test.sh --- sumo-1.11.0/docs/tutorial/public_transport/test.sh 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/public_transport/test.sh 2022-01-24 23:05:53.000000000 +0000 @@ -0,0 +1 @@ +python runner.py \ No newline at end of file diff -Nru sumo-1.11.0/docs/tutorial/quickstart/runner.py sumo-1.12.0/docs/tutorial/quickstart/runner.py --- sumo-1.11.0/docs/tutorial/quickstart/runner.py 2021-01-20 23:01:27.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/quickstart/runner.py 2022-01-14 07:15:12.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/sumolympics/data/makeSumolympicWalkers.py sumo-1.12.0/docs/tutorial/sumolympics/data/makeSumolympicWalkers.py --- sumo-1.11.0/docs/tutorial/sumolympics/data/makeSumolympicWalkers.py 2021-11-22 23:05:52.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/sumolympics/data/makeSumolympicWalkers.py 2022-01-24 23:05:53.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2009-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/sumolympics/runner.py sumo-1.12.0/docs/tutorial/sumolympics/runner.py --- sumo-1.11.0/docs/tutorial/sumolympics/runner.py 2021-01-20 23:01:27.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/sumolympics/runner.py 2022-01-14 07:15:12.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/traci_pedestrian_crossing/runner.py sumo-1.12.0/docs/tutorial/traci_pedestrian_crossing/runner.py --- sumo-1.11.0/docs/tutorial/traci_pedestrian_crossing/runner.py 2021-01-20 23:01:27.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/traci_pedestrian_crossing/runner.py 2022-01-14 07:15:12.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2009-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/traci_taxi/runner.py sumo-1.12.0/docs/tutorial/traci_taxi/runner.py --- sumo-1.11.0/docs/tutorial/traci_taxi/runner.py 2021-06-30 22:00:59.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/traci_taxi/runner.py 2022-01-14 07:15:12.000000000 +0000 @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/docs/tutorial/traci_tls/runner.py sumo-1.12.0/docs/tutorial/traci_tls/runner.py --- sumo-1.11.0/docs/tutorial/traci_tls/runner.py 2021-01-20 23:01:27.000000000 +0000 +++ sumo-1.12.0/docs/tutorial/traci_tls/runner.py 2022-01-14 07:15:12.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2009-2022 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/ diff -Nru sumo-1.11.0/docs/userdoc/404.html sumo-1.12.0/docs/userdoc/404.html --- sumo-1.11.0/docs/userdoc/404.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/404.html 2022-01-24 23:06:32.000000000 +0000 @@ -144,7 +144,7 @@


-

Copyright © 2001-2021 German Aerospace Center (DLR) and others.

+

Copyright © 2001-2022 German Aerospace Center (DLR) and others.

Follow us on | Documentation built with MkDocs

diff -Nru sumo-1.11.0/docs/userdoc/activitygen.html sumo-1.12.0/docs/userdoc/activitygen.html --- sumo-1.11.0/docs/userdoc/activitygen.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/activitygen.html 2022-01-24 23:06:32.000000000 +0000 @@ -435,7 +435,7 @@
This page was last edited on: 11 February 2021
-

Copyright © 2001-2021 German Aerospace Center (DLR) and others.

+

Copyright © 2001-2022 German Aerospace Center (DLR) and others.

Follow us on | Documentation built with MkDocs

diff -Nru sumo-1.11.0/docs/userdoc/Basics/Basic_Computer_Skills.html sumo-1.12.0/docs/userdoc/Basics/Basic_Computer_Skills.html --- sumo-1.11.0/docs/userdoc/Basics/Basic_Computer_Skills.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Basics/Basic_Computer_Skills.html 2022-01-24 23:06:32.000000000 +0000 @@ -308,15 +308,15 @@
  • A small window should appear. Under user variables select PATH (or Path - Windows environment variables are case insensitive) and click Edit. If no such variable exists you must create it with the New-Button
  • -
  • Append ;C:\Program Files\sumo-1.11.0\bin to the end of the PATH value +
  • Append ;C:\Program Files\sumo-1.12.0\bin to the end of the PATH value (don't delete the existing values!)
  • Under user variables now select SUMO_HOME and click Edit. If no such variable exists you must create it with the New-Button
  • -
  • Set C:\Program Files\sumo-1.11.0 as the value of the SUMO_HOME variable
  • +
  • Set C:\Program Files\sumo-1.12.0 as the value of the SUMO_HOME variable
  • Note

    -

    Replace C:\Program Files\sumo-1.11.0\ with your sumo directory.

    +

    Replace C:\Program Files\sumo-1.12.0\ with your sumo directory.

    Caution

    @@ -423,7 +423,7 @@
    This page was last edited on: 12 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Basics/Notation.html sumo-1.12.0/docs/userdoc/Basics/Notation.html --- sumo-1.11.0/docs/userdoc/Basics/Notation.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Basics/Notation.html 2022-01-24 23:06:32.000000000 +0000 @@ -289,7 +289,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Basics/Using_the_Command_Line_Applications.html sumo-1.12.0/docs/userdoc/Basics/Using_the_Command_Line_Applications.html --- sumo-1.11.0/docs/userdoc/Basics/Using_the_Command_Line_Applications.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Basics/Using_the_Command_Line_Applications.html 2022-01-24 23:06:32.000000000 +0000 @@ -241,7 +241,7 @@ (netgenerate in this case). As no parameter has been given, the application does not know what to do and prints only an information about itself:

    -
    Eclipse SUMO netgenerate Version 1.11.0
    +
    Eclipse SUMO netgenerate Version 1.12.0
      Build features: Linux-4.1.39-56-default Proj GDAL GUI
      Copyright (C) 2001-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de
      License EPL-2.0: Eclipse Public License Version 2 <https://eclipse.org/legal/epl-v20.html>
    @@ -561,7 +561,7 @@
                 
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Car-Following-Models/ACC.html sumo-1.12.0/docs/userdoc/Car-Following-Models/ACC.html --- sumo-1.11.0/docs/userdoc/Car-Following-Models/ACC.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Car-Following-Models/ACC.html 2022-01-24 23:06:32.000000000 +0000 @@ -193,6 +193,7 @@ three modes: (i) speed (or cruising) control, (ii) gap-closing control and (iii) gap control. A fourth mode (i.e. collision avoidance mode) has been introduced within the project TransAID.

    +

    see also CACC model.

    Speed control mode#

    The speed control mode is designed to maintain the pre-defined by the driver desired speed and is activated when there are no preceding @@ -227,6 +228,10 @@ situations.

  • When there is no leader vehicle, the model uses the same speed as the Krauss model to approach junctions and speed limits
  • +
    +

    Caution

    +

    The model is known to produce collisions at the default step-length of 1s. Better results can be achieved by setting a lower step length.

    +

    References#

    1. Milanés, V., & Shladover, S. E. (2014). Modeling cooperative and @@ -247,10 +252,10 @@
      -
      This page was last edited on: 22 April 2021 +
      This page was last edited on: 06 January 2022
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Car-Following-Models/CACC.html sumo-1.12.0/docs/userdoc/Car-Following-Models/CACC.html --- sumo-1.11.0/docs/userdoc/Car-Following-Models/CACC.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Car-Following-Models/CACC.html 2022-01-24 23:06:32.000000000 +0000 @@ -194,6 +194,7 @@ cruising) control, (ii) gap-closing control and (iii) gap control. A fourth mode (i.e. collision avoidance mode) has been introduced within the project TransAID.

      +

      see also ACC model.

      Speed control mode#

      The speed control mode is designed to maintain the pre-defined by the driver desired speed and is activated when there are no preceding @@ -253,10 +254,10 @@

      -
      This page was last edited on: 22 April 2021 +
      This page was last edited on: 06 January 2022
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Car-Following-Models/EIDM.html sumo-1.12.0/docs/userdoc/Car-Following-Models/EIDM.html --- sumo-1.11.0/docs/userdoc/Car-Following-Models/EIDM.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Car-Following-Models/EIDM.html 2022-01-24 23:06:32.000000000 +0000 @@ -0,0 +1,321 @@ + + + + + + + + + + + + + + + + + Extended Intelligent Driver Model - SUMO Documentation + + + + + + + + + + + + + + + + + + + + + +
      +
      +
      +
      + + + +
      +
      + + + Extended Intelligent Driver Model
      + + + +

      Overview#

      +

      The Extended Intelligent Driver Model (EIDM) [1] is based on many known model extensions of the Intelligent Driver Model (IDM) by Treiber and Kesting. +Additionally, it includes calculations to reduce the jerk in different driving situations (lane changes, accelerating from standstill, etc.). +By changing the parameters (mostly to 0), each extension can individually be turned "off". +The aim of the model is to correctly replicate submicroscopic acceleration profiles of single vehicles and drivers.

      +

      Notes#

      +
        +
      • The model is intended to run with subsecond timesteps (0.05-0.5s). The model will produce unwanted emergency braking and collisions at higher step-lengths.
      • +
      • The EIDM uses lower safe gaps than the IDM (e.g. when changing lanes).
      • +
      • The model is based on the Improved Intelligent Driver Model, which can currently not be changed via parameters (e.g. to the IDM as base model).
      • +
      • The model is still in development, future releases may include: + - spatial anticipation + - a reaction time added to the action point time + - acceleration thresholds depending on vehicle dynamics and resistance + - situation dependent driving
      • +
      +
      +

      Caution

      +

      When simulating with estimated variables, the function randNorm() is used. +Due to the calculation and rounding of the log()-function, results differ depending on the compiler/processor/operating system. For more information and a workaround, see [2].

      +
      +

      References#

      +
        +
      1. "Extending the Intelligent Driver Model in SUMO and Verifying the Drive Off Trajectories with Aerial Measurements"; + Dominik Salles, Stefan Kaufmann, Hans-Christian Reuss. SUMO User Conference 2020.
      2. +
      3. Platform-dependent behavior: "Github-issue #8921"
      4. +
      5. "SUMO Conference presentation"
      6. +
      +
      +
      + +
      + +
      + +
      This page was last edited on: 26 November 2021 + +
      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      +

      Follow us on + | Documentation built with MkDocs

      +
      + + + + + + + + + + diff -Nru sumo-1.11.0/docs/userdoc/Car-Following-Models.html sumo-1.12.0/docs/userdoc/Car-Following-Models.html --- sumo-1.11.0/docs/userdoc/Car-Following-Models.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Car-Following-Models.html 2022-01-24 23:06:32.000000000 +0000 @@ -241,7 +241,7 @@
      This page was last edited on: 27 September 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/ChangeLog.html sumo-1.12.0/docs/userdoc/ChangeLog.html --- sumo-1.11.0/docs/userdoc/ChangeLog.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/ChangeLog.html 2022-01-24 23:06:32.000000000 +0000 @@ -142,7 +142,7 @@
    2. Added tool addTAZ.py for adding taz information to route files. Issue #8884
    3. osmWebWizard.py now imports all bicycle lane data when building scenario with bicycle traffic. Issue #9071
    4. osmWebWizard.py uses improved pedestrian routing on shared space. Issue #9100
    5. -
    6. osmWebWizard.py now avoids duplicate sidewalks when building a simulation with persons. Rebuild network with osm.sidewalks False to replicate the old behavior (for areas that lack OSM sidewalk data). Issue #9444
    7. +
    8. osmWebWizard.py now avoids duplicate sidewalks when building a simulation with persons. Rebuild network with --osm.sidewalks False to replicate the old behavior (for areas that lack OSM sidewalk data). Issue #9444
    9. gridDistricts.py now supports option --vclass for filtering taz edges in multi-modal networks. Issue #9127
    10. Added tool route2OD.py which generates a tazRelation-file (OD-Matrix) from a taz-file and route-file. Issue #9117
    11. Major speedup in GTFS import with gtfs2pt. Issue #9136
    12. @@ -675,20 +993,21 @@
    13. generateContinousRerouters.py: added option --vlcass to avoid errors in multi-modal networks. Issue #9188
    14. generateTurnRatios.py: Added option --interval to write time-dependent turn counts / ratios. Issue #9294
    15. duaIterate.py: Now supports options --save-configuration (-C) and --configuration-file (-c) to save and load configurations. Issue #9314
    16. -
    17. Added tool computePassengercounts.py to count passenger number in vehicle over time #9366
    18. +
    19. Added tool computePassengerCounts.py to count passenger number in vehicle over time #9366
    20. generateParkingAreaRerouters.py
      • added option --opposite-visible to ensure that parking areas on the opposite direction road are visible. Issue #9372
      • now runs much faster. Issue #9379
    21. -
    22. routeSampler.py: added option --min-count to set mininum number of counting locations for each used route. Issue #9415
    23. -
    24. Added tool scheduleStats to analyze deviations between loaded public transport schedules and simulation timing. Issue #8420
    25. +
    26. routeSampler.py: added option --min-count to set minimum number of counting locations for each used route. Issue #9415
    27. +
    28. Added tool scheduleStats.py to analyze deviations between loaded public transport schedules and simulation timing. Issue #8420
    29. Added tool plotXMLAttributes.py to generated 2D-plots from arbitrary attribute of XML files. Issue #9403
    30. osmTaxiStop.py: added option --fleet-size to generated a taxi fleet along with the stops. Issue #9116
    31. sumolib.net.getShortest path now allows using edges in both directions for pedestrian route search (ignoreDirection="true"). Issue #9533
    32. -
    33. addStops2Routes.py received new options to define stops at parkingAreas, add stops to persons and to define stationary (parkig) traffic. Issue #3607, #9561, #9562
    34. +
    35. addStops2Routes.py received new options to define stops at parkingAreas, add stops to persons and to define stationary (parking) traffic. Issue #3607, #9561, #9562
    36. library functions 'sumolib.xml.parse_fast' and 'parse_fast_nested' can now handle XML-comments. Issue #8565
    37. -
    38. Added tool to analyze reroute times and distances for parking search traffic. Issue #9534
    39. +
    40. Added tool parkingSearchTraffic.py to analyze reroute times and distances for parking search traffic. Issue #9534
    41. +
    42. Added tool tripinfoByType.py for aggregating tripinfo output by vType #9596
    43. @@ -709,7 +1028,7 @@
    44. duaIterate.py option -C is no longer a synonym for --continue-on-unbuild. Instead, it is a shortcut for --save-configuration. Issue #9314
    45. Version 1.10.0 (17.08.2021)#

      -

      Bugfixes#

      +

      Bugfixes#

      • simulation
        • Fixed invalid state file when using option --vehroute-output.exit-times and saved vehicles are still on their first edge. Issue #8536 (regression in 1.9.1)
        • @@ -739,7 +1058,7 @@
        • Fixed briefly invisible vehicle while passing short internal edge. Issue #8749 (regression in 1.9.0)
        • Drawing parkingAreas with large roadsideCapacity no longer causes the gui to slow down. Issue #8400
        • Fixed invalid window size after using "restore" button. Issue #8826
        • -
        • Fixed flickering whiile vehicles drive on the opposite side. Issue #8887
        • +
        • Fixed flickering while vehicles drive on the opposite side. Issue #8887
        • Invisible vehicles (alpha=0) no longer register clicks. Issue #8913
        • Fixed invalid position of size-exaggerated persons at a size-exaggerated busStop. Issue #8883
        • Fixed hidden context menu near the screen border. Issue #8860
        • @@ -824,7 +1143,7 @@
      -

      Enhancements#

      +

      Enhancements#

      • simulation
        • CarFollowModel 'EIDM' (extended IDM) is now supported. Issue #8909 (Thanks to Dominik Salles)
        • @@ -903,7 +1222,7 @@
      -

      Miscellaneous#

      +

      Miscellaneous#

      • tools
        • Function sumolib.xml.parse now sets the attribute heterogeneous=True by default. This enables parsing of all attributes even not all elements have the same set of attributes. The value heterogeneous=False is useful for conserving memory when all elements are known to have the same set of attributes. Issue #8651
        • @@ -912,7 +1231,7 @@

        Version 1.9.2 (18.05.2021)#

        -

        Bugfixes#

        +

        Bugfixes#

        • simulation
          • Vehroute output for persons now writes the correct stopping place type (i.e. parkingArea, busStop, etc.) Issue #8597
          • @@ -954,7 +1273,7 @@
        -

        Enhancements#

        +

        Enhancements#

        • simulation
          • Vehroute-output now includes stop attributes 'started' and 'ended' and ride attribute 'ended' if option --vehroute-output.exit-times is set. Issue #8415, #8600
          • @@ -982,7 +1301,7 @@

          Version 1.9.1 (04.05.2021)#

          -

          Bugfixes#

          +

          Bugfixes#

          • Simulation
            • Statistic-output value departDelayWaiting is now in s (was in ms before).
            • @@ -1046,7 +1365,7 @@
          -

          Enhancements#

          +

          Enhancements#

          • Simulation
            • Vehicles can now be equipped with the glosa device to adapt their speed at traffic lights. Issue #7721
            • @@ -1102,7 +1421,7 @@

            Version 1.9.0 (13.04.2021)#

            -

            Bugfixes#

            +

            Bugfixes#

            • Simulation Option --xml-validation.net is now working again. Issue #8107 (regression in 1.5.0)
                @@ -1263,7 +1582,7 @@
            -

            Enhancements#

            +

            Enhancements#

            • Simulation
              • Sublane model can now be used together with overtaking through the opposite direction. Issue #1997
              • @@ -1477,7 +1796,7 @@

              Version 1.8.0 (02.12.2020)#

              -

              Bugfixes#

              +

              Bugfixes#

              • simulation
                • Fixed automatic ride sharing for personTrips between the same origin and destination that did not declare a common 'group'. By default, rides are not shared. Automatic ride sharing for personTrips and rides can be enabled by setting option --persontrip.default.group STR to an arbitrary value. Issue #7559, #7560
                • @@ -1618,7 +1937,7 @@
              -

              Enhancements#

              +

              Enhancements#

              • simulation
                • Added vehicle attribute 'departEdge' which can be used to insert a vehicle beyond the first edge of its route. Issue #1129
                • @@ -1713,7 +2032,7 @@
                • extractTest.py now extracts tests for all variants (sumo, meso) which have specific outputs and got a lot better picking up all options

                Version 1.7.0 (09.09.2020)#

                -

                Bugfixes#

                +

                Bugfixes#

                • Simulation
                  • When using the options --vehroute-output.write-unfinished --vehroute-output.exit-times all edges of the route are now included (instead of passed edges only) and the exit times for unfinished edges are written as '-1'. Issue #6956
                  • @@ -1865,7 +2184,7 @@
                -

                Enhancements#

                +

                Enhancements#

                • Simulation
                  • Added option --person-summary-output which causes statistics on person numbers and their travel modes to be written in every simulation step. Issue #6964
                  • @@ -2031,7 +2350,7 @@

                  Version 1.6.0 (28.04.2020)#

                  -

                  Bugfixes#

                  +

                  Bugfixes#

                  • Simulation
                    • Fixed negative depart delay. Vehicles with a sub-step-length depart time now depart in the subsequent step. Issue #964
                    • @@ -2125,7 +2444,7 @@
                  -

                  Enhancements#

                  +

                  Enhancements#

                  • Simulation
                    • Taxi device now supports ride sharing. Issue #6544
                    • @@ -2241,7 +2560,7 @@

                    Version 1.5.0 (11.02.2020)#

                    -

                    Bugfixes#

                    +

                    Bugfixes#

                    • Simulation
                      • Fixed bug that could cause the simulation to freeze when vehicles approach a right_before_left junction from all directions simultaneously. Issue #6471 (regression in 1.4)
                      • @@ -2304,7 +2623,7 @@
                    -

                    Enhancements#

                    +

                    Enhancements#

                    • Simulation
                      • Added new model for electric hybrid vehicles and overhead lines and power substations.
                      • @@ -2491,10 +2810,10 @@
                        -
                        This page was last edited on: 22 November 2021 +
                        This page was last edited on: 24 January 2022
                        -

                        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

                        +

                        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

                        Follow us on | Documentation built with MkDocs

                        diff -Nru sumo-1.11.0/docs/userdoc/Contact.html sumo-1.12.0/docs/userdoc/Contact.html --- sumo-1.11.0/docs/userdoc/Contact.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contact.html 2022-01-24 23:06:32.000000000 +0000 @@ -173,7 +173,7 @@
                        This page was last edited on: 11 February 2021
                        -

                        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

                        +

                        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

                        Follow us on | Documentation built with MkDocs

                        diff -Nru sumo-1.11.0/docs/userdoc/Contributed/Cadyts.html sumo-1.12.0/docs/userdoc/Contributed/Cadyts.html --- sumo-1.11.0/docs/userdoc/Contributed/Cadyts.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contributed/Cadyts.html 2022-01-24 23:06:32.000000000 +0000 @@ -260,7 +260,7 @@
                        This page was last edited on: 18 June 2021
                        -

                        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

                        +

                        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

                        Follow us on | Documentation built with MkDocs

                        diff -Nru sumo-1.11.0/docs/userdoc/Contributed/index.html sumo-1.12.0/docs/userdoc/Contributed/index.html --- sumo-1.11.0/docs/userdoc/Contributed/index.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contributed/index.html 2022-01-24 23:06:32.000000000 +0000 @@ -298,6 +298,10 @@
                      • SumoNetVis

                        A python library to render Sumo network files and trajectories with matplotlib or as an OBJ file.

                      +
                        +
                      • SESAM

                        SUMO as a cloud service to build, run and analyze simulation scenarios, developed by the DLR spin-off company co4e GmbH

                        +
                      • +

                      Purgatory#

                      The following extensions exist or have existed, but their state is unclear.

                      @@ -324,10 +328,10 @@
                      -
                      This page was last edited on: 11 May 2021 +
                      This page was last edited on: 24 November 2021
                      -

                      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

                      +

                      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

                      Follow us on | Documentation built with MkDocs

                      diff -Nru sumo-1.11.0/docs/userdoc/Contributed/iTranSIM.html sumo-1.12.0/docs/userdoc/Contributed/iTranSIM.html --- sumo-1.11.0/docs/userdoc/Contributed/iTranSIM.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contributed/iTranSIM.html 2022-01-24 23:06:32.000000000 +0000 @@ -229,7 +229,7 @@
                      This page was last edited on: 11 February 2021
                      -

                      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

                      +

                      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

                      Follow us on | Documentation built with MkDocs

                      diff -Nru sumo-1.11.0/docs/userdoc/Contributed/SmallMaps.html sumo-1.12.0/docs/userdoc/Contributed/SmallMaps.html --- sumo-1.11.0/docs/userdoc/Contributed/SmallMaps.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contributed/SmallMaps.html 2022-01-24 23:06:32.000000000 +0000 @@ -220,7 +220,7 @@
                      This page was last edited on: 11 February 2021
                      -

                      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

                      +

                      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

                      Follow us on | Documentation built with MkDocs

                      diff -Nru sumo-1.11.0/docs/userdoc/Contributed/SUMOPlayer.html sumo-1.12.0/docs/userdoc/Contributed/SUMOPlayer.html --- sumo-1.11.0/docs/userdoc/Contributed/SUMOPlayer.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contributed/SUMOPlayer.html 2022-01-24 23:06:32.000000000 +0000 @@ -274,7 +274,7 @@
                      This page was last edited on: 11 February 2021
                      -

                      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

                      +

                      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

                      Follow us on | Documentation built with MkDocs

                      diff -Nru sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/Demand/Turn_Flows.html sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/Demand/Turn_Flows.html --- sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/Demand/Turn_Flows.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/Demand/Turn_Flows.html 2022-01-24 23:06:32.000000000 +0000 @@ -276,7 +276,7 @@
                      This page was last edited on: 11 February 2021
                      -

                      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

                      +

                      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

                      Follow us on | Documentation built with MkDocs

                      diff -Nru sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/Demand/Zone_To_Zone.html sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/Demand/Zone_To_Zone.html --- sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/Demand/Zone_To_Zone.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/Demand/Zone_To_Zone.html 2022-01-24 23:06:32.000000000 +0000 @@ -263,7 +263,7 @@
                      This page was last edited on: 11 February 2021
                      -

                      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

                      +

                      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

                      Follow us on | Documentation built with MkDocs

                      diff -Nru sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/GUI/Demand_Modelling.html sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/GUI/Demand_Modelling.html --- sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/GUI/Demand_Modelling.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/GUI/Demand_Modelling.html 2022-01-24 23:06:32.000000000 +0000 @@ -199,7 +199,7 @@
                      This page was last edited on: 11 February 2021
                      -

                      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

                      +

                      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

                      Follow us on | Documentation built with MkDocs

                      diff -Nru sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/GUI/Getting_Started.html sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/GUI/Getting_Started.html --- sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/GUI/Getting_Started.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/GUI/Getting_Started.html 2022-01-24 23:06:32.000000000 +0000 @@ -422,7 +422,7 @@
                      This page was last edited on: 11 February 2021
                      -

                      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

                      +

                      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

                      Follow us on | Documentation built with MkDocs

                      diff -Nru sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/Installation/Linux.html sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/Installation/Linux.html --- sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/Installation/Linux.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/Installation/Linux.html 2022-01-24 23:06:32.000000000 +0000 @@ -188,6 +188,19 @@ sudo apt update
    + +

    SUMOPy now supports wxWidgets 3.0. Here are the steps I needed to do with openSUSE 15.3:

    +
    sudo zypper addrepo https://download.opensuse.org/repositories/Application:/Geo/openSUSE_Leap_15.3/ Application:Geo
    +sudo zypper in python-wxWidgets-3_0 python2-opengl python-basemap python2-matplotlib python2-numpy python2-Pillow
    +sudo pip2 install pyproj
    +
    + +

    Unfortunately pyproj is only available via pypi while python-wxWidgets-3_0 and python-basemap are not available via pypi so you need to use both sources.

    +

    You can install pyproj also in a virtualenv if you prefer, then you need to replace the last line with:

    +
    python2 -m virtualenv --system-site-packages sumopyenv
    +. sumopyenv/bin/activate
    +pip install pyproj
    +
    @@ -195,10 +208,10 @@
    -
    This page was last edited on: 11 February 2021 +
    This page was last edited on: 10 December 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/Installation/Windows.html sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/Installation/Windows.html --- sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/Installation/Windows.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/Installation/Windows.html 2022-01-24 23:06:32.000000000 +0000 @@ -184,7 +184,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/Simulation/Sublanes.html sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/Simulation/Sublanes.html --- sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/Simulation/Sublanes.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/Simulation/Sublanes.html 2022-01-24 23:06:32.000000000 +0000 @@ -193,7 +193,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/Tutorials/Open_and_Simulate.html sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/Tutorials/Open_and_Simulate.html --- sumo-1.11.0/docs/userdoc/Contributed/SUMOPy/Tutorials/Open_and_Simulate.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contributed/SUMOPy/Tutorials/Open_and_Simulate.html 2022-01-24 23:06:32.000000000 +0000 @@ -204,7 +204,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Contributed/SUMOPy.html sumo-1.12.0/docs/userdoc/Contributed/SUMOPy.html --- sumo-1.11.0/docs/userdoc/Contributed/SUMOPy.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contributed/SUMOPy.html 2022-01-24 23:06:32.000000000 +0000 @@ -295,7 +295,7 @@
    This page was last edited on: 26 August 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Contributed/SUMO_Traffic_Modeler.html sumo-1.12.0/docs/userdoc/Contributed/SUMO_Traffic_Modeler.html --- sumo-1.11.0/docs/userdoc/Contributed/SUMO_Traffic_Modeler.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Contributed/SUMO_Traffic_Modeler.html 2022-01-24 23:06:32.000000000 +0000 @@ -228,7 +228,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Data/Networks.html sumo-1.12.0/docs/userdoc/Data/Networks.html --- sumo-1.11.0/docs/userdoc/Data/Networks.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Data/Networks.html 2022-01-24 23:06:32.000000000 +0000 @@ -229,7 +229,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Data/Scenarios/TAPASCologne.html sumo-1.12.0/docs/userdoc/Data/Scenarios/TAPASCologne.html --- sumo-1.11.0/docs/userdoc/Data/Scenarios/TAPASCologne.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Data/Scenarios/TAPASCologne.html 2022-01-24 23:06:32.000000000 +0000 @@ -450,7 +450,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Data/Scenarios.html sumo-1.12.0/docs/userdoc/Data/Scenarios.html --- sumo-1.11.0/docs/userdoc/Data/Scenarios.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Data/Scenarios.html 2022-01-24 23:06:32.000000000 +0000 @@ -146,7 +146,13 @@ - + + + @@ -221,11 +227,15 @@
  • Main Page
  • Publication: Quantifying the impact of connected and autonomous vehicles on traffic efficiency and safety in mixed traffic" by Maxime Gueriau and Ivana Dusparic, presented at the The 23rd IEEE International Conference on Intelligent Transportation Systems (ITSC 2020)
  • -

    Ingolstadt traffic scenario (InTAS)#

    +

    Ingolstadt traffic scenario#

    +

    InTAS#

    +

    SUMO Ingolstadt#

    +

    Created in the SAVe:, SAVeNoW and KIVI research projects +- Main Page

    Luxembourg SUMO Traffic (LuST)#

    • Main Page
    • @@ -322,10 +332,10 @@
      -
      This page was last edited on: 19 October 2021 +
      This page was last edited on: 14 December 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Data/Traffic_Data.html sumo-1.12.0/docs/userdoc/Data/Traffic_Data.html --- sumo-1.11.0/docs/userdoc/Data/Traffic_Data.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Data/Traffic_Data.html 2022-01-24 23:06:32.000000000 +0000 @@ -255,7 +255,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html sumo-1.12.0/docs/userdoc/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html --- sumo-1.11.0/docs/userdoc/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html 2022-01-24 23:06:32.000000000 +0000 @@ -205,19 +205,16 @@ • Speed Distributions - + @@ -451,7 +451,7 @@ departSpeed -float(m/s)/string (≥0, "random", "max", "desired", "speedLimit") +float(m/s)/string (≥0, "random", "max", "desired", "speedLimit", "last", "avg") The speed with which the vehicle shall enter the network; see #departSpeed. default: 0 @@ -788,6 +788,8 @@
    • "max": The maxSpeed is used, the speed may be adapted to ensure a safe distance to the leader vehicle.
    • "desired": The maxSpeed is used. If that speed is unsafe, departure is delayed.
    • "speedLimit": The speed limit of the lane is used. If that speed is unsafe, departure is delayed.
    • +
    • "last": The current speed of the last vehicle on the departure lane is used (or 'desired' speed if the lane is empty). If that speed is unsafe, departure is delayed.
    • +
    • "avg": The average speed on the departure lane is ised (or the minimum of 'speedLimit' and 'desired' if the lane is empty). If that speed is unsafe, departure is delayed.

    departEdge#

    Determines the edge along the vehicles route where the vehicle enters the network (By default this is 0: the first edge).

    @@ -1057,16 +1059,10 @@ The preferred lateral alignment when using the sublane-model. <FLOAT> (in m from the center of the lane) or one of ("left", "right", "center", "compact", "nice", "arbitrary"). -minGapLat -float -0.6 -The desired minimum lateral gap when using the sublane-model - - maxSpeedLat float 1.0 -The maximum lateral speed when using the sublane-model +The maximum lateral speed when using the sublane-model or continuous lane change model actionStepLength @@ -1082,12 +1078,37 @@ described in the following. Also, you may find further descriptions of implemented car-following models in the subsection #Car-Following Models.

    Speed Distributions#

    +

    Individual Speed Factor#

    The desired driving speed usually varies among the vehicle of a fleet. -In SUMO this is modeled by a speed distribution using the attributes -speedFactor or speedDev. as explained below.

    -
    -

    Note

    -

    Since version 1.0.0 speed distributions are used by default (speedDev="0.1"). In older version, speed distributions had to be defined for every vehicle type to avoid homogeneous speeds (and consequently invalid driving behavior because vehicles would never catch up with their leader vehicle)

    +In SUMO this is modeled by assigning to each vehicle an individual multiplier which gets applied to the road speed limit. +This multiplier is called the individual speedFactor or in short the speedFactor of a vehicle. +The product of road speed limit and the individual speed factor gives the desired free flow driving speed of a vehicle. +If the individual speedFactor is larger than 1 vehicles can exceed edge speeds. However, vehicle speeds are still +capped at the vehicle type's maxSpeed.

    +

    While it is possible to assign the individual speedFactor value directly in a <vehicle>, <trip> or even <flow> definition using attribute speedFactor, a more common use case is to define the distribution of these factors for a <vType>.

    +

    Having a distribution of speed factors (and hence of desired speeds) is beneficial to the realism of a simulation. If the desired speed is constant among a fleet of vehicles, this implies that gaps between vehicles will keep their size constant over a long time. For this reason, the individual speed factor for each simulated vehicle (whether defined as <vehicle>, <trip> or part of a <flow>) is drawn from a distribution by default.

    +

    The speedFactor of a vehicle is writen to various outputs (tripinfo-output, vehroute-output) and can also be checked via the vehicle parameter dialog.

    +

    Defining a normal distribution for vehicle speeds#

    +

    Two types of distributions can be defined for sampling the individual speedFactor of each vehicl by giving one of the following attributes in the <vType> element:

    +
      +
    • normal distribution: speedFactor="norm(mean,deviation)"
    • +
    • truncated normal distribution: speedFactor="normc(mean,deviation,lowerCutOff,upperCutOff)"
    • +
    +

    The default for passenger cars is "normc(1, 0.1, 0.2, 2)" which implies that ~95% of the vehicles drive between 80% and 120% +of the legal speed limit.

    +

    Instead of giving the multi-parameter definition above, a simpler definition style is also possible.

    +
      +
    • setting the deviation of the distribution directly: speedDev="0.3"
    • +
    • setting the mean of the distribution directly: speedFactor="1.2"
    • +
    +

    When using the attributes in this way, the default cut-off range [0.2, 2] remains unchanged.

    +
    +

    Caution

    +

    The distribution mean must fall within the cut-off range. In order to use mean values below 0.2 or above 2.0, the 4-parameter version must be used to modify the cut-off parameters as well.

    +
    +
    +

    Caution

    +

    Attribute speedFactor has three different meanings: in a <vehicle> it defines the individual speedFactor directly. In a <vType> if given as a single floating point value, it defines the mean of the speed distribution and when giving as norm(...) / nomrc(...), it defines the whole distribution.

    Vehicle class specific defaults#

    When defining a vehicle type with a vClass, the following default speed-deviation will be used.

    @@ -1100,49 +1121,14 @@
  • emergency: 0
  • everything else: 0.1
  • +
    +

    Note

    +

    before version 1.0.0, the default speedDev values was 0

    +

    Global Configuration#

    Instead of configuring speed distributions in a <vType> definition (as explained below), the sumo-option --default.speeddev <FLOAT> can be used to set -a global default. Setting this value to 0 restores pre-1.0.0 behavior.

    -

    Defining speed limit violations explicitly#

    -

    Each vehicle has an individual speed factor which is multiplied with the -speed limit (edge speed) to determine the desired driving speed (default -1.0). A vehicle with speed factor 1.2 drives up to 20% above the speed -limit whereas a vehicle with speed factor 0.8 would always stay below -the speed limit by 20%. By setting attributes speedFactor and -speedDev as show below this individual speed factor for all vehicles -of a type can be set to a fixed value.

    -
    <vType id="example" speedFactor="1.2" speedDev="0"
    -
    - -

    Defining a normal distribution for vehicle speeds#

    -

    The desired driving speed usually varies among the vehicle of a fleet. -While this could be modeled by defining a new type for each vehicle and -assigning a distinct speed factor for each type (as above) this would be -quite cumbersome. Instead the attribute speedFactor can also be used -to sample a vehicle specific speed factor from a normal distribution. -The parameter can be given as "norm(mean, dev)" or "normc(mean, dev, -min, max)". Using speedFactor="normc(1,0.1,0.2,2)" will result in a -speed distribution where 95% of the vehicles drive between 80% and 120% -of the legal speed limit. For flows, every inserted vehicle will draw an -individual chosen speed multiplier as well. The resulting values in this -example are capped at 20% of speedFactor at the low end to prevent -extreme dawdling and at twice the recommended speed. A vehicle keeps its -chosen speed multiplier for the whole simulation and multiplies it with -edge speeds to compute the actual speed for driving on this edge. Thus -vehicles can exceed edge speeds. However, vehicle speeds are still -capped at the vehicle type's maxSpeed.

    -
    -

    Caution

    -

    In order to use mean values below 0.2 or above 2.0, the 4-parameter version must be used to modify the cut-off parameters as well.

    -
    -

    Defining a normal distribution (old style)#

    -

    An alternative way to specify speed distributions is to use numerical -values for speedFactor and speedDev. In this case -speedFactor defines the expected value and speedDev defines the -deviation. When using this style, capping cannot be controlled and will -always default to 20% and 200%. Thus the above example can also be -defined as speedFactor="1" speedDev="0.1".

    +a global default. The option value overrides all vClass-defaults. Setting --default.speeddev 0 estores pre-1.0.0 behavior.

    Different distributions for cars and trucks#

    The center of the speed distribution is defined relative to the road speed limit. On some roads, different speed limits may apply to cars and trucks. To model this, vClass-specific speed limits may be defined either in the network or directly in an additional file:

    @@ -1161,6 +1147,16 @@

    Note

    If the specified departSpeed of a vehicle exceeds the speed limit and it's vType has a speedFactor deviation > 0, the individual chosen speed multiplier is at least high enough to accommodate the stated depart speed.

    +

    Examples#

    +

    Define a flow of vehicles that desire to drive at 120% of the speed limit without any deviation:

    +
      <vType id="example" speedFactor="1.2" speedDev="0"/>
    +  <flow id="f" type="example" begin="0" end="3600" probability="0.2" from="A" to="B"/>
    +
    + +

    Define a vehicle type with high speed deviation and no cut-off

    +
      <vType id="example2" speedFactor="norm(1.0, 0.5)"/>  
    +
    +

    Vehicle Length#

    Due to the work on car following models, we decided to use two values for vehicle length. The length-attribute @@ -1496,7 +1492,7 @@ carFollowing-EIDM EIDM -Extended Intelligent Driver Model for subsecond simulation by Dominik Salles +Extended Intelligent Driver Model for subsecond simulation by Dominik Salles carFollowing-KraussPS @@ -1993,7 +1989,7 @@ lcStrategic -The eagerness for performing strategic lane changing. Higher values result in earlier lane-changing. default: 1.0, range [0-inf[ +The eagerness for performing strategic lane changing. Higher values result in earlier lane-changing. default: 1.0, range [0-inf) LC2013, SL2015 @@ -2003,42 +1999,42 @@ lcSpeedGain -The eagerness for performing lane changing to gain speed. Higher values result in more lane-changing. default: 1.0, range [0-inf[ +The eagerness for performing lane changing to gain speed. Higher values result in more lane-changing. default: 1.0, range [0-inf) LC2013, SL2015 lcKeepRight -The eagerness for following the obligation to keep right. Higher values result in earlier lane-changing. default: 1.0, range [0-inf[ +The eagerness for following the obligation to keep right. Higher values result in earlier lane-changing. default: 1.0, range [0-inf) LC2013, SL2015 lcOvertakeRight -The probability for violating rules gainst overtaking on the right default: 0, range [0-1[ +The probability for violating rules gainst overtaking on the right default: 0, range [0-1] LC2013 lcOpposite -The eagerness for overtaking through the opposite-direction lane. Higher values result in more lane-changing. default: 1.0, range [0-inf[ +The eagerness for overtaking through the opposite-direction lane. Higher values result in more lane-changing. default: 1.0, range [0-inf) LC2013 lcLookaheadLeft -Factor for configuring the strategic lookahead distance when a change to the left is necessary (relative to right lookahead). default: 2.0, range ]0-inf[ +Factor for configuring the strategic lookahead distance when a change to the left is necessary (relative to right lookahead). default: 2.0, range [0-inf) LC2013, SL2015 lcSpeedGainRight -Factor for configuring the threshold asymmetry when changing to the left or to the right for speed gain. By default the decision for changing to the right takes more deliberation. Symmetry is achieved when set to 1.0. default: 0.1, range ]0-inf[ +Factor for configuring the threshold asymmetry when changing to the left or to the right for speed gain. By default the decision for changing to the right takes more deliberation. Symmetry is achieved when set to 1.0. default: 0.1, range [0-inf) LC2013, SL2015 lcSpeedGainLookahead -Lookahead time in seconds for anticipating slow down. default: 0 (LC2013), 5 (SL2015), range [0-inf[ +Lookahead time in seconds for anticipating slow down. default: 0 (LC2013), 5 (SL2015), range [0-inf) LC2013, SL2015 lcCooperativeRoundabout -Factor that increases willingness to move to the inside lane in a multi-lane roundabout. default: lcCooperative, range ]0-1[ +Factor that increases willingness to move to the inside lane in a multi-lane roundabout. default: lcCooperative, range [0-1] LC2013, SL2015 @@ -2047,28 +2043,33 @@ LC2013, SL2015 +minGapLat +The desired minimum lateral gap when using the sublane-model , default: 0.6 +SL2015 + + lcSublane -The eagerness for using the configured lateral alignment within the lane. Higher values result in increased willingness to sacrifice speed for alignment. default: 1.0, range [0-inf] +The eagerness for using the configured lateral alignment within the lane. Higher values result in increased willingness to sacrifice speed for alignment. default: 1.0, range [0-inf) SL2015 lcPushy -Willingness to encroach laterally on other drivers. ''default: 0, range 0 to 1 +Willingness to encroach laterally on other drivers. default: 0, range [0-1] SL2015 lcPushyGap -Minimum lateral gap when encroaching laterally on other drives (alternative way to define lcPushy). ''default: minGapLat, range 0 to minGapLat +Minimum lateral gap when encroaching laterally on other drives (alternative way to define lcPushy). default: minGapLat, range 0 to minGapLat SL2015 lcAssertive -Willingness to accept lower front and rear gaps on the target lane. The required gap is divided by this value. ''default: 1, range: positive reals +Willingness to accept lower front and rear gaps on the target lane. The required gap is divided by this value. default: 1, range: positive reals LC2013,SL2015 lcImpatience -dynamic factor for modifying lcAssertive and lcPushy. default: 0 (no effect) range -1 to 1. Impatience acts as a multiplier. At -1 the multiplier is 0.5 and at 1 the multiplier is 1.5. +Dynamic factor for modifying lcAssertive and lcPushy. default: 0 (no effect) range -1 to 1. Impatience acts as a multiplier. At -1 the multiplier is 0.5 and at 1 the multiplier is 1.5. SL2015 @@ -2088,7 +2089,7 @@ lcMaxSpeedLatStanding -Constant term for lateral speed when standing. default: maxSpeedLat (i.e., disabled). +Constant term for lateral speed when standing. default: maxSpeedLat (i.e., disabled) LC2013, SL2015 @@ -2116,6 +2117,10 @@

    Note

    parameter 'lcMaxSpeedLatStanding' will not be applied when a vehicle is at the end of its lane (to ensure that there are no deadlocks).

    +
    +

    Caution

    +

    Modifying and Retrieving lane change model attributes via TraCI works different from other vType attributes

    +

    Junction Model Parameters#

    The behavior at intersections may be configured with the parameters listed below.

    @@ -2281,6 +2286,13 @@ <route id="route0" color="1,1,0" edges="beg middle end rend" probability="0.9"/> <route id="route1" color="1,2,0" edges="beg middle end" probability="0.1"/> </routeDistribution> + + <route id="route2" edges="beg middle end rend"/> + <route id="route3" edges="beg middle end"/> + <routeDistribution id="routedist2"> + <route refId="route2" probability="2"/> + <route refId="route3" probability="3"/> + </routeDistribution> </routes> @@ -2609,6 +2621,12 @@ </vType> <vehicle id="v1" route="route0" depart="0" type="t1"/> + + <vType id="t2"> + <param key="device.<DEVICENAME>.probablity" value="0.5"/> + </vType> + + <vehicle id="v2" route="route0" depart="0" type="t2"/> </routes> @@ -2623,10 +2641,10 @@
    -
    This page was last edited on: 19 November 2021 +
    This page was last edited on: 19 January 2022
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Demand/Activity-based_Demand_Generation.html sumo-1.12.0/docs/userdoc/Demand/Activity-based_Demand_Generation.html --- sumo-1.11.0/docs/userdoc/Demand/Activity-based_Demand_Generation.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Demand/Activity-based_Demand_Generation.html 2022-01-24 23:06:32.000000000 +0000 @@ -1016,7 +1016,7 @@
    This page was last edited on: 22 October 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Demand/Automatic_Routing.html sumo-1.12.0/docs/userdoc/Demand/Automatic_Routing.html --- sumo-1.11.0/docs/userdoc/Demand/Automatic_Routing.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Demand/Automatic_Routing.html 2022-01-24 23:06:32.000000000 +0000 @@ -388,7 +388,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Demand/Dynamic_User_Assignment.html sumo-1.12.0/docs/userdoc/Demand/Dynamic_User_Assignment.html --- sumo-1.11.0/docs/userdoc/Demand/Dynamic_User_Assignment.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Demand/Dynamic_User_Assignment.html 2022-01-24 23:06:32.000000000 +0000 @@ -372,7 +372,7 @@
    This page was last edited on: 24 October 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Demand/Further_Ways_to_import_Vissim_Demand_Definitions.html sumo-1.12.0/docs/userdoc/Demand/Further_Ways_to_import_Vissim_Demand_Definitions.html --- sumo-1.11.0/docs/userdoc/Demand/Further_Ways_to_import_Vissim_Demand_Definitions.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Demand/Further_Ways_to_import_Vissim_Demand_Definitions.html 2022-01-24 23:06:32.000000000 +0000 @@ -223,7 +223,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Demand/Further_Ways_to_import_VISUM_Demand_Definitions.html sumo-1.12.0/docs/userdoc/Demand/Further_Ways_to_import_VISUM_Demand_Definitions.html --- sumo-1.11.0/docs/userdoc/Demand/Further_Ways_to_import_VISUM_Demand_Definitions.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Demand/Further_Ways_to_import_VISUM_Demand_Definitions.html 2022-01-24 23:06:32.000000000 +0000 @@ -307,7 +307,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Demand/Importing_O/D_Matrices.html sumo-1.12.0/docs/userdoc/Demand/Importing_O/D_Matrices.html --- sumo-1.11.0/docs/userdoc/Demand/Importing_O/D_Matrices.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Demand/Importing_O/D_Matrices.html 2022-01-24 23:06:32.000000000 +0000 @@ -735,7 +735,7 @@
    This page was last edited on: 23 September 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Demand/Introduction_to_demand_modelling_in_SUMO.html sumo-1.12.0/docs/userdoc/Demand/Introduction_to_demand_modelling_in_SUMO.html --- sumo-1.11.0/docs/userdoc/Demand/Introduction_to_demand_modelling_in_SUMO.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Demand/Introduction_to_demand_modelling_in_SUMO.html 2022-01-24 23:06:32.000000000 +0000 @@ -279,7 +279,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Demand/Random_Routes.html sumo-1.12.0/docs/userdoc/Demand/Random_Routes.html --- sumo-1.11.0/docs/userdoc/Demand/Random_Routes.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Demand/Random_Routes.html 2022-01-24 23:06:32.000000000 +0000 @@ -203,7 +203,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Demand/Routes_from_Observation_Points.html sumo-1.12.0/docs/userdoc/Demand/Routes_from_Observation_Points.html --- sumo-1.11.0/docs/userdoc/Demand/Routes_from_Observation_Points.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Demand/Routes_from_Observation_Points.html 2022-01-24 23:06:32.000000000 +0000 @@ -458,7 +458,7 @@
    This page was last edited on: 21 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Demand/Routing_by_Turn_Probabilities.html sumo-1.12.0/docs/userdoc/Demand/Routing_by_Turn_Probabilities.html --- sumo-1.11.0/docs/userdoc/Demand/Routing_by_Turn_Probabilities.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Demand/Routing_by_Turn_Probabilities.html 2022-01-24 23:06:32.000000000 +0000 @@ -341,7 +341,7 @@
    This page was last edited on: 07 September 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Demand/Shortest_or_Optimal_Path_Routing.html sumo-1.12.0/docs/userdoc/Demand/Shortest_or_Optimal_Path_Routing.html --- sumo-1.11.0/docs/userdoc/Demand/Shortest_or_Optimal_Path_Routing.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Demand/Shortest_or_Optimal_Path_Routing.html 2022-01-24 23:06:32.000000000 +0000 @@ -614,7 +614,7 @@
    This page was last edited on: 07 September 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/CodeStyle.html sumo-1.12.0/docs/userdoc/Developer/CodeStyle.html --- sumo-1.11.0/docs/userdoc/Developer/CodeStyle.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/CodeStyle.html 2022-01-24 23:06:32.000000000 +0000 @@ -438,7 +438,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/CppFileTemplate.html sumo-1.12.0/docs/userdoc/Developer/CppFileTemplate.html --- sumo-1.11.0/docs/userdoc/Developer/CppFileTemplate.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/CppFileTemplate.html 2022-01-24 23:06:32.000000000 +0000 @@ -247,7 +247,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Debugging.html sumo-1.12.0/docs/userdoc/Developer/Debugging.html --- sumo-1.11.0/docs/userdoc/Developer/Debugging.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Debugging.html 2022-01-24 23:06:32.000000000 +0000 @@ -264,7 +264,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Docker.html sumo-1.12.0/docs/userdoc/Developer/Docker.html --- sumo-1.11.0/docs/userdoc/Developer/Docker.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Docker.html 2022-01-24 23:06:32.000000000 +0000 @@ -243,7 +243,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Documentation_Build.html sumo-1.12.0/docs/userdoc/Developer/Documentation_Build.html --- sumo-1.11.0/docs/userdoc/Developer/Documentation_Build.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Documentation_Build.html 2022-01-24 23:06:32.000000000 +0000 @@ -241,7 +241,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/ExploringTheStructure.html sumo-1.12.0/docs/userdoc/Developer/ExploringTheStructure.html --- sumo-1.11.0/docs/userdoc/Developer/ExploringTheStructure.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/ExploringTheStructure.html 2022-01-24 23:06:32.000000000 +0000 @@ -224,7 +224,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/FMI.html sumo-1.12.0/docs/userdoc/Developer/FMI.html --- sumo-1.11.0/docs/userdoc/Developer/FMI.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/FMI.html 2022-01-24 23:06:32.000000000 +0000 @@ -195,7 +195,7 @@

    The initial goal is to build a prototype which is able to load a SUMO simulation via libsumocpp, run the simulation and provide the total amount of vehicles in the simulation as a scalar variable.

    Architecture#

    The current architecture to build the functionality for a functional mockup unit (FMU) is as followed. The source code is located in the src/fmi folder.

    -

    uml diagram

    +

    uml diagram

    FMI 2.0 Compliance Checking#

    Compliance with FMI 2.0 is checked with FMU Compliance Checker. It can be installed after cloning according to the build instructions.

    The validation can be triggered on macOS with

    @@ -215,7 +215,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Github_Actions_CI_Test.html sumo-1.12.0/docs/userdoc/Developer/Github_Actions_CI_Test.html --- sumo-1.11.0/docs/userdoc/Developer/Github_Actions_CI_Test.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Github_Actions_CI_Test.html 2022-01-24 23:06:32.000000000 +0000 @@ -293,7 +293,7 @@
    This page was last edited on: 15 June 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/GitStuff.html sumo-1.12.0/docs/userdoc/Developer/GitStuff.html --- sumo-1.11.0/docs/userdoc/Developer/GitStuff.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/GitStuff.html 2022-01-24 23:06:32.000000000 +0000 @@ -213,7 +213,7 @@
    This page was last edited on: 01 September 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/GUI_Testing.html sumo-1.12.0/docs/userdoc/Developer/GUI_Testing.html --- sumo-1.11.0/docs/userdoc/Developer/GUI_Testing.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/GUI_Testing.html 2022-01-24 23:06:32.000000000 +0000 @@ -236,7 +236,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/HFileTemplate.html sumo-1.12.0/docs/userdoc/Developer/HFileTemplate.html --- sumo-1.11.0/docs/userdoc/Developer/HFileTemplate.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/HFileTemplate.html 2022-01-24 23:06:32.000000000 +0000 @@ -272,7 +272,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/How_To/Car-Following_Model.html sumo-1.12.0/docs/userdoc/Developer/How_To/Car-Following_Model.html --- sumo-1.11.0/docs/userdoc/Developer/How_To/Car-Following_Model.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/How_To/Car-Following_Model.html 2022-01-24 23:06:32.000000000 +0000 @@ -309,7 +309,7 @@
    This page was last edited on: 23 October 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/How_To/Device.html sumo-1.12.0/docs/userdoc/Developer/How_To/Device.html --- sumo-1.11.0/docs/userdoc/Developer/How_To/Device.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/How_To/Device.html 2022-01-24 23:06:32.000000000 +0000 @@ -312,7 +312,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/How_To/Extend_Vehicles.html sumo-1.12.0/docs/userdoc/Developer/How_To/Extend_Vehicles.html --- sumo-1.11.0/docs/userdoc/Developer/How_To/Extend_Vehicles.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/How_To/Extend_Vehicles.html 2022-01-24 23:06:32.000000000 +0000 @@ -266,7 +266,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/How_To/Net_Importer.html sumo-1.12.0/docs/userdoc/Developer/How_To/Net_Importer.html --- sumo-1.11.0/docs/userdoc/Developer/How_To/Net_Importer.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/How_To/Net_Importer.html 2022-01-24 23:06:32.000000000 +0000 @@ -380,7 +380,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/HowToRelease.html sumo-1.12.0/docs/userdoc/Developer/HowToRelease.html --- sumo-1.11.0/docs/userdoc/Developer/HowToRelease.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/HowToRelease.html 2022-01-24 23:06:32.000000000 +0000 @@ -350,10 +350,10 @@
  • if you try this on Windows Linux Subsystem you will also need to do sudo update-alternatives --set fakeroot /usr/bin/fakeroot-tcp
  • -
  • unzip the special source release sumo_1.11.0+dfsg1.orig.tar.gz
  • +
  • unzip the special source release sumo_1.12.0+dfsg1.orig.tar.gz
  • copy the debian dir one level up
  • modify the changelog, using dch (enter an email address which has write access to the ppa and a valid gpg key)
  • -
  • run dpkg-buildpackage -S in the sumo dir and dput -f ppa:sumo/stable sumo_1.11.0+dfsg1_source.changes one level up
  • +
  • run dpkg-buildpackage -S in the sumo dir and dput -f ppa:sumo/stable sumo_1.12.0+dfsg1_source.changes one level up
  • scenarios (optional)
      @@ -371,6 +371,7 @@
    • close the milestone (retargeting open tickets needs to be done manually for now)
    • +
    • add the latest version to the "software version identifier" statement in Wikidata (this will update the Wikipedia articles about SUMO), making sure to select the latest version as "preferred rank" and setting the previous one to "normal rank".

    After-release cleanup#

    The trunk is now open for changes again.

    @@ -388,10 +389,10 @@
    -
    This page was last edited on: 17 August 2021 +
    This page was last edited on: 23 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/HowToUpdateHomebrewFormula.html sumo-1.12.0/docs/userdoc/Developer/HowToUpdateHomebrewFormula.html --- sumo-1.11.0/docs/userdoc/Developer/HowToUpdateHomebrewFormula.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/HowToUpdateHomebrewFormula.html 2022-01-24 23:06:32.000000000 +0000 @@ -225,7 +225,7 @@
    This page was last edited on: 07 June 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Implementation_Notes/Drawing_in_sumo-gui.html sumo-1.12.0/docs/userdoc/Developer/Implementation_Notes/Drawing_in_sumo-gui.html --- sumo-1.11.0/docs/userdoc/Developer/Implementation_Notes/Drawing_in_sumo-gui.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Implementation_Notes/Drawing_in_sumo-gui.html 2022-01-24 23:06:32.000000000 +0000 @@ -231,7 +231,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Implementation_Notes/Error_Handling.html sumo-1.12.0/docs/userdoc/Developer/Implementation_Notes/Error_Handling.html --- sumo-1.11.0/docs/userdoc/Developer/Implementation_Notes/Error_Handling.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Implementation_Notes/Error_Handling.html 2022-01-24 23:06:32.000000000 +0000 @@ -359,7 +359,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Implementation_Notes/index.html sumo-1.12.0/docs/userdoc/Developer/Implementation_Notes/index.html --- sumo-1.11.0/docs/userdoc/Developer/Implementation_Notes/index.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Implementation_Notes/index.html 2022-01-24 23:06:32.000000000 +0000 @@ -180,7 +180,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Implementation_Notes/Options_Sub_System.html sumo-1.12.0/docs/userdoc/Developer/Implementation_Notes/Options_Sub_System.html --- sumo-1.11.0/docs/userdoc/Developer/Implementation_Notes/Options_Sub_System.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Implementation_Notes/Options_Sub_System.html 2022-01-24 23:06:32.000000000 +0000 @@ -337,7 +337,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Implementation_Notes/Simulation_Loop.html sumo-1.12.0/docs/userdoc/Developer/Implementation_Notes/Simulation_Loop.html --- sumo-1.11.0/docs/userdoc/Developer/Implementation_Notes/Simulation_Loop.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Implementation_Notes/Simulation_Loop.html 2022-01-24 23:06:32.000000000 +0000 @@ -184,7 +184,7 @@

    sumo and sumo-gui call both the method MSNet::simulationStep. This sketch describes the further communication of this method with the other elements of the simulation and the update cycle for the vehicles.

    -

    uml diagram

    +

    uml diagram

    @@ -195,7 +195,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Implementation_Notes/Sumo_Modules.html sumo-1.12.0/docs/userdoc/Developer/Implementation_Notes/Sumo_Modules.html --- sumo-1.11.0/docs/userdoc/Developer/Implementation_Notes/Sumo_Modules.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Implementation_Notes/Sumo_Modules.html 2022-01-24 23:06:32.000000000 +0000 @@ -532,7 +532,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Implementation_Notes/Vehicle_Models.html sumo-1.12.0/docs/userdoc/Developer/Implementation_Notes/Vehicle_Models.html --- sumo-1.11.0/docs/userdoc/Developer/Implementation_Notes/Vehicle_Models.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Implementation_Notes/Vehicle_Models.html 2022-01-24 23:06:32.000000000 +0000 @@ -421,7 +421,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/index.html sumo-1.12.0/docs/userdoc/Developer/index.html --- sumo-1.11.0/docs/userdoc/Developer/index.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/index.html 2022-01-24 23:06:32.000000000 +0000 @@ -259,7 +259,6 @@
  • SUMO on Travis (legacy)
  • SUMO brew formula on Github Actions
  • SUMO on OpenHub
  • -
  • SUMO on codeclimate
  • @@ -268,10 +267,10 @@
    -
    This page was last edited on: 15 June 2021 +
    This page was last edited on: 13 January 2022
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Managing_Publications.html sumo-1.12.0/docs/userdoc/Developer/Managing_Publications.html --- sumo-1.11.0/docs/userdoc/Developer/Managing_Publications.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Managing_Publications.html 2022-01-24 23:06:32.000000000 +0000 @@ -223,7 +223,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Maven.html sumo-1.12.0/docs/userdoc/Developer/Maven.html --- sumo-1.11.0/docs/userdoc/Developer/Maven.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Maven.html 2022-01-24 23:06:32.000000000 +0000 @@ -240,7 +240,7 @@
    This page was last edited on: 03 May 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Network_Building_Process.html sumo-1.12.0/docs/userdoc/Developer/Network_Building_Process.html --- sumo-1.11.0/docs/userdoc/Developer/Network_Building_Process.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Network_Building_Process.html 2022-01-24 23:06:32.000000000 +0000 @@ -757,7 +757,7 @@
    This page was last edited on: 12 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Nightly_Build.html sumo-1.12.0/docs/userdoc/Developer/Nightly_Build.html --- sumo-1.11.0/docs/userdoc/Developer/Nightly_Build.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Nightly_Build.html 2022-01-24 23:06:32.000000000 +0000 @@ -345,7 +345,7 @@
    This page was last edited on: 24 August 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/PythonFileTemplate.html sumo-1.12.0/docs/userdoc/Developer/PythonFileTemplate.html --- sumo-1.11.0/docs/userdoc/Developer/PythonFileTemplate.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/PythonFileTemplate.html 2022-01-24 23:06:32.000000000 +0000 @@ -209,7 +209,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Tests.html sumo-1.12.0/docs/userdoc/Developer/Tests.html --- sumo-1.11.0/docs/userdoc/Developer/Tests.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Tests.html 2022-01-24 23:06:32.000000000 +0000 @@ -433,7 +433,7 @@
    This page was last edited on: 19 October 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Unit_Tests.html sumo-1.12.0/docs/userdoc/Developer/Unit_Tests.html --- sumo-1.11.0/docs/userdoc/Developer/Unit_Tests.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Unit_Tests.html 2022-01-24 23:06:32.000000000 +0000 @@ -239,7 +239,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/Used_Tools.html sumo-1.12.0/docs/userdoc/Developer/Used_Tools.html --- sumo-1.11.0/docs/userdoc/Developer/Used_Tools.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/Used_Tools.html 2022-01-24 23:06:32.000000000 +0000 @@ -178,7 +178,7 @@
    This page was last edited on: 24 August 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/VisualStudioCode.html sumo-1.12.0/docs/userdoc/Developer/VisualStudioCode.html --- sumo-1.11.0/docs/userdoc/Developer/VisualStudioCode.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/VisualStudioCode.html 2022-01-24 23:06:32.000000000 +0000 @@ -293,7 +293,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Developer/XML_Validation.html sumo-1.12.0/docs/userdoc/Developer/XML_Validation.html --- sumo-1.11.0/docs/userdoc/Developer/XML_Validation.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Developer/XML_Validation.html 2022-01-24 23:06:32.000000000 +0000 @@ -270,7 +270,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/dfrouter.html sumo-1.12.0/docs/userdoc/dfrouter.html --- sumo-1.11.0/docs/userdoc/dfrouter.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/dfrouter.html 2022-01-24 23:06:32.000000000 +0000 @@ -640,7 +640,7 @@
    This page was last edited on: 12 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/DiplomStudArb.html sumo-1.12.0/docs/userdoc/DiplomStudArb.html --- sumo-1.11.0/docs/userdoc/DiplomStudArb.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/DiplomStudArb.html 2022-01-24 23:06:32.000000000 +0000 @@ -454,7 +454,7 @@
    This page was last edited on: 15 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Downloads.html sumo-1.12.0/docs/userdoc/Downloads.html --- sumo-1.11.0/docs/userdoc/Downloads.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Downloads.html 2022-01-24 23:06:32.000000000 +0000 @@ -142,39 +142,49 @@ @@ -213,38 +223,23 @@ -

    SUMO - Latest Release (Version 1.11.0)#

    -

    Release date: 23.11.2021

    -

    MS Windows binaries#

    -

    Contains the binaries (32 or 64 bit), all dlls needed, the examples, +

    SUMO - Latest Release (Version 1.12.0)#

    +

    Release date: 25.01.2022 (updated 15.12.2021)

    +

    Windows#

    +

    Binaries (64 bit), all dlls needed, the examples, tools, and documentation in HTML format. For an explanation of the contents and the -licensing, especially concerning the "extra" build, see the notes below

    +licensing (especially concerning the "extra" build which contains GPL code to support GeoTIFFs, shapefiles and 3D models), see the notes below.

    SUMO-Game#

    - + -

    Sources#

    -

    Includes sources, examples, and CMake-files for creating Visual Studio -solutions or Linux Makefiles. Does not contain tests. Download as:

    - - -

    All-inclusive-tarball#

    -

    Includes sources, tests and docs but no binaries. Download as:

    - - -

    Linux binaries#

    +

    Linux#

    The community maintains several repositories notably at the open build service. For a detailed list of repositories see below.

    @@ -268,7 +263,7 @@ try one of the build service repositories here too, e.g. Application:Geo). At the moment there is no documentation included in the packages. The -repositories include a nightly build as well (called sumo-git).

    +repositories include a nightly build as well (called sumo-git).

    +

    Adding the repository and installing (the quick and dirty way without checking GPG keys!) looks like this, for yum on CentOS 7:

    +
    yum-config-manager --add-repo=https://download.opensuse.org/repositories/science:/dlr/CentOS_7/
    +yum install -y --nogpgcheck epel-release
    +yum install -y --nogpgcheck sumo-1.12.0
    +
    + +

    and like this, for zypper on openSUSE Leap 15.3:

    +
    zypper ar http://download.opensuse.org/repositories/science:/dlr/15.3/ science:dlr
    +zypper in sumo=1.12.0
    +
    + +

    I you leave out the version number it will install the latest nightly build.

    Ubuntu, Debian and Arch users please see the community repositories above.

    macOS#

    You can read the Homebrew-based installation guide here or follow the Build instructions here.

    @@ -307,23 +315,31 @@

    Important notice

    In order to use the launchers, make sure you have installed SUMO beforehand (any version) and have set the SUMO_HOME environment variable.

    +

    Sources#

    +

    Download the sources, examples, and CMake-files for creating Visual Studio +solutions or Linux Makefiles. This download does not contain tests. Download as:

    + +

    Python packages / Virtual environments#

    -

    Starting with SUMO 1.8.0 the installation is also possible from the Python packaging index. -You can install either the applications: pip install eclipse-sumo or only traci, libsumo or sumolib, e.g. pip install libsumo. -This should work for Windows and all Linux versions which are more recent than 2014 but currently not for macOS. -The applications are available for Python 2 and Python 3, libsumo only for Python 3.5 and above. This gives an easy way to test -a new SUMO version via virtual environments - or a nightly build using the following commands (on Linux):

    +

    Starting with SUMO 1.8.0 (for macOS since 1.12.0) the installation is also possible from the Python packaging index.

    +

    You can install either the applications: pip install eclipse-sumo or only traci (pip install traci), libsumo (pip install libsumo) or sumolib (pip install sumolib).

    +

    This should work for Windows, macOS and all Linux versions which are more recent than 2014. +The applications are available for Python 2 and Python 3, libsumo only for Python 3.6 and above. This gives an easy way to test +a new SUMO version via virtual environments or a nightly build using the following commands (on Linux):

    python -m venv sumo_test
     cd sumo_test
     . bin/activate
     pip install eclipse-sumo
     
    -

    SUMO - Alternative download and older releases#

    -

    All releases can also be obtained via the sourceforge download -portal.

    -

    SUMO - Latest Development Version#

    +
    +

    macOS dependencies

    +

    In order to use the Python wheels on macOS you need to have all the dependencies installed and up to date via brew for instance by following the standard installation once.

    +
    +

    SUMO - Latest Development Version#

    SUMO is under active development. You can find a continuously updated list of bug-fixes and enhancements at our ChangeLog. To make use of the latest features @@ -331,29 +347,32 @@ you to use the latest version from our code repository.

    Every push to our main branch also triggers a build for Windows, Linux and macOS. The results can be found by clicking on the relevant commit here and downloading the -appropriate file for your platform.

    -

    Nightly Snapshots#

    +appropriate file for your platform (you may need to sign in to GitHub).

    +

    Nightly Snapshots#

    The code within the repository is compiled each -night. The following resulting -packages can be obtained:

    +night. All Windows builds are for the 64bit platform. For an explanation of the contents and the +licensing (especially concerning the "extra" build which contains GPL code to support GeoTIFFs, shapefiles and 3D models), +see the notes below. The following packages can be obtained:

    The nightly builds are also available from the Python packaging index test instance. -To install the latest nightly version use pip install -i https://test.pypi.org/simple/ eclipse-sumo. Although this is a python -package it contains all compiled SUMO binaries and should be fully functional for Windows and recent Linux.

    +To install the latest nightly version use:

    +
    pip install -i https://test.pypi.org/simple/ eclipse-sumo
    +
    + +

    Although this is a python package, it contains all compiled SUMO binaries and should be fully functional (see the requirements in the section above).

    The Linux repositories at the open build service contain a nightly build as well. This is unfortunately not the case for the Debian, Ubuntu and Arch versions.

    The corresponding documentation is @@ -364,10 +383,17 @@ night.

    Caution

    -

    The available windows binary packages may lag behind the latest Git revision due to being compiled only once per day (around midnight, Berlin time).

    +

    The available Windows binary packages may lag behind the latest Git revision due to being compiled only once per day (around midnight, Berlin time).

    -

    Direct repository access#

    -

    You can get very latest sources directly from our Git repository, see +

    SUMO - Older releases and alternative download#

    +

    All releases can also be obtained via the sourceforge download portal. +If you want to try out an older version you can also use the virtual environment approach (explained above) with a fixed version, e.g. +pip install eclipse-sumo=1.9.0 (works only for 1.8.0 and later).

    +

    If you need a complete zipped snapshot of the repository (including tests) for an older version have a look at the tags in your +local repository or at GitHub tags.

    +

    Other#

    +

    Direct repository access#

    +

    You can get the very latest sources directly from our Git repository, see the FAQ on repository access. Normally, they should compile and complete our test suite successfully. To assess the current state of the build, you may take a look at the @@ -422,20 +448,6 @@ ✔ -sumo-all-XXX.tar.gz
    sumo-all-XXX.zip - -✔ -✔ -✔ - -✔ -✔ -✔ -✔ -✔ -✔ - - rpm (✔) @@ -453,7 +465,7 @@

    Dependencies for developers#

    For the Windows platform you can retrieve all dependencies by cloning -this repository https://github.com/DLR-TS/SUMOLibraries, if you want +this repository: https://github.com/DLR-TS/SUMOLibraries, if you want to develop with Visual Studio. If you just want to run SUMO, use the binary downloads above which already contain the runtime dependencies.

    Scenarios and other Data#

    @@ -463,7 +475,7 @@
  • traffic data
  • Test cases
  • -

    Note on Licensing#

    +

    Note on Licensing#

    SUMO is licensed under the EPL-2.0 with GPL v2 or later as a secondary license option using only open source libraries.

    @@ -476,7 +488,7 @@ function getFileDate($fname, $type){ switch($type){ case "r": - $file = "/releases/1.11.0/" . $fname; + $file = "/releases/1.12.0/" . $fname; break; case "d": $file = "/daily/" . $fname; @@ -489,7 +501,7 @@ function getFileSize($fname, $type){ switch($type){ case "r": - $file = "/releases/1.11.0/" . $fname; + $file = "/releases/1.12.0/" . $fname; break; case "d": $file = "/daily/" . $fname; @@ -514,10 +526,10 @@
    -
    This page was last edited on: 26 October 2021 +
    This page was last edited on: 23 January 2022
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Driver_State.html sumo-1.12.0/docs/userdoc/Driver_State.html --- sumo-1.11.0/docs/userdoc/Driver_State.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Driver_State.html 2022-01-24 23:06:32.000000000 +0000 @@ -346,7 +346,7 @@
    This page was last edited on: 19 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/duarouter.html sumo-1.12.0/docs/userdoc/duarouter.html --- sumo-1.11.0/docs/userdoc/duarouter.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/duarouter.html 2022-01-24 23:06:32.000000000 +0000 @@ -412,6 +412,10 @@ Write trips with fromJunction and toJunction; default: false +--write-costs <BOOL> +Include the cost attribute in route output; default: false + + --exit-times <BOOL> Write exit times (weights) for each edge; default: false @@ -771,10 +775,10 @@
    -
    This page was last edited on: 17 November 2021 +
    This page was last edited on: 23 January 2022
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Editing_Articles.html sumo-1.12.0/docs/userdoc/Editing_Articles.html --- sumo-1.11.0/docs/userdoc/Editing_Articles.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Editing_Articles.html 2022-01-24 23:06:32.000000000 +0000 @@ -431,7 +431,7 @@

    <SUMO_HOME> <FILE> <STRING> -1.11.0

    +1.12.0

    Note

    The full list of available Macros can be found here at the end in the extra section.

    @@ -619,7 +619,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/FAQ.html sumo-1.12.0/docs/userdoc/FAQ.html --- sumo-1.11.0/docs/userdoc/FAQ.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/FAQ.html 2022-01-24 23:06:32.000000000 +0000 @@ -190,7 +190,7 @@ • SUMO does not do what I want and I don't know how to solve the issue
  • using sumolib , coordinates can be transformed between network-coordinates (m,m) - and geo-coordinates (lon,lat) and vice versa
  • + and geo-coordinates (lon,lat) and vice versa. Converting back and forth between lon,lat and raw UTM (m,m) is also supported.

    Obtaining output with geo-coordinates#

      @@ -241,10 +241,10 @@
      -
      This page was last edited on: 30 April 2021 +
      This page was last edited on: 08 December 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/GSoC.html sumo-1.12.0/docs/userdoc/GSoC.html --- sumo-1.11.0/docs/userdoc/GSoC.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/GSoC.html 2022-01-24 23:06:32.000000000 +0000 @@ -434,7 +434,7 @@
      This page was last edited on: 28 April 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/docs/userdoc/images/capacity.png and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/docs/userdoc/images/capacity.png differ Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/docs/userdoc/images/show_phases.png and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/docs/userdoc/images/show_phases.png differ Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/docs/userdoc/images/track_phases.png and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/docs/userdoc/images/track_phases.png differ diff -Nru sumo-1.11.0/docs/userdoc/index.html sumo-1.12.0/docs/userdoc/index.html --- sumo-1.11.0/docs/userdoc/index.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/index.html 2022-01-24 23:06:32.000000000 +0000 @@ -328,6 +328,7 @@
    • Vehicle speed
    • Vehicle insertion
    • Vehicle permissions (access restrictions)
    • +
    • Road capacity
    • Intersection dynamics
    • Randomness
    • Routing and Re-routing
    • @@ -406,10 +407,10 @@
      -
      This page was last edited on: 03 November 2021 +
      This page was last edited on: 04 January 2022
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Installing/index.html sumo-1.12.0/docs/userdoc/Installing/index.html --- sumo-1.11.0/docs/userdoc/Installing/index.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Installing/index.html 2022-01-24 23:06:32.000000000 +0000 @@ -204,10 +204,10 @@ package contains the binaries, all dlls needed, the examples, tools, and documentation in HTML format.

      Within the installation folder, you will find a folder named "bin". Here, you can find the executables (programs). You may double click on @@ -328,7 +328,7 @@
      This page was last edited on: 19 November 2021


      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Installing/Linux_Build.html sumo-1.12.0/docs/userdoc/Installing/Linux_Build.html --- sumo-1.11.0/docs/userdoc/Installing/Linux_Build.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Installing/Linux_Build.html 2022-01-24 23:06:32.000000000 +0000 @@ -214,7 +214,7 @@
    • Build the SUMO binaries
    • For ubuntu this boils down to

      -
       sudo apt-get install git cmake python3 g++ libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev
      +
       sudo apt-get install git cmake python3 g++ libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev python3-dev swig default-jdk maven libeigen3-dev
        git clone --recursive https://github.com/eclipse/sumo
        export SUMO_HOME="$PWD/sumo"
        mkdir sumo/build/cmake-build && cd sumo/build/cmake-build
      @@ -235,21 +235,22 @@
         network import from shapefile (arcgis). This requires the GDAL
         library. To compile you will need the devel versions of all packages.
         For openSUSE this means installing libxerces-c-devel, libproj-devel,
      -  libgdal-devel, and fox16-devel. For ubuntu the call is:
      -  sudo apt-get install cmake python g++ libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev.
      +  libgdal-devel, and fox16-devel. For ubuntu the call is above.
      +  The installation of swig, python3-dev and the jdk enables also the build of libsumo
      +  wgile eigen3 is necessary for the overheadwire model.
         There are some outdated platform specific
         and manual build instructions for the
         libraries
       
    • Optionally you may want to add
    • ffmpeg-devel (for video output),
    • libOpenSceneGraph-devel (for the experimental 3D GUI),
    • -
    • python-devel and swig (for running TraCI pythons scripts without a socket connection),
    • -
    • libeigen3 (for the overheadwire model)
    • gtest (for unit testing)
    • -
    • texttest (for the acceptance tests) - The package names above are for openSUSE, for ubuntu the call to get all optional libraries and tools is: - sudo apt-get install libavformat-dev libswscale-dev libopenscenegraph-dev python3-dev swig libgtest-dev libeigen3-dev python3-pip python3-setuptools default-jdk - sudo pip3 install texttest
    • +
    • +

      texttest (for the acceptance tests) + The package names above are for openSUSE, for ubuntu the call to get all optional libraries and tools is:

      +

      sudo apt-get install libavformat-dev libswscale-dev libopenscenegraph-dev libgtest-dev python3-pip python3-setuptools +sudo pip3 install texttest

      +

    Getting the source code#

    For the correct setting of SUMO_HOME you have to remember the correct @@ -270,7 +271,7 @@ local project history.

    release version or nightly tarball#

    Download -sumo-src-1.11.0.tar.gz or http://sumo.dlr.de/daily/sumo-src-git.tar.gz

    +sumo-src-1.12.0.tar.gz or http://sumo.dlr.de/daily/sumo-src-git.tar.gz

    tar xzf sumo-src-<version>.tar.gz
     cd sumo-<version>/
     pwd
    @@ -441,10 +442,10 @@
     
             
    -
    This page was last edited on: 13 November 2021 +
    This page was last edited on: 17 January 2022
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Installing/Linux_Build_Libraries.html sumo-1.12.0/docs/userdoc/Installing/Linux_Build_Libraries.html --- sumo-1.11.0/docs/userdoc/Installing/Linux_Build_Libraries.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Installing/Linux_Build_Libraries.html 2022-01-24 23:06:32.000000000 +0000 @@ -390,7 +390,7 @@
    This page was last edited on: 28 March 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Installing/MacOS_Build.html sumo-1.12.0/docs/userdoc/Installing/MacOS_Build.html --- sumo-1.11.0/docs/userdoc/Installing/MacOS_Build.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Installing/MacOS_Build.html 2022-01-24 23:06:32.000000000 +0000 @@ -404,7 +404,7 @@
    This page was last edited on: 10 June 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Installing/Windows_Build.html sumo-1.12.0/docs/userdoc/Installing/Windows_Build.html --- sumo-1.11.0/docs/userdoc/Installing/Windows_Build.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Installing/Windows_Build.html 2022-01-24 23:06:32.000000000 +0000 @@ -419,7 +419,7 @@
    This page was last edited on: 12 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Installing/Windows_Libraries.html sumo-1.12.0/docs/userdoc/Installing/Windows_Libraries.html --- sumo-1.11.0/docs/userdoc/Installing/Windows_Libraries.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Installing/Windows_Libraries.html 2022-01-24 23:06:32.000000000 +0000 @@ -422,7 +422,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/IntermodalRouting.html sumo-1.12.0/docs/userdoc/IntermodalRouting.html --- sumo-1.11.0/docs/userdoc/IntermodalRouting.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/IntermodalRouting.html 2022-01-24 23:06:32.000000000 +0000 @@ -260,7 +260,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/jtrrouter.html sumo-1.12.0/docs/userdoc/jtrrouter.html --- sumo-1.11.0/docs/userdoc/jtrrouter.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/jtrrouter.html 2022-01-24 23:06:32.000000000 +0000 @@ -640,7 +640,7 @@
    This page was last edited on: 17 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Libraries_Licenses.html sumo-1.12.0/docs/userdoc/Libraries_Licenses.html --- sumo-1.11.0/docs/userdoc/Libraries_Licenses.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Libraries_Licenses.html 2022-01-24 23:06:32.000000000 +0000 @@ -375,7 +375,7 @@
    This page was last edited on: 21 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Libsumo.html sumo-1.12.0/docs/userdoc/Libsumo.html --- sumo-1.11.0/docs/userdoc/Libsumo.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Libsumo.html 2022-01-24 23:06:32.000000000 +0000 @@ -264,7 +264,7 @@ libsumo.simulationStep()
    -

    Existing traci scripts can mostly be reused by calling

    +

    Existing traci scripts can be reused (subject to the limitations mentioned above) by calling

    import libsumo as traci
     
    @@ -327,10 +327,10 @@
    -
    This page was last edited on: 20 November 2021 +
    This page was last edited on: 23 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Libtraci.html sumo-1.12.0/docs/userdoc/Libtraci.html --- sumo-1.11.0/docs/userdoc/Libtraci.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Libtraci.html 2022-01-24 23:06:32.000000000 +0000 @@ -331,7 +331,7 @@
    This page was last edited on: 04 May 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/marouter.html sumo-1.12.0/docs/userdoc/marouter.html --- sumo-1.11.0/docs/userdoc/marouter.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/marouter.html 2022-01-24 23:06:32.000000000 +0000 @@ -727,7 +727,7 @@
    This page was last edited on: 17 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Models/Electric.html sumo-1.12.0/docs/userdoc/Models/Electric.html --- sumo-1.11.0/docs/userdoc/Models/Electric.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Models/Electric.html 2022-01-24 23:06:32.000000000 +0000 @@ -488,7 +488,7 @@ totalEnergyCharged float -Total energy charged in W during the entire simulation +Total energy charged in Wh during the entire simulation chargingSteps @@ -520,7 +520,7 @@ totalEnergyChargedIntoVehicle double -Energy charged during these charging stop +Energy charged (in Wh) during these charging stop chargingBegin @@ -776,10 +776,10 @@
    -
    This page was last edited on: 17 November 2021 +
    This page was last edited on: 30 December 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Models/ElectricHybrid.html sumo-1.12.0/docs/userdoc/Models/ElectricHybrid.html --- sumo-1.11.0/docs/userdoc/Models/ElectricHybrid.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Models/ElectricHybrid.html 2022-01-24 23:06:32.000000000 +0000 @@ -1346,7 +1346,7 @@
    This page was last edited on: 14 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Models/Emissions/HBEFA3-based.html sumo-1.12.0/docs/userdoc/Models/Emissions/HBEFA3-based.html --- sumo-1.11.0/docs/userdoc/Models/Emissions/HBEFA3-based.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Models/Emissions/HBEFA3-based.html 2022-01-24 23:06:32.000000000 +0000 @@ -428,7 +428,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Models/Emissions/HBEFA-based.html sumo-1.12.0/docs/userdoc/Models/Emissions/HBEFA-based.html --- sumo-1.11.0/docs/userdoc/Models/Emissions/HBEFA-based.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Models/Emissions/HBEFA-based.html 2022-01-24 23:06:32.000000000 +0000 @@ -787,7 +787,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Models/Emissions/PHEMlight.html sumo-1.12.0/docs/userdoc/Models/Emissions/PHEMlight.html --- sumo-1.11.0/docs/userdoc/Models/Emissions/PHEMlight.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Models/Emissions/PHEMlight.html 2022-01-24 23:06:32.000000000 +0000 @@ -472,7 +472,7 @@
    This page was last edited on: 20 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Models/Emissions.html sumo-1.12.0/docs/userdoc/Models/Emissions.html --- sumo-1.11.0/docs/userdoc/Models/Emissions.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Models/Emissions.html 2022-01-24 23:06:32.000000000 +0000 @@ -350,7 +350,7 @@
    This page was last edited on: 19 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Models/MMPEVEM.html sumo-1.12.0/docs/userdoc/Models/MMPEVEM.html --- sumo-1.11.0/docs/userdoc/Models/MMPEVEM.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Models/MMPEVEM.html 2022-01-24 23:06:32.000000000 +0000 @@ -143,10 +143,21 @@
    @@ -185,27 +196,42 @@

    Overview#

    -

    Since version 1.11.0 SUMO includes a model for electric vehicles energy -consumption from Teaching and Research Area Mechatronics in Mobile Propulsion (MMP), RWTH -Aachen. It was implemented by Kevin Badalian. -The model uses detailed characterstic maps to describe the a specific vehicle -powertrain.

    -

    You can find test cases for example vehicle type configurations at {SUMO_HOME} / -data/emissions/MMPEVEM

    -

    Using the model#

    -

    To use the model define a <vType> with emissionClass "MMPEVEM".

    -

    To also track the battery state, the vehicle must be equipped with a battery -device. The model is fully compatible -with charging infrastructure and related outputs as described in Electric -Vehicles.

    -

    Additional properties of the vehicle and its electrical components must -then be defined via parameters of the vehicle or its -type.

    -

    These values have the following meanings:

    +

    Since version 1.11.0, SUMO comes with an energy consumption model for electric +vehicles (EVs) developed by the Teaching and Research Area Mechatronics in +Mobile Propulsion (MMP) of RWTH Aachen University. MMPEVEM (MMP's +Electric Vehicle Emission Model), as it is called, is +implemented as a SUMO emission model (hence the name) and considers the +components of the powertrain individually in order to accurately compute the +power consumption in every simulation step. This includes the transmission +(i.e. a single reduction gear and a differential) with constant efficiency, the +electric motor (as well as its inverter) whose power losses are +read/interpolated from a characteristic map, a constant power consumer to +represent auxiliary devices such as air conditioning, and the battery.

    +

    Using the Model#

    +

    To utilise MMPEVEM, set emissionClass="MMPEVEM" in the vType definitions of +the vehicles you are interested in and add the following parameter:

    +
    <param key="has.battery.device" value="true"/>
    +
    + +

    Equipping the vType with a battery device is necessary because it triggers the +parsing and loading of all energy-related quantities. Other than that, there is +currently no interaction between MMPEVEM and said device. This especially +entails that the battery's state and output are not affected by or based on +the former.

    +

    Although default parameters are available, it is strongly advised to explicitly +specify all the model parameters listed below and to make sure that they are +compatible with one another. Failing to do so may lead to wrong or even invalid +operating points (cf. Output) which skew the overall energy +consumption.

    +

    Model Parameters#

    +

    MMPEVEM shares a lot of SUMO's +native electric vehicle parameters and +introduces only a couple of new ones. You can find exemplary vehicle type +definitions at {SUMO_HOME}/data/emissions/MMPEVEM1.

    - + @@ -213,16 +239,230 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + +
    keyKey Value Type Default Description
    maximumBatteryCapacityvehicleMassfloat (> 0)1000.0 [kg]Mass of the vehicle
    wheelRadiusfloat (> 0)0.3588 [m]Wheel radius
    internalMomentOfInertiafloat (>= 0)0.01 [kg * m^2]Internal components' moment of inertia
    rollDragCoefficientfloat (>= 0)0.01 [1]Rolling resistance coefficient
    airDragCoefficientfloat (>= 0)0.6 [1]Air drag coefficient
    frontSurfaceAreafloat (>= 0)5.0 [m^2]Cross-sectional area of the front of the vehicle
    gearRatiofloat (> 0)10.0 [1]Combined ratio of the single reduction gear and the differential
    gearEfficiencyfloat (> 0)0.96 [1]Combined efficiency of the single reduction gear and the differential
    maximumTorquefloat (>= 0)310.0 [Nm]Maximum generative torque of the electric motor
    maximumPowerfloat (>= 0)107000.0 [W]Maximum generative power of the electric motor
    maximumRecuperationTorquefloat (>= 0)95.5 [Nm]Maximum recuperation torque of the electric motor
    maximumRecuperationPowerfloat (>= 0)42800.0 [W]Maximum recuperation power of the electric motor
    internalBatteryResistancefloat (> 0)0.1142 [Ohm]Internal battery resistance
    nominalBatteryVoltagefloat (>= 0)396.0 [V]Nominal battery voltage
    constantPowerIntake float0 (Wh)Maximum battery capacity Emax100.0 [W]Constant power consumption of auxiliary devices
    powerLossMapstring2,1\|-1e9,1e9;-1e9,1e9\|0,0,0,02String representation of the electric motor's power loss map
    +

    Power Loss Map#

    +

    The power loss map describes the electric motor's power loss (in W) as a +function of motor speed (in rpm) and torque (in Nm). It is passed to the model +using a custom string format which shall be explicated using the mock power loss +map below.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    0 rpm4000 rpm8000 rpm
    -100 Nm826.7 W4295.6 W
    0 Nm0.0 W2162.9 W6137.4 W
    100 Nm826.7 W4295.6 W9317.5 W
    200 Nm3297.4 W8361.2 W14988.6 W
    -

    Publications#

    -

    "Accurate physics-based modeling of electric vehicle energy - consumption in the SUMO traffic microsimulator" (DOI: 10.1109/ITSC48978.2021.9564463).

    +

    Its string representation is:

    +
    2,1|0,4000,8000;-100,0,100,200|826.7,4295.6,nan,0.0,2162.9,6137.4,826.7,4295.6,9317.5,3297.4,8361.2,14988.6
    +
    + +

    The string consists of three parts delimited by the | character: +- The first part signifies that it maps from ℝ² to ℝ¹ and does not change + for MMPEVEM's power loss maps. +- The middle section contains the axis values in ascending order. Axes are + separated by semi-colons while commas are used to delimit the values of each + axis. +- The final part contains the row-major flattened entries of the map (i.e. the + first row of the table followed by the second row etc.) separated by commas. + Undefined operating points (e.g. (8000 rpm, -100 Nm) in this example) are + passed as nan.

    +

    Tools#

    +

    For permanent magnet synchronous machines (PMSMs), power loss maps can be +generated with the +Electric Machine Design Tool +developed by Kalt et al.3 and converted into the expected format using +{SUMO_HOME}/tools/contributed/convertMapMat2XML.M. The tool and the conversion +script require MATLAB® 2017 or newer.

    +

    Example#

    +

    This is an example vType definition of a generic electric SUV and was taken +from {SUMO_HOME}/data/emissions/MMPEVEM/SUV.xml.

    +
    <vType id="SUV" vClass="passenger" emissionClass="MMPEVEM" actionStepLength="1.0">
    +  <param key="has.battery.device" value="true"/>
    +  <param key="vehicleMass" value="2100"/>
    +  <param key="wheelRadius" value="0.3835"/>
    +  <param key="internalMomentOfInertia" value="16"/>
    +  <param key="rollDragCoefficient" value="0.01"/>
    +  <param key="airDragCoefficient" value="0.29"/>
    +  <param key="frontSurfaceArea" value="3.23"/>
    +  <param key="gearRatio" value="9.325"/>
    +  <param key="gearEfficiency" value="0.96"/>
    +  <param key="maximumTorque" value="380"/>
    +  <param key="maximumPower" value="180000"/>
    +  <param key="maximumRecuperationTorque" value="180"/>
    +  <param key="maximumRecuperationPower" value="105000"/>
    +  <param key="internalBatteryResistance" value="0.1575"/>
    +  <param key="nominalBatteryVoltage" value="405"/>
    +  <param key="constantPowerIntake" value="360"/>
    +  <param key="powerLossMap" value="2,1|0,413.7931,827.5862,1241.3793,1655.1724,2068.9655,2482.7586,2896.5517,3310.3448,3724.1379,4137.931,4551.7241,4965.5172,5379.3103,5793.1034,6206.8966,6620.6897,7034.4828,7448.2759,7862.069,8275.8621,8689.6552,9103.4483,9517.2414,9931.0345,10344.8276,10758.6207,11172.4138,11586.2069,12000;-192.8157,-176.7477,-160.6797,-144.6118,-128.5438,-112.4758,-96.4078,-80.3399,-64.2719,-48.2039,-32.1359,-16.068,0,16.068,32.1359,48.2039,64.2719,80.3399,96.4078,112.4758,128.5438,144.6118,160.6797,176.7477,192.8157,208.8836,224.9516,241.0196,257.0876,273.1555,289.2235,305.2915,321.3594,337.4274,353.4954,369.5634,385.6313|3059.92,3292.2,3684.4,4125.3,4607.96,5128.38,5683.86,6272.42,6892.5,7542.89,8222.55,8930.61,9666.35,10429.1,10310.8,11089.67,10785.82,10390.27,10810.04,10481.93,10979.63,11522.42,11203.92,11766.01,12353.56,12963.17,12593.66,13195.25,13812.23,14443.49,2571.18,2794.54,3160.93,3574.57,4028.8,4519.78,5044.9,5602.28,6190.42,6808.15,7454.48,8128.58,8829.74,9557.33,10310.8,11089.67,10785.82,10390.27,10810.04,10481.93,10979.63,11522.42,11203.92,11766.01,12353.56,12963.17,12593.66,13195.25,13812.23,14443.49,2124.95,2338.35,2679.36,3066.29,3492.74,3955.01,4450.61,4977.7,5534.87,6120.96,6735.04,7376.31,8044.08,8737.75,9456.79,10200.74,10785.82,10390.27,10810.04,10481.93,10979.63,11522.42,11203.92,11766.01,12353.56,12963.17,12593.66,13195.25,13812.23,14443.49,1721.21,1923.61,2239.66,2600.44,2999.77,3434.09,3900.98,4398.68,4925.83,5481.31,6064.23,6673.8,7309.37,7970.36,8656.27,9366.63,10064.34,10390.27,10810.04,10481.93,10979.63,11522.42,11203.92,11766.01,12353.56,12963.17,12593.66,13195.25,13812.23,14443.49,1359.97,1550.33,1841.86,2177.04,2549.9,2957,3396.01,3865.22,4363.31,4889.2,5442.04,6021.05,6625.62,7255.17,7909.23,8587.34,9289.11,9670.59,10040.46,10481.93,10979.63,11522.42,11203.92,11766.01,12353.56,12963.17,12593.66,13195.25,13812.23,14443.49,1041.22,1218.5,1485.94,1796.07,2143.13,2523.76,2935.71,3377.32,3847.31,4344.64,4868.47,5418.07,5992.82,6592.18,7215.67,7862.87,8533.39,9003.21,9328.15,9724.18,10175.82,10671.82,11203.92,11766.01,12353.56,12963.17,12593.66,13195.25,13812.23,14443.49,764.98,928.14,1171.9,1457.55,1779.45,2134.36,2520.07,2934.97,3377.82,3847.62,4343.53,4864.85,5410.97,5981.38,6575.6,7193.22,7833.87,8384.9,8669.14,9024.21,9434.59,9888.97,10379.02,10898.58,11443.04,12008.93,12593.66,13195.25,13812.23,14443.49,531.24,679.23,899.76,1161.47,1458.87,1788.79,2149.09,2538.18,2954.86,3398.14,3867.21,4361.39,4880.08,5422.77,5989,6578.39,7190.55,7813.13,8060.28,8378.21,8751.34,9168.33,9620.81,10102.57,10608.98,11136.54,11682.6,12245.16,12822.71,13414.09,339.99,471.78,669.49,907.82,1181.39,1487.07,1822.77,2186.96,2578.42,2996.21,3439.52,3907.69,4400.14,4916.35,5455.9,6018.38,6603.43,7210.74,7499.12,7783.23,8122.55,8505.71,8924.32,9372.16,9844.56,10337.99,10849.81,11377.99,11920.98,12477.63,191.25,305.79,481.12,696.62,947,1229.19,1541.13,1881.29,2248.5,2641.82,3060.46,3503.76,3971.15,4462.13,4976.27,5513.19,6072.52,6653.95,6983.77,7237,7545.53,7897.97,8285.9,8703.07,9144.81,9607.58,10088.72,10586.18,11098.42,11624.26,85,181.26,334.63,527.86,755.71,1015.15,1304.14,1621.18,1965.1,2334.97,2730.02,3149.58,3593.11,4060.1,4550.14,5062.82,5597.81,6154.78,6512.75,6737.81,7018.29,7342.77,7702.83,8092.19,8506.18,8941.24,9394.7,9864.51,10349.11,10847.33,21.25,98.19,230.02,401.53,607.51,844.95,1111.82,1406.62,1728.22,2075.66,2448.2,2845.17,3266.03,3710.27,4177.48,4667.27,5179.3,5713.25,6085.03,6284.42,6539.38,6838.46,7173.21,7537.36,7926.2,8336.18,8764.61,9209.44,9669.11,10142.42,0,58.32,172.48,327.47,517.95,740.81,993.98,1275.91,1585.42,1921.55,2283.51,2670.64,3082.37,3518.18,3977.64,4460.35,4965.97,5494.17,5876.18,6057.77,6296.78,6581.41,6902.92,7254.84,7632.29,8031.6,8450,8885.36,9336.06,9800.88,21.25,98.19,230.02,401.53,607.51,844.95,1111.82,1406.62,1728.22,2075.66,2448.2,2845.17,3266.03,3710.27,4177.48,4667.27,5179.3,5713.25,6085.03,6284.42,6539.38,6838.46,7173.21,7537.36,7926.2,8336.18,8764.61,9209.44,9669.11,10142.42,85,181.26,334.63,527.86,755.71,1015.15,1304.14,1621.18,1965.1,2334.97,2730.02,3149.58,3593.11,4060.1,4550.14,5062.82,5597.81,6154.78,6512.75,6737.81,7018.29,7342.77,7702.83,8092.19,8506.18,8941.24,9394.7,9864.51,10349.11,10847.33,191.25,305.79,481.12,696.62,947,1229.19,1541.13,1881.29,2248.5,2641.82,3060.46,3503.76,3971.15,4462.13,4976.27,5513.19,6072.52,6653.95,6983.77,7237,7545.53,7897.97,8285.9,8703.07,9144.81,9607.58,10088.72,10586.18,11098.42,11624.26,339.99,471.78,669.49,907.82,1181.39,1487.07,1822.77,2186.96,2578.42,2996.21,3439.52,3907.69,4400.14,4916.35,5455.9,6018.38,6603.43,7210.74,7499.12,7783.23,8122.55,8505.71,8924.32,9372.16,9844.56,10337.99,10849.81,11377.99,11920.98,12477.63,531.24,679.23,899.76,1161.47,1458.87,1788.79,2149.09,2538.18,2954.86,3398.14,3867.21,4361.39,4880.08,5422.77,5989,6578.39,7190.55,7813.13,8060.28,8378.21,8751.34,9168.33,9620.81,10102.57,10608.98,11136.54,11682.6,12245.16,12822.71,13414.09,764.98,928.14,1171.9,1457.55,1779.45,2134.36,2520.07,2934.97,3377.82,3847.62,4343.53,4864.85,5410.97,5981.38,6575.6,7193.22,7833.87,8384.9,8669.14,9024.21,9434.59,9888.97,10379.02,10898.58,11443.04,12008.93,12593.66,13195.25,13812.23,14443.49,1041.22,1218.5,1485.94,1796.07,2143.13,2523.76,2935.71,3377.32,3847.31,4344.64,4868.47,5418.07,5992.82,6592.18,7215.67,7862.87,8533.39,9003.21,9328.15,9724.18,10175.82,10671.82,11203.92,11766.01,12353.56,12963.17,13592.32,14239.12,14902.19,15580.51,1359.97,1550.33,1841.86,2177.04,2549.9,2957,3396.01,3865.22,4363.31,4889.2,5442.04,6021.05,6625.62,7255.17,7909.23,8587.34,9289.11,9670.59,10040.46,10481.93,10979.63,11522.42,12102.14,12712.82,13350.05,14010.59,14692.09,15392.85,16111.74,16848.03,1721.21,1923.61,2239.66,2600.44,2999.77,3434.09,3900.98,4398.68,4925.83,5481.31,6064.23,6673.8,7309.37,7970.36,8656.27,9366.63,10064.34,10390.27,10810.04,11302.37,11852.06,12448.17,13082.76,13750.09,14446.05,15167.75,15913.26,16681.4,17471.69,18284.23,2124.95,2338.35,2679.36,3066.29,3492.74,3955.01,4450.61,4977.7,5534.87,6120.96,6735.04,7376.31,8044.08,8737.75,9456.79,10200.74,10785.82,11166.28,11641.97,12191.89,12801.15,13459.15,14158.41,14893.73,15661.64,16460.13,17288.37,18146.71,19036.72,18284.23,2571.18,2794.54,3160.93,3574.57,4028.8,4519.78,5044.9,5602.28,6190.42,6808.15,7454.48,8128.58,8829.74,9557.33,10310.8,11089.67,11562.13,12003.73,12542.85,13158.98,13837.82,14569.51,15347.47,16167.76,17028.57,17930.23,17288.37,18146.71,19036.72,18284.23,3059.92,3292.2,3684.4,4125.3,4607.96,5128.38,5683.86,6272.42,6892.5,7542.89,8222.55,8930.61,9666.35,10429.1,11218.29,12017.36,12398.26,12909.18,13521.37,14215.18,14977.47,15799.94,16678.16,17611.3,17028.57,17930.23,17288.37,18146.71,19036.72,18284.23,3591.16,3831.31,4249.75,4718.46,5230.21,5780.83,6367.49,6988.11,7641.1,8325.17,9039.24,9782.41,10553.91,11353.06,12179.27,12844.59,13300.53,13891.26,14589.29,15376.72,16242.8,17182.8,16678.16,17611.3,17028.57,17930.23,17288.37,18146.71,19036.72,18284.23,4164.89,4411.88,4856.98,5354.06,5895.56,6477.12,7095.77,7749.36,8436.22,9154.99,9904.55,10683.97,11492.43,12329.22,13193.73,13735.1,14277.15,14961.52,15763.13,16667.61,16242.8,17182.8,16678.16,17611.3,17028.57,17930.23,17288.37,18146.71,19036.72,18284.23,4781.13,5033.91,5506.1,6032.11,6604.01,7217.24,7868.72,8556.18,9277.86,10032.35,10818.49,11635.29,12481.9,13357.58,14244.44,14696.41,15339.05,16136.09,17067.26,16667.61,16242.8,17182.8,16678.16,17611.3,17028.57,17930.23,17288.37,18146.71,19036.72,18284.23,5439.86,5697.4,6197.11,6752.59,7355.56,8001.21,8686.33,9408.55,10166.02,10957.26,11781.06,12636.37,13522.32,14438.12,15180.17,15738.39,16501.23,17438.49,17067.26,16667.61,16242.8,17182.8,16678.16,17611.3,17028.57,17930.23,17288.37,18146.71,19036.72,18284.23,6141.09,6402.34,6930,7515.52,8150.2,8829.02,9548.61,10306.48,11100.69,11929.71,12792.25,13687.22,14613.7,15570.87,16190.45,16874.33,17785.24,17438.49,17067.26,16667.61,16242.8,17182.8,16678.16,17611.3,17028.57,17930.23,17288.37,18146.71,19036.72,18284.23,6884.82,7148.74,7704.78,8320.88,8987.93,9700.67,10455.55,11249.96,12081.89,12949.7,13852.06,14787.83,15756.02,16747.9,17286.49,18122.91,17785.24,17438.49,17067.26,16667.61,16242.8,17182.8,16678.16,17611.3,17028.57,17930.23,17288.37,18146.71,19036.72,18284.23,7671.05,7936.6,8521.45,9168.69,9868.76,10616.16,11407.15,12239.01,13109.61,14017.24,14960.5,15938.2,16949.3,17791.47,18483.6,18122.91,17785.24,17438.49,17067.26,16667.61,16242.8,17182.8,16678.16,17611.3,17028.57,17930.23,17288.37,18146.71,19036.72,18284.23,8499.78,8765.92,9380,10058.93,10792.69,11575.49,12403.42,13273.61,14183.84,15132.32,16117.57,17138.33,18193.54,18923.23,18483.6,18122.91,17785.24,17438.49,17067.26,16667.61,16242.8,17182.8,16678.16,17611.3,17028.57,17930.23,17288.37,18146.71,19036.72,18284.23,9371.01,9636.7,10280.44,10991.61,11759.72,12578.66,13444.35,14353.78,15304.6,16294.94,17323.25,18388.23,19488.72,18923.23,18483.6,18122.91,17785.24,17438.49,17067.26,16667.61,16242.8,17182.8,16678.16,17611.3,17028.57,17930.23,17288.37,18146.71,19036.72,18284.23,10284.74,10548.93,11222.76,11966.74,12769.84,13625.68,14529.95,15479.5,16471.87,17505.11,18577.57,19687.88,20674.02,18923.23,18483.6,18122.91,17785.24,17438.49,17067.26,16667.61,16242.8,17182.8,16678.16,17611.3,17028.57,17930.23,17288.37,18146.71,19036.72,18284.23,11240.96,11502.63,12206.97,12984.3,13823.05,14716.53,15660.21,16650.78,17685.67,18762.81,19880.51,21037.3,20674.02,18923.23,18483.6,18122.91,17785.24,17438.49,17067.26,16667.61,16242.8,17182.8,16678.16,17611.3,17028.57,17930.23,17288.37,18146.71,19036.72,18284.23,12239.69,12497.78,13233.06,14044.31,14919.37,15851.22,16835.13,17867.61,18945.98,20068.07,21232.07,22436.48,20674.02,18923.23,18483.6,18122.91,17785.24,17438.49,17067.26,16667.61,16242.8,17182.8,16678.16,17611.3,17028.57,17930.23,17288.37,18146.71,19036.72,18284.23"/>
    +</vType>
    +
    + +

    Output#

    +

    Start SUMO with the --emission-output option in order to generate an XML file +with the emissions of all vehicles. In the XML, the attribute electricity +shows the electric energy consumption (in Wh) of a vehicle in a given time step. +Please note that this value is only provided by MMPEVEM if and only if the +vtype definition of the vehicle in question was set accordingly.

    +

    MMPEVEM is a backward-facing model, meaning that it expects a velocity, +acceleration, slope, and time step size to calculate the energy demand. This +also means that it has no way to stop the vehicle from running into invalid +operating points. The latter can be caused by implausible accelerations (for +instance due to teleportations), wrong vehicle parameters, etc. If the model +finds itself in such a state, it returns nan. On a related note, MMPEVEM +assumes that the driver perfectly operates the mechanical brakes such that +torque and power are clipped to the motor's limits during recuperation.

    +

    Publications#

    + + @@ -230,10 +470,10 @@
    -
    This page was last edited on: 19 November 2021 +
    This page was last edited on: 30 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/netconvert.html sumo-1.12.0/docs/userdoc/netconvert.html --- sumo-1.11.0/docs/userdoc/netconvert.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/netconvert.html 2022-01-24 23:06:32.000000000 +0000 @@ -1316,6 +1316,10 @@ Use maximum value of incoming and outgoing edge speed on junction instead of average; default: false +--internal-junctions.vehicle-width <FLOAT> +Assumed vehicle width for computing internal junction positions; default: 1.8 + + --rectangular-lane-cut <BOOL> Forces rectangular cuts between lanes and intersections; default: false @@ -1449,6 +1453,10 @@ Set edge priority values based on estimated main direction; default: false +--railway.topology.extend-priority <BOOL> +Extend loaded edge priority values based on estimated main direction; default: false + + --railway.access-distance <FLOAT> The search radius for finding suitable road accesses for rail stops; default: 150 @@ -1512,6 +1520,10 @@ Import sidewalks; default: false +--osm.turn-lanes <BOOL> +Import turning arrows from OSM to help with connection building; default: false + + --osm.stop-output.length <FLOAT> The default length of a public transport stop in FLOAT m; default: 25 @@ -1683,6 +1695,14 @@ --opendrive.internal-shapes <BOOL> Import internal lane shapes; default: false + +--opendrive.position-ids <BOOL> +Sets edge-id based on road-id and offset in m (legacy); default: false + + +--opendrive.lane-shapes <BOOL> +Use custom lane shapes to compensate discarded lane types; default: false +

    Report#

    @@ -1885,10 +1905,10 @@
    -
    This page was last edited on: 17 November 2021 +
    This page was last edited on: 23 January 2022
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Netedit/editModesCommon.html sumo-1.12.0/docs/userdoc/Netedit/editModesCommon.html --- sumo-1.11.0/docs/userdoc/Netedit/editModesCommon.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Netedit/editModesCommon.html 2022-01-24 23:06:32.000000000 +0000 @@ -426,7 +426,7 @@
    This page was last edited on: 03 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Netedit/editModesData.html sumo-1.12.0/docs/userdoc/Netedit/editModesData.html --- sumo-1.11.0/docs/userdoc/Netedit/editModesData.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Netedit/editModesData.html 2022-01-24 23:06:32.000000000 +0000 @@ -216,7 +216,7 @@
    This page was last edited on: 13 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Netedit/editModesDemand.html sumo-1.12.0/docs/userdoc/Netedit/editModesDemand.html --- sumo-1.11.0/docs/userdoc/Netedit/editModesDemand.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Netedit/editModesDemand.html 2022-01-24 23:06:32.000000000 +0000 @@ -213,7 +213,7 @@


    Inspecting route.

    Vehicle mode#

    -

    Vehicles, flows and trips can be created using this mode. The term "vehicle" includes three different elements: Vehicles, flows (both placed over a Route) and Trips (placed over a "from" edge). Also every vehicle need to be a "Vehicle Type", therefore both parameters has to be selected in both list of left frame.

    +

    Vehicles, flows and trips can be created using this mode. The term "vehicle" includes three different elements: Vehicles, flows (both placed over a Route) and Trips (placed over a "from" edge). Also every vehicle need to have a "Vehicle Type", therefore both parameters has to be selected in both list of left frame.


    General view of vehicle mode, highlighting the list of vehicles and vehicle types


    @@ -286,10 +286,10 @@

    -
    This page was last edited on: 14 April 2021 +
    This page was last edited on: 07 January 2022
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Netedit/editModes.html sumo-1.12.0/docs/userdoc/Netedit/editModes.html --- sumo-1.11.0/docs/userdoc/Netedit/editModes.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Netedit/editModes.html 2022-01-24 23:06:32.000000000 +0000 @@ -192,7 +192,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Netedit/editModesNetwork.html sumo-1.12.0/docs/userdoc/Netedit/editModesNetwork.html --- sumo-1.11.0/docs/userdoc/Netedit/editModesNetwork.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Netedit/editModesNetwork.html 2022-01-24 23:06:32.000000000 +0000 @@ -430,7 +430,7 @@
    This page was last edited on: 14 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Netedit/elementsAdditional.html sumo-1.12.0/docs/userdoc/Netedit/elementsAdditional.html --- sumo-1.11.0/docs/userdoc/Netedit/elementsAdditional.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Netedit/elementsAdditional.html 2022-01-24 23:06:32.000000000 +0000 @@ -352,7 +352,7 @@
    This page was last edited on: 14 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Netedit/elementsData.html sumo-1.12.0/docs/userdoc/Netedit/elementsData.html --- sumo-1.11.0/docs/userdoc/Netedit/elementsData.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Netedit/elementsData.html 2022-01-24 23:06:32.000000000 +0000 @@ -204,7 +204,7 @@
    This page was last edited on: 13 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Netedit/elementsDemand.html sumo-1.12.0/docs/userdoc/Netedit/elementsDemand.html --- sumo-1.11.0/docs/userdoc/Netedit/elementsDemand.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Netedit/elementsDemand.html 2022-01-24 23:06:32.000000000 +0000 @@ -257,7 +257,7 @@
    This page was last edited on: 02 March 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Netedit/elements.html sumo-1.12.0/docs/userdoc/Netedit/elements.html --- sumo-1.11.0/docs/userdoc/Netedit/elements.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Netedit/elements.html 2022-01-24 23:06:32.000000000 +0000 @@ -511,7 +511,7 @@
    This page was last edited on: 02 March 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Netedit/elementsNetwork.html sumo-1.12.0/docs/userdoc/Netedit/elementsNetwork.html --- sumo-1.11.0/docs/userdoc/Netedit/elementsNetwork.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Netedit/elementsNetwork.html 2022-01-24 23:06:32.000000000 +0000 @@ -226,7 +226,7 @@
    This page was last edited on: 02 March 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Netedit/elementsShape.html sumo-1.12.0/docs/userdoc/Netedit/elementsShape.html --- sumo-1.11.0/docs/userdoc/Netedit/elementsShape.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Netedit/elementsShape.html 2022-01-24 23:06:32.000000000 +0000 @@ -209,7 +209,7 @@
    This page was last edited on: 13 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Netedit/elementsTAZ.html sumo-1.12.0/docs/userdoc/Netedit/elementsTAZ.html --- sumo-1.11.0/docs/userdoc/Netedit/elementsTAZ.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Netedit/elementsTAZ.html 2022-01-24 23:06:32.000000000 +0000 @@ -195,7 +195,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Netedit/index.html sumo-1.12.0/docs/userdoc/Netedit/index.html --- sumo-1.11.0/docs/userdoc/Netedit/index.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Netedit/index.html 2022-01-24 23:06:32.000000000 +0000 @@ -808,7 +808,7 @@
    This page was last edited on: 19 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Netedit/neteditPopupFunctions.html sumo-1.12.0/docs/userdoc/Netedit/neteditPopupFunctions.html --- sumo-1.11.0/docs/userdoc/Netedit/neteditPopupFunctions.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Netedit/neteditPopupFunctions.html 2022-01-24 23:06:32.000000000 +0000 @@ -319,7 +319,7 @@
    This page was last edited on: 14 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Netedit/neteditUsageExamples.html sumo-1.12.0/docs/userdoc/Netedit/neteditUsageExamples.html --- sumo-1.11.0/docs/userdoc/Netedit/neteditUsageExamples.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Netedit/neteditUsageExamples.html 2022-01-24 23:06:32.000000000 +0000 @@ -200,6 +200,9 @@ + @@ -403,6 +406,17 @@
  • optionally: use inspect mode and enable 'show connections' (Alt+5). Click on the zipper connections (brown) and customize 'visibilityDistance' to set the range where vehicles start zipper merging.
  • +

    Simplify TLS program state after changing connections#

    +

    After deleting connections at a junction of type traffic_light, the traffic light program will remain unchanged by default. +This stability implies that the length of the phase state may be longer than needed and the list of used can contain gaps (where the unused states are). +To clean up the states:

    +
      +
    1. enter traffic light mode (T)
    2. +
    3. click on the junction
    4. +
    5. press the 'Clean States' button (this shortens the state and re-assigns indices to controlled connections)
    6. +
    7. save the program
    8. +
    9. recompute the network (F5) to see updated tls indices (when inspecting connections or drawing 'tls link index')
    10. +
    @@ -410,10 +424,10 @@
    -
    This page was last edited on: 18 October 2021 +
    This page was last edited on: 11 January 2022
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/netgenerate.html sumo-1.12.0/docs/userdoc/netgenerate.html --- sumo-1.11.0/docs/userdoc/netgenerate.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/netgenerate.html 2022-01-24 23:06:32.000000000 +0000 @@ -1029,6 +1029,10 @@ Use maximum value of incoming and outgoing edge speed on junction instead of average; default: false +--internal-junctions.vehicle-width <FLOAT> +Assumed vehicle width for computing internal junction positions; default: 1.8 + + --rectangular-lane-cut <BOOL> Forces rectangular cuts between lanes and intersections; default: false @@ -1205,10 +1209,10 @@
    -
    This page was last edited on: 17 November 2021 +
    This page was last edited on: 23 January 2022
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Abstract_Network_Generation.html sumo-1.12.0/docs/userdoc/Networks/Abstract_Network_Generation.html --- sumo-1.11.0/docs/userdoc/Networks/Abstract_Network_Generation.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Abstract_Network_Generation.html 2022-01-24 23:06:32.000000000 +0000 @@ -281,7 +281,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Elevation.html sumo-1.12.0/docs/userdoc/Networks/Elevation.html --- sumo-1.11.0/docs/userdoc/Networks/Elevation.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Elevation.html 2022-01-24 23:06:32.000000000 +0000 @@ -241,7 +241,7 @@
    This page was last edited on: 12 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Export.html sumo-1.12.0/docs/userdoc/Networks/Export.html --- sumo-1.11.0/docs/userdoc/Networks/Export.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Export.html 2022-01-24 23:06:32.000000000 +0000 @@ -250,7 +250,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Further_Options.html sumo-1.12.0/docs/userdoc/Networks/Further_Options.html --- sumo-1.11.0/docs/userdoc/Networks/Further_Options.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Further_Options.html 2022-01-24 23:06:32.000000000 +0000 @@ -305,7 +305,7 @@
    This page was last edited on: 12 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Further_Outputs.html sumo-1.12.0/docs/userdoc/Networks/Further_Outputs.html --- sumo-1.11.0/docs/userdoc/Networks/Further_Outputs.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Further_Outputs.html 2022-01-24 23:06:32.000000000 +0000 @@ -422,7 +422,7 @@
    This page was last edited on: 12 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Import/ArcView.html sumo-1.12.0/docs/userdoc/Networks/Import/ArcView.html --- sumo-1.11.0/docs/userdoc/Networks/Import/ArcView.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Import/ArcView.html 2022-01-24 23:06:32.000000000 +0000 @@ -528,7 +528,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Import/DlrNavteq.html sumo-1.12.0/docs/userdoc/Networks/Import/DlrNavteq.html --- sumo-1.11.0/docs/userdoc/Networks/Import/DlrNavteq.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Import/DlrNavteq.html 2022-01-24 23:06:32.000000000 +0000 @@ -178,7 +178,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Import/MATsim.html sumo-1.12.0/docs/userdoc/Networks/Import/MATsim.html --- sumo-1.11.0/docs/userdoc/Networks/Import/MATsim.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Import/MATsim.html 2022-01-24 23:06:32.000000000 +0000 @@ -186,7 +186,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Import/OpenDRIVE.html sumo-1.12.0/docs/userdoc/Networks/Import/OpenDRIVE.html --- sumo-1.11.0/docs/userdoc/Networks/Import/OpenDRIVE.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Import/OpenDRIVE.html 2022-01-24 23:06:32.000000000 +0000 @@ -394,7 +394,7 @@
    This page was last edited on: 01 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Import/OpenStreetMapDownload.html sumo-1.12.0/docs/userdoc/Networks/Import/OpenStreetMapDownload.html --- sumo-1.11.0/docs/userdoc/Networks/Import/OpenStreetMapDownload.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Import/OpenStreetMapDownload.html 2022-01-24 23:06:32.000000000 +0000 @@ -417,7 +417,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Import/OpenStreetMap.html sumo-1.12.0/docs/userdoc/Networks/Import/OpenStreetMap.html --- sumo-1.11.0/docs/userdoc/Networks/Import/OpenStreetMap.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Import/OpenStreetMap.html 2022-01-24 23:06:32.000000000 +0000 @@ -156,6 +156,12 @@ + + -
  • osmBidiRailNetconvert.typ.xml. Changes the default from +
  • osmNetconvertBidiRail.typ.xml. Changes the default from uni-directional railroads to bi-directional railroads. This may be useful in some regions of the world where OSM contributors used this style of date representation. The use of this typemap supplants the older option --osm.railway.oneway-default <BOOL>.
  • +
  • osmNetconvertAirport.typ.xml. Imports aeroways (runway, taxiway, etc.)
  • Caution

    @@ -372,6 +379,15 @@ as well as oneway information for bicycles. This usually applies only to the permissions for existing lanes and streets. If you want to add further bike lanes use the bicycle type map mentioned above.

    +

    Pedestrian Traffic#

    +

    By default only footpaths (osm ways dedicated for pedestrian use) are imported. +To import all sidewalk related information, the option --sidewalks can be set. Alternatively, sidwalks can be added heuristically via typemaps (see above) or guessing-options

    +

    Lane-To-Lane Connections#

    +

    By default, lane-to-lane connections are guessed by netconvert and only turning restrictions are loaded from OSM to influence connection generation. When setting option --osm.turn-lanes, the turn direction road markings form OSM are evaluated to guide connection generation.

    +
    +

    Caution

    +

    At roads where some lanes have turn markings and others do not, the unmarked lanes are interpreted as through-lanes. This may not be correct in all cases.

    +

    Importing additional Polygons (Buildings, Water, etc.)#

    OSM-data not only contains the road network but also a wide range of additional polygons such as buildings and rivers. These polygons can be @@ -833,10 +849,10 @@

    -
    This page was last edited on: 08 November 2021 +
    This page was last edited on: 15 December 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Import/RoboCup.html sumo-1.12.0/docs/userdoc/Networks/Import/RoboCup.html --- sumo-1.11.0/docs/userdoc/Networks/Import/RoboCup.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Import/RoboCup.html 2022-01-24 23:06:32.000000000 +0000 @@ -176,7 +176,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Import/SUMO_Road_Networks.html sumo-1.12.0/docs/userdoc/Networks/Import/SUMO_Road_Networks.html --- sumo-1.11.0/docs/userdoc/Networks/Import/SUMO_Road_Networks.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Import/SUMO_Road_Networks.html 2022-01-24 23:06:32.000000000 +0000 @@ -194,7 +194,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Import/Vissim.html sumo-1.12.0/docs/userdoc/Networks/Import/Vissim.html --- sumo-1.11.0/docs/userdoc/Networks/Import/Vissim.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Import/Vissim.html 2022-01-24 23:06:32.000000000 +0000 @@ -277,7 +277,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Import/VISUM.html sumo-1.12.0/docs/userdoc/Networks/Import/VISUM.html --- sumo-1.11.0/docs/userdoc/Networks/Import/VISUM.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Import/VISUM.html 2022-01-24 23:06:32.000000000 +0000 @@ -401,7 +401,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/Import.html sumo-1.12.0/docs/userdoc/Networks/Import.html --- sumo-1.11.0/docs/userdoc/Networks/Import.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/Import.html 2022-01-24 23:06:32.000000000 +0000 @@ -209,7 +209,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/PlainXML.html sumo-1.12.0/docs/userdoc/Networks/PlainXML.html --- sumo-1.11.0/docs/userdoc/Networks/PlainXML.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/PlainXML.html 2022-01-24 23:06:32.000000000 +0000 @@ -174,6 +174,9 @@ → Understanding right-of-way rules in a Network +
    +

    Fringe#

    +

    For route generation it may be relevant to know whether a particular junction or edge is at boundary of a network where other roads (that exist in the real world) were cut off. This can specified using the 'fringe' attrribute:

    +
      +
    • default: this junction is not part of the fringe
    • +
    • outer: this junction is connected to additional edges in the real world. It is part of the outer boundary of the network
    • +
    • inner: this junction is connected to additional edges in the real world. It lies within the network but other roads (i.e. with a lower road class) were removed from the simulation
    • +
    +

    The fringe attribut can be determined automatically for the outer fringe based on the pareto frontier by setting netconvert option --fringe.guess. It is also set automatically by netgenerate when option --attach-length is used. Editing the attribute in netedit is also supported.

    +

    The 'fringe' attribute is used by randomTrips.py when setting option --fringe-junctions.

    Joining Nodes#

    Sometimes your network may contain nodes which are very close together forming a big cluster. This happens frequently when Importing Networks from OpenStreetMap. @@ -1875,10 +1892,10 @@

    -
    This page was last edited on: 10 November 2021 +
    This page was last edited on: 20 January 2022
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Networks/SUMO_Road_Networks.html sumo-1.12.0/docs/userdoc/Networks/SUMO_Road_Networks.html --- sumo-1.11.0/docs/userdoc/Networks/SUMO_Road_Networks.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Networks/SUMO_Road_Networks.html 2022-01-24 23:06:32.000000000 +0000 @@ -971,7 +971,7 @@
    This page was last edited on: 22 October 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/od2trips.html sumo-1.12.0/docs/userdoc/od2trips.html --- sumo-1.11.0/docs/userdoc/od2trips.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/od2trips.html 2022-01-24 23:06:32.000000000 +0000 @@ -552,7 +552,7 @@
    This page was last edited on: 17 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/OpenStreetMap_file.html sumo-1.12.0/docs/userdoc/OpenStreetMap_file.html --- sumo-1.11.0/docs/userdoc/OpenStreetMap_file.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/OpenStreetMap_file.html 2022-01-24 23:06:32.000000000 +0000 @@ -285,7 +285,7 @@
    This page was last edited on: 15 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/OsmNetconvert.typ.xml.html sumo-1.12.0/docs/userdoc/OsmNetconvert.typ.xml.html --- sumo-1.11.0/docs/userdoc/OsmNetconvert.typ.xml.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/OsmNetconvert.typ.xml.html 2022-01-24 23:06:32.000000000 +0000 @@ -198,7 +198,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Osm-urban-de.typ.xml.html sumo-1.12.0/docs/userdoc/Osm-urban-de.typ.xml.html --- sumo-1.11.0/docs/userdoc/Osm-urban-de.typ.xml.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Osm-urban-de.typ.xml.html 2022-01-24 23:06:32.000000000 +0000 @@ -198,7 +198,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Other/File_Extensions.html sumo-1.12.0/docs/userdoc/Other/File_Extensions.html --- sumo-1.11.0/docs/userdoc/Other/File_Extensions.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Other/File_Extensions.html 2022-01-24 23:06:32.000000000 +0000 @@ -373,7 +373,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Other/Glossary.html sumo-1.12.0/docs/userdoc/Other/Glossary.html --- sumo-1.11.0/docs/userdoc/Other/Glossary.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Other/Glossary.html 2022-01-24 23:06:32.000000000 +0000 @@ -465,7 +465,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Other/Links.html sumo-1.12.0/docs/userdoc/Other/Links.html --- sumo-1.11.0/docs/userdoc/Other/Links.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Other/Links.html 2022-01-24 23:06:32.000000000 +0000 @@ -279,7 +279,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Other/Projects.html sumo-1.12.0/docs/userdoc/Other/Projects.html --- sumo-1.11.0/docs/userdoc/Other/Projects.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Other/Projects.html 2022-01-24 23:06:32.000000000 +0000 @@ -243,7 +243,7 @@ management approaches
  • OIS: Verification of using optical sensors for optimization of traffic lights
  • -
  • CityMobil Automatic urban +
  • CityMobil Automatic urban transportation. A simulation for a parking lot inspired by the Rome demonstrator is included with SUMO.
  • DRIVE C2X Driving implementation @@ -368,10 +368,10 @@
    -
    This page was last edited on: 27 August 2021 +
    This page was last edited on: 29 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/polyconvert.html sumo-1.12.0/docs/userdoc/polyconvert.html --- sumo-1.11.0/docs/userdoc/polyconvert.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/polyconvert.html 2022-01-24 23:06:32.000000000 +0000 @@ -656,7 +656,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Publications.html sumo-1.12.0/docs/userdoc/Publications.html --- sumo-1.11.0/docs/userdoc/Publications.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Publications.html 2022-01-24 23:06:32.000000000 +0000 @@ -543,7 +543,7 @@
    This page was last edited on: 18 October 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Screenshots/index.html sumo-1.12.0/docs/userdoc/Screenshots/index.html --- sumo-1.11.0/docs/userdoc/Screenshots/index.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Screenshots/index.html 2022-01-24 23:06:32.000000000 +0000 @@ -233,7 +233,7 @@
    This page was last edited on: 12 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Screenshots/Shapes.html sumo-1.12.0/docs/userdoc/Screenshots/Shapes.html --- sumo-1.11.0/docs/userdoc/Screenshots/Shapes.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Screenshots/Shapes.html 2022-01-24 23:06:32.000000000 +0000 @@ -211,7 +211,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simpla.html sumo-1.12.0/docs/userdoc/Simpla.html --- sumo-1.11.0/docs/userdoc/Simpla.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simpla.html 2022-01-24 23:06:32.000000000 +0000 @@ -408,7 +408,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Basic_Definition.html sumo-1.12.0/docs/userdoc/Simulation/Basic_Definition.html --- sumo-1.11.0/docs/userdoc/Simulation/Basic_Definition.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Basic_Definition.html 2022-01-24 23:06:32.000000000 +0000 @@ -213,11 +213,13 @@ Routes are normally given to the simulation modules using the option --route-files <ROUTES_FILE>[,<ROUTES_FILE>]* (or -r <ROUTES_FILE>[,<ROUTES_FILE>]*). As you can see, you can use more than one route file within a single simulation run.

    -

    The routes MUST be sorted. The reason is that we want to simulate large -road networks with up to millions of routes. Using a plain PC this is -only possible if you do not keep all routes in memory. All files given -as parameter to --route-files <ROUTES_FILE>[,<ROUTES_FILE>]* are read step-wise. Starting at the begin time step, -new routes are loaded every n time steps for the next n time steps. n +

    +

    Caution

    +

    The vehicular elements (trips, vehicles, flows) must be sorted by depart / begin time.

    +
    +

    The reason is that route files are read incrementally to conserve memory and enable large simulations. +All files given as parameter to --route-files <ROUTES_FILE>[,<ROUTES_FILE>]* are read step-wise. +Starting at the begin time step, new routes are loaded every n time steps for the next n time steps. n may be controlled using the --route-steps <INT> where <=0 forces sumo/sumo-gui to load the file completely. Fetching routes for the next steps only implies that the @@ -225,6 +227,10 @@ routes that use them.

    You may also give routes including vehicle definitions as additional-file to sumo/sumo-gui.

    +
    +

    Caution

    +

    vTypes and named routes must preceed vehicle definitions which reference those types and routes.

    +

    Additional Files#

    One ore more additional-file(s) are used to load additional entities:

    All these additional structures / definitions are given to the -simulation using the --additional-files <FILE>[,<FILE>]*. The list of given files is processed -incrementally, this means each file is read completely from top to -bottom and the list is processed starting with the first file of the -list.

    +simulation using the --additional-files <FILE>[,<FILE>]*. +Each file is read completely into memory and the list of files is processed from left to right.

    Parsing Order#

    To ensure the correct resolution of references, it is important to know what is loaded when. The order is as follows:

    @@ -351,10 +355,10 @@
    -
    This page was last edited on: 11 February 2021 +
    This page was last edited on: 13 December 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Bicycles.html sumo-1.12.0/docs/userdoc/Simulation/Bicycles.html --- sumo-1.11.0/docs/userdoc/Simulation/Bicycles.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Bicycles.html 2022-01-24 23:06:32.000000000 +0000 @@ -390,7 +390,7 @@
    This page was last edited on: 19 October 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Bluetooth.html sumo-1.12.0/docs/userdoc/Simulation/Bluetooth.html --- sumo-1.11.0/docs/userdoc/Simulation/Bluetooth.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Bluetooth.html 2022-01-24 23:06:32.000000000 +0000 @@ -418,7 +418,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Calibrator.html sumo-1.12.0/docs/userdoc/Simulation/Calibrator.html --- sumo-1.11.0/docs/userdoc/Simulation/Calibrator.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Calibrator.html 2022-01-24 23:06:32.000000000 +0000 @@ -402,7 +402,7 @@
    This page was last edited on: 04 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Distances.html sumo-1.12.0/docs/userdoc/Simulation/Distances.html --- sumo-1.11.0/docs/userdoc/Simulation/Distances.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Distances.html 2022-01-24 23:06:32.000000000 +0000 @@ -242,7 +242,7 @@
    This page was last edited on: 10 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Emergency.html sumo-1.12.0/docs/userdoc/Simulation/Emergency.html --- sumo-1.11.0/docs/userdoc/Simulation/Emergency.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Emergency.html 2022-01-24 23:06:32.000000000 +0000 @@ -269,7 +269,7 @@
    This page was last edited on: 06 October 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/GenericParameters.html sumo-1.12.0/docs/userdoc/Simulation/GenericParameters.html --- sumo-1.11.0/docs/userdoc/Simulation/GenericParameters.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/GenericParameters.html 2022-01-24 23:06:32.000000000 +0000 @@ -208,7 +208,7 @@
    This page was last edited on: 20 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/GLOSA.html sumo-1.12.0/docs/userdoc/Simulation/GLOSA.html --- sumo-1.11.0/docs/userdoc/Simulation/GLOSA.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/GLOSA.html 2022-01-24 23:06:32.000000000 +0000 @@ -278,7 +278,7 @@
    This page was last edited on: 22 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Intersections.html sumo-1.12.0/docs/userdoc/Simulation/Intersections.html --- sumo-1.11.0/docs/userdoc/Simulation/Intersections.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Intersections.html 2022-01-24 23:06:32.000000000 +0000 @@ -393,7 +393,7 @@
    This page was last edited on: 22 October 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Meso.html sumo-1.12.0/docs/userdoc/Simulation/Meso.html --- sumo-1.11.0/docs/userdoc/Simulation/Meso.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Meso.html 2022-01-24 23:06:32.000000000 +0000 @@ -453,7 +453,7 @@
    This page was last edited on: 26 August 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Motorways.html sumo-1.12.0/docs/userdoc/Simulation/Motorways.html --- sumo-1.11.0/docs/userdoc/Simulation/Motorways.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Motorways.html 2022-01-24 23:06:32.000000000 +0000 @@ -214,11 +214,11 @@

    If the network does not contain detailed ramp data, netconvert can be configured to add them heuristically. -This basically adds acceleration at on-ramps and deceleration lanes at -off-ramps.

    +This basically adds acceleration lanes at on-ramps and deceleration lanes at +off-ramps by increasing the lane count of one or more edges.

    Ramps usually merge into the main road via an acceleration lane. This acceleration lane opens up where the ramp enters the motorway and is modelled as a dead-end lane (no outgoing connection). This forces on-ramp vehicles to change lanes in order to continue their route.

    It may be useful to make acceleration lanes in SUMO somewhat longer than in reality. -This compensates the cautious default behavior of SUMO drivers: Vehicles on the acceleration lane will decelerate when approaching the end of that lane since they cannot anticipate with certainty whether their lanechange will be successful. In contrast, human drivers are better at predicting the future and may accelerate up to the end of the acceleration lane (and then change into the anticipated gap at the last moment)

    +This compensates for the cautious default behavior of SUMO drivers: Vehicles on the acceleration lane will decelerate when approaching the end of that lane since they cannot anticipate with certainty whether their lanechange will be successful. In contrast, human drivers are better at predicting the future and may accelerate up to the end of the acceleration lane (and then change into the anticipated gap at the last moment)

    Reduction in the number of lanes#

    The usual way to set up a lane-number reduction is to configure one of the lanes as a dead-end (no connection to the next edge) and force @@ -274,10 +274,10 @@

    -
    This page was last edited on: 17 August 2021 +
    This page was last edited on: 05 January 2022
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/NEMA.html sumo-1.12.0/docs/userdoc/Simulation/NEMA.html --- sumo-1.11.0/docs/userdoc/Simulation/NEMA.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/NEMA.html 2022-01-24 23:06:32.000000000 +0000 @@ -154,6 +154,7 @@ • <phase> Attributes
  • + @@ -203,7 +204,7 @@

    You can load new definitions for NEMA-phase traffic controller as a part of an additional-file. The signal timing could be updated in simulation through TraCI functions. A definition of a traffic light program within an additional-file looks like this:

    <add>
    -    <tlLogic id="2881" offset="0" programID="NEMA" type="NEMA">
    +    <tlLogic id="2881" offset="0" programID="NEMA" type="NEMA" offset="10">
             <param key="detector-length" value="20"/>
             <param key="detector-length-leftTurnLane" value="10"/>
             <param key="total-cycle-length" value="120"/>
    @@ -211,9 +212,11 @@
             <param key="ring2" value="0,4,0,6"/>
             <param key="barrierPhases" value="4,4"/>
             <param key="coordinate-mode" value="true"/>
    -        <param key="coordinatePhases" value="2,6"/>
    -        <param key="offset" value="10" />
    +        <param key="barrier2Phases" value="2,6"/>     
    +        <param key="minRecall" value="2,6"/>     
    +        <param key="maxRecall" value=""/>     
             <param key="whetherOutputState" value="true"/>
    +        <param key="fixForceOff" value="false"/>
     
             <phase duration="99" minDur="6"  maxDur="16" vehext="2" yellow="4" red="1" name="1" state="grrrrrrGGrrr"/>
             <phase duration="99" minDur="10" maxDur="67" vehext="2" yellow="4" red="1" name="2" state="grrrrrrrrGGG"/>
    @@ -252,7 +255,7 @@
     
     offset
     int
    -The offset value here will be overwritten by the param offset below
    +The offset value in seconds. Default to 0. Only effective when the controller is in coordinated mode. The reference to the offset is always the end of the coordinated phases.
     
     
     
    @@ -303,19 +306,29 @@
     Default to false. True if the controller is in coordinated mode.
     
     
    -coordinatePhases
    +barrier2Phases
     string
     One set of phases, seperated by comma (','), that need to end together. This defines another barrier. If in coordinated mode, this set of phases are the coordinated phases. Usually phase 2 and 6, i.e., "2,6".
     
     
    -offset
    -double
    -The offset value in seconds. Default to 0. Only effective when the controller is in coordinated mode. The reference to the offset is always the end of the coordinated phases.
    +minRecall
    +string
    +One set of phases, seperated by comma (','), that will get activated no matter if the corresponding detectors will be activated or not. The duration of the phase activation will be between minDur and maxDur of the phase. E.g., "2,6". The value will be default to "1,2,3,4,5,6,7,8" if not set (all the existing phases will be called).
    +
    +
    +maxRecall
    +string
    +One set of phases, seperated by comma (','), that will get activated no matter if the corresponding detectors will be activated or not. The duration of the phase activation will be the maxDur of the phase. If you set all the phases to have maxRecall, the controller will behave as a fixed time controller with the green times being the maxDur of the phases. The value will be default to empty ("") if not set.
    +
    +
    +fixForceOff
    +bool (true or false)
    +If true, the controller will be in fixed force-off mode. This permits non-coordinated phases to use the unused time of previous phases. If false, the controller will be in floating force-off mode. default false
     
     
     whetherOutputState
     bool (true or false)
    -Whether record the signal phase change events. This could be used for generating Automated Traffic Signal Performance Measures (ATSPM).
    +Whether record the signal phase change events. This could be used for generating Automated Traffic Signal Performance Measures (ATSPM). The value will be default to false if not set.
     
     
     show-detectors
    @@ -386,6 +399,13 @@
     
  • traci.trafficlight.setNemaCycleLength(tlsID, cycleLength): the cycle length may change when you update the splits/max green. You need to set the new cycle length to make the new timing work without problems.
  • All the updates in the signal timing parameters in the NEMA-phase controller will happen after the current cycle ended.

    +

    Configuration Errors#

    +

    The following errors may be raised:

    +
      +
    • the phases before barrier X from both rings do not add up: EXPLANATION FORTHCOMING
    • +
    • Ring X does not add to cycle length: EXPLANATION FORTHCOMING
    • +
    +

    To simulate misconfigured controllers, both errors may be ignored by setting <param key="ignore-errors" value="true"/>.

    @@ -393,10 +413,10 @@
    -
    This page was last edited on: 22 November 2021 +
    This page was last edited on: 21 January 2022
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/OppositeDirectionDriving.html sumo-1.12.0/docs/userdoc/Simulation/OppositeDirectionDriving.html --- sumo-1.11.0/docs/userdoc/Simulation/OppositeDirectionDriving.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/OppositeDirectionDriving.html 2022-01-24 23:06:32.000000000 +0000 @@ -244,7 +244,7 @@
    This page was last edited on: 17 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/AmitranOutput.html sumo-1.12.0/docs/userdoc/Simulation/Output/AmitranOutput.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/AmitranOutput.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/AmitranOutput.html 2022-01-24 23:06:32.000000000 +0000 @@ -225,7 +225,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/Amitran_Traffic_Measures.html sumo-1.12.0/docs/userdoc/Simulation/Output/Amitran_Traffic_Measures.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/Amitran_Traffic_Measures.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/Amitran_Traffic_Measures.html 2022-01-24 23:06:32.000000000 +0000 @@ -335,7 +335,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/Binary.html sumo-1.12.0/docs/userdoc/Simulation/Output/Binary.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/Binary.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/Binary.html 2022-01-24 23:06:32.000000000 +0000 @@ -304,7 +304,7 @@
    This page was last edited on: 23 September 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/Collisions.html sumo-1.12.0/docs/userdoc/Simulation/Output/Collisions.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/Collisions.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/Collisions.html 2022-01-24 23:06:32.000000000 +0000 @@ -277,7 +277,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/EmissionOutput.html sumo-1.12.0/docs/userdoc/Simulation/Output/EmissionOutput.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/EmissionOutput.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/EmissionOutput.html 2022-01-24 23:06:32.000000000 +0000 @@ -345,7 +345,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/FCDOutput.html sumo-1.12.0/docs/userdoc/Simulation/Output/FCDOutput.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/FCDOutput.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/FCDOutput.html 2022-01-24 23:06:32.000000000 +0000 @@ -359,7 +359,7 @@ information to the output
  • --fcd-output.distance will add kilometrage information to the output
  • --fcd-output.acceleration will add acceleration data to the output (also lateral acceleration when using the sublane model
  • -
  • --fcd-output.max-leader-distance FLOAT will add attributes leaderGap, leaderSpeed, leaderID whenever a vehicle has a leader within the given distance
  • +
  • --fcd-output.max-leader-distance FLOAT will add attributes leaderGap, leaderSpeed, leaderID whenever a vehicle has a leader within the given distance. Otherwise, leaderID will be "" and leaderGap, leaderSpeed will be -1.
  • --fcd-output.params KEY1,KEY2,... adds generic parameters to the output (supports device and carfollowmodel parameters as well as arbitrary user-define values)
  • --fcd-output.attributes ATTR1,ATTR2,... restricts written attributes to the given list (to reduce output).
    • The special attribute vehicle may be given to add a vehicle attribute to each person (and thereby distinguish riding from walking persons).
    • @@ -378,10 +378,10 @@
      -
      This page was last edited on: 03 March 2021 +
      This page was last edited on: 21 January 2022
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/FullOutput.html sumo-1.12.0/docs/userdoc/Simulation/Output/FullOutput.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/FullOutput.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/FullOutput.html 2022-01-24 23:06:32.000000000 +0000 @@ -441,7 +441,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/index.html sumo-1.12.0/docs/userdoc/Simulation/Output/index.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/index.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/index.html 2022-01-24 23:06:32.000000000 +0000 @@ -535,7 +535,7 @@
      This page was last edited on: 28 October 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/Induction_Loops_Detectors_(E1).html sumo-1.12.0/docs/userdoc/Simulation/Output/Induction_Loops_Detectors_(E1).html --- sumo-1.11.0/docs/userdoc/Simulation/Output/Induction_Loops_Detectors_(E1).html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/Induction_Loops_Detectors_(E1).html 2022-01-24 23:06:32.000000000 +0000 @@ -350,7 +350,8 @@

      Further Notes#

      @@ -361,10 +362,10 @@
      -
      This page was last edited on: 29 September 2021 +
      This page was last edited on: 20 January 2022
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/Instantaneous_Induction_Loops_Detectors.html sumo-1.12.0/docs/userdoc/Simulation/Output/Instantaneous_Induction_Loops_Detectors.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/Instantaneous_Induction_Loops_Detectors.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/Instantaneous_Induction_Loops_Detectors.html 2022-01-24 23:06:32.000000000 +0000 @@ -372,7 +372,7 @@
      This page was last edited on: 12 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/Lanearea_Detectors_(E2).html sumo-1.12.0/docs/userdoc/Simulation/Output/Lanearea_Detectors_(E2).html --- sumo-1.11.0/docs/userdoc/Simulation/Output/Lanearea_Detectors_(E2).html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/Lanearea_Detectors_(E2).html 2022-01-24 23:06:32.000000000 +0000 @@ -402,12 +402,12 @@ nVehEntered # -The number of vehicles that entered the detector in the corresponding interval. +The number of vehicles that entered the detector in the corresponding interval. (vehicle front has passed 'pos') nVehLeft # -The number of vehicles that left the detector in the corresponding interval. +The number of vehicles that left the detector in the corresponding interval. (vehicle back has passed 'endPos') nVehSeen @@ -513,6 +513,9 @@

      Further notes#

        +
      • Simulated lane area detectors can be accessed using + TraCI. If no XML output is + needed, the attribute file="NUL" may be used.
      • You can generate detector definitions automatically. See output tools for more information.
      • The mean speed given by the detector is rather the length divided by @@ -536,10 +539,10 @@
        -
        This page was last edited on: 29 September 2021 +
        This page was last edited on: 20 January 2022
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/Lanechange.html sumo-1.12.0/docs/userdoc/Simulation/Output/Lanechange.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/Lanechange.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/Lanechange.html 2022-01-24 23:06:32.000000000 +0000 @@ -343,7 +343,7 @@
        This page was last edited on: 03 March 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/Lane-_or_Edge-based_Emissions_Measures.html sumo-1.12.0/docs/userdoc/Simulation/Output/Lane-_or_Edge-based_Emissions_Measures.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/Lane-_or_Edge-based_Emissions_Measures.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/Lane-_or_Edge-based_Emissions_Measures.html 2022-01-24 23:06:32.000000000 +0000 @@ -508,7 +508,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/Lane-_or_Edge-based_Noise_Measures.html sumo-1.12.0/docs/userdoc/Simulation/Output/Lane-_or_Edge-based_Noise_Measures.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/Lane-_or_Edge-based_Noise_Measures.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/Lane-_or_Edge-based_Noise_Measures.html 2022-01-24 23:06:32.000000000 +0000 @@ -361,7 +361,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/Lane-_or_Edge-based_Traffic_Measures.html sumo-1.12.0/docs/userdoc/Simulation/Output/Lane-_or_Edge-based_Traffic_Measures.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/Lane-_or_Edge-based_Traffic_Measures.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/Lane-_or_Edge-based_Traffic_Measures.html 2022-01-24 23:06:32.000000000 +0000 @@ -585,7 +585,7 @@
        This page was last edited on: 10 November 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/Multi-Entry-Exit_Detectors_(E3).html sumo-1.12.0/docs/userdoc/Simulation/Output/Multi-Entry-Exit_Detectors_(E3).html --- sumo-1.11.0/docs/userdoc/Simulation/Output/Multi-Entry-Exit_Detectors_(E3).html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/Multi-Entry-Exit_Detectors_(E3).html 2022-01-24 23:06:32.000000000 +0000 @@ -396,7 +396,8 @@
      • All measurements concerning durations refer to the end of the relevant interval
      • Simulated multi-entry-exit detectors can be accessed using - TraCI
      • + TraCI. If no XML output is + needed, the attribute file="NUL" may be used.
      • You can generate detector definitions automatically. See output tools for more information.
      • The simulation does not check whether the area defined by the @@ -433,10 +434,10 @@
        -
        This page was last edited on: 29 September 2021 +
        This page was last edited on: 20 January 2022
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/PersonSummary.html sumo-1.12.0/docs/userdoc/Simulation/Output/PersonSummary.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/PersonSummary.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/PersonSummary.html 2022-01-24 23:06:32.000000000 +0000 @@ -281,7 +281,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/QueueOutput.html sumo-1.12.0/docs/userdoc/Simulation/Output/QueueOutput.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/QueueOutput.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/QueueOutput.html 2022-01-24 23:06:32.000000000 +0000 @@ -260,7 +260,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/RawDump.html sumo-1.12.0/docs/userdoc/Simulation/Output/RawDump.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/RawDump.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/RawDump.html 2022-01-24 23:06:32.000000000 +0000 @@ -320,7 +320,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/RouteProbe.html sumo-1.12.0/docs/userdoc/Simulation/Output/RouteProbe.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/RouteProbe.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/RouteProbe.html 2022-01-24 23:06:32.000000000 +0000 @@ -257,7 +257,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/SSM_Device.html sumo-1.12.0/docs/userdoc/Simulation/Output/SSM_Device.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/SSM_Device.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/SSM_Device.html 2022-01-24 23:06:32.000000000 +0000 @@ -1000,7 +1000,7 @@
        This page was last edited on: 16 November 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/StatisticOutput.html sumo-1.12.0/docs/userdoc/Simulation/Output/StatisticOutput.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/StatisticOutput.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/StatisticOutput.html 2022-01-24 23:06:32.000000000 +0000 @@ -544,7 +544,7 @@
        This page was last edited on: 13 April 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/StopOutput.html sumo-1.12.0/docs/userdoc/Simulation/Output/StopOutput.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/StopOutput.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/StopOutput.html 2022-01-24 23:06:32.000000000 +0000 @@ -243,6 +243,16 @@ The time at which the vehicle resumed driving +delay +time (s) +The difference between 'ended' and 'until' (or -1 if until was not set) + + +arrivalDelay +time (s) +The difference betweend 'started' and 'arrival' (only if stop had attribute 'arrival' set) + + initialPersons int The number of persons in the vehicle when arriving at the stop @@ -301,10 +311,10 @@
        -
        This page was last edited on: 11 February 2021 +
        This page was last edited on: 29 December 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/Summary.html sumo-1.12.0/docs/userdoc/Simulation/Output/Summary.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/Summary.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/Summary.html 2022-01-24 23:06:32.000000000 +0000 @@ -305,7 +305,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/Traffic_Lights.html sumo-1.12.0/docs/userdoc/Simulation/Output/Traffic_Lights.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/Traffic_Lights.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/Traffic_Lights.html 2022-01-24 23:06:32.000000000 +0000 @@ -507,7 +507,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/TripInfo.html sumo-1.12.0/docs/userdoc/Simulation/Output/TripInfo.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/TripInfo.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/TripInfo.html 2022-01-24 23:06:32.000000000 +0000 @@ -516,7 +516,7 @@
        This page was last edited on: 15 April 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/VehRoutes.html sumo-1.12.0/docs/userdoc/Simulation/Output/VehRoutes.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/VehRoutes.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/VehRoutes.html 2022-01-24 23:06:32.000000000 +0000 @@ -338,7 +338,7 @@
        This page was last edited on: 23 September 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/VTKOutput.html sumo-1.12.0/docs/userdoc/Simulation/Output/VTKOutput.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/VTKOutput.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/VTKOutput.html 2022-01-24 23:06:32.000000000 +0000 @@ -213,7 +213,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Output/VTypeProbe.html sumo-1.12.0/docs/userdoc/Simulation/Output/VTypeProbe.html --- sumo-1.11.0/docs/userdoc/Simulation/Output/VTypeProbe.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Output/VTypeProbe.html 2022-01-24 23:06:32.000000000 +0000 @@ -319,7 +319,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/ParkingArea.html sumo-1.12.0/docs/userdoc/Simulation/ParkingArea.html --- sumo-1.11.0/docs/userdoc/Simulation/ParkingArea.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/ParkingArea.html 2022-01-24 23:06:32.000000000 +0000 @@ -432,7 +432,7 @@
        This page was last edited on: 19 October 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Pedestrians.html sumo-1.12.0/docs/userdoc/Simulation/Pedestrians.html --- sumo-1.11.0/docs/userdoc/Simulation/Pedestrians.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Pedestrians.html 2022-01-24 23:06:32.000000000 +0000 @@ -154,6 +154,9 @@ → Explicit specification of sidewalks
      • +
      +

      Customer Stops#

      +

      Taxis will stop to pick-up and drop-off customers. The 'actType' attribute of a stop indicates the purpose ('pickup' / 'dropOff') as well as the ids of the customers and their reservation id. Stop attributes can be configured using generic parameters <vType> or <vehicle> definition of the taxi:

      +
          <vType id="taxi" vClass="taxi">
      +        <param key="has.taxi.device" value="true"/>
      +        <param key="device.taxi.pickUpDuration" value="0"/>
      +        <param key="device.taxi.dropOffDuration" value="60"/>
      +        <param key="device.taxi.parking" value="false"/>
      +    </vType>
      +
      + +
        +
      • duration for pick-up stop can be configurd with vType/vehicle param "device.taxi.pickupDuration" (default "0")
      • +
      • duration for drop-off stop can be configurd with vType/vehicle param "device.taxi.dropOffDuration" (default "60")
      • +
      +

      By default, vehicle stops will have attribute parking="true" which means that the taxi will not block a driving lane. This can be changed by setting +param "device.taxi.parking" to "false".

      TraCI#

      To couple an external dispatch algorithm to SUMO, the following TraCI functions are provided:

      @@ -401,10 +426,10 @@
      -
      This page was last edited on: 01 November 2021 +
      This page was last edited on: 30 November 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Traffic_Lights.html sumo-1.12.0/docs/userdoc/Simulation/Traffic_Lights.html --- sumo-1.11.0/docs/userdoc/Simulation/Traffic_Lights.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Traffic_Lights.html 2022-01-24 23:06:32.000000000 +0000 @@ -200,9 +200,15 @@ → Lane-specific max-gap + + + + +
    @@ -641,6 +654,13 @@

    Each lane incoming to the traffic light will receive a detector. However, not all detectors can be used in all phases. In the current implementation, detectors for actuation are only used if all connections from the detector lane gets the unconditional green light ('G') in a particular phase. This is done to prevent useless phase extensions when the first vehicle on a given lane is not allowed to drive. A simple fix is often the provide dedicate left turn lanes.

    +

    The detector names take the form TLSID_PROGRAMID_EDGEINDEX.LANEINDEX where

    +
      +
    • TLSID is the id of the tlLogic element
    • +
    • PROGRAMID is the value attribute 'programID'
    • +
    • EDGEINDEX is a running index that starts at 0 for edge that approaches tls linkIndex 0 (typically the northern approach)
    • +
    • LANEINDEX is a running index for the current edge that starts at the first vehicular lane (sidewalks do not count)
    • +

    Note

    Sumo will issue a warning of the form "... has no controlling detector" if a phase or link index does not have usable detectors.

    @@ -673,6 +693,8 @@
  • show-detectors controls whether generated detectors will be visible or hidden in sumo-gui. The default for all traffic lights can be set with option --tls.actuated.show-detectors. It is also possible to toggle this value from within the GUI by right-clicking on a traffic light.
  • parameters vTypes, file and freq have the same meaning as for regular induction loop detectors.
  • +
  • coordinated (true/false) Influence there reference point for time-in-cycle when using coordination
  • +
  • cycleTime sets the cycle time (in s) when using coordination. Defaults to the sum of all phase 'durations' values.
  • Some parameters are only used when a signal plan with dynamic phase selection is active:

      @@ -694,6 +716,29 @@
         <param key="max-gap:gneE42_2" value="2"/>
       
      +

      Coordination#

      +

      Actuated phases (minDur != maxDur) can be coordinated by adding attributes 'earliestEnd' and 'latestEnd'. +If these values are used, each step in the traffic light plan is assigned a 'timeInCycle' value depending on the value of param 'coordinated' (default 'false').

      +
        +
      • coordinated=true: timeInCycle = (simulationTime - offset) % cycleTime (where cycleTime is taken from the param with key=cycleTime)
      • +
      • coordinated=false: timeInCycle = time since last switching into phase 0
      • +
      +

      If 'earliestEnd' is set, a phase can not end while timeInCycle < earliestEnd (effectively increasing minDur) +If 'latestEnd' is set, a phase cannot be prolonged when timeInCycle = latestEnd (effectively reducing maxDur).

      +

      When setting 'latestEnd' < 'earliestEnd', the phase can be extended into the next cycle. +If both values are defined and a phase has already started and ended in the +current cycle, both values will be shifted into the next cycle to avoid having a +phase run more than once in the same cycle (this only happens when param +'coordinated' is set to 'true').

      +
      <tlLogic id="0" programID="my_program" offset="10" type="actuated">
      +  <param key="coordinated" value="true"/>
      +  <param key="cycleTime" value="60"/>
      +
      +  <phase duration="31" minDur="5" maxDur="45" state="GGggrrrrGGggrrrr" earliestEnd="10" latestEnd="50"/>
      +  ...
      +</tlLogic>
      +
      +

      Dynamic Phase Selection (Phase Skipping)#

      When a phase uses attribute 'next' with a list of indices. The next phase is chosen dynamically based on the detector status of all candidate phases according to the following algorithm:

        @@ -710,6 +755,94 @@

      Examples for this type of traffic light logic can be found in <SUMO_HOME>/tests/sumo/basic/tls/actuated/dualring_simple.

      The helper script [tls_buildTransitions.py] can be used to generate such logics from simplified definitions.

      +

      Custom Switching Rules#

      +

      By default, all detectors use the same time gaps and there are pre-defined rules +that govern which detectors are used or ignored in each phase. If more +flexibility is needed, custom conditions can be defined by using the phase +attributes 'earlyTarget' and 'finalTarget' to define logical expressions.

      +

      If the controller is in an actuated phase (minDur < maxDur) and could switch +into a new phase, the attribute 'earlyTarget' of the new phase is evaluated. If +the expression evalutes to 'true', the controller switches into the new phase. +Otherwise it remains in the current phase. If the current phase has multiple successors (attribute 'next'), +the candidates are evaluated from left to right and the first candidate where 'earlyTarget' evaluates to true is used.

      +

      If the controller has reached the maximum duration of it's current phase and +multiple successor phases are defined with attribute 'next', the +attribute 'finalTarget' of all candidate phases is evaluated from left to right. +The first phase where the expression evaluates to 'true' is used. +Otherwise, the rightmost phase in the next-list is used.

      +

      The following elements are permitted in an expression for attributes +'earlyTarget' and 'finalTarget':

      +
        +
      • numbers
      • +
      • comparators <,>,=,<=,>=
      • +
      • mathematical operators +,-,,/,*
      • +
      • logical operators 'or', 'and', '!'
      • +
      • parentheses (,)
      • +
      • pre-defined functions:
          +
        • 'z:DETID': returns the time gap since the last vehicle detection for inductionLoop detector with id 'DETID' or id 'TLSID_PROGRAMID_DETID' (DETID may ommmit the the prefix 'TLSID_PROGRAMID_')
        • +
        • 'a:DETID': returns true (1) if a vehicle is on detector with id 'DETID' and + false (0) otherwise. Supports inductionLoop and laneAreaDetectors. Also supports omitting the prefix of the detector id. (see 'z:')
        • +
        • 'g:TLSINDEX': returns current green duration in seconds for link with the given index
        • +
        • 'r:TLSINDEX': returns current red duration in seconds for link with the given index
        • +
        +
      • +
      • Symbolic names for pre-defined expressions
      • +
      +

      The following constraints apply to expressions:

      +
        +
      • all elements of an expression must be separated by a space character (' ') + with the exception of the operator '!' (logical negation) which must precede it's operand without a space.
      • +
      +

      Named Expressions#

      +

      To organize expressions, the element <condition> may be used as a child element +of <tlLogic> to define named expressions that can be referenced in other expressions:

      +
      <tlLogic id="example" type="actuated" ...>
      +   <condition id="C3" value="z:det5 > 5"/>
      +   <condition id="C4" value="C3 and z:det6 < 2"/>
      +   <condition id="C5" value="g:3 > 20"/>
      +   ...
      +
      + +
        +
      • condition id must be an alphanumeric string without spaces and without the ':'-character
      • +
      • value may be any expression which is permitted for 'earlyTarget' or 'finalTarget'
      • +
      +

      Condition values can be visualized while the simulation is running. It may be useful to add extra conditions that are only used for debugging purposes.

      +

      Examples#

      +

      Diverse Logical Conditions#

      +
      <tlLogic id="example" type="actuated" ...>
      +   <condition id="C3" value="z:Det2.0 > 5"/>
      +   <condition id="C4" value="C3 and z:Det0.0 < 2"/>
      +   <condition id="C5" value="r:0 > 60"/>
      +   <phase ... next="1 2"/>
      +   <phase ... earlyTarget="C3" finalTarget="!C4"/>
      +   <phase ... earlyTarget="(z:D2.0 > 3) and (z:D3.1 <= 4)" finalTarget="C5 or (z:Det3.1 = 0)"/>
      +</tlLogic>
      +
      + +

      Default Gap Control Logic#

      +

      The default gap control logic, replicated with custom conditions. A complete scenario including network and detector definitions can be downloaded here:

      +
      <tlLogic id="C" type="actuated" programID="P1" offset="0">
      +        <phase duration="33" state="GgrrGgrr" minDur="5" maxDur="60" />
      +        <phase duration="3"  state="ygrrygrr" earlyTarget="NS"/>
      +        <phase duration="6"  state="rGrrrGrr" minDur="5" maxDur="60" />
      +        <phase duration="3"  state="ryrrryrr" earlyTarget="NSL"/>
      +        <phase duration="33" state="rrGgrrGg" minDur="5" maxDur="60" />
      +        <phase duration="3"  state="rrygrryg" earlyTarget="EW"/>
      +        <phase duration="6"  state="rrrGrrrG" minDur="5" maxDur="60" />
      +        <phase duration="3"  state="rrryrrry" earlyTarget="EWL"/>
      +
      +        <condition id="NS"  value="z:D0.0 > 3 and z:D2.0 > 3"/>
      +        <condition id="NSL" value="z:D0.1 > 3 and z:D2.1 > 3"/>
      +        <condition id="EW"  value="z:D1.0 > 3 and z:D3.0 > 3"/>
      +        <condition id="EWL" value="z:D1.1 > 3 and z:D3.1 > 3"/>
      +    </tlLogic>
      +
      + +
      +

      Note

      +

      The the expression 'z:D0.0' retrieves the detection gap of detector 'C_PI_D0.0' but the prefix 'C_PI_' may be omitted.

      +

      Visualization#

      By setting the sumo option --tls.actuated.show-detectors the default visibility of detectors can be set. Also, in sumo-gui detectors can be @@ -1100,6 +1233,34 @@

      SUMO can load multiple traffic light programs from the .net.mxl file and from additional files. Using the TraCI function setProgram, a script can switch between them.

      +

      Signal Plan Visualization#

      +

      In sumo-gui, right-clicking on a traffic light allows opening up a menu that contains the items 'Show Phases' and 'Track Phases'. +These items open up new windows which are explained below

      +

      Show Phases#

      +

      This shows the signal states of all controlled links for the complete list of defined phases. Here, time is on the x-axis and there is one row for each link index. The time axis in the bottom shows the time of each phase change starting at 0.

      +

      The time can be switched between the following styles +- Seconds: absolute simulation time in seconds +- MM::SS: current minute and second (values repeat every hour) +- Time in Cycle: current second within the traffic light cycle (resets either when starting phase 0 or in some alignment to absolute simulation time).

      +

      Optionally, the green phase durations can be written for every phase. +The top row contains the phase index but it is possible to change this so it shows phase names instead. (phase names are optional, and only the names of 'Green' phases are shown for brevity)

      +

      show_phases.png

      +
      +

      Note

      +

      All phases will be shown in definition order. This may be different from their operational sequence if phase attribute 'next' is used.

      +
      +

      Track Phases#

      +

      This shows the evoluation of signal states for all controlled links for the last X seconds of operation (set via the 'Range' value). The basic layout is the same as for the 'Show Phases' Window.

      +

      The following additional features may be activated via checkboxes:

      + +
      +

      Note

      +

      When the mouse is placed over an active condition block, the numerical value of the condition will be shown.

      +
      +

      track_phases.png

      @@ -1107,10 +1268,10 @@
      -
      This page was last edited on: 22 November 2021 +
      This page was last edited on: 16 January 2022
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Turnarounds.html sumo-1.12.0/docs/userdoc/Simulation/Turnarounds.html --- sumo-1.11.0/docs/userdoc/Simulation/Turnarounds.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Turnarounds.html 2022-01-24 23:06:32.000000000 +0000 @@ -245,7 +245,7 @@
      This page was last edited on: 12 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Vaporizer.html sumo-1.12.0/docs/userdoc/Simulation/Vaporizer.html --- sumo-1.11.0/docs/userdoc/Simulation/Vaporizer.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Vaporizer.html 2022-01-24 23:06:32.000000000 +0000 @@ -198,7 +198,7 @@
      This page was last edited on: 28 May 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Variable_Speed_Signs.html sumo-1.12.0/docs/userdoc/Simulation/Variable_Speed_Signs.html --- sumo-1.11.0/docs/userdoc/Simulation/Variable_Speed_Signs.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Variable_Speed_Signs.html 2022-01-24 23:06:32.000000000 +0000 @@ -249,7 +249,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Simulation/VehicleInsertion.html sumo-1.12.0/docs/userdoc/Simulation/VehicleInsertion.html --- sumo-1.11.0/docs/userdoc/Simulation/VehicleInsertion.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/VehicleInsertion.html 2022-01-24 23:06:32.000000000 +0000 @@ -283,6 +283,7 @@
    • insert with a fixed departSpeed (numerical value) and set option --ignore-route-errors. Vehicles will be inserted with unsafe speeds at the specified time if emergency-braking would still allow collision-free dynamics
    • +
    • inserted vehicles with a homogeneous departSpeed by setting departSpeed="last" or departSpeed="avg"`
    • use traci.vehicle.moveTo or @@ -314,6 +315,7 @@
    • The departure edge can be determined at run-time when using Traffic Assignment Zones (TAZ)
    • +
    • Table of insertion capacity achievable with different options and insertion attributes
    @@ -322,10 +324,10 @@
    -
    This page was last edited on: 11 February 2021 +
    This page was last edited on: 04 January 2022
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/VehiclePermissions.html sumo-1.12.0/docs/userdoc/Simulation/VehiclePermissions.html --- sumo-1.11.0/docs/userdoc/Simulation/VehiclePermissions.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/VehiclePermissions.html 2022-01-24 23:06:32.000000000 +0000 @@ -253,7 +253,7 @@
    This page was last edited on: 12 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/VehicleSpeed.html sumo-1.12.0/docs/userdoc/Simulation/VehicleSpeed.html --- sumo-1.11.0/docs/userdoc/Simulation/VehicleSpeed.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/VehicleSpeed.html 2022-01-24 23:06:32.000000000 +0000 @@ -315,7 +315,7 @@
    This page was last edited on: 14 August 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Waterways.html sumo-1.12.0/docs/userdoc/Simulation/Waterways.html --- sumo-1.11.0/docs/userdoc/Simulation/Waterways.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Waterways.html 2022-01-24 23:06:32.000000000 +0000 @@ -218,7 +218,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Simulation/Why_Vehicles_are_teleporting.html sumo-1.12.0/docs/userdoc/Simulation/Why_Vehicles_are_teleporting.html --- sumo-1.11.0/docs/userdoc/Simulation/Why_Vehicles_are_teleporting.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Simulation/Why_Vehicles_are_teleporting.html 2022-01-24 23:06:32.000000000 +0000 @@ -283,7 +283,7 @@
    This page was last edited on: 14 June 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/sitemap.xml sumo-1.12.0/docs/userdoc/sitemap.xml --- sumo-1.11.0/docs/userdoc/sitemap.xml 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/sitemap.xml 2022-01-24 23:06:32.000000000 +0000 @@ -1,31 +1,31 @@ https://sumo.dlr.de/docs/index.html - 2021-11-22 + 2022-01-24 daily https://sumo.dlr.de/docs/Tutorials/index.html - 2021-11-22 + 2022-01-24 daily https://sumo.dlr.de/docs/FAQ.html - 2021-11-22 + 2022-01-24 daily https://sumo.dlr.de/docs/Downloads.html - 2021-11-22 + 2022-01-24 daily https://sumo.dlr.de/docs/Publications.html - 2021-11-22 + 2022-01-24 daily https://sumo.dlr.de/docs/Developer/index.html - 2021-11-22 + 2022-01-24 daily https://sumo.dlr.de/docs/ChangeLog.html - 2021-11-22 + 2022-01-24 daily \ No newline at end of file Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/docs/userdoc/sitemap.xml.gz and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/docs/userdoc/sitemap.xml.gz differ diff -Nru sumo-1.11.0/docs/userdoc/Specification/Containers.html sumo-1.12.0/docs/userdoc/Specification/Containers.html --- sumo-1.11.0/docs/userdoc/Specification/Containers.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Specification/Containers.html 2022-01-24 23:06:32.000000000 +0000 @@ -636,7 +636,7 @@
    This page was last edited on: 12 March 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Specification/Duarouter.html sumo-1.12.0/docs/userdoc/Specification/Duarouter.html --- sumo-1.11.0/docs/userdoc/Specification/Duarouter.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Specification/Duarouter.html 2022-01-24 23:06:32.000000000 +0000 @@ -285,7 +285,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Specification/index.html sumo-1.12.0/docs/userdoc/Specification/index.html --- sumo-1.11.0/docs/userdoc/Specification/index.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Specification/index.html 2022-01-24 23:06:32.000000000 +0000 @@ -1117,7 +1117,7 @@
    This page was last edited on: 12 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Specification/Logistics.html sumo-1.12.0/docs/userdoc/Specification/Logistics.html --- sumo-1.11.0/docs/userdoc/Specification/Logistics.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Specification/Logistics.html 2022-01-24 23:06:32.000000000 +0000 @@ -312,7 +312,7 @@
    This page was last edited on: 10 March 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Specification/Persons.html sumo-1.12.0/docs/userdoc/Specification/Persons.html --- sumo-1.11.0/docs/userdoc/Specification/Persons.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Specification/Persons.html 2022-01-24 23:06:32.000000000 +0000 @@ -793,7 +793,7 @@
    This page was last edited on: 16 September 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Students_And_Support.html sumo-1.12.0/docs/userdoc/Students_And_Support.html --- sumo-1.11.0/docs/userdoc/Students_And_Support.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Students_And_Support.html 2022-01-24 23:06:32.000000000 +0000 @@ -383,7 +383,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/SUMO_at_a_Glance.html sumo-1.12.0/docs/userdoc/SUMO_at_a_Glance.html --- sumo-1.11.0/docs/userdoc/SUMO_at_a_Glance.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/SUMO_at_a_Glance.html 2022-01-24 23:06:32.000000000 +0000 @@ -529,7 +529,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/SUMO_edge_type_file.html sumo-1.12.0/docs/userdoc/SUMO_edge_type_file.html --- sumo-1.11.0/docs/userdoc/SUMO_edge_type_file.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/SUMO_edge_type_file.html 2022-01-24 23:06:32.000000000 +0000 @@ -573,7 +573,7 @@
    This page was last edited on: 28 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/sumo-gui.html sumo-1.12.0/docs/userdoc/sumo-gui.html --- sumo-1.11.0/docs/userdoc/sumo-gui.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/sumo-gui.html 2022-01-24 23:06:32.000000000 +0000 @@ -466,8 +466,9 @@
  • Select junction foe vehicles (vehicles). Requires coloring vehicles by selection to be visible
  • Close for traffic (edges and lanes)
  • -
  • Switch programs (traffic lights)
  • Set speed limit (variable speed sign)
  • +
  • Switch programs (traffic lights)
  • +
  • Visualize Signal Plans (traffic lights)
  • Selecting Objects#

    sumo-gui allows for the selection of arbitrary @@ -756,6 +757,10 @@ +

    +

    Note

    +

    When using an imgFile as the shape, it is necessary to select the vehicles to show as "raster images" in the viewsettings menu.

    +

    Table 1.2 Vehicle coloring schemes and boundaries

    @@ -1556,10 +1561,10 @@
    -
    This page was last edited on: 10 November 2021 +
    This page was last edited on: 15 January 2022
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/sumo.html sumo-1.12.0/docs/userdoc/sumo.html --- sumo-1.11.0/docs/userdoc/sumo.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/sumo.html 2022-01-24 23:06:32.000000000 +0000 @@ -1813,6 +1813,10 @@ + + + + @@ -2013,10 +2017,10 @@
    -
    This page was last edited on: 17 November 2021 +
    This page was last edited on: 23 January 2022
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/SumoWorkshop2010.html sumo-1.12.0/docs/userdoc/SumoWorkshop2010.html --- sumo-1.11.0/docs/userdoc/SumoWorkshop2010.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/SumoWorkshop2010.html 2022-01-24 23:06:32.000000000 +0000 @@ -298,7 +298,7 @@
    This page was last edited on: 14 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Theory/Traffic_Simulations.html sumo-1.12.0/docs/userdoc/Theory/Traffic_Simulations.html --- sumo-1.11.0/docs/userdoc/Theory/Traffic_Simulations.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Theory/Traffic_Simulations.html 2022-01-24 23:06:32.000000000 +0000 @@ -239,7 +239,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/ToC_Device.html sumo-1.12.0/docs/userdoc/ToC_Device.html --- sumo-1.11.0/docs/userdoc/ToC_Device.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/ToC_Device.html 2022-01-24 23:06:32.000000000 +0000 @@ -411,7 +411,7 @@
    This page was last edited on: 15 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Assign.html sumo-1.12.0/docs/userdoc/Tools/Assign.html --- sumo-1.11.0/docs/userdoc/Tools/Assign.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Assign.html 2022-01-24 23:06:32.000000000 +0000 @@ -307,7 +307,7 @@
    This page was last edited on: 24 August 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Build.html sumo-1.12.0/docs/userdoc/Tools/Build.html --- sumo-1.11.0/docs/userdoc/Tools/Build.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Build.html 2022-01-24 23:06:32.000000000 +0000 @@ -252,7 +252,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Detector.html sumo-1.12.0/docs/userdoc/Tools/Detector.html --- sumo-1.11.0/docs/userdoc/Tools/Detector.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Detector.html 2022-01-24 23:06:32.000000000 +0000 @@ -283,7 +283,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/devel.html sumo-1.12.0/docs/userdoc/Tools/devel.html --- sumo-1.11.0/docs/userdoc/Tools/devel.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/devel.html 2022-01-24 23:06:32.000000000 +0000 @@ -205,7 +205,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/District.html sumo-1.12.0/docs/userdoc/Tools/District.html --- sumo-1.11.0/docs/userdoc/Tools/District.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/District.html 2022-01-24 23:06:32.000000000 +0000 @@ -257,7 +257,7 @@
    This page was last edited on: 13 September 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Drt.html sumo-1.12.0/docs/userdoc/Tools/Drt.html --- sumo-1.11.0/docs/userdoc/Tools/Drt.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Drt.html 2022-01-24 23:06:32.000000000 +0000 @@ -242,7 +242,7 @@
    This page was last edited on: 30 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Emissions.html sumo-1.12.0/docs/userdoc/Tools/Emissions.html --- sumo-1.11.0/docs/userdoc/Tools/Emissions.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Emissions.html 2022-01-24 23:06:32.000000000 +0000 @@ -487,7 +487,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Import/GTFS.html sumo-1.12.0/docs/userdoc/Tools/Import/GTFS.html --- sumo-1.11.0/docs/userdoc/Tools/Import/GTFS.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Import/GTFS.html 2022-01-24 23:06:32.000000000 +0000 @@ -239,7 +239,7 @@
    This page was last edited on: 30 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Import/MATSim.html sumo-1.12.0/docs/userdoc/Tools/Import/MATSim.html --- sumo-1.11.0/docs/userdoc/Tools/Import/MATSim.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Import/MATSim.html 2022-01-24 23:06:32.000000000 +0000 @@ -201,7 +201,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Import/OpenDRIVE.html sumo-1.12.0/docs/userdoc/Tools/Import/OpenDRIVE.html --- sumo-1.11.0/docs/userdoc/Tools/Import/OpenDRIVE.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Import/OpenDRIVE.html 2022-01-24 23:06:32.000000000 +0000 @@ -202,7 +202,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Import/OSM.html sumo-1.12.0/docs/userdoc/Tools/Import/OSM.html --- sumo-1.11.0/docs/userdoc/Tools/Import/OSM.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Import/OSM.html 2022-01-24 23:06:32.000000000 +0000 @@ -258,7 +258,7 @@
    This page was last edited on: 12 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Import/VISSIM.html sumo-1.12.0/docs/userdoc/Tools/Import/VISSIM.html --- sumo-1.11.0/docs/userdoc/Tools/Import/VISSIM.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Import/VISSIM.html 2022-01-24 23:06:32.000000000 +0000 @@ -685,7 +685,7 @@
    This page was last edited on: 11 March 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Import/VISUM.html sumo-1.12.0/docs/userdoc/Tools/Import/VISUM.html --- sumo-1.11.0/docs/userdoc/Tools/Import/VISUM.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Import/VISUM.html 2022-01-24 23:06:32.000000000 +0000 @@ -206,7 +206,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/index.html sumo-1.12.0/docs/userdoc/Tools/index.html --- sumo-1.11.0/docs/userdoc/Tools/index.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/index.html 2022-01-24 23:06:32.000000000 +0000 @@ -281,7 +281,7 @@
    This page was last edited on: 29 September 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/LiSuM.html sumo-1.12.0/docs/userdoc/Tools/LiSuM.html --- sumo-1.11.0/docs/userdoc/Tools/LiSuM.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/LiSuM.html 2022-01-24 23:06:32.000000000 +0000 @@ -418,7 +418,7 @@
    This page was last edited on: 24 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Misc.html sumo-1.12.0/docs/userdoc/Tools/Misc.html --- sumo-1.11.0/docs/userdoc/Tools/Misc.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Misc.html 2022-01-24 23:06:32.000000000 +0000 @@ -147,12 +147,25 @@ • Retrieving parameters from measurements of individual vehicles + + + + + @@ -254,6 +267,34 @@ +

    generateParkingAreas.py#

    +

    This tool generates parking areas for a network, and saves them in an additional file. If the output filename is not defined (using -o or --output-file), it will use as default parkingareas.add.xml.

    +

    Most basic call:

    +
    python tools/generateParkingAreas.py -n <my network>
    +
    + +

    Other Example:

    +
    python tools/generateParkingAreas.py -n <my network> -o <name of output file> --space-length <visual length per parking space> --min <minimum capacity> --max <maximum capacity>
    +
    + +

    The required parameter is the network (-n or --net-file). More options can be obtained by calling python tools/generateParkingAreas.py --help.

    +

    Additional options:

    +
      +
    • --output-file define the output filename
    • +
    • --probability probability for an edge to receive a parkingArea
    • +
    • --length length required per parking space
    • +
    • --space-length visual length of each parking space
    • +
    • --width visual width of each parking space
    • +
    • --random-capacity randomize roadsideCapacity
    • +
    • --min minimum capacity for parkingAreas
    • +
    • --max maximum capacity for parkingAreas
    • +
    • --angle parking area angle
    • +
    • --prefix prefix for the parkingArea ids
    • +
    • --seed random seed
    • +
    • --random use a random seed to initialize the random number generator
    • +
    • --vclass only use edges which permit the given vehicle class
    • +
    • --verbose tell me what you are doing
    • +

    generateParkingLots.py#

    This script generates parking lots. Example:

    python tools/generateParkingLots.py -b <xmin, ymin, xmax, ymax> -c <connecting edge>
    @@ -331,6 +372,7 @@
     ptlines-file will be used, rather than creating new shortest path routes between stops.

    A ptlines-file is typically created by netconvert option --ptlines-output when importing OSM data. However it can also be customized or created from scratch for a non OSM network.

    +

    Example Input#

    A minimal description for a bus line looks like this:

    <additional>
         <ptLine id="0" line="123" type="bus">
    @@ -341,6 +383,7 @@
     </additional>
     
    +

    Example Output#

    The used busStops must be defined in an additional file and passed with option -s when running the tool. The resulting bus definition may look like this:

    <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
    @@ -354,6 +397,90 @@
     </routes>
     
    +

    Further Options#

    +
      +
    • --types: only export lines with the given list of types
    • +
    • --bus.parking: let busses clear the road while stopping
    • +
    • --vtype-prefix: prefix for generated vehicle types (to allow combining multiple runs in the same simulation)
    • +
    • --stop-duration: minimum duration for stops (default 20)
    • +
    • --stop-duration.slack: time to reserve in the schedule per stop (default 10)
    • +
    • --speedfactor.bus: assumed relative travel speed of busses (default 0.95)
    • +
    • --speedfactor.tram: assumed relative travel speed of trams (default 1)
    • +
    • --night: only export lines that run during the night (by default, only lines running during the day are used)
    • +
    • --begin: flow begin time in output (default 0)
    • +
    • --end: flow end time in output (default 3600)
    • +
    • --min-stops: minimum number of stops to use a line (default 2)
    • +
    • --flow-attribute: additional attributes to include in the flows (i.e. "departSpeed=\"max\"")
    • +
    • --extend-to-fringe: whether vehicles should start on the first route edge rather than the first stop
    • +
    • --random-begin: whether to set the flow begin time to a random value between options --begin and the period of the line
    • +
    • --no-vtypes: whether to skip writing vTypes for the output
    • +
    • --seed: set random seed
    • +
    • --ignore-errors: ignore various input errors
    • +
    • --human-readable-time: write all times as (H:M:S)
    • +
    • --verbose: more output
    • +
    +

    Available ptLine Attributes#

    +

    These values have the following meanings:

    +
    Enable separate queues for every lane; default: false
    --meso-ignore-lanes-by-vclassDo not build queues (or reduce capacity) for lanes allowing only the given vclasses; default: pedestrian,bicycle
    --meso-junction-control <BOOL> Enable mesoscopic traffic light and priority junction handling; default: false
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDefaultDescription
    idid (string)-The id of the public transport relation (usually from OSM)
    typestring (enum)-The route type [bus, tram, train, subway, light_rail, monorail, trolleybus, minibus, share_taxi ,aerialway, ferry]
    linestring-The official line reference (must not be unique)
    vClassstring-sumo vehicle class
    periodtime (s, H:M:S)--period (600)The service period
    night_servicestring (enum)falseThe service period
    namestringLong name for the line
    colorcolorOfficial line color

    tileGet.py#

    This script retrieves background images from ESRI ArcGIS tile servers and other imaging APIs such as Google Maps and MapQuest. The simplest usage is to call it with a SUMO @@ -398,10 +525,10 @@

    -
    This page was last edited on: 02 October 2021 +
    This page was last edited on: 09 December 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Net.html sumo-1.12.0/docs/userdoc/Tools/Net.html --- sumo-1.11.0/docs/userdoc/Tools/Net.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Net.html 2022-01-24 23:06:32.000000000 +0000 @@ -351,7 +351,7 @@
    This page was last edited on: 05 May 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Output.html sumo-1.12.0/docs/userdoc/Tools/Output.html --- sumo-1.11.0/docs/userdoc/Tools/Output.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Output.html 2022-01-24 23:06:32.000000000 +0000 @@ -401,7 +401,7 @@

    parkingSearchTraffic.py#

    -

    This tool reads vehicle-routes-output (with exit-times) and generates statistics for the time and the distance vehicles +

    This tool reads vehroute-output with exit-times and generates statistics for the time and the distance vehicles spent on searching parking locations as well as the length of the walking way back. It evaluates the time and distance between the first reroute and the arrival at the final stop. It currently outputs only basic statistics (mean, avg, quartiles etc.).

    @@ -415,10 +415,10 @@
    -
    This page was last edited on: 22 November 2021 +
    This page was last edited on: 14 December 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Railways.html sumo-1.12.0/docs/userdoc/Tools/Railways.html --- sumo-1.11.0/docs/userdoc/Tools/Railways.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Railways.html 2022-01-24 23:06:32.000000000 +0000 @@ -310,7 +310,7 @@
    This page was last edited on: 04 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Routes.html sumo-1.12.0/docs/userdoc/Tools/Routes.html --- sumo-1.11.0/docs/userdoc/Tools/Routes.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Routes.html 2022-01-24 23:06:32.000000000 +0000 @@ -591,7 +591,7 @@
    This page was last edited on: 17 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Shapes.html sumo-1.12.0/docs/userdoc/Tools/Shapes.html --- sumo-1.11.0/docs/userdoc/Tools/Shapes.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Shapes.html 2022-01-24 23:06:32.000000000 +0000 @@ -276,7 +276,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Sumolib.html sumo-1.12.0/docs/userdoc/Tools/Sumolib.html --- sumo-1.11.0/docs/userdoc/Tools/Sumolib.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Sumolib.html 2022-01-24 23:06:32.000000000 +0000 @@ -265,6 +265,10 @@ avgSpeed = speedSum / edgeCount +
    +

    Note

    +

    This is just a processing example. To compute average travel speeds in a network, process edgeData, tripinfos or summary-output instead.

    +

    compute the median speed using the Statistics module#

    edgeStats = sumolib.miscutils.Statistics("edge speeds")
     for edge in sumolib.xml.parse('myNet.edg.xml', ['edge']):
    @@ -361,10 +365,10 @@
     
             
    -
    This page was last edited on: 04 October 2021 +
    This page was last edited on: 02 December 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/tls.html sumo-1.12.0/docs/userdoc/Tools/tls.html --- sumo-1.11.0/docs/userdoc/Tools/tls.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/tls.html 2022-01-24 23:06:32.000000000 +0000 @@ -506,7 +506,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/TraceExporter.html sumo-1.12.0/docs/userdoc/Tools/TraceExporter.html --- sumo-1.11.0/docs/userdoc/Tools/TraceExporter.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/TraceExporter.html 2022-01-24 23:06:32.000000000 +0000 @@ -613,7 +613,7 @@
    This page was last edited on: 12 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/traci.html sumo-1.12.0/docs/userdoc/Tools/traci.html --- sumo-1.11.0/docs/userdoc/Tools/traci.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/traci.html 2022-01-24 23:06:32.000000000 +0000 @@ -223,7 +223,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Trip.html sumo-1.12.0/docs/userdoc/Tools/Trip.html --- sumo-1.11.0/docs/userdoc/Tools/Trip.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Trip.html 2022-01-24 23:06:32.000000000 +0000 @@ -441,7 +441,7 @@
    This page was last edited on: 04 August 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Turns.html sumo-1.12.0/docs/userdoc/Tools/Turns.html --- sumo-1.11.0/docs/userdoc/Tools/Turns.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Turns.html 2022-01-24 23:06:32.000000000 +0000 @@ -172,6 +172,9 @@ • Vehicle attributes +
  • --write-flows number: write <flow>-definitions instead of vehicles. The exact number of flow vehicles will be spaced evenly between the earliest and latest vehicle departures that would have been generated by default
  • --write-flows probability: write <flow>-definitions instead of vehicles. Flows will be defined with attribute 'probability' so that the expected number of vehicles is equal to the number of vehicles that would have been generated by default but the specific number will vary due to sampling effects
  • --pedestrians: write persons and personFlows with walks instead of vehicles and flows
  • +
  • --prefix: prefix vehicle- and route-IDs with the given string. This is needed to combine output of multiple routeSampler runs (i.e. for different modes of traffic) into a single simulation. Otherwise there would be errors regarding duplicate IDs.
  • Vehicle attributes#

    With the option --attributes <STRING>, additional parameters can be given to the generated vehicles (note, usage of the quoting characters).

    -
    python tools/randomTrips.py -n input_net.net.xml 
    +
    python tools/routeSampler.py -n input_net.net.xml -r candidate.rou.xml -o out.rou.xml -d data.xml
       --attributes="departLane=\"best\" departSpeed=\"max\" departPos=\"random\""
     

    The above attriutes would make the vehicles be distributed randomly on their starting edges and inserted with high speed on a reasonable lane.

    -

    The distinguish vehicles of different types, the 'type' attribute may be set. The corresponding type should then be defined in an additional xml file and loaded with option --additional-files.

    -
    python tools/randomTrips.py -n input_net.net.xml 
    -  --attributes="type=\"customType\""
    -
    -

    Note

    Quoting of trip attributes on Linux may also use the style --attributes 'departLane="best" departSpeed="max" departPos="random"'

    +

    Multiple vehicle types#

    +

    To distinguish vehicles of different types, routeSampler may be run multiple times with different attributes. Note, that it is also necessary to set the option --prefix to prevent duplicate ids. The example below creates traffic consisting of cars and trucks using two edgedata files with distinct count values (stored in the default attribute 'entered').

    +
    python tools/routeSampler.py --attributes="type=\"car\"" --edgedata-files carcounts.xml --prefix c -o cars.rou.xml -n net.net.xml -r candidate.rou.xml
    +python tools/routeSampler.py --attributes="type=\"heavy\"" --edgedata-files truckcounts.xml --prefix t -o trucks.rou.xml  -n net.net.xml -r candidate.rou.xml
    +
    + +

    Alternatively, the count values might also be stored in different attributes of the same file (i.e. 'count1', 'count2'):

    +
    python tools/routeSampler.py --attributes="type=\"car\"" --edgedata-files counts.xml --edgedata-attribute count1 --prefix c -o cars.rou.xml  -n net.net.xml -r candidate.rou.xml
    +python tools/routeSampler.py --attributes="type=\"heavy\"" --edgedata-files counts.xml --edgedata-attribute count2 --prefix t -o trucks.rou.xml  -n net.net.xml -r candidate.rou.xml
    +
    + +

    When running the simulation, the types 'car' and 'heavy' (previously set as vehicle attributes), must be defined in an additional file which could look like the following example (types.add.xml):

    +
    <additional>
    +  <vType id="car"/>
    +  <vType id="heavy" vClass="truck"/>
    +</additional>
    +
    + +

    The simulation could then be called like this:

    +
      sumo -n net.net.xml -a types.add.xml -r cars.rou.xml,trucks.rou.xml
    +
    +

    Sampling#

    By default, sampling will be performed iteratively by 1) selecting a random counting location that has not yet reached it's count (and which still has viable routes) @@ -393,10 +414,10 @@

    -
    This page was last edited on: 18 November 2021 +
    This page was last edited on: 10 December 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Visualization.html sumo-1.12.0/docs/userdoc/Tools/Visualization.html --- sumo-1.11.0/docs/userdoc/Tools/Visualization.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Visualization.html 2022-01-24 23:06:32.000000000 +0000 @@ -406,72 +406,24 @@

    If two input files are given they must cover the same time intervals or no data will be plotted.

    Options

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    OptionDescription
    -n <FILE>
    --net <FILE>
    Defines the network to read
    -i <FILE>,<FILE>
    --dump-inputs <FILE>,<FILE>
    Defines the dump-output files to use as input
    -m <STRING>,<STRING>
    --measures <STRING>,<STRING>
    Define which measure to plot;default: speed,entered
    -w <FLOAT>
    --default-width <FLOAT>
    Defines the default edge width; default: .1
    -c <COLOR>
    --default-color <COLOR>
    If set, the progress is printed on the screen
    --min-width <FLOAT>Defines the minimum edge width; default: .5
    --max-width <FLOAT>Defines the maximumedge width; default: 3
    --log-colorsIf set, colors are log-scaled
    --log-widthsIf set, widths are log-scaled
    --min-color-value <FLOAT>If set, defines the minimum edge color value
    --max-color-value <FLOAT>If set, defines the maximum edge color value
    --min-width-value <FLOAT>If set, defines the minimum edge width value
    --max-width-value <FLOAT>If set, defines the maximum edge width value
    -v
    --verbose
    If set, the progress is printed on the screen
    +

    Here the most important options are listed. Use --help to see all options. +| Option | Description | +|------------------------------------------------------|-----------------------------------------------------| +| -n <FILE>
    --net <FILE> | Defines the network to read | +| -i <FILE>,<FILE>
    --dump-inputs <FILE>,<FILE> | Defines the dump-output files to use as input | +| -m <STRING>,<STRING>
    --measures <STRING>,<STRING> | Define which measure to plot;default: speed,entered | +| -w <FLOAT>
    --default-width <FLOAT> | Defines the default edge width; default: .1 | +| -c <COLOR>
    --default-color <COLOR> | Defines the default edge color | +| --min-width <FLOAT> | Defines the minimum edge width; default: .5 | +| --max-width <FLOAT> | Defines the maximumedge width; default: 3 | +| --log-colors | If set, colors are log-scaled | +| --log-widths | If set, widths are log-scaled | +| --min-color-value <FLOAT> | If set, defines the minimum edge color value | +| --max-color-value <FLOAT> | If set, defines the maximum edge color value | +| --min-width-value <FLOAT> | If set, defines the minimum edge width value | +| --max-width-value <FLOAT> | If set, defines the maximum edge width value | +| -v
    --verbose | If set, the progress is printed on the screen | +| --internal | If set, internal edges (of junctions) are included to the genrated shapes. |

    plot_net_selection.py#

    plot_net_selection.py reads a road network and a selection file as written by sumo-gui. It plots the road network, @@ -1141,10 +1093,10 @@

    -
    This page was last edited on: 07 November 2021 +
    This page was last edited on: 03 December 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Tools/Xml.html sumo-1.12.0/docs/userdoc/Tools/Xml.html --- sumo-1.11.0/docs/userdoc/Tools/Xml.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tools/Xml.html 2022-01-24 23:06:32.000000000 +0000 @@ -263,7 +263,7 @@
    This page was last edited on: 23 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Topics/Environmental_Issues.html sumo-1.12.0/docs/userdoc/Topics/Environmental_Issues.html --- sumo-1.11.0/docs/userdoc/Topics/Environmental_Issues.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Topics/Environmental_Issues.html 2022-01-24 23:06:32.000000000 +0000 @@ -448,7 +448,7 @@
    This page was last edited on: 21 April 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/Topics/V2X.html sumo-1.12.0/docs/userdoc/Topics/V2X.html --- sumo-1.11.0/docs/userdoc/Topics/V2X.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Topics/V2X.html 2022-01-24 23:06:32.000000000 +0000 @@ -257,7 +257,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Add_Vehicle.html sumo-1.12.0/docs/userdoc/TraCI/Add_Vehicle.html --- sumo-1.11.0/docs/userdoc/TraCI/Add_Vehicle.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Add_Vehicle.html 2022-01-24 23:06:32.000000000 +0000 @@ -255,7 +255,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/TraCI/BusStop.html sumo-1.12.0/docs/userdoc/TraCI/BusStop.html --- sumo-1.11.0/docs/userdoc/TraCI/BusStop.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/BusStop.html 2022-01-24 23:06:32.000000000 +0000 @@ -244,7 +244,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Calibrator.html sumo-1.12.0/docs/userdoc/TraCI/Calibrator.html --- sumo-1.11.0/docs/userdoc/TraCI/Calibrator.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Calibrator.html 2022-01-24 23:06:32.000000000 +0000 @@ -133,27 +133,6 @@
    -
    @@ -283,41 +262,6 @@ Returns the number of vehicles per hour in the current calibration interval getVehsPerHour - -flow -compound (string, double, double, double, double, string, string, string, string), see below -Update or add a calibrator interval -setFlow - - - -

    compound message details#

    -

    The message contents are as following:

    -

    flow#

    - - - - - - - - - - - - - - - - - - - - - - - -
    stringdoubledoubledoublestringstringstringstring
    calibratorIDbeginendvehsPerHourspeedtypeIDrouteIDdepartLane='first'
    @@ -327,10 +271,10 @@
    -
    This page was last edited on: 11 February 2021 +
    This page was last edited on: 25 November 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Change_Calibrator_State.html sumo-1.12.0/docs/userdoc/TraCI/Change_Calibrator_State.html --- sumo-1.11.0/docs/userdoc/TraCI/Change_Calibrator_State.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Change_Calibrator_State.html 2022-01-24 23:06:32.000000000 +0000 @@ -0,0 +1,392 @@ + + + + + + + + + + + + + + + + + Change Calibrator State - SUMO Documentation + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + + +
    +
    + + + Change Calibrator State
    + + + +

    Command 0xc4: Change Calibrator State#

    + + + + + + + + + + + + + + + + + +
    ubytestringubyte<value_type>
    VariableCalibrator IDType of the valueNew Value
    +

    Changes the state of a calibrator. Because it is possible to change +different values of a calibrator, the number of parameter to supply and +their types differ between commands. The following values can be +changed, the parameter which must be given are also shown in the table.

    +

    +Overview Changeable Calibrator Variables +

    + + + + + + + + + + + + + + + + + +
    VariableValueTypeDescriptionPython Method
    flow (0x18)compound (string, double, double, double, double, string, string, string, string), see belowSet the hourly flow and speed at the calibrator location in a given time range. Missing traffic will be added with the given routeID (or routeDistribution ID) and type. DepartLane and departSpeed default to "first" and "max" but can optionally be set. For details on calibrating only flow, speed or type individually, see Calibrator.setFlow
    +

    compound message details#

    +

    The message contents are as following:

    +

    flow (0x18)#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    byteintegerbytestringbytedoublebytedoublebytedoublebytedoublebytestringbytestringbytestringbytestring
    value type compounditem number (7 to 9)value type stringcalibrator IDvalue type doublebeginvalue type doubleendvalue type doublevehsPerHourvalue type doublespeedvalue type stringtype idvalue type stringroute idvalue type string (optional)depart lanevalue type string (optional)depart speed
    +
    +
    + +
    + +
    + +
    This page was last edited on: 26 November 2021 + +
    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    +

    Follow us on + | Documentation built with MkDocs

    +
    + + + + + + + + + + diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Change_Edge_State.html sumo-1.12.0/docs/userdoc/TraCI/Change_Edge_State.html --- sumo-1.11.0/docs/userdoc/TraCI/Change_Edge_State.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Change_Edge_State.html 2022-01-24 23:06:32.000000000 +0000 @@ -305,7 +305,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Change_GUI_State.html sumo-1.12.0/docs/userdoc/TraCI/Change_GUI_State.html --- sumo-1.11.0/docs/userdoc/TraCI/Change_GUI_State.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Change_GUI_State.html 2022-01-24 23:06:32.000000000 +0000 @@ -386,7 +386,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Change_Lane_State.html sumo-1.12.0/docs/userdoc/TraCI/Change_Lane_State.html --- sumo-1.11.0/docs/userdoc/TraCI/Change_Lane_State.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Change_Lane_State.html 2022-01-24 23:06:32.000000000 +0000 @@ -250,7 +250,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Change_Person_State.html sumo-1.12.0/docs/userdoc/TraCI/Change_Person_State.html --- sumo-1.11.0/docs/userdoc/TraCI/Change_Person_State.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Change_Person_State.html 2022-01-24 23:06:32.000000000 +0000 @@ -695,7 +695,7 @@
    This page was last edited on: 18 October 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Change_PoI_State.html sumo-1.12.0/docs/userdoc/TraCI/Change_PoI_State.html --- sumo-1.11.0/docs/userdoc/TraCI/Change_PoI_State.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Change_PoI_State.html 2022-01-24 23:06:32.000000000 +0000 @@ -454,7 +454,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Change_Polygon_State.html sumo-1.12.0/docs/userdoc/TraCI/Change_Polygon_State.html --- sumo-1.11.0/docs/userdoc/TraCI/Change_Polygon_State.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Change_Polygon_State.html 2022-01-24 23:06:32.000000000 +0000 @@ -468,7 +468,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Change_Route_State.html sumo-1.12.0/docs/userdoc/TraCI/Change_Route_State.html --- sumo-1.11.0/docs/userdoc/TraCI/Change_Route_State.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Change_Route_State.html 2022-01-24 23:06:32.000000000 +0000 @@ -230,7 +230,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Change_Simulation_State.html sumo-1.12.0/docs/userdoc/TraCI/Change_Simulation_State.html --- sumo-1.11.0/docs/userdoc/TraCI/Change_Simulation_State.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Change_Simulation_State.html 2022-01-24 23:06:32.000000000 +0000 @@ -244,7 +244,7 @@
    This page was last edited on: 25 May 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Change_Traffic_Lights_State.html sumo-1.12.0/docs/userdoc/TraCI/Change_Traffic_Lights_State.html --- sumo-1.11.0/docs/userdoc/TraCI/Change_Traffic_Lights_State.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Change_Traffic_Lights_State.html 2022-01-24 23:06:32.000000000 +0000 @@ -412,7 +412,7 @@
    This page was last edited on: 11 February 2021
    -

    Copyright © 2001-2021 German Aerospace Center (DLR) and others.

    +

    Copyright © 2001-2022 German Aerospace Center (DLR) and others.

    Follow us on | Documentation built with MkDocs

    diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Change_Vehicle_State.html sumo-1.12.0/docs/userdoc/TraCI/Change_Vehicle_State.html --- sumo-1.11.0/docs/userdoc/TraCI/Change_Vehicle_State.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Change_Vehicle_State.html 2022-01-24 23:06:32.000000000 +0000 @@ -217,6 +217,7 @@ + +

    Relationship between lanechange model attributes and vTypes#

    +

    All lanechange model attributes are initialized from the vehicles vType and then stored in the individual lane change model instance of each vehicle. This has important consequences

    +
      +
    • setting a new vType for a vehicle doesn't affect lane change model attributes (the vehicle keeps using it's individual values)
    • +
    • changing lane change model attributes on the vType of a vehicle does not affect the vehicle (the vehicle keeps using it's individual values)
    • +
    • changing lane change model attributes for a vehicle does not affect it's vType (and instead changes the individual values of the vehicle)
    • +
    +
    +

    Caution

    +

    Attribute 'minGapLat' also counts as a lanechange model attribute since version 1.12.0

    +

    Application order of traci commands and simulation step#

    Step n:

      @@ -1570,10 +1588,10 @@
      -
      This page was last edited on: 22 November 2021 +
      This page was last edited on: 20 January 2022
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Change_VehicleType_State.html sumo-1.12.0/docs/userdoc/TraCI/Change_VehicleType_State.html --- sumo-1.11.0/docs/userdoc/TraCI/Change_VehicleType_State.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Change_VehicleType_State.html 2022-01-24 23:06:32.000000000 +0000 @@ -388,7 +388,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/ChargingStation.html sumo-1.12.0/docs/userdoc/TraCI/ChargingStation.html --- sumo-1.11.0/docs/userdoc/TraCI/ChargingStation.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/ChargingStation.html 2022-01-24 23:06:32.000000000 +0000 @@ -230,7 +230,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Control-related_commands.html sumo-1.12.0/docs/userdoc/TraCI/Control-related_commands.html --- sumo-1.11.0/docs/userdoc/TraCI/Control-related_commands.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Control-related_commands.html 2022-01-24 23:06:32.000000000 +0000 @@ -392,7 +392,7 @@
      This page was last edited on: 21 July 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/C++TraCIAPI.html sumo-1.12.0/docs/userdoc/TraCI/C++TraCIAPI.html --- sumo-1.11.0/docs/userdoc/TraCI/C++TraCIAPI.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/C++TraCIAPI.html 2022-01-24 23:06:32.000000000 +0000 @@ -298,7 +298,7 @@
      This page was last edited on: 07 April 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Edge_Value_Retrieval.html sumo-1.12.0/docs/userdoc/TraCI/Edge_Value_Retrieval.html --- sumo-1.11.0/docs/userdoc/TraCI/Edge_Value_Retrieval.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Edge_Value_Retrieval.html 2022-01-24 23:06:32.000000000 +0000 @@ -403,7 +403,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/GenericParameters.html sumo-1.12.0/docs/userdoc/TraCI/GenericParameters.html --- sumo-1.11.0/docs/userdoc/TraCI/GenericParameters.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/GenericParameters.html 2022-01-24 23:06:32.000000000 +0000 @@ -315,7 +315,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/GUI_Value_Retrieval.html sumo-1.12.0/docs/userdoc/TraCI/GUI_Value_Retrieval.html --- sumo-1.11.0/docs/userdoc/TraCI/GUI_Value_Retrieval.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/GUI_Value_Retrieval.html 2022-01-24 23:06:32.000000000 +0000 @@ -277,7 +277,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Induction_Loop_Value_Retrieval.html sumo-1.12.0/docs/userdoc/TraCI/Induction_Loop_Value_Retrieval.html --- sumo-1.11.0/docs/userdoc/TraCI/Induction_Loop_Value_Retrieval.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Induction_Loop_Value_Retrieval.html 2022-01-24 23:06:32.000000000 +0000 @@ -380,7 +380,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Interfacing_TraCI_from_Python.html sumo-1.12.0/docs/userdoc/TraCI/Interfacing_TraCI_from_Python.html --- sumo-1.11.0/docs/userdoc/TraCI/Interfacing_TraCI_from_Python.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Interfacing_TraCI_from_Python.html 2022-01-24 23:06:32.000000000 +0000 @@ -587,7 +587,7 @@
      This page was last edited on: 29 April 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Junction_Value_Retrieval.html sumo-1.12.0/docs/userdoc/TraCI/Junction_Value_Retrieval.html --- sumo-1.11.0/docs/userdoc/TraCI/Junction_Value_Retrieval.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Junction_Value_Retrieval.html 2022-01-24 23:06:32.000000000 +0000 @@ -270,7 +270,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Lane_Area_Detector_Value_Retrieval.html sumo-1.12.0/docs/userdoc/TraCI/Lane_Area_Detector_Value_Retrieval.html --- sumo-1.11.0/docs/userdoc/TraCI/Lane_Area_Detector_Value_Retrieval.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Lane_Area_Detector_Value_Retrieval.html 2022-01-24 23:06:32.000000000 +0000 @@ -329,7 +329,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Lane_Value_Retrieval.html sumo-1.12.0/docs/userdoc/TraCI/Lane_Value_Retrieval.html --- sumo-1.11.0/docs/userdoc/TraCI/Lane_Value_Retrieval.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Lane_Value_Retrieval.html 2022-01-24 23:06:32.000000000 +0000 @@ -495,7 +495,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Multi-Entry-Exit_Detectors_Value_Retrieval.html sumo-1.12.0/docs/userdoc/TraCI/Multi-Entry-Exit_Detectors_Value_Retrieval.html --- sumo-1.11.0/docs/userdoc/TraCI/Multi-Entry-Exit_Detectors_Value_Retrieval.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Multi-Entry-Exit_Detectors_Value_Retrieval.html 2022-01-24 23:06:32.000000000 +0000 @@ -319,7 +319,7 @@
      This page was last edited on: 09 November 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Object_Context_Subscription.html sumo-1.12.0/docs/userdoc/TraCI/Object_Context_Subscription.html --- sumo-1.11.0/docs/userdoc/TraCI/Object_Context_Subscription.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Object_Context_Subscription.html 2022-01-24 23:06:32.000000000 +0000 @@ -442,6 +442,11 @@ +

      When adding a context subscription filter, it is applied to the vehicle context subscription (command ID 0x84) that was created most recently.

      +
      +

      Note

      +

      Context subscription filters are only supported for ego objects of type 'vehicle'.

      +

      Currently, the following context subscription filter types are implemented:

      @@ -557,10 +562,10 @@
      -
      This page was last edited on: 17 September 2021 +
      This page was last edited on: 02 December 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Object_Variable_Subscription.html sumo-1.12.0/docs/userdoc/TraCI/Object_Variable_Subscription.html --- sumo-1.11.0/docs/userdoc/TraCI/Object_Variable_Subscription.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Object_Variable_Subscription.html 2022-01-24 23:06:32.000000000 +0000 @@ -330,7 +330,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/OverheadWire.html sumo-1.12.0/docs/userdoc/TraCI/OverheadWire.html --- sumo-1.11.0/docs/userdoc/TraCI/OverheadWire.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/OverheadWire.html 2022-01-24 23:06:32.000000000 +0000 @@ -230,7 +230,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/ParkingArea.html sumo-1.12.0/docs/userdoc/TraCI/ParkingArea.html --- sumo-1.11.0/docs/userdoc/TraCI/ParkingArea.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/ParkingArea.html 2022-01-24 23:06:32.000000000 +0000 @@ -232,7 +232,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Person_Value_Retrieval.html sumo-1.12.0/docs/userdoc/TraCI/Person_Value_Retrieval.html --- sumo-1.11.0/docs/userdoc/TraCI/Person_Value_Retrieval.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Person_Value_Retrieval.html 2022-01-24 23:06:32.000000000 +0000 @@ -427,7 +427,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/POI_Value_Retrieval.html sumo-1.12.0/docs/userdoc/TraCI/POI_Value_Retrieval.html --- sumo-1.11.0/docs/userdoc/TraCI/POI_Value_Retrieval.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/POI_Value_Retrieval.html 2022-01-24 23:06:32.000000000 +0000 @@ -300,7 +300,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Polygon_Value_Retrieval.html sumo-1.12.0/docs/userdoc/TraCI/Polygon_Value_Retrieval.html --- sumo-1.11.0/docs/userdoc/TraCI/Polygon_Value_Retrieval.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Polygon_Value_Retrieval.html 2022-01-24 23:06:32.000000000 +0000 @@ -288,7 +288,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Protocol.html sumo-1.12.0/docs/userdoc/TraCI/Protocol.html --- sumo-1.11.0/docs/userdoc/TraCI/Protocol.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Protocol.html 2022-01-24 23:06:32.000000000 +0000 @@ -447,7 +447,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Rerouter.html sumo-1.12.0/docs/userdoc/TraCI/Rerouter.html --- sumo-1.11.0/docs/userdoc/TraCI/Rerouter.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Rerouter.html 2022-01-24 23:06:32.000000000 +0000 @@ -258,7 +258,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/RouteProbe.html sumo-1.12.0/docs/userdoc/TraCI/RouteProbe.html --- sumo-1.11.0/docs/userdoc/TraCI/RouteProbe.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/RouteProbe.html 2022-01-24 23:06:32.000000000 +0000 @@ -258,7 +258,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Route_Value_Retrieval.html sumo-1.12.0/docs/userdoc/TraCI/Route_Value_Retrieval.html --- sumo-1.11.0/docs/userdoc/TraCI/Route_Value_Retrieval.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Route_Value_Retrieval.html 2022-01-24 23:06:32.000000000 +0000 @@ -264,7 +264,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Simulation_Value_Retrieval.html sumo-1.12.0/docs/userdoc/TraCI/Simulation_Value_Retrieval.html --- sumo-1.11.0/docs/userdoc/TraCI/Simulation_Value_Retrieval.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Simulation_Value_Retrieval.html 2022-01-24 23:06:32.000000000 +0000 @@ -738,7 +738,7 @@
      This page was last edited on: 22 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/SUMO_ID_Commands_Structure.html sumo-1.12.0/docs/userdoc/TraCI/SUMO_ID_Commands_Structure.html --- sumo-1.11.0/docs/userdoc/TraCI/SUMO_ID_Commands_Structure.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/SUMO_ID_Commands_Structure.html 2022-01-24 23:06:32.000000000 +0000 @@ -289,7 +289,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/TraaS.html sumo-1.12.0/docs/userdoc/TraCI/TraaS.html --- sumo-1.11.0/docs/userdoc/TraCI/TraaS.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/TraaS.html 2022-01-24 23:06:32.000000000 +0000 @@ -273,7 +273,7 @@
      This page was last edited on: 25 October 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Traffic_Lights_Value_Retrieval.html sumo-1.12.0/docs/userdoc/TraCI/Traffic_Lights_Value_Retrieval.html --- sumo-1.11.0/docs/userdoc/TraCI/Traffic_Lights_Value_Retrieval.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Traffic_Lights_Value_Retrieval.html 2022-01-24 23:06:32.000000000 +0000 @@ -458,7 +458,7 @@
      This page was last edited on: 11 November 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/VariableSpeedSign.html sumo-1.12.0/docs/userdoc/TraCI/VariableSpeedSign.html --- sumo-1.11.0/docs/userdoc/TraCI/VariableSpeedSign.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/VariableSpeedSign.html 2022-01-24 23:06:32.000000000 +0000 @@ -235,7 +235,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Vehicle_Signalling.html sumo-1.12.0/docs/userdoc/TraCI/Vehicle_Signalling.html --- sumo-1.11.0/docs/userdoc/TraCI/Vehicle_Signalling.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Vehicle_Signalling.html 2022-01-24 23:06:32.000000000 +0000 @@ -297,7 +297,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/VehicleType_Value_Retrieval.html sumo-1.12.0/docs/userdoc/TraCI/VehicleType_Value_Retrieval.html --- sumo-1.11.0/docs/userdoc/TraCI/VehicleType_Value_Retrieval.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/VehicleType_Value_Retrieval.html 2022-01-24 23:06:32.000000000 +0000 @@ -374,7 +374,7 @@
      This page was last edited on: 11 February 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI/Vehicle_Value_Retrieval.html sumo-1.12.0/docs/userdoc/TraCI/Vehicle_Value_Retrieval.html --- sumo-1.11.0/docs/userdoc/TraCI/Vehicle_Value_Retrieval.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI/Vehicle_Value_Retrieval.html 2022-01-24 23:06:32.000000000 +0000 @@ -1190,7 +1190,7 @@
      This page was last edited on: 21 July 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/TraCI.html sumo-1.12.0/docs/userdoc/TraCI.html --- sumo-1.11.0/docs/userdoc/TraCI.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/TraCI.html 2022-01-24 23:06:32.000000000 +0000 @@ -358,6 +358,8 @@ simulation
    1. Change GUI State change the simulation visualization
    2. +
    3. Change Calibrator State change the + calibrator state
    4. Subscriptions
        @@ -545,10 +547,10 @@
        -
        This page was last edited on: 28 April 2021 +
        This page was last edited on: 25 November 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/Autobahn.html sumo-1.12.0/docs/userdoc/Tutorials/Autobahn.html --- sumo-1.11.0/docs/userdoc/Tutorials/Autobahn.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/Autobahn.html 2022-01-24 23:06:32.000000000 +0000 @@ -224,12 +224,12 @@
        <routes>
             <vType id="normal_car" vClass="passenger" maxSpeed="40" speedFactor="0.9" speedDev="0.2" sigma="0.5" />
             <vType id="sporty_car" vClass="passenger" maxSpeed="60" speedFactor="1.3" speedDev="0.1" sigma="0.1" />
        -    <vType id="trailer" vClass="trailer"  maxSpeed="30" speedFactor="1.1" speedDev="0.1" />
        -    <vType id="coach" vClass="coach"  maxSpeed="30" speedFactor="1." speedDev="0.1" />
        -    <flow id="normal" type="normal_car" begin="0" end="5000" number="5000" from="entry" to="exit" departPos="last" departLane="best" />
        -    <flow id="sporty" type="sporty_car" begin="0" end="5000" number="300" from="entry" to="exit" departPos="last" departLane="best" />
        -    <flow id="coach" type="coach" begin="0" end="5000" number="300" from="entry" to="exit" departPos="last" departLane="best" />
        -    <flow id="trailer" type="trailer" begin="0" end="5000" number="700" from="entry" to="exit" departPos="last" departLane="best" />
        +    <vType id="trailer" vClass="trailer"  maxSpeed="30" speedFactor="1" speedDev="0.05" />
        +    <vType id="coach" vClass="coach"  maxSpeed="30" speedFactor="1" speedDev="0.05" />
        +    <flow id="normal" type="normal_car" begin="0" end="5000" number="5000" from="entry" to="exit" departSpeed="avg" departLane="best" />
        +    <flow id="sporty" type="sporty_car" begin="0" end="5000" number="300" from="entry" to="exit" departSpeed="avg" departLane="best" />
        +    <flow id="coach" type="coach" begin="0" end="5000" number="300" from="entry" to="exit" departSpeed="avg" departLane="best" />
        +    <flow id="trailer" type="trailer" begin="0" end="5000" number="700" from="entry" to="exit" departSpeed="avg" departLane="best" />
         </routes>
         
        @@ -279,10 +279,10 @@
        -
        This page was last edited on: 12 February 2021 +
        This page was last edited on: 17 January 2022
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/Calibration/Berlin.html sumo-1.12.0/docs/userdoc/Tutorials/Calibration/Berlin.html --- sumo-1.11.0/docs/userdoc/Tutorials/Calibration/Berlin.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/Calibration/Berlin.html 2022-01-24 23:06:32.000000000 +0000 @@ -304,7 +304,7 @@
        This page was last edited on: 06 April 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/Calibration/San_Pablo_Dam.html sumo-1.12.0/docs/userdoc/Tutorials/Calibration/San_Pablo_Dam.html --- sumo-1.11.0/docs/userdoc/Tutorials/Calibration/San_Pablo_Dam.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/Calibration/San_Pablo_Dam.html 2022-01-24 23:06:32.000000000 +0000 @@ -365,7 +365,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/CityMobil.html sumo-1.12.0/docs/userdoc/Tutorials/CityMobil.html --- sumo-1.11.0/docs/userdoc/Tutorials/CityMobil.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/CityMobil.html 2022-01-24 23:06:32.000000000 +0000 @@ -432,7 +432,7 @@
        This page was last edited on: 14 April 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/CityMobil_old.html sumo-1.12.0/docs/userdoc/Tutorials/CityMobil_old.html --- sumo-1.11.0/docs/userdoc/Tutorials/CityMobil_old.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/CityMobil_old.html 2022-01-24 23:06:32.000000000 +0000 @@ -192,7 +192,7 @@
        This page was last edited on: 15 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/Driving_in_Circles.html sumo-1.12.0/docs/userdoc/Tutorials/Driving_in_Circles.html --- sumo-1.11.0/docs/userdoc/Tutorials/Driving_in_Circles.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/Driving_in_Circles.html 2022-01-24 23:06:32.000000000 +0000 @@ -456,7 +456,7 @@
        This page was last edited on: 14 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/FundamentalDiagram.html sumo-1.12.0/docs/userdoc/Tutorials/FundamentalDiagram.html --- sumo-1.11.0/docs/userdoc/Tutorials/FundamentalDiagram.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/FundamentalDiagram.html 2022-01-24 23:06:32.000000000 +0000 @@ -271,7 +271,7 @@
        This page was last edited on: 09 April 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/GTFS.html sumo-1.12.0/docs/userdoc/Tutorials/GTFS.html --- sumo-1.11.0/docs/userdoc/Tutorials/GTFS.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/GTFS.html 2022-01-24 23:06:32.000000000 +0000 @@ -300,7 +300,7 @@
        This page was last edited on: 05 July 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/Hello_SUMO.html sumo-1.12.0/docs/userdoc/Tutorials/Hello_SUMO.html --- sumo-1.11.0/docs/userdoc/Tutorials/Hello_SUMO.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/Hello_SUMO.html 2022-01-24 23:06:32.000000000 +0000 @@ -326,7 +326,7 @@
        This page was last edited on: 08 April 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/Hello_World.html sumo-1.12.0/docs/userdoc/Tutorials/Hello_World.html --- sumo-1.11.0/docs/userdoc/Tutorials/Hello_World.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/Hello_World.html 2022-01-24 23:06:32.000000000 +0000 @@ -314,7 +314,7 @@
        This page was last edited on: 12 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/HighwayDetector.html sumo-1.12.0/docs/userdoc/Tutorials/HighwayDetector.html --- sumo-1.11.0/docs/userdoc/Tutorials/HighwayDetector.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/HighwayDetector.html 2022-01-24 23:06:32.000000000 +0000 @@ -374,7 +374,7 @@
        This page was last edited on: 14 April 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/Import_from_OpenStreetMap.html sumo-1.12.0/docs/userdoc/Tutorials/Import_from_OpenStreetMap.html --- sumo-1.11.0/docs/userdoc/Tutorials/Import_from_OpenStreetMap.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/Import_from_OpenStreetMap.html 2022-01-24 23:06:32.000000000 +0000 @@ -399,7 +399,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/index.html sumo-1.12.0/docs/userdoc/Tutorials/index.html --- sumo-1.11.0/docs/userdoc/Tutorials/index.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/index.html 2022-01-24 23:06:32.000000000 +0000 @@ -318,7 +318,7 @@
        This page was last edited on: 20 September 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/Manhattan.html sumo-1.12.0/docs/userdoc/Tutorials/Manhattan.html --- sumo-1.11.0/docs/userdoc/Tutorials/Manhattan.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/Manhattan.html 2022-01-24 23:06:32.000000000 +0000 @@ -265,7 +265,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/Open_and_Simulate.html sumo-1.12.0/docs/userdoc/Tutorials/Open_and_Simulate.html --- sumo-1.11.0/docs/userdoc/Tutorials/Open_and_Simulate.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/Open_and_Simulate.html 2022-01-24 23:06:32.000000000 +0000 @@ -197,7 +197,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/OSMActivityGen/eichstaett.net.xml.html sumo-1.12.0/docs/userdoc/Tutorials/OSMActivityGen/eichstaett.net.xml.html --- sumo-1.11.0/docs/userdoc/Tutorials/OSMActivityGen/eichstaett.net.xml.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/OSMActivityGen/eichstaett.net.xml.html 2022-01-24 23:06:32.000000000 +0000 @@ -211,7 +211,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/OSMActivityGen/eichstaett.osm.html sumo-1.12.0/docs/userdoc/Tutorials/OSMActivityGen/eichstaett.osm.html --- sumo-1.11.0/docs/userdoc/Tutorials/OSMActivityGen/eichstaett.osm.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/OSMActivityGen/eichstaett.osm.html 2022-01-24 23:06:32.000000000 +0000 @@ -214,7 +214,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/OSMWebWizard.html sumo-1.12.0/docs/userdoc/Tutorials/OSMWebWizard.html --- sumo-1.11.0/docs/userdoc/Tutorials/OSMWebWizard.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/OSMWebWizard.html 2022-01-24 23:06:32.000000000 +0000 @@ -307,7 +307,7 @@
        This page was last edited on: 12 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/Output_Parsing.html sumo-1.12.0/docs/userdoc/Tutorials/Output_Parsing.html --- sumo-1.11.0/docs/userdoc/Tutorials/Output_Parsing.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/Output_Parsing.html 2022-01-24 23:06:32.000000000 +0000 @@ -346,7 +346,7 @@
        This page was last edited on: 25 May 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/Plotting_Cookbook.html sumo-1.12.0/docs/userdoc/Tutorials/Plotting_Cookbook.html --- sumo-1.11.0/docs/userdoc/Tutorials/Plotting_Cookbook.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/Plotting_Cookbook.html 2022-01-24 23:06:32.000000000 +0000 @@ -239,7 +239,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/port.html sumo-1.12.0/docs/userdoc/Tutorials/port.html --- sumo-1.11.0/docs/userdoc/Tutorials/port.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/port.html 2022-01-24 23:06:32.000000000 +0000 @@ -498,7 +498,7 @@
        This page was last edited on: 20 September 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/PT_from_OpenStreetMap.html sumo-1.12.0/docs/userdoc/Tutorials/PT_from_OpenStreetMap.html --- sumo-1.11.0/docs/userdoc/Tutorials/PT_from_OpenStreetMap.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/PT_from_OpenStreetMap.html 2022-01-24 23:06:32.000000000 +0000 @@ -259,7 +259,7 @@
        This page was last edited on: 12 April 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/PublicTransport.html sumo-1.12.0/docs/userdoc/Tutorials/PublicTransport.html --- sumo-1.11.0/docs/userdoc/Tutorials/PublicTransport.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/PublicTransport.html 2022-01-24 23:06:32.000000000 +0000 @@ -153,16 +153,16 @@ - - +
      @@ -236,7 +236,7 @@ Simultaneously people are created. Each person hurries to their favourite bus stop and waits for their bus or tram.
      They're getting picked up and brought to the target bus stop.

      Running the simulation:

      -
      ./PublicTransportTutorial.sumocfg
      +
      .docs/tutorials/public_transport/data/run.sumocfg
       

      @@ -261,56 +261,53 @@

      When saving the net you should as well save your additionals. Bus stops should be written in the additional.add.xml file to provide the stops for the people and vehicles.
      An example how an xml code for the bus stop may look like:

      -
      <busStop id="busStop_-gneE0_1_7" lane="-gneE0_1" startPos="519.30" endPos="529.30"/>
      +
          <busStop id="A_bus" lane="-E1_1" startPos="14.42" endPos="24.42"/>
      +    <busStop id="A_tram1" lane="-E4_0" startPos="13.43" endPos="43.43">
      +        <access lane="E1_0" pos="175.00"/>
      +    </busStop>
       
      -

      You can go ahead and create a basic net to your liking and save it as net.net.xml, -as well as the bus stops by just saving the additionals.

      -

      Routes#

      +

      If a busStop is on an edge that does not permit pedestrians (i.e. tram track) it must be connected to the rest of the network with <access> elements (also in the netedit additional-mode).

      +

      Public Transport#

      The created bus stops can be used as the stopping points within the route declaration.
      Those routes can later be assigned to vehicles, in this case the trams and buses. The routes are written into the routes.rou.xml file.
      -Below you can see examples from the code for the routes of the trams and buses. -Additionally there is a duration how long the tram/bus is stopping at given stop.

      -
      <route id="tramRoute" edges="gneE10 -gneE10 " >
      -            <stop busStop="busStop_gneE10_1_5" duration="20"/>
      -            <stop busStop="busStop_-gneE10_1_6" duration="20"/>
      -            <stop busStop="busStop_-gneE10_1_5" duration="20"/>
      -</route>
      -
      -
      -<route id="busRoute" edges="-gneE2 -gneE1 -gneE0 -gneE3 -gneE2" >
      -            <stop busStop="busStop_-gneE1_0_1" duration="20"/>
      -            <stop busStop="busStop_-gneE0_1_7" duration="20"/>
      -</route>
      -
      - -

      You can write your own routes for your net using netedit or writing them in the xml file.
      -The busStop parameter in routes should be a existing busStop in the additional.add.xml file.

      -

      So far we created a net, some bus stops and routes.

      -

      Demand#

      -

      All demands of this tutorial are written into the routes.rou.xml file.
      -The demand consists out of different person-, tram- and bus-flows. The vehicle flows are -getting the routes assigned that where created earlier.

      -

      The person flow defines the travel behaviour of the people. For this small example -the person flow walks from an existing edge in the net to a bus stop to wait for -their ride (lines="tram"/lines="bus") to bring them to their destination.

      -

      First you have to declare the type of vehicle that is used in a flow via vType. -The id from vType is then used as the type parameter within the flow.

      -
      <vType color="1,1,0" maxSpeed="70" minGap="3" length="12" sigma="0" decel="4.5" accel="2.6" id="Tram" personCapacity="8" vClass="tram"/>
      -<vType color="1,1,0" maxSpeed="70" minGap="3" length="12" sigma="0" decel="4.5" accel="2.6" id="Bus" personCapacity="8" vClass="bus"/>
      +Below you can see examples from the code for the routes of the trams and buses.

      +

      To obtain a repeating schedule multiple approaches are feasible

      +
        +
      • define repeating vehicles (<flow>) that disappear after running the route once. This is useful if the network does not contain the full circuit of the route
      • +
      • define a single vehicle with a repeating route. This is ideal for letting delays from one round of the scheduel carry over to the next round
      • +
      +
          <vType id="bus" vClass="bus"/>
      +    <vType id="tram" vClass="tram"/>
       
      -<flow type="Tram" line="tram" id="flow_0" begin="1.00" route="tramRoute" end="3600.00" number="25" />
      -<flow type="Bus"  line="bus" id="flow_1" begin="1.00" route="busRoute" end="3600.00" number="25" />
      +    <route id="busRoute" edges="-E1 -E0 -E3 -E2" color="yellow" repeat="10" cycleTime="140">
      +        <stop busStop="A_bus" duration="20.00" until="30.00"/>
      +        <stop busStop="B_bus" duration="20.00" until="90.00"/>
      +    </route>
      +
      +    <vehicle id="bus" type="bus" depart="0.00" line="42" route="busRoute"/>
      +
      +    <flow id="tram1" type="tram" begin="0.00" end="3600.00" period="300.00" line="23">
      +        <route edges="-E4" color="cyan"/>
      +        <stop busStop="A_tram1" duration="20.00" until="30.00"/>
      +        <stop busStop="B_tram1" duration="20.00" until="45.00"/>
      +    </flow>
      +
      -<personFlow id="TramPerson_0" begin="0.00" end="3600.00" number="80" > - <walk from="gneE1" busStop="busStop_-gneE10_1_6"/> - <ride busStop="busStop_-gneE10_1_5" lines="tram"/> -</personFlow> +

      Schedules#

      +

      Buses and trams usually run by strict schedules in daily life. Similar alterations are possible in Sumo and vital when using intermodal routing.
      +Such schedules are defined with the attribute until. The until attribute is set for the stops. +The vehicle following this schedule can't leave this stop until this time ('until') has passed and the minimum stoppping time ('duration') has also passed.

      +

      Demand#

      +

      The travel demand consists of persons that can choose their mode of transport freely

      +
         <personFlow id="AB" begin="0" end="3600" probability="0.1">
      +        <personTrip from="-E1" to="-E0" arrivalPos="-20" modes="public"/>
      +    </personFlow>
       
      -

      If you don't want to write a flow, you can assign vehicles and people their routes -individually.

      +

      Instead of flows, all persons and vehicles can also be defined individually and person plans can be defined with explicit steps. +Use sumo option --vehroute output to learn how a <personFlow> is expanded into multiple travel stages during the simulation.

      <person id="HeadingBusstop20" depart="1.00" color="green">
            <walk from="gneE1" busStop="busStop_-gneE10_1_6"/>
            <ride busStop="busStop_-gneE10_1_5" lines="tram"/>    
      @@ -322,23 +319,8 @@
       </vehicle>
       
      -

      Schedules#

      -

      Buses and trams usually run by strict schedules in daily life. Similar alterations are possible in Sumo and vital when using intermodal routing.
      -Such schedules are defined with the attribute until. The until attribute is set for the stops. -The vehicle following this schedule can't leave this stop until this time has passed and the eventual added duration.
      -This entails that if both, until and duration are used, this might cause a traffic delay, because the vehicle still waits at the bus stop when running late.

      -
      <route id="busRoute" edges="-gneE2 -gneE1 -gneE0 -gneE3 -gneE2" >
      -      <stop busStop="busStop_-gneE1_0_1" duration="20"/>
      -      <stop busStop="busStop_-gneE0_1_7" until="00170" duration="20"/>
      -</route>
      -
      -

      Alteration of the busRoute.The bus stops until 170 at the uppermost bus stop.

      -

      Notice that when running the simulation that the next buses and trams have the same schedule, just adjusted -to their departure time. This is handled differently depending on you implementation of until. -It is possible to use the until attribute with flows, trips and routes. The time declaration can also be written in human-readable times.

      -

      It is beneficial to add the schedules to your implementation and to newly added stops to avoid errors when using intermodal routing.

      sumocfg#

      As you probably have seen from other tutorials you bind everything together with a sumocfg. Within you set the net, route and additional files.
      @@ -348,14 +330,10 @@ <input> <net-file value="net.net.xml"/> - <route-files value="routes.rou.xml"/> - <additional-files value="additional.add.xml"/> + <route-files value="pt.rou.xml,persons.rou.xml"/> + <additional-files value="stops.add.xml"/> </input> - <time> - <begin value="0"/> - <end value="10000"/> - </time> </configuration>

      @@ -372,10 +350,10 @@
      -
      This page was last edited on: 18 March 2021 +
      This page was last edited on: 01 December 2021
      -

      Copyright © 2001-2021 German Aerospace Center (DLR) and others.

      +

      Copyright © 2001-2022 German Aerospace Center (DLR) and others.

      Follow us on | Documentation built with MkDocs

      diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/quick_start.html sumo-1.12.0/docs/userdoc/Tutorials/quick_start.html --- sumo-1.11.0/docs/userdoc/Tutorials/quick_start.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/quick_start.html 2022-01-24 23:06:32.000000000 +0000 @@ -361,11 +361,11 @@

      Eighth.png

      Now you should be able to create the rest of the given nodes and edges in this example and change the names, the number of lanes, and reset the -positions. Don't forget to save your work from time to time. The Dummy -nodes 911-914 are needed for analyzing the traffic performance on the -incoming and outgoing links in the network. More dummy nodes can be -applied if needed (such as for accurate geometric alignment or for the -specification of detector locations).

      +positions. Don't forget to save your work from time to time.

      +

      The junctions 911-914 aren't really needed. +Splitting an length of road into multiple edges is necessary when an attribute such as speed or numLanes changes. +Distinct edges may also be useful for analyzing the traffic performance in more detail. +To model curved roads it is sufficient to modify the shape of an edge using 'move mode'.

      • Next step would be to define the connections between the edges. To see which connections are already build automatically, please select @@ -807,10 +807,10 @@
        -
        This page was last edited on: 12 February 2021 +
        This page was last edited on: 26 November 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/Quick_Start_old_style.html sumo-1.12.0/docs/userdoc/Tutorials/Quick_Start_old_style.html --- sumo-1.11.0/docs/userdoc/Tutorials/Quick_Start_old_style.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/Quick_Start_old_style.html 2022-01-24 23:06:32.000000000 +0000 @@ -789,7 +789,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/ScenarioGuide.html sumo-1.12.0/docs/userdoc/Tutorials/ScenarioGuide.html --- sumo-1.11.0/docs/userdoc/Tutorials/ScenarioGuide.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/ScenarioGuide.html 2022-01-24 23:06:32.000000000 +0000 @@ -353,7 +353,7 @@
        This page was last edited on: 05 May 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/SUMOlympics.html sumo-1.12.0/docs/userdoc/Tutorials/SUMOlympics.html --- sumo-1.11.0/docs/userdoc/Tutorials/SUMOlympics.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/SUMOlympics.html 2022-01-24 23:06:32.000000000 +0000 @@ -389,7 +389,7 @@
        This page was last edited on: 12 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/TaxiService.html sumo-1.12.0/docs/userdoc/Tutorials/TaxiService.html --- sumo-1.11.0/docs/userdoc/Tutorials/TaxiService.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/TaxiService.html 2022-01-24 23:06:32.000000000 +0000 @@ -394,7 +394,7 @@
        This page was last edited on: 14 April 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/Trace_File_Generation.html sumo-1.12.0/docs/userdoc/Tutorials/Trace_File_Generation.html --- sumo-1.11.0/docs/userdoc/Tutorials/Trace_File_Generation.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/Trace_File_Generation.html 2022-01-24 23:06:32.000000000 +0000 @@ -279,7 +279,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/TraCI4Traffic_Lights.html sumo-1.12.0/docs/userdoc/Tutorials/TraCI4Traffic_Lights.html --- sumo-1.11.0/docs/userdoc/Tutorials/TraCI4Traffic_Lights.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/TraCI4Traffic_Lights.html 2022-01-24 23:06:32.000000000 +0000 @@ -295,7 +295,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Tutorials/TraCIPedCrossing.html sumo-1.12.0/docs/userdoc/Tutorials/TraCIPedCrossing.html --- sumo-1.11.0/docs/userdoc/Tutorials/TraCIPedCrossing.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Tutorials/TraCIPedCrossing.html 2022-01-24 23:06:32.000000000 +0000 @@ -278,7 +278,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Vehicle_Type_Parameter_Defaults.html sumo-1.12.0/docs/userdoc/Vehicle_Type_Parameter_Defaults.html --- sumo-1.11.0/docs/userdoc/Vehicle_Type_Parameter_Defaults.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Vehicle_Type_Parameter_Defaults.html 2022-01-24 23:06:32.000000000 +0000 @@ -627,7 +627,7 @@
        This page was last edited on: 28 September 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Versioning.html sumo-1.12.0/docs/userdoc/Versioning.html --- sumo-1.11.0/docs/userdoc/Versioning.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Versioning.html 2022-01-24 23:06:32.000000000 +0000 @@ -258,7 +258,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/XMLValidation.html sumo-1.12.0/docs/userdoc/XMLValidation.html --- sumo-1.11.0/docs/userdoc/XMLValidation.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/XMLValidation.html 2022-01-24 23:06:32.000000000 +0000 @@ -319,7 +319,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.10.0_to_Version_0.10.1.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.10.0_to_Version_0.10.1.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.10.0_to_Version_0.10.1.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.10.0_to_Version_0.10.1.html 2022-01-24 23:06:32.000000000 +0000 @@ -186,7 +186,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.10.1_to_Version_0.10.2.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.10.1_to_Version_0.10.2.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.10.1_to_Version_0.10.2.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.10.1_to_Version_0.10.2.html 2022-01-24 23:06:32.000000000 +0000 @@ -258,7 +258,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.10.2_to_Version_0.10.3.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.10.2_to_Version_0.10.3.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.10.2_to_Version_0.10.3.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.10.2_to_Version_0.10.3.html 2022-01-24 23:06:32.000000000 +0000 @@ -212,7 +212,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.10.3_to_Version_0.11.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.10.3_to_Version_0.11.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.10.3_to_Version_0.11.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.10.3_to_Version_0.11.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -310,7 +310,7 @@
        This page was last edited on: 12 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.11.0_to_Version_0.11.1.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.11.0_to_Version_0.11.1.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.11.0_to_Version_0.11.1.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.11.0_to_Version_0.11.1.html 2022-01-24 23:06:32.000000000 +0000 @@ -257,7 +257,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.11.1_to_Version_0.12.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.11.1_to_Version_0.12.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.11.1_to_Version_0.12.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.11.1_to_Version_0.12.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -237,7 +237,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.12.0_to_Version_0.12.1.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.12.0_to_Version_0.12.1.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.12.0_to_Version_0.12.1.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.12.0_to_Version_0.12.1.html 2022-01-24 23:06:32.000000000 +0000 @@ -211,7 +211,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.12.1_to_Version_0.12.2.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.12.1_to_Version_0.12.2.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.12.1_to_Version_0.12.2.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.12.1_to_Version_0.12.2.html 2022-01-24 23:06:32.000000000 +0000 @@ -191,7 +191,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.12.2_to_Version_0.12.3.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.12.2_to_Version_0.12.3.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.12.2_to_Version_0.12.3.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.12.2_to_Version_0.12.3.html 2022-01-24 23:06:32.000000000 +0000 @@ -207,7 +207,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.12.3_to_Version_0.13.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.12.3_to_Version_0.13.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.12.3_to_Version_0.13.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.12.3_to_Version_0.13.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -320,7 +320,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.13.0_to_Version_0.13.1.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.13.0_to_Version_0.13.1.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.13.0_to_Version_0.13.1.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.13.0_to_Version_0.13.1.html 2022-01-24 23:06:32.000000000 +0000 @@ -281,7 +281,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.13.1_to_Version_0.14.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.13.1_to_Version_0.14.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.13.1_to_Version_0.14.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.13.1_to_Version_0.14.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -287,7 +287,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.14.0_to_Version_0.15.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.14.0_to_Version_0.15.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.14.0_to_Version_0.15.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.14.0_to_Version_0.15.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -285,7 +285,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.15.0_to_Version_0.16.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.15.0_to_Version_0.16.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.15.0_to_Version_0.16.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.15.0_to_Version_0.16.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -434,7 +434,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.16.0_to_Version_0.17.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.16.0_to_Version_0.17.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.16.0_to_Version_0.17.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.16.0_to_Version_0.17.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -352,7 +352,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.17.0_to_Version_0.17.1.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.17.0_to_Version_0.17.1.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.17.0_to_Version_0.17.1.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.17.0_to_Version_0.17.1.html 2022-01-24 23:06:32.000000000 +0000 @@ -202,7 +202,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.17.1_to_Version_0.18.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.17.1_to_Version_0.18.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.17.1_to_Version_0.18.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.17.1_to_Version_0.18.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -384,7 +384,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.18.0_to_Version_0.19.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.18.0_to_Version_0.19.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.18.0_to_Version_0.19.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.18.0_to_Version_0.19.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -430,7 +430,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.19.0_to_Version_0.20.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.19.0_to_Version_0.20.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.19.0_to_Version_0.20.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.19.0_to_Version_0.20.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -404,7 +404,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.20.0_to_Version_0.21.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.20.0_to_Version_0.21.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.20.0_to_Version_0.21.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.20.0_to_Version_0.21.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -468,7 +468,7 @@
        This page was last edited on: 12 April 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.21.0_to_Version_0.22.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.21.0_to_Version_0.22.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.21.0_to_Version_0.22.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.21.0_to_Version_0.22.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -453,7 +453,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.22.0_to_Version_0.23.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.22.0_to_Version_0.23.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.22.0_to_Version_0.23.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.22.0_to_Version_0.23.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -544,7 +544,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.23.0_to_Version_0.24.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.23.0_to_Version_0.24.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.23.0_to_Version_0.24.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.23.0_to_Version_0.24.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -513,7 +513,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.24.0_to_Version_0.25.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.24.0_to_Version_0.25.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.24.0_to_Version_0.25.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.24.0_to_Version_0.25.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -614,7 +614,7 @@
        This page was last edited on: 12 April 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.25.0_to_Version_0.26.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.25.0_to_Version_0.26.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.25.0_to_Version_0.26.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.25.0_to_Version_0.26.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -606,7 +606,7 @@
        This page was last edited on: 12 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.26.0_to_Version_0.27.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.26.0_to_Version_0.27.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.26.0_to_Version_0.27.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.26.0_to_Version_0.27.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -485,7 +485,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.27.0_to_Version_0.27.1.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.27.0_to_Version_0.27.1.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.27.0_to_Version_0.27.1.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.27.0_to_Version_0.27.1.html 2022-01-24 23:06:32.000000000 +0000 @@ -268,7 +268,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.27.1_to_Version_0.28.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.27.1_to_Version_0.28.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.27.1_to_Version_0.28.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.27.1_to_Version_0.28.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -445,7 +445,7 @@
        This page was last edited on: 12 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.28.0_to_Version_0.29.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.28.0_to_Version_0.29.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.28.0_to_Version_0.29.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.28.0_to_Version_0.29.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -558,7 +558,7 @@
        This page was last edited on: 12 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.29.0_to_Version_0.30.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.29.0_to_Version_0.30.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.29.0_to_Version_0.30.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.29.0_to_Version_0.30.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -482,7 +482,7 @@
        This page was last edited on: 12 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.30.0_to_Version_0.31.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.30.0_to_Version_0.31.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.30.0_to_Version_0.31.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.30.0_to_Version_0.31.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -630,7 +630,7 @@
        This page was last edited on: 12 April 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.31.0_to_Version_0.32.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.31.0_to_Version_0.32.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.31.0_to_Version_0.32.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.31.0_to_Version_0.32.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -546,7 +546,7 @@
        This page was last edited on: 12 April 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.7.0_to_version_pre0.8.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.7.0_to_version_pre0.8.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.7.0_to_version_pre0.8.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.7.0_to_version_pre0.8.html 2022-01-24 23:06:32.000000000 +0000 @@ -180,7 +180,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.8.0.1_to_version_0.8.0.2.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.8.0.1_to_version_0.8.0.2.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.8.0.1_to_version_0.8.0.2.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.8.0.1_to_version_0.8.0.2.html 2022-01-24 23:06:32.000000000 +0000 @@ -247,7 +247,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.8.0.2_to_version_0.8.2.1.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.8.0.2_to_version_0.8.2.1.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.8.0.2_to_version_0.8.2.1.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.8.0.2_to_version_0.8.2.1.html 2022-01-24 23:06:32.000000000 +0000 @@ -236,7 +236,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.8.0_to_version_0.8.0.1.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.8.0_to_version_0.8.0.1.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.8.0_to_version_0.8.0.1.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.8.0_to_version_0.8.0.1.html 2022-01-24 23:06:32.000000000 +0000 @@ -216,7 +216,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.8.2.1_to_version_0.8.2.2.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.8.2.1_to_version_0.8.2.2.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.8.2.1_to_version_0.8.2.2.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.8.2.1_to_version_0.8.2.2.html 2022-01-24 23:06:32.000000000 +0000 @@ -187,7 +187,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.8.2.2_to_version_0.8.3.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.8.2.2_to_version_0.8.3.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.8.2.2_to_version_0.8.3.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.8.2.2_to_version_0.8.3.html 2022-01-24 23:06:32.000000000 +0000 @@ -184,7 +184,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.8.x_to_version_0.9.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.8.x_to_version_0.9.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.8.x_to_version_0.9.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.8.x_to_version_0.9.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -248,7 +248,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.0_to_version_0.9.1.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.0_to_version_0.9.1.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.0_to_version_0.9.1.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.0_to_version_0.9.1.html 2022-01-24 23:06:32.000000000 +0000 @@ -201,7 +201,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.9.10_to_Version_0.10.0.html sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.9.10_to_Version_0.10.0.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_Version_0.9.10_to_Version_0.10.0.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_Version_0.9.10_to_Version_0.10.0.html 2022-01-24 23:06:32.000000000 +0000 @@ -293,7 +293,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.1_to_version_0.9.2.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.1_to_version_0.9.2.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.1_to_version_0.9.2.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.1_to_version_0.9.2.html 2022-01-24 23:06:32.000000000 +0000 @@ -235,7 +235,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.2_to_version_0.9.3.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.2_to_version_0.9.3.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.2_to_version_0.9.3.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.2_to_version_0.9.3.html 2022-01-24 23:06:32.000000000 +0000 @@ -235,7 +235,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.3_to_version_0.9.4.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.3_to_version_0.9.4.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.3_to_version_0.9.4.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.3_to_version_0.9.4.html 2022-01-24 23:06:32.000000000 +0000 @@ -258,7 +258,7 @@
        This page was last edited on: 12 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.5_to_version_0.9.6.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.5_to_version_0.9.6.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.5_to_version_0.9.6.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.5_to_version_0.9.6.html 2022-01-24 23:06:32.000000000 +0000 @@ -280,7 +280,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.6_to_version_0.9.7.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.6_to_version_0.9.7.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.6_to_version_0.9.7.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.6_to_version_0.9.7.html 2022-01-24 23:06:32.000000000 +0000 @@ -233,7 +233,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.7_to_version_0.9.8.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.7_to_version_0.9.8.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.7_to_version_0.9.8.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.7_to_version_0.9.8.html 2022-01-24 23:06:32.000000000 +0000 @@ -331,7 +331,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.8_to_version_0.9.9.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.8_to_version_0.9.9.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.8_to_version_0.9.9.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.8_to_version_0.9.9.html 2022-01-24 23:06:32.000000000 +0000 @@ -355,7 +355,7 @@
        This page was last edited on: 01 March 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.9_to_version_0.9.10.html sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.9_to_version_0.9.10.html --- sumo-1.11.0/docs/userdoc/Z/Changes_from_version_0.9.9_to_version_0.9.10.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_from_version_0.9.9_to_version_0.9.10.html 2022-01-24 23:06:32.000000000 +0000 @@ -225,7 +225,7 @@
        This page was last edited on: 11 February 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_in_2018_releases.html sumo-1.12.0/docs/userdoc/Z/Changes_in_2018_releases.html --- sumo-1.11.0/docs/userdoc/Z/Changes_in_2018_releases.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_in_2018_releases.html 2022-01-24 23:06:32.000000000 +0000 @@ -1173,7 +1173,7 @@
        This page was last edited on: 26 August 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/userdoc/Z/Changes_in_2019_releases.html sumo-1.12.0/docs/userdoc/Z/Changes_in_2019_releases.html --- sumo-1.11.0/docs/userdoc/Z/Changes_in_2019_releases.html 2021-11-22 23:06:27.000000000 +0000 +++ sumo-1.12.0/docs/userdoc/Z/Changes_in_2019_releases.html 2022-01-24 23:06:32.000000000 +0000 @@ -1081,7 +1081,7 @@
        This page was last edited on: 26 August 2021
        -

        Copyright © 2001-2021 German Aerospace Center (DLR) and others.

        +

        Copyright © 2001-2022 German Aerospace Center (DLR) and others.

        Follow us on | Documentation built with MkDocs

        diff -Nru sumo-1.11.0/docs/web/docs/Car-Following-Models/ACC.md sumo-1.12.0/docs/web/docs/Car-Following-Models/ACC.md --- sumo-1.11.0/docs/web/docs/Car-Following-Models/ACC.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Car-Following-Models/ACC.md 2022-01-24 20:43:50.000000000 +0000 @@ -11,6 +11,8 @@ and (iii) gap control. A fourth mode (i.e. collision avoidance mode) has been introduced within the project [TransAID](https://www.transaid.eu). +see also [CACC model](CACC.md). + ## Speed control mode The speed control mode is designed to maintain the pre-defined by the @@ -53,6 +55,9 @@ situations. - When there is no leader vehicle, the model uses the same speed as the Krauss model to approach junctions and speed limits +!!! caution + The model is known to produce collisions at the default step-length of 1s. Better results can be achieved by setting a lower step length. + ## References 1. Milanés, V., & Shladover, S. E. (2014). Modeling cooperative and diff -Nru sumo-1.11.0/docs/web/docs/Car-Following-Models/CACC.md sumo-1.12.0/docs/web/docs/Car-Following-Models/CACC.md --- sumo-1.11.0/docs/web/docs/Car-Following-Models/CACC.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Car-Following-Models/CACC.md 2022-01-24 20:43:50.000000000 +0000 @@ -12,6 +12,8 @@ fourth mode (i.e. collision avoidance mode) has been introduced within the project [TransAID](https://www.transaid.eu). +see also [ACC model](ACC.md). + ## Speed control mode The speed control mode is designed to maintain the pre-defined by the diff -Nru sumo-1.11.0/docs/web/docs/Car-Following-Models/EIDM.md sumo-1.12.0/docs/web/docs/Car-Following-Models/EIDM.md --- sumo-1.11.0/docs/web/docs/Car-Following-Models/EIDM.md 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Car-Following-Models/EIDM.md 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,32 @@ +--- +title: Extended Intelligent Driver Model +--- + +## Overview + +The Extended Intelligent Driver Model (EIDM) [1] is based on many known model extensions of the Intelligent Driver Model (IDM) by Treiber and Kesting. +Additionally, it includes calculations to reduce the jerk in different driving situations (lane changes, accelerating from standstill, etc.). +By changing the parameters (mostly to 0), each extension can individually be turned "off". +The aim of the model is to correctly replicate submicroscopic acceleration profiles of single vehicles and drivers. + +## Notes + +- The model is intended to run with subsecond timesteps (0.05-0.5s). The model will produce unwanted emergency braking and collisions at higher step-lengths. +- The EIDM uses lower safe gaps than the IDM (e.g. when changing lanes). +- The model is based on the Improved Intelligent Driver Model, which can currently not be changed via parameters (e.g. to the IDM as base model). +- The model is still in development, future releases may include: + - spatial anticipation + - a reaction time added to the action point time + - acceleration thresholds depending on vehicle dynamics and resistance + - situation dependent driving + +!!! caution + When simulating with estimated variables, the function randNorm() is used. + Due to the calculation and rounding of the log()-function, results differ depending on the compiler/processor/operating system. For more information and a workaround, see [2]. + +## References + +1. ["Extending the Intelligent Driver Model in SUMO and Verifying the Drive Off Trajectories with Aerial Measurements"](https://sumo.dlr.de/2020/SUMO2020_paper_28.pdf); + Dominik Salles, Stefan Kaufmann, Hans-Christian Reuss. SUMO User Conference 2020. +2. Platform-dependent behavior: ["Github-issue #8921"](https://github.com/eclipse/sumo/issues/8921) +3. ["SUMO Conference presentation"](https://www.youtube.com/watch?v=0VuSguxDVv8) diff -Nru sumo-1.11.0/docs/web/docs/ChangeLog.md sumo-1.12.0/docs/web/docs/ChangeLog.md --- sumo-1.11.0/docs/web/docs/ChangeLog.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/ChangeLog.md 2022-01-24 20:43:50.000000000 +0000 @@ -2,6 +2,250 @@ title: ChangeLog --- +## Version 1.12.0 (25.01.2022) + +### Bugfixes + +- simulation + - Fixed bug where persons could enter the wrong vehicle and thereby cause a taxis simulation to crash. Issue #9821, #9733 (regression in 1.11.0) + - tripId is now updated again when passing waypoints. Issue #9751 (regression in 1.11.0) + - calibrator speed -1 no longer triggers error. Issue #9767 (regression in 1.11.0) + - Fixed invalid error on taxi dispatch. Issue #9695, #9867 + - Fix person model bug where person enters jammed state without good reason. Issue #9717 + - Fixed invalid error on mismatch between ride destination stop and vehicle destination stop. Issue #9712 + - Parking search no longer stalls when all current alternatives are known to be full. Issue #9678 + - Fixed crash when retrieving detected persons with an active vTypes filter. Issue #9772 + - Fixed various issues with emergency vehicle behavior, Issue #9310, #9768 + - Fixed bug where parkingReroute failed due to invalid rerouteOrigin. Issue #9778 + - Fixed inconsistent arrival times for trains approaching red and green signals. Issue #9788 + - Fixed slow sublane simulation on large networks with only a few vehicles. Issue #9816 + - Fixed emergency braking of carFollowModel CACC at small step lengths. Issue #9831 + - Setting **--step-length** > 1 now raises a warning for default tau. Issue #1375 + - Fixed superfluous route extension for taxi with idle-algorithm 'randomCircling'. Issue #9866 + - Fixed collisions and emergency braking for Wiedemann carFollowModel. Issue #1351, #5715, #9832 + - CarFollowModel EIDM now respects emergencyDecel. Issue #9618 + - Fixed bug in driving speed calculation for EIDM. Issue #9878 + - Stop positions between 0 and 0.1 can now be defined. Issue #9915 + - Fixed invalid collider/victim classification for junction collision. Issue #9916 + - Fixed collision on junction when long vehicle cuts a corner. Issue #4431 + - Fixned invalid junction collision warning. Issue #9920 + - Fixed junction collision when bluelight vehicle drives on red. Issue #9919 + - Fixed missing access stage after ride to busStop. Issue #9958 + - Detector ``s are noW loaded. Issue #9578 + - Various NEMA fixes. Issue #9965, #9971, #9940, #9987 + - Fixed invalid tripinfo for persons that did not finish their plan by simulation end. Issue #8461 + - When setting option **--vehroute-output.sorted**, all persons are now sorted. Issue #9929 + - Fixed deadlock at parkingArea with `onRoad="true"`. Issue #10005 + - opposite direction driving + - Fixed crash on opposite direction driving (at looped road). Issue #9718 + - Opposite direction overtaking now takes into account slopes. Issue #9719 + - Fixed collision during opposite direction driving near junction. Issue #9721 + - Fixed invalid maneuver distance when returning from opposite side. Issue #9536 + +- netedit + - Fixed bug preventing inspection of tazRelations. Issue #9728 + - splitting and merging edges with custom length now preserves total length. Issue #9617 + - can now load parkingAreaReroute without probability attribute. Issue #9640 + - Fixed invalid weights of sinks and sources when loading taz from file. Issue #9672 + - Fixed unclickable ParkingArea after moving junction with active grid. Issue #9639 + - Fixed rendering of turn direction arrows for narrow lanes. Issue #9738 + - In create-edge mode: shift-click to split edge now takes into account active grid. Issue #9624 + - Fixed crash on undo after resetting connections. Issue #9673 + - Stop attribute "triggered" now supports symbolic string values. Issue #9563 + - Fixed missing 'end' attribute when converting trip to flow. Issue #9834 + - Fixed invalid weights when loading source or sink weight for taz edge. Issue #9672 + - Routes now longer have a color unless set by the user. Issue #9512 + - Stops can no longer be created on edges that do not belong to the route. Issue #9923 + - Routes with invalid stops (invalid order or edge) now trigger a dialog for corrections on saving. Issue #9921 + - TLS mode now always shows the correct connection shape. Issue #9962 + - When splitting an edge, all routes passing that edge are now adapted. Issue #9511 + +- sumo-gui + - Fixed crash when using guiShape "truck/trailer" or "truck/semitrailer" for short vehicles. #9682 (regression in 1.11.0) + - Fixed inconsistent behavior when storing gui settings in registry. Issue #9693 + - Fixed meso vehicle tracking focus. Issue #9711 + - Exaggerating stopping place size only increases symbol size. Issue #9370 + - Fixed invisible rerouter on short edge. Issue #9779 + - Fixed invalid detector visibility when switching actuated traffic light program on. Issue #9877 + - Fixed keyboard navigation in locate object dialogs. Issue #9740 + - Rerouter symbols are no longer drawn on sidewalks. Issue #9908 + - Fixed verious inconsistences in the TLS Phase tracker. Issue #9963 + - Fixed occasional freezing during person simulation. Issue #9973 + +- netconvert + - Fixed unsafe location of internal junctions that were causing collisions in the simulation. Positioning can be controleld with option **--internal-junctions.vehicle-width** and setting this to 0 restores legacy behavior. Issue #4397 + - Fixed invalid network when importing public transport and sidewalks. Issue #9701 (regression in 1.10.0) + - Fixed invalid internal junction location. Issue #9381 + - Fixed intersection rules that could cause emergency braking at pedestrian crossing. Issue #9671 + - Fixed invalid error when loading projections with '+geogrids' entry on windows. Issue #9766 + - Fixed invalid handling of loaded roundabouts when the network is modified. Issue #9810 + - Network building now aborts when a type file could not be loaded. Issue #9392 + - Option **--ignore-errors** now ignores duplicate node ids in dlr-navteq input. Issue #8581 + - Reduced variation between platforms. Issue #9874 + - Fixed invalid connectivity at motorway ramp when importing OSM lane change prohibitions. Issue #9939 + - Fixed invalid link direction when there are multiple turnaround edges. Issue #9957 + - Options **--tls.group-signals** and **--tls.ungroup-signals** now work for pedestrian crossings. Issue #9521, #9997 + - Fixed invalid permissions when leaving multi--lane-roundabout from inner lane. Issue #10017 + - invalid edge geometry after trying to patch very short edge #10018 + - OpenDRIVE + - Fixed invalid LaneLink index in OpenDRIVE export. Issue #9637 + - Fixed too sparse geometry in OpenDRIVE import when using --geometry.min-dist. Issue #10012 + - Fixed geometry affected by spacing of non-driving lanes. Issue #4913 + - Several geometry fixes that mostly affect OpenDRIVE: #10018, #1498 + +- meso + - Fixed invalid stop arrival time in meso. Issue #9713 + - Fixed invalid ride depart time and route length when starting directly after stop. Issue #9560 + - No more warnings about small tau. Issue #9505 + - Dynamically modified road permissions (i.e. closingReroute with disallow and closingLaneReroute) are no longer ignored and can cause jamming. Issue #9950, #10010 + - Fixed invalid capacity in intermodal scenario. Issue #8167 + +- duarouter + - Option **--write-costs** now also applies to walks/rides, Option **--route-length** now applies to normal vehicles. Issue #9698 + - Fixed invalid error on mismatch between ride destination stop and vehicle destination stop. Issue #9730 + - Fixed invalid route output when using option **--remove-loops** on routes with multiple loops. Issue #9837 + - Fixed inconsistent vType defaults for speedFactor. Issue #9864 + - Fixed inconsistent railway routing results for stops on consecutive bidi-edges. Issue #9949 + - Fixed inconsistent handling of personTrips and explicit trip items. Issue #5821 + - Setting **--vtype-output NUL** now discards vtypes. Issue #9991 + +- jtrrouter + - Unsorted flows now trigger a warning. Issue #9327 + - Fixed inconsistent vType defaults for speedFactor. Issue #9864 + +- marouter + - Fixed wrong begin and end times in marouter output with additive traffic. Issue #10004 + +- traci + - New programs created via 'trafficlight.setProgramLogic' now support GUI access. Issue #549 + - turn subscription filter no longer crashes when crossings are present in foe lanes. Issue #9630 + - Fixed crash when calling vehicle.rerouteParkingArea for newly added vehicle. Issue #9755 + - Fixed invalid warnings when adding turn/lanes filter with context domain person. Issue #9760 + - TraCI server no longer hangs when trying to add a subscription filter without previous vehicle subscription. Issue #9770 + - Fixed memory leak in libsumo::TrafficLight::getCompleteRedYellowGreenDefinition. Issue #9818 + - Fixed bug where calling changeSublane with high values 'latDist' value, causes exaggerated maneuverDistance. Issue #9863 + - Fixed crash when calling getStopDelay for a vehicle that isn't in the network. Issue #9944 + +- tools + - generateParkingAreaRerouters.py: fixed distance bias against long parkingAreas. Issue #9644 + - routeSampler.py: warning message instead of crash when trying to load an empty interval. Issue #9754 + - addStopsToRoutes.py: Now handles disallowed vClass and vTypes with undefined vClass. Issue #9792 + - generateRailSignalConstraints.py: Now handles intermediate parking stops. Issue #9806 + - Fixed encoding problems in osmTaxiStop.py #9893 + - [emissionsDrivingCycle](Tools/Emissions.md#emissionsdrivingcycle) now permits loading of [electric vehicle params](Models/Electric.md#defining_electric_vehicles) via the new options **--vtype** and **--additional-files**. Issue #9930 + - plot_csv_timeline.py now supports python3. Issue #9951 + - splitroutefiles.py can now handle gzipped input on Windows. Issue #8807 + +- Miscellaneous + - Specifying NUL output on the command line finally works. Issue #3400 + - Fixed unhelpful error message when defining invalid color in XML input. Issue #9623 + - Time output beyond 25 days now works correctly with all compilers. Issue #8912 + +### Enhancements + +- simulation + - Persons are now included in saved simulation state when setting option **--save-state.transportables**. Issue #2792 + - Traffic lights of type 'actuated' and 'delay_based' now support attributes 'earliestEnd', 'latestEnd' and param 'cycleTime' to configure coordination. Issue #9748, #9885, #9889 + - Traffic lights of type 'actuated' now support [custom logical conditions](Simulation/Traffic_Lights.md#custom_switching_rules) for switching. Issue #9890 + - Added attribute speedRelative to edgeData output. Issue #9601 + - Option **--fcd-output.attributes** can now be used to active non-standard attributes (i.e. acceleration). Issue #9625 + - Rerouting period can now be customized via `` in vType or vehicle. Issue #9646 + - Detector processing now takes less time if their output file is set to 'NUL'. Issue #7772, #9620 + - Vehicle attribute [departSpeed](Definition_of_Vehicles%2C_Vehicle_Types%2C_and_Routes.md#departspeed) now supports the values 'last' and 'avg'. Issue #2024 + - Traffic light type 'NEMA': + - now supports param 'fixForceOff' which permits non-coordinated phases to use the unused time of previous phases. Issue #9848 + - Added "fully actuated" operation support. Issue #9933 + - Added "Rest in Green" functionality when not in coordinated mode. Issue #9937, #9968 + - Supporting phase skipping. Issue #9897 + - Supporting Green Transfer. Issue #9954 + - parking search: + - Parking search now supports `` which permit using free parkingArea along the way after doing unsuccessful parkingAreaReroute x times. Issue #9577 + - Parking search now supports `` which increases the preference for visibly free parkingAreas over time. Issue 9657 + - Parking search now supports `` to let driver "guess" the occupancy of invisible parkingAreas with probability x. Issue #9545 + - Vehicles now collect occupancy information for all parkingareas along the way during parking search. Issue #9645 + +- sumo-gui + - All text setting now have the checkbox "only for selected" to display text selectively. Issue #9574 + - Added vehicle setting "show parking info" which labels parking memory (block time and scores) for vehicles with active route visualization. Also, the vehicle is labeled with the number of parking reroutes since the last successful parkingArea stop. Issue #9572 + - Can now color roads "by free parking spaces". Issue #9643 + - Added context menu entry to open map location in an online map. Issue #9787 + - Vehicle size can now be scaled by attribute. Issue #9567 + - Added speedFactor to vehicle type parameter dialog. Issue #9865 + - The locate dialog has improved keyboard navigation, optional case-sensitivity and optional auto-centering. Issue #9902, #9876 + - Traffic light parameter dialog now includes cycle duration, timeInCycle, earliestEnd and latestEnd. Issue #9784 + - Parameter Tracker window enhancements: + - The value at the cursor position is now highlighted and printed. Issue #9976 + - When saving data, the time values are now included. Issue #9977 + - Plotting multiple values in the same window is now supported by activating 'Multiplot' and starting more plots. Issue #9984 + - Phase Tracker window enhancements: + - shows switch times with configure style (seconds, MM:SS, time-in-cycle). Issue #9785 + - optionally shows green phase durations. + - remembers window position and size. Issue #9826 + - shows phase index or phase name. Issue #9836 + - optionally draws states of actuation detectors. Issue #9887, #9952 + - optionally draws states of custom switching conditions. Issue #9928 + +- netedit + - Trips and flows between junctions (fromJunction, toJunction) are now supported. Issue #9081 + - The name prefixes for all created additional elements can now be configured and their defaults have been shortened. Issue #9666 + - Add images for the guiShapes in the vType attributes editor. Issue #9457 + - All output elements now write 'id' as their first attribute. Issue #9664 + - All elements of a side frame can now be collapsed/expanded. Issue #6034 + - Trips with a single edge can now be created. Issue #9758 + - Added lane context menu function "set custom shape". Issue #9741 + - Loading and setting of vTypeDistributions is now supported. Issue #9435 + - List of issues from 'demand element problems'-dialog can now be saved to file. Issue #7868 + - Lane chang prohibitions (changeLeft, changeRight) are now visualized. Issue #9942 + - Selections can now be modified based on object hierarchy (i.e. to selection junctions for all selected edges). Issue #9524 + - Improved visibility for short edges. Issue #9434 + +- netconvert + - OSM: import of public transport now supports share_taxi (PUJ) and minibus. Issue #9708 + - OSM: attribute turn:lanes is now used to determine lane-to-lane connections when option **--osm.turn-lanes** is set. Issue #1446 + - OSM: importing airports (aeroways) is now supported. Issue #9800 + - Simplified edge and junction names in OpenDRIVE import. (i.e. '42' instead of '42.0.00'). The option **--opendrive.position-ids** is provided for backward compatibility. #9463 + - Added option **--opendrive.lane-shapes** which uses custom lane shapes to account for spacing of discarded lanes. Issue #4913 + - Added option **--railway.topology.extend-priority** which extrapolates directional priorities in an all-bidi network based on initial priorities. Issue #9683 + - OpenDRIVE export and import now supports writing and reading the `` element for handling shifted geo references. Issue #4417, #10006 + +- duarouter + - can now write route costs in regular route output. Issue #9667 + +- TraCI + - 'traci.vehicle.getParameter' and 'setParameter' now support all laneChangeModel paramters. Issue #10011 + +- tools + - routeSampler.py: Option **--prefix** now also applies to route ids. Issue #9634 + - generateParkingAreaRerouters.py: added option **--prefer-visible** which prefers visible alternatives regardless of distance. Issue #9642 + - generateParkingAreaRerouters.py: added option **--distribute** which sets a distance distribution for the given number of alternatives (instead of always using the closest parkingAreas). Issue #9566 + - generateParkingAreaRerouters.py: added option **--visible-ids** to set visible parkingAreas explicitly. Issue #9669 + - addStops2Routes.py: Can now generate stationary traffic to fill each parkingArea to a configurable occupancy. Issue #9660 + - addStops2Routes.py: added option **--relpos** for configuring stop position along edge. Issue #9795 + - Added tool [generateParkingAreas.py](Tools/Misc.md#generateparkingareaspy) to generate parkingAreas for some or all edges of a network. Issue #9659 + - plot_net_dump.py now supports option **--internal** for plotting internal edges. Issue #9729 + - randomTrips.py now supports option **--random-depart** to randomize departure times. Issue #9735 + - tripinfoByType.py: now supports option **--interval** to aggregated data by depart time (or by arrival time with option **--by-arrivals**) Issue #9746 + - netdiff.py: now supports option **--plain-geo** to write locational diffs in geo coordinates. Issue #9808 + - netdiff.py: now also writes diff for edge type file. Issue #9807 + - implausibleRoutes.py: now supports option **--xml-output** to write route scores for post-processing. Issue #9862 + - randomTrips.py: now support option **--fringe-junctions** to determine the fringe from [junction attribute 'fringe'](Networks/PlainXML.md#fringe). Issue #9948 + +### Miscellaneous + +- SUMO can now be installed from python wheels. This provides up to date [release](Downloads.md#python_packages_virtual_environments) and nightly versions (via test.pypi.org) for all platforms. #4639 +- Added [documentation on road capacity and headways](Simulation/RoadCapacity.md). Issue #9870 +- Added [documentation for signal plan visualization](Simulation/Traffic_Lights.md#signal_plan_visualization) +- Traffic light type 'NEMA' now uses attribute 'offset' instead of param key="offset". Issue #9804 +- The [generated detector names for actuated traffic lights](Simulation/Traffic_Lights.md#detectors) have been simplified. Issue #9955 +- Speed up Visual Studio build with sccache (only works with Ninja not with Visual Studio projects). Issue #9290 +- The text "Loading configuration" is printed now only if **--verbose** is given. Issue #9743 +- vType attribute 'minGapLat' is now stored for each vehicle ([similar to other lane change model attributes](TraCI/Change_Vehicle_State.md#relationship_between_lanechange_model_attributes_and_vtypes)). Issue #9769 +- The download 'sumo-all.zip' is no longer provided (use git clone instead). Issue #9794 +- Updated Eigen library Issue #9613 +- Updated GDAL library Issue #9614 +- Updated gtest library Issue #9616 +- The ubuntu ppa now contains ARM builds as well + ## Version 1.11.0 (23.11.2021) ### Bugfixes @@ -25,6 +269,7 @@ - Fixed emergency braking during opposite-direction overtaking. Issue #9183, #9184, #9185, #9297, #9530 - Fixed invalid collision warning during opposite direction driving. Issue #9388 - Fixed bug where frontal collision between fast vehicles was not detected. Issue #9402 + - Fixed rail_signal bug that could cause a flanking conflict to be ignored. Issue #9612 - sublane - Fixed invalid behavior after using stop posLat in non-sublane simulation. Issue #9013 - Fixed deadlock when using lcSigma without sublane model. Issue #9395 @@ -53,7 +298,7 @@ - network mode: additionals - Fixed probability statistics and coloring in taz mode. Issue #9107 (regression in 1.7.0) - Fixed crash when creating reverse edge with "both directions" active. Issue #9408 (regression in 1.8.0) - - Inverting selection of shapes now works even when no edges are loaded. Issue #8951 (regresssion in 1.9.2) + - Inverting selection of shapes now works even when no edges are loaded. Issue #8951 (regression in 1.9.2) - BusStops with '/' in their name can now be loaded gain. Issue #9064 (regression in 1.10.0) - Fixed disappearance of connecting lines between E3 detector and its entry/exit elements. Issue #8916 - trainStops with access can now be loaded. Issue #8969 @@ -68,7 +313,7 @@ - network mode: other - Copying one of several traffic light programs now copies the correct one. Issue #7963 - Adding a bicycle lane via lane context menu now respects option **--default.bikelane-width** Issue #9073 - - Fixed missung turnaround after adding bike lane. Issue #9079 + - Fixed missing turnaround after adding bike lane. Issue #9079 - Fixed invalid drawing style for lane that allows tram and bus. Issue #9089 - Fixed invalid edge type attributes in saved network. Issue #9070 - Fixed invalid linkIndex2 for indirect left turn after modifying an existing turn. Issue #9102 @@ -99,26 +344,26 @@ - Fixed slow stepping on windows when the simulation has little to do. Issue #6371 - Fixed unresponsive UI on linux when the simulation has little to do. Issue #9028 - Speed mode in vehicle parameter dialog now shows all 6 bits. Issue #9078 - - Option **--no-warnings** now supresses warnings from actuated tls. Issue #9104 + - Option **--no-warnings** now suppresses warnings from actuated tls. Issue #9104 - Fixed crash on pressing "recalibrate rainbow" button when taz files are loaded. #9119 - Fixed invalid error when defining step-length with human readable time. Issue #9196 - - Coloring by edgedata is now working in meso. Issue #9215 + - Coloring by edgeData is now working in meso. Issue #9215 - Edge color value is now correct when coloring 'by angle'. Issue #9431 - Color values for 'color by edge data' are now loaded from settings file. Issue #9462 - Small text placement fixes. Issue #9477, #9476, #9467 - Fixed freezing in person simulation. Issue #9468 - - Fixed crash when loading edgeData with inconsisten interval times. Issue #9502 + - Fixed crash when loading edgeData with inconsistent interval times. Issue #9502 - netconvert - Connection attribute visibility is now working if the connection has an internal junction. Issue #8953 - - Fixed crash when importing OpenDrive with internal lane shapes when the input defines no width. Issue #9009 + - Fixed crash when importing OpenDRIVE with internal lane shapes when the input defines no width. Issue #9009 - Attribute 'color' and generic params of loaded stops are now kept. Issue #9011, #9048 - Guessed bicycle lanes are now always placed to the left of an existing sidewalk. Issue #9084 - Fixed invalid connections after guessing bicycle lanes. Issue #9083 - Option **--no-turnarounds.geometry** now ignores pedestrian paths and bike paths that attach to the main road. Issue #9068 - Fixed missing tlType in plain .nod.xml output. Issue #9281 - Fixed invalid network when importing OSM with 'nan' values for maxspeed. Issue #9302 - - Fixed crash when loading joined traffic lights togher with option **--tls.join**. Issue #9299 + - Fixed crash when loading joined traffic lights together with option **--tls.join**. Issue #9299 - Fixed errors and invalid shape when converting short roads with arc-geometry from OpenDRIVE. Issue #9332 - Option **--flatten** now works for OpenDRIVE input. Issue #9447 - Option **--geometry.min-dist** no longer changes OpenDRIVE topology. Issue #9448 @@ -173,11 +418,12 @@ - Fixed warning "splitting vector close to end" when using subscription filter. Issue #9404 - Fixed invalid expected vehicle number after failed vehicle.add. Issue #9456 - Fixed crash when using libtraci repeatedly. Issue #9478 - - 'traci.vehicle.getLaneChangeState' now longer inclues 'TraCI' in the 'state-without-traci' component. Issue #9492 - - Fixeds bug where command 'traci.vehicle.changeLane' was ignored in sublane simulation. Issue #9147, #9493 + - 'traci.vehicle.getLaneChangeState' no longer includes 'TraCI' in the 'state-without-traci' component. Issue #9492 + - Fixed bug where command 'traci.vehicle.changeLane' was ignored in sublane simulation. Issue #9147, #9493 - Function 'traci.vehicle.replaceStop' no longer fails while on junction. Issue #9467 - Fixed invalid stop duration reported after updating duration with setStop. Issue #9522 - Added missing convenience functions in traci.vehicle (i.e. 'isAtBusstop' to libsumo and libtraci python bindings. Issue #9591 + - Fixed missing vehicles when using subscriptionFilterLateralDistance. Issue #9603 - tools - cutRoutes.py: Fixed mixed usage of trainStop and busStop. Issue #8982 @@ -204,9 +450,9 @@ - simulation - Traffic light type "NEMA" is now supported and implements a NEMA compliant dual-ring controller. Issue #9520 (Thanks to Qichao Wang and NREL) - Added new electric vehicle model ["MMPEVEM"](Models/MMPEVEM.md). Issue #8764 (Thanks to Kevin Badalian and the MMP, RHTW Aachen) - - Detectortype (E1, E2, E3) now support [attribute 'detectPersons'](Simulation/Pedestrians.md#detectors_for_pedestrians) to detect pedestrians and passengesr. Issue #5252 + - Detectortype (E1, E2, E3) now support [attribute 'detectPersons'](Simulation/Pedestrians.md#detectors_for_pedestrians) to detect pedestrians and passengers. Issue #5252 - When option **--vehroute-output.exit-times** is set, The output for walk,ride, transport and tranship now includes the values 'started' and 'ended.' Issue #9005 - - Added option **--weights.separate-turns FLOAT**. When this is set to values in ]0,1] routing in the simulation will distinguish travel times by turning direction (i.e. to prefer right turns over left truns where the latter are a cause of delay). Issue #2566 + - Added option **--weights.separate-turns FLOAT**. When this is set to values in ]0,1] routing in the simulation will distinguish travel times by turning direction (i.e. to prefer right turns over left turns where the latter are a cause of delay). Issue #2566 - If a simulation includes bicycles, they will get a separate section in trip statistics for bicycles. Issue #9069 - Added option **--vehroute-output.speedfactor**. When this is set, the vehicle specific speed factor will be written in the output. If the vehicle defines a departSpeed, this defaults to 'true'. Issue #9199 - BoardingDuration / loadingDuration are now also applied when exiting a vehicle. Issue #4216 @@ -236,8 +482,7 @@ - Added vehicle context menu function 'Select transported'. Issue #2241 - Time range and intervals in loaded edgedata are now reported. Issue #9217 - Meso vehicles are now drawn with interpolated positions - - Segment boundaries are now drawn in meso simulation. Issue #9227 - - Added support for custom coloring of busStops. Issue #8280 + - Segment boundaries are now drawn in meso simulation. Issue #9227 - Breakpoints are now rounded down to reachable step value. Issue #6789 - Clicking on timestamps in message window now creates breakpoints with a configurable offset. Issue #7617 - Lane params and street names are now shown in meso edge parameter dialog. Issue #9300 @@ -266,9 +511,9 @@ - Colors for traffic demand elements (routes, stops, ...) can now be customized in the 'Demand' tab of the view settings dialog. Issue #6318 - Added options **--node-prefix**, **--edge-prefix** and **--edge-infix** to customize the default names for new objects. Issue #4375 - New default prefix for edges is 'E' and new prefix for junctions is 'J'. Issue #9424 - - Generic paramters (``) of traffic light programs can now be edited in the traffic light frame. Issue #7659 + - Generic parameters (``) of traffic light programs can now be edited in the traffic light frame. Issue #7659 - [stopOffset](Networks/PlainXML.md#stop_offsets) can now be defined. Issue #3799 - - Object attributes that are computed rather than user-defined (i.e. edge length) are now distinguised in blue. Issue #4633 + - Object attributes that are computed rather than user-defined (i.e. edge length) are now distinguished in blue. Issue #4633 - Stopping places can now be resized via shift + drag #3966 - Loaded rerouters are now drawn near their edges rather than (0, 0), when no position is defined. Issue #9365 - Parking spaces and textured POIs can now be resized with the mouse. Issue #8825 @@ -291,23 +536,23 @@ - tazRelation files (as written by netedit) are now supported as OD-matrix definition. Issue #9057 - duarouter & jtrrouter - - Added option **--named-routes** which writes routes with an id and lets vehicles reference them. Can reduce output size if many vehicles using the same route. Issue #8643 + - Added option **--named-routes** which writes routes with an id and lets vehicles reference them. Can reduce output size if many vehicles are using the same route. Issue #8643 - meso - Tau value of vehicles types now affect simulation (by acting as a multiplier on the segment tau value) Issue #9356 - marouter - tazRelation files (as written by netedit) are now supported as OD-matrix definition. Issue #9057 - - **--netload-output** now includes 'density' and 'laneDensity' and 'speedRelative. Issue #9197 + - **--netload-output** now includes 'density' and 'laneDensity' and 'speedRelative'. Issue #9197 - traci - Added function 'traci.simulation.getEndTime' to retrieve the **--end** value that was set when starting sumo. Issue #2764 - addSubscriptionFilterTurn can now be combined (additively) with addSubscriptionFilterLateralDistance and with addSubscriptionFilterLanes. Issue #9177 - Added function 'traci.person.remove' Issue #9351 - Improved warning messages when 'traci.vehicle.replaceStop', or 'changeTarget' fails. Issue #9453 - - Added functions retrieve aggregated traffic measures from E3-detector. Issue #9501 + - Added functions to retrieve aggregated traffic measures from E3-detector. Issue #9501 - Libtraci now supports 'Simulation::start'. Issue #6466 - - Added functions 'trafficlight.setNemaSplits' and 'setNemaOffset' to control the split and offset of NEMA-type controllers. Issue #9520 + - Added functions 'trafficlight.setNemaSplits', 'setNemaMaxGreens', 'setNemaCycleLength' and 'setNemaOffset' to control the split and offset of NEMA-type controllers. Issue #9520 - tools - cutRoutes.py: Can now handle multiple additional and public transport files in input. Issue #8997 @@ -315,7 +560,7 @@ - Added tool [addTAZ.py](Tools/Routes.md#addtazpy) for adding taz information to route files. Issue #8884 - osmWebWizard.py now imports all bicycle lane data when building scenario with bicycle traffic. Issue #9071 - osmWebWizard.py uses improved pedestrian routing on shared space. Issue #9100 - - osmWebWizard.py now [avoids duplicate sidewalks](Networks/Import/OpenStreetMap.md#sidwalks_from_osm) when building a simulation with persons. Rebuild network with **osm.sidewalks False** to replicate the old behavior (for areas that lack OSM sidewalk data). Issue #9444 + - osmWebWizard.py now [avoids duplicate sidewalks](Networks/Import/OpenStreetMap.md#sidwalks_from_osm) when building a simulation with persons. Rebuild network with **--osm.sidewalks False** to replicate the old behavior (for areas that lack OSM sidewalk data). Issue #9444 - [gridDistricts.py](Tools/District.md#griddistrictspy) now supports option **--vclass** for filtering taz edges in multi-modal networks. Issue #9127 - Added tool [route2OD.py](Tools/Routes.md#route2odpy) which generates a [tazRelation-file (OD-Matrix)](Demand/Importing_O/D_Matrices.md#tazrelation_format) from a taz-file and route-file. Issue #9117 - Major speedup in GTFS import with [gtfs2pt](Tools/Import/GTFS.md). Issue #9136 @@ -325,18 +570,19 @@ - generateContinousRerouters.py: added option **--vlcass** to avoid errors in multi-modal networks. Issue #9188 - generateTurnRatios.py: Added option **--interval** to write time-dependent turn counts / ratios. Issue #9294 - duaIterate.py: Now supports options **--save-configuration** (**-C**) and **--configuration-file** (**-c**) to save and load configurations. Issue #9314 - - Added tool [computePassengercounts.py](Tools/Output.md#computepassengercountspy) to count passenger number in vehicle over time #9366 + - Added tool [computePassengerCounts.py](Tools/Output.md#computepassengercountspy) to count passenger number in vehicle over time #9366 - [generateParkingAreaRerouters.py](Tools/Misc.md#generateparkingarearerouterspy) - added option **--opposite-visible** to ensure that parking areas on the opposite direction road are visible. Issue #9372 - now runs much faster. Issue #9379 - - routeSampler.py: added option **--min-count** to set mininum number of counting locations for each used route. Issue #9415 - - Added tool [scheduleStats](Tools/Railways.md#schedulestatspy) to analyze deviations between loaded public transport schedules and simulation timing. Issue #8420 + - routeSampler.py: added option **--min-count** to set minimum number of counting locations for each used route. Issue #9415 + - Added tool [scheduleStats.py](Tools/Railways.md#schedulestatspy) to analyze deviations between loaded public transport schedules and simulation timing. Issue #8420 - Added tool [plotXMLAttributes.py](Tools/Visualization.md#plotxmlattributespy) to generated 2D-plots from arbitrary attribute of XML files. Issue #9403 - osmTaxiStop.py: added option **--fleet-size** to generated a taxi fleet along with the stops. Issue #9116 - sumolib.net.getShortest path now allows using edges in both directions for pedestrian route search (`ignoreDirection="true"`). Issue #9533 - - [addStops2Routes.py](Tools/Routes.md#addstops2routespy) received new options to define stops at parkingAreas, add stops to persons and to define stationary (parkig) traffic. Issue #3607, #9561, #9562 + - [addStops2Routes.py](Tools/Routes.md#addstops2routespy) received new options to define stops at parkingAreas, add stops to persons and to define stationary (parking) traffic. Issue #3607, #9561, #9562 - library functions 'sumolib.xml.parse_fast' and 'parse_fast_nested' can now handle XML-comments. Issue #8565 - - Added tool [](Tools/Output.md#parkingsearchtrafficpy) to analyze reroute times and distances for parking search traffic. Issue #9534 + - Added tool [parkingSearchTraffic.py](Tools/Output.md#parkingsearchtrafficpy) to analyze reroute times and distances for parking search traffic. Issue #9534 + - Added tool [tripinfoByType.py](Tools/Output.md#tripinfobytypepy) for aggregating tripinfo output by vType #9596 ### Other @@ -352,7 +598,6 @@ - polyconvert: When no network is loaded, output will now be in lon,lat by default (if the input is geo-referenced) in order to be useful with any network. The old behavior of writing raw utm values in this case can be restored by setting option **--proj.plain-geo false**. - duaIterate.py option **-C** is no longer a synonym for **--continue-on-unbuild**. Instead, it is a shortcut for **--save-configuration**. Issue #9314 - ## Version 1.10.0 (17.08.2021) ### Bugfixes @@ -382,7 +627,7 @@ - Fixed briefly invisible vehicle while passing short internal edge. Issue #8749 (regression in 1.9.0) - Drawing parkingAreas with large roadsideCapacity no longer causes the gui to slow down. Issue #8400 - Fixed invalid window size after using "restore" button. Issue #8826 - - Fixed flickering whiile vehicles drive on the opposite side. Issue #8887 + - Fixed flickering while vehicles drive on the opposite side. Issue #8887 - Invisible vehicles (alpha=0) no longer register clicks. Issue #8913 - Fixed invalid position of size-exaggerated persons at a size-exaggerated busStop. Issue #8883 - Fixed hidden context menu near the screen border. Issue #8860 diff -Nru sumo-1.11.0/docs/web/docs/Contributed/index.md sumo-1.12.0/docs/web/docs/Contributed/index.md --- sumo-1.11.0/docs/web/docs/Contributed/index.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Contributed/index.md 2022-01-24 20:43:50.000000000 +0000 @@ -115,6 +115,10 @@ - [SumoNetVis](https://pypi.org/project/SumoNetVis/) A python library to render Sumo network files and trajectories with matplotlib or as an OBJ file. + +- [SESAM](https://sesam.co4e.com) + + SUMO as a cloud service to build, run and analyze simulation scenarios, developed by the DLR spin-off company co4e GmbH # Purgatory diff -Nru sumo-1.11.0/docs/web/docs/Contributed/SUMOPy/Installation/Linux.md sumo-1.12.0/docs/web/docs/Contributed/SUMOPy/Installation/Linux.md --- sumo-1.11.0/docs/web/docs/Contributed/SUMOPy/Installation/Linux.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Contributed/SUMOPy/Installation/Linux.md 2022-01-24 20:43:50.000000000 +0000 @@ -32,4 +32,19 @@ sudo rm /etc/apt/sources.list.d/wily-copies.list sudo apt update -``` \ No newline at end of file +``` + +SUMOPy now supports wxWidgets 3.0. Here are the steps I needed to do with openSUSE 15.3: +``` +sudo zypper addrepo https://download.opensuse.org/repositories/Application:/Geo/openSUSE_Leap_15.3/ Application:Geo +sudo zypper in python-wxWidgets-3_0 python2-opengl python-basemap python2-matplotlib python2-numpy python2-Pillow +sudo pip2 install pyproj +``` +Unfortunately pyproj is only available via pypi while python-wxWidgets-3_0 and python-basemap are not available via pypi so you need to use both sources. + +You can install pyproj also in a virtualenv if you prefer, then you need to replace the last line with: +``` +python2 -m virtualenv --system-site-packages sumopyenv +. sumopyenv/bin/activate +pip install pyproj +``` diff -Nru sumo-1.11.0/docs/web/docs/Data/Scenarios.md sumo-1.12.0/docs/web/docs/Data/Scenarios.md --- sumo-1.11.0/docs/web/docs/Data/Scenarios.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Data/Scenarios.md 2022-01-24 20:43:50.000000000 +0000 @@ -32,11 +32,16 @@ - [Main Page](https://github.com/maxime-gueriau/ITSC2020_CAV_impact) - Publication: Quantifying the impact of connected and autonomous vehicles on traffic efficiency and safety in mixed traffic" by Maxime Gueriau and Ivana Dusparic, presented at the The 23rd IEEE International Conference on Intelligent Transportation Systems (ITSC 2020) -# Ingolstadt traffic scenario (InTAS) +# Ingolstadt traffic scenario +## InTAS - [Main Page](https://github.com/silaslobo/InTAS) - [Presentation video](https://www.youtube.com/watch?v=UgPeBxXzDHc) +## SUMO Ingolstadt +Created in the SAVe:, SAVeNoW and KIVI research projects +- [Main Page](https://github.com/TUM-VT/sumo_ingolstadt) + # Luxembourg SUMO Traffic (LuST) - [Main Page](https://github.com/lcodeca/LuSTScenario) diff -Nru sumo-1.11.0/docs/web/docs/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md sumo-1.12.0/docs/web/docs/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md --- sumo-1.11.0/docs/web/docs/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md 2022-01-24 20:43:50.000000000 +0000 @@ -81,7 +81,7 @@ | **depart** | float (s) or one of *triggered*, *containerTriggered* | The time step at which the vehicle shall enter the network; see [\#depart](#depart). Alternatively the vehicle departs once a [person enters](Specification/Persons.md#rides) or a [container is loaded](Specification/Containers.md) | | departLane | int/string (≥0, "random", "free", "allowed", "best", "first") | The lane on which the vehicle shall be inserted; see [\#departLane](#departlane). *default: "first"* | | departPos | float(m)/string ("random", "free", "random_free", "base", "last", "stop") | The position at which the vehicle shall enter the net; see [\#departPos](#departpos). *default: "base"* | -| departSpeed | float(m/s)/string (≥0, "random", "max", "desired", "speedLimit") | The speed with which the vehicle shall enter the network; see [\#departSpeed](#departspeed). *default: 0* | +| departSpeed | float(m/s)/string (≥0, "random", "max", "desired", "speedLimit", "last", "avg") | The speed with which the vehicle shall enter the network; see [\#departSpeed](#departspeed). *default: 0* | | departEdge | int (index from \[0, routeLength\[ or "random" | The initial edge along the route where the vehicle should enter the network (only supported if a complete route is defined); see [\#departEdge](#departEdge). *default: 0* | | arrivalLane | int/string (≥0,"current") | The lane at which the vehicle shall leave the network; see [\#arrivalLane](#arrivallane). *default: "current"* | | arrivalPos | float(m)/string (≥0(1), "random", "max") | The position at which the vehicle shall leave the network; see [\#arrivalPos](#arrivalpos). *default: "max"* | @@ -323,6 +323,8 @@ - "`max`": The maxSpeed is used, the speed may be adapted to ensure a safe distance to the leader vehicle. - "`desired`": The maxSpeed is used. If that speed is unsafe, departure is delayed. - "`speedLimit`": The speed limit of the lane is used. If that speed is unsafe, departure is delayed. +- "`last`": The current speed of the last vehicle on the departure lane is used (or 'desired' speed if the lane is empty). If that speed is unsafe, departure is delayed. +- "`avg`": The average speed on the departure lane is ised (or the minimum of 'speedLimit' and 'desired' if the lane is empty). If that speed is unsafe, departure is delayed. ### departEdge @@ -458,8 +460,7 @@ | boardingDuration | float | 0.5 | The time required by a person to board the vehicle. | | loadingDuration | float | 90.0 | The time required to load a container onto the vehicle. | | latAlignment | float, "left", "right", "center", "compact", "nice", "arbitrary" | "center" | The preferred lateral alignment when using the [sublane-model](Simulation/SublaneModel.md). {{DT_FLOAT}} (in m from the center of the lane) or one of ("left", "right", "center", "compact", "nice", "arbitrary"). | -| minGapLat | float | 0.6 | The desired minimum lateral gap when using the [sublane-model](Simulation/SublaneModel.md) | -| maxSpeedLat | float | 1.0 | The maximum lateral speed when using the [sublane-model](Simulation/SublaneModel.md) | +| maxSpeedLat | float | 1.0 | The maximum lateral speed when using the [sublane-model or continuous lane change model](Simulation/SublaneModel.md) | | actionStepLength | float | global default (defaults to the simulation step, configurable via **--default.action-step-length**) | The interval length for which vehicle performs its decision logic (acceleration and lane-changing). The given value is processed to the closest (if possible smaller) positive multiple of the simulation step length. See [actionStepLength details](Car-Following-Models.md#actionsteplength)| Besides values which describe the vehicle's car-following properties, @@ -470,12 +471,42 @@ ## Speed Distributions +### Individual Speed Factor The desired driving speed usually varies among the vehicle of a fleet. -In SUMO this is modeled by a speed distribution using the attributes -**speedFactor** or **speedDev**. as explained below. +In SUMO this is modeled by assigning to each vehicle an individual multiplier which gets applied to the road speed limit. +This multiplier is called the *individual speedFactor* or in short the *speedFactor of a vehicle*. +The product of road speed limit and the individual speed factor gives the desired free flow driving speed of a vehicle. +If the individual speedFactor is larger than 1 vehicles can exceed edge speeds. However, vehicle speeds are still +capped at the vehicle type's **maxSpeed**. -!!! note - Since version 1.0.0 speed distributions are used by default (speedDev="0.1"). In older version, speed distributions had to be defined for every vehicle type to avoid homogeneous speeds (and consequently invalid driving behavior because vehicles would never catch up with their leader vehicle) +While it is possible to assign the individual speedFactor value directly in a ``, `` or even `` definition using attribute `speedFactor`, a more common use case is to define the distribution of these factors for a ``. + +Having a distribution of speed factors (and hence of desired speeds) is beneficial to the realism of a simulation. If the desired speed is constant among a fleet of vehicles, this implies that gaps between vehicles will keep their size constant over a long time. For this reason, the individual speed factor for each simulated vehicle (whether defined as ``, `` or part of a ``) is drawn from a distribution by default. + +The speedFactor of a vehicle is writen to various outputs ([tripinfo-output](Simulation/Output/TripInfo.md), [vehroute-output](https://sumo.dlr.de/docs/Simulation/Output/VehRoutes.md)) and can also be checked via the [vehicle parameter dialog](sumo-gui.md#object_properties_right-click-functions). + +### Defining a normal distribution for vehicle speeds + +Two types of distributions can be defined for sampling the individual speedFactor of each vehicl by giving one of the following attributes in the `` element: + +- normal distribution: `speedFactor="norm(mean,deviation)"` +- truncated normal distribution: `speedFactor="normc(mean,deviation,lowerCutOff,upperCutOff)"` + +The default for passenger cars is `"normc(1, 0.1, 0.2, 2)"` which implies that ~95% of the vehicles drive between 80% and 120% +of the legal speed limit. + +Instead of giving the multi-parameter definition above, a simpler definition style is also possible. + +- setting the deviation of the distribution directly: `speedDev="0.3"` +- setting the mean of the distribution directly: `speedFactor="1.2"` + +When using the attributes in this way, the default cut-off range [0.2, 2] remains unchanged. + +!!! caution + The distribution mean must fall within the cut-off range. In order to use mean values below 0.2 or above 2.0, the 4-parameter version must be used to modify the cut-off parameters as well. + +!!! caution + Attribute `speedFactor` has three different meanings: in a `` it defines the individual speedFactor directly. In a `` if given as a single floating point value, it defines the mean of the speed distribution and when giving as `norm(...)` / `nomrc(...)`, it defines the whole distribution. ### Vehicle class specific defaults @@ -489,56 +520,15 @@ - emergency: 0 - everything else: 0.1 +!!! note + before version 1.0.0, the default speedDev values was 0 + ### Global Configuration Instead of configuring speed distributions in a `` definition (as explained below), the [sumo](sumo.md)-option **--default.speeddev** {{DT_FLOAT}} can be used to set -a global default. Setting this value to 0 restores pre-1.0.0 behavior. +a global default. The option value overrides all vClass-defaults. Setting **--default.speeddev 0** estores pre-1.0.0 behavior. -### Defining speed limit violations explicitly - -Each vehicle has an individual speed factor which is multiplied with the -speed limit (edge speed) to determine the desired driving speed (default -1.0). A vehicle with speed factor 1.2 drives up to 20% above the speed -limit whereas a vehicle with speed factor 0.8 would always stay below -the speed limit by 20%. By setting attributes **speedFactor** and -**speedDev** as show below this individual speed factor for all vehicles -of a type can be set to a fixed value. - -```xml - 0, the individual chosen speed multiplier is at least high enough to accommodate the stated depart speed. +### Examples + +Define a flow of vehicles that desire to drive at 120% of the speed limit without any deviation: + +```xml + + +``` + +Define a vehicle type with high speed deviation and no cut-off + +```xml + +``` + ## Vehicle Length Due to the work on [car following models](#car-following_models), we decided to use two values @@ -728,7 +733,7 @@ | carFollowing-BKerner | BKerner | A model by Boris Kerner

        **Caution:** currently under work | | carFollowing-IDM | IDM | The Intelligent Driver Model by Martin Treiber

        **Caution:** Default parameters result in very conservative lane changing gap acceptance | | carFollowing-IDMM | IDMM | Variant of IDMM

        **Caution:** lacking documentation | -| carFollowing-EIDM | EIDM | Extended Intelligent Driver Model for subsecond simulation by Dominik Salles | +| carFollowing-EIDM | EIDM | [Extended Intelligent Driver Model for subsecond simulation by Dominik Salles](Car-Following-Models/EIDM.md) | | carFollowing-KraussPS | KraussPS | the default Krauss model with consideration of road slope | | carFollowing-KraussAB | KraussAB | the default Krauss model with bounded acceleration (only relevant when using PHEM classes) | | carFollowing-SmartSK | SmartSK | Variant of the default Krauss model

        **Caution:** lacking documentation | @@ -843,26 +848,27 @@ | Attribute | Description | Models | | ----------------------- | ----------------------------- | -------------- | -| lcStrategic | The eagerness for performing strategic lane changing. Higher values result in earlier lane-changing. *default: 1.0, range \[0-inf\[* | LC2013, SL2015 | +| lcStrategic | The eagerness for performing strategic lane changing. Higher values result in earlier lane-changing. *default: 1.0, range \[0-inf)* | LC2013, SL2015 | | lcCooperative | The willingness for performing cooperative lane changing. Lower values result in reduced cooperation. *default: 1.0, range \[0-1\]* | LC2013, SL2015 | -| lcSpeedGain | The eagerness for performing lane changing to gain speed. Higher values result in more lane-changing. *default: 1.0, range \[0-inf\[* | LC2013, SL2015 | -| lcKeepRight | The eagerness for following the obligation to keep right. Higher values result in earlier lane-changing. *default: 1.0, range \[0-inf\[* | LC2013, SL2015 | -| lcOvertakeRight | The probability for violating rules gainst overtaking on the right *default: 0, range \[0-1\[* | LC2013 | -| lcOpposite | The eagerness for overtaking through the opposite-direction lane. Higher values result in more lane-changing. *default: 1.0, range \[0-inf\[* | LC2013 | -| lcLookaheadLeft | Factor for configuring the strategic lookahead distance when a change to the left is necessary (relative to right lookahead). *default: 2.0, range \]0-inf\[* | LC2013, SL2015 | -| lcSpeedGainRight | Factor for configuring the threshold asymmetry when changing to the left or to the right for speed gain. By default the decision for changing to the right takes more deliberation. Symmetry is achieved when set to 1.0. *default: 0.1, range \]0-inf\[* | LC2013, SL2015 | -| lcSpeedGainLookahead | Lookahead time in seconds for anticipating slow down. *default: 0 (LC2013), 5 (SL2015), range \[0-inf\[* | LC2013, SL2015 | -| lcCooperativeRoundabout | Factor that increases willingness to move to the inside lane in a multi-lane roundabout. *default: lcCooperative, range \]0-1[* | LC2013, SL2015 | +| lcSpeedGain | The eagerness for performing lane changing to gain speed. Higher values result in more lane-changing. *default: 1.0, range \[0-inf)* | LC2013, SL2015 | +| lcKeepRight | The eagerness for following the obligation to keep right. Higher values result in earlier lane-changing. *default: 1.0, range \[0-inf)* | LC2013, SL2015 | +| lcOvertakeRight | The probability for violating rules gainst overtaking on the right *default: 0, range \[0-1\]* | LC2013 | +| lcOpposite | The eagerness for overtaking through the opposite-direction lane. Higher values result in more lane-changing. *default: 1.0, range \[0-inf)* | LC2013 | +| lcLookaheadLeft | Factor for configuring the strategic lookahead distance when a change to the left is necessary (relative to right lookahead). *default: 2.0, range \[0-inf)* | LC2013, SL2015 | +| lcSpeedGainRight | Factor for configuring the threshold asymmetry when changing to the left or to the right for speed gain. By default the decision for changing to the right takes more deliberation. Symmetry is achieved when set to 1.0. *default: 0.1, range \[0-inf)* | LC2013, SL2015 | +| lcSpeedGainLookahead | Lookahead time in seconds for anticipating slow down. *default: 0 (LC2013), 5 (SL2015), range \[0-inf)* | LC2013, SL2015 | +| lcCooperativeRoundabout | Factor that increases willingness to move to the inside lane in a multi-lane roundabout. *default: lcCooperative, range \[0-1\]* | LC2013, SL2015 | | lcCooperativeSpeed | Factor for cooperative speed adjustments. *default: lcCooperative, range \[0-1\]* | LC2013, SL2015 | -| lcSublane | The eagerness for using the configured lateral alignment within the lane. Higher values result in increased willingness to sacrifice speed for alignment. *default: 1.0, range \[0-inf\]* | SL2015 | -| lcPushy | Willingness to encroach laterally on other drivers. ''default: 0, range 0 to 1 | SL2015 | -| lcPushyGap | Minimum lateral gap when encroaching laterally on other drives (alternative way to define lcPushy). ''default: minGapLat, range 0 to minGapLat | SL2015 | -| lcAssertive | Willingness to accept lower front and rear gaps on the target lane. The required gap is divided by this value. ''default: 1, range: positive reals | LC2013,SL2015 | -| lcImpatience | dynamic factor for modifying lcAssertive and lcPushy. *default: 0 (no effect) range -1 to 1*. Impatience acts as a multiplier. At -1 the multiplier is 0.5 and at 1 the multiplier is 1.5. | SL2015 | +| minGapLat | The desired minimum lateral gap when using the [sublane-model](Simulation/SublaneModel.md) , *default: 0.6* | SL2015 | +| lcSublane | The eagerness for using the configured lateral alignment within the lane. Higher values result in increased willingness to sacrifice speed for alignment. *default: 1.0, range \[0-inf)* | SL2015 | +| lcPushy | Willingness to encroach laterally on other drivers. *default: 0, range \[0-1\]* | SL2015 | +| lcPushyGap | Minimum lateral gap when encroaching laterally on other drives (alternative way to define lcPushy). *default: minGapLat, range 0 to minGapLat* | SL2015 | +| lcAssertive | Willingness to accept lower front and rear gaps on the target lane. The required gap is divided by this value. *default: 1, range: positive reals* | LC2013,SL2015 | +| lcImpatience | Dynamic factor for modifying lcAssertive and lcPushy. *default: 0 (no effect) range -1 to 1*. Impatience acts as a multiplier. At -1 the multiplier is 0.5 and at 1 the multiplier is 1.5. | SL2015 | | lcTimeToImpatience | Time to reach maximum impatience (of 1). Impatience grows whenever a lane-change manoeuvre is blocked.. *default: infinity (disables impatience growth)* | SL2015 | | lcAccelLat | maximum lateral acceleration per second. *default: 1.0* | SL2015 | | lcTurnAlignmentDistance | Distance to an upcoming turn on the vehicles route, below which the alignment should be dynamically adapted to match the turn direction. *default: 0.0 (i.e., disabled)* | SL2015 | -| lcMaxSpeedLatStanding | Constant term for lateral speed when standing. *default: maxSpeedLat (i.e., disabled)*. | LC2013, SL2015 | +| lcMaxSpeedLatStanding | Constant term for lateral speed when standing. *default: maxSpeedLat (i.e., disabled)* | LC2013, SL2015 | | lcMaxSpeedLatFactor | Bound on lateral speed while moving computed as lcMaxSpeedLatStanding + lcMaxSpeedLatFactor \* getSpeed(). If > 0, this is an upper bound (vehicles change slower at low speed, if < 0 this is a lower bound on speed and should be combined with lcMaxSpeedLatStanding > maxSpeedLat (vehicles change faster at low speed). *default: 1.0* | LC2013, SL2015 | | lcLaneDiscipline | Reluctance to perform speedGain-changes that would place the vehicle across a lane boundary. *default: 0.0*| SL2015 | | lcSigma | Lateral positioning-imperfection. *default: 0.0* | LC2013, SL2015 | @@ -876,6 +882,9 @@ !!! note parameter 'lcMaxSpeedLatStanding' will not be applied when a vehicle is at the end of its lane (to ensure that there are no deadlocks). +!!! caution + Modifying and Retrieving lane change model attributes via TraCI [works different from other vType attributes](TraCI/Change_Vehicle_State.md#relationship_between_lanechange_model_attributes_and_vtypes) + ## Junction Model Parameters The behavior at intersections may be configured with the parameters @@ -995,6 +1004,13 @@ + + + + + + + ``` @@ -1183,6 +1199,12 @@
        + + + + + + ``` diff -Nru sumo-1.11.0/docs/web/docs/Developer/HowToRelease.md sumo-1.12.0/docs/web/docs/Developer/HowToRelease.md --- sumo-1.11.0/docs/web/docs/Developer/HowToRelease.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Developer/HowToRelease.md 2022-01-24 20:43:50.000000000 +0000 @@ -150,6 +150,7 @@ - trigger update of main website at - close [the milestone](https://github.com/eclipse/sumo/milestones) (retargeting open tickets needs to be done manually for now) +- add the latest version to the **"software version identifier"** statement in [Wikidata](https://www.wikidata.org/wiki/Q15847637) (this will update the Wikipedia articles about SUMO), making sure to select the latest version as **"preferred rank"** and setting the previous one to **"normal rank"**. ### After-release cleanup diff -Nru sumo-1.11.0/docs/web/docs/Developer/index.md sumo-1.12.0/docs/web/docs/Developer/index.md --- sumo-1.11.0/docs/web/docs/Developer/index.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Developer/index.md 2022-01-24 20:43:50.000000000 +0000 @@ -66,4 +66,3 @@ - [SUMO on Travis](https://travis-ci.org/eclipse/sumo) (legacy) - [SUMO brew formula on Github Actions](https://github.com/DLR-TS/homebrew-sumo/actions) - [SUMO on OpenHub](https://www.openhub.net/p/sumo/) -- [SUMO on codeclimate](https://codeclimate.com/github/DLR-TS/sumo) diff -Nru sumo-1.11.0/docs/web/docs/Downloads.md sumo-1.12.0/docs/web/docs/Downloads.md --- sumo-1.11.0/docs/web/docs/Downloads.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Downloads.md 2022-01-24 20:43:50.000000000 +0000 @@ -2,47 +2,29 @@ title: Downloads --- -## SUMO - Latest Release (Version {{Version}}) +# SUMO - Latest Release (Version {{Version}}) -**Release date: {{ReleaseDate}}** +**Release date:** {{ReleaseDate}} (updated 15.12.2021) -### MS Windows binaries +## Windows -Contains the binaries (32 or 64 bit), all dlls needed, the examples, +Binaries (64 bit), all dlls needed, the examples, tools, and documentation in HTML format. For an explanation of the contents and the -licensing, especially concerning the "extra" build, see [the notes below](Downloads.md#note_on_licensing) +licensing (especially concerning the "extra" build which contains GPL code to support GeoTIFFs, shapefiles and 3D models), see [the notes below](Downloads.md#note_on_licensing). ### SUMO-Game - + -### Sources -Includes sources, examples, and CMake-files for creating Visual Studio -solutions or Linux Makefiles. Does not contain tests. Download as: - - - -### All-inclusive-tarball - -Includes sources, tests and docs but no binaries. Download as: - - - -## Linux binaries +## Linux The community maintains several repositories notably at the [open build service](https://build.opensuse.org/project/show/science:dlr). @@ -71,7 +53,7 @@ try one of the build service repositories here too, e.g. [Application:Geo](https://download.opensuse.org/repositories/Application:/Geo/)). At the moment there is no documentation included in the packages. The -repositories include a nightly build as well (called sumo-git). +repositories include a nightly build as well (called ***sumo-git***). - [openSUSE Leap 42.3 repository](http://download.opensuse.org/repositories/science:/dlr/openSUSE_Leap_42.3/) - [openSUSE Leap 15.0 repository](http://download.opensuse.org/repositories/science:/dlr/openSUSE_Leap_15.0/) @@ -85,10 +67,24 @@ - [Fedora 32 repository](http://download.opensuse.org/repositories/science:/dlr/Fedora_32/) - [Fedora 33 repository](http://download.opensuse.org/repositories/science:/dlr/Fedora_33/) - [Fedora 34 repository](http://download.opensuse.org/repositories/science:/dlr/Fedora_34/) +- [Fedora 35 repository](http://download.opensuse.org/repositories/science:/dlr/Fedora_35/) - [Fedora Rawhide repository](http://download.opensuse.org/repositories/science:/dlr/Fedora_Rawhide/) - [CentOS 7 repository](http://download.opensuse.org/repositories/science:/dlr/CentOS_7/) - [CentOS 8 repository](http://download.opensuse.org/repositories/science:/dlr/CentOS_8/) +Adding the repository and installing (the quick and dirty way without checking GPG keys!) looks like this, for yum on CentOS 7: +``` +yum-config-manager --add-repo=https://download.opensuse.org/repositories/science:/dlr/CentOS_7/ +yum install -y --nogpgcheck epel-release +yum install -y --nogpgcheck sumo-{{Version}} +``` +and like this, for zypper on openSUSE Leap 15.3: +``` +zypper ar http://download.opensuse.org/repositories/science:/dlr/15.3/ science:dlr +zypper in sumo={{Version}} +``` +I you leave out the version number it will install the latest nightly build. + Ubuntu, Debian and Arch users please see the community repositories above. ## macOS @@ -116,14 +112,25 @@ !!! caution "Important notice" In order to use the launchers, make sure you have installed SUMO beforehand (any version) and have set the [SUMO_HOME](Basics/Basic_Computer_Skills.md#sumo_home) environment variable. +## Sources + +Download the sources, examples, and CMake-files for creating Visual Studio +solutions or Linux Makefiles. This download does not contain tests. Download as: + + + ## Python packages / Virtual environments -Starting with SUMO 1.8.0 the installation is also possible from the [Python packaging index](https://pypi.org/project/eclipse-sumo/). -You can install either the applications: `pip install eclipse-sumo` or only traci, libsumo or sumolib, e.g. `pip install libsumo`. -This should work for Windows and all Linux versions which are more recent than 2014 but currently not for macOS. -The applications are available for Python 2 and Python 3, libsumo only for Python 3.5 and above. This gives an easy way to test -a new SUMO version via [virtual environments](https://docs.python.org/3/library/venv.html) - or a nightly build using the following commands (on Linux): +Starting with SUMO 1.8.0 (for macOS since 1.12.0) the installation is also possible from the [Python packaging index](https://pypi.org/project/eclipse-sumo/). + +You can install either the applications: `pip install eclipse-sumo` or only traci (`pip install traci`), libsumo (`pip install libsumo`) or sumolib (`pip install sumolib`). + +This should work for Windows, macOS and all Linux versions which are more recent than 2014. +The applications are available for Python 2 and Python 3, libsumo only for Python 3.6 and above. This gives an easy way to test +a new SUMO version via [virtual environments](https://docs.python.org/3/library/venv.html) or a nightly build using the following commands (on Linux): ``` python -m venv sumo_test cd sumo_test @@ -131,13 +138,10 @@ pip install eclipse-sumo ``` -## SUMO - Alternative download and older releases +!!! caution "macOS dependencies" + In order to use the Python wheels on macOS you need to have all the dependencies installed and up to date via brew for instance by following the [standard installation](Installing/index.md#macos) once. -All releases can also be obtained via the [sourceforge download -portal](https://sourceforge.net/projects/sumo/files/sumo/). - - -## SUMO - Latest Development Version +# SUMO - Latest Development Version SUMO is under active development. You can find a continuously updated list of bug-fixes and enhancements at our @@ -147,32 +151,35 @@ Every push to our main branch also triggers a build for Windows, Linux and macOS. The results can be found by clicking on the [relevant commit here](https://github.com/eclipse/sumo/actions) and downloading the -appropriate file for your platform. +appropriate file for your platform (you may need to sign in to GitHub). -### Nightly Snapshots +## Nightly Snapshots
        The code within the repository is [compiled each -night](Developer/Nightly_Build.md). The following resulting -packages can be obtained: +night](Developer/Nightly_Build.md). All Windows builds are for the 64bit platform. For an explanation of the contents and the +licensing (especially concerning the "extra" build which contains GPL code to support GeoTIFFs, shapefiles and 3D models), +see [the notes below](Downloads.md#note_on_licensing). The following packages can be obtained: The nightly builds are also available from the [Python packaging index test instance](https://test.pypi.org/project/eclipse-sumo/). -To install the latest nightly version use `pip install -i https://test.pypi.org/simple/ eclipse-sumo`. Although this is a python -package it contains all compiled SUMO binaries and should be fully functional for Windows and recent Linux. +To install the latest nightly version use: +``` +pip install -i https://test.pypi.org/simple/ eclipse-sumo +``` +Although this is a python package, it contains all compiled SUMO binaries and should be fully functional (see the requirements in [the section above](#python_packages_virtual_environments)). The Linux [repositories](#repositories) at the open build service contain a nightly build as well. This is unfortunately not the case for the Debian, Ubuntu and Arch versions. @@ -185,11 +192,22 @@ night. !!! caution - The available windows binary packages may lag behind the [latest Git revision](https://github.com/eclipse/sumo/commits/main) due to being compiled only once per day (around midnight, Berlin time). + The available Windows binary packages may lag behind the [latest Git revision](https://github.com/eclipse/sumo/commits/main) due to being compiled only once per day (around midnight, Berlin time). + +# SUMO - Older releases and alternative download + +All releases can also be obtained via the [sourceforge download portal](https://sourceforge.net/projects/sumo/files/sumo/). +If you want to try out an older version you can also use the virtual environment approach (explained above) with a fixed version, e.g. +`pip install eclipse-sumo=1.9.0` (works only for 1.8.0 and later). + +If you need a complete zipped snapshot of the repository (including tests) for an older version have a look at the tags in your +local repository or at [GitHub tags](https://github.com/eclipse/sumo/tags). + +# Other -### Direct repository access +## Direct repository access -You can get very latest sources directly from our Git repository, see +You can get the very latest sources directly from our Git repository, see [the FAQ on repository access](FAQ.md#how_do_i_access_the_code_repository). Normally, they should compile and complete our test suite successfully. To assess the current state of the build, you may take a look at the @@ -203,14 +221,13 @@ | | bin | build | src (source code) | user docs | developer docs (doxygen) | data | examples | tutorials | tests | tools (except jars) | jars | |---|------|--------|--------------------|------------|---------------------------|-------|-----------|------------|--------|----------------------|-------| | sumo-src-*XXX*.tar.gz
        sumo-src-*XXX*.zip | | ✔ | ✔ | | | ✔ | ✔ | ✔ | | ✔ | | -| sumo-win??-*XXX*.zip
        sumo-win??-*XXX*.msi | ✔ | | | ✔ | | ✔ | ✔ | ✔ | | ✔ | ✔ | -| sumo-all-*XXX*.tar.gz
        sumo-all-*XXX*.zip | | ✔ | ✔ | ✔ | | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | +| sumo-win??-*XXX*.zip
        sumo-win??-*XXX*.msi | ✔ | | | ✔ | | ✔ | ✔ | ✔ | | ✔ | ✔ | | rpm | (✔) | | | ✔ | | ✔ | ✔ | ✔ | | ✔ | | ## Dependencies for developers For the Windows platform you can retrieve all dependencies by cloning -this repository , if you want +this repository: , if you want to develop with Visual Studio. If you just want to run SUMO, use the binary downloads above which already contain the runtime dependencies. @@ -220,7 +237,7 @@ - [traffic data](Data/Traffic_Data.md) - [Test cases](Tutorials/index.md#using_examples_from_the_test_suite) -## Note on Licensing +# Note on Licensing SUMO is licensed under the [EPL-2.0](https://eclipse.org/legal/epl-v20.html) with GPL v2 or later as a secondary license option using only [open diff -Nru sumo-1.11.0/docs/web/docs/duarouter.md sumo-1.12.0/docs/web/docs/duarouter.md --- sumo-1.11.0/docs/web/docs/duarouter.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/duarouter.md 2022-01-24 20:43:50.000000000 +0000 @@ -106,6 +106,7 @@ | **--write-trips** {{DT_BOOL}} | Write trips instead of vehicles (for validating trip input); *default:* **false** | | **--write-trips.geo** {{DT_BOOL}} | Write trips with geo-coordinates; *default:* **false** | | **--write-trips.junctions** {{DT_BOOL}} | Write trips with fromJunction and toJunction; *default:* **false** | +| **--write-costs** {{DT_BOOL}} | Include the cost attribute in route output; *default:* **false** | | **--exit-times** {{DT_BOOL}} | Write exit times (weights) for each edge; *default:* **false** | | **--route-length** {{DT_BOOL}} | Include total route length in the output; *default:* **false** | diff -Nru sumo-1.11.0/docs/web/docs/FAQ.md sumo-1.12.0/docs/web/docs/FAQ.md --- sumo-1.11.0/docs/web/docs/FAQ.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/FAQ.md 2022-01-24 20:43:50.000000000 +0000 @@ -191,27 +191,31 @@ See above but **please** give enough details when asking on the mailing list. -### What should I do to get helpful answers on the mailing list? +### What should I do to get helpful answers on the mailing list or on the issue tracker? - Make your question specific - avoid vague terms. - Always name the SUMO version to which your question applies - Include relevant warnings/errors/stack-traces in your question - (please copy the text and avoid screenshots to reproduce text - messages). When sending screenshots of sumo-gui, please include the whole screen so the application version and simulation time are visible. +- whenever possible copy text rather than screenshots of text +- When sending screenshots of sumo-gui or netedit, please include the whole screen so the application version and simulation time are visible. +- Attach scenario files including .sumocfg as a zip archive +- describe what you are trying to accomplish +- describe how what you see differs from your expectations - Phrase your question using familiar terms (not everyone is an expert in your domain). -- Don't ask for too many things in a single post. +- Don't ask for too many things in a single post / issue. - Do some research on your own before you post the question (otherwise you may appear to be lazy). - read the FAQ - read the documentation - check out the [Tutorials](Tutorials/index.md) - - do a web search (past questions and answers from the mailing - list can be found by google) + - do a web search (past questions and answers from the mailing list can be found by google) + - describe which documentation you used, especially when [your experience doesn't match the documentation](#why_does_sumo_not_behave_as_documented_in_this_wiki) - Do not ask the same thing twice in a short span of time. If you are in a hurry and cannot get an answer, try to change your question according to the above suggestions. +- if you put your question into an issue an the issue was closed, put your follow-up questions into the closed issue rather than open an new issue - Be polite - Good Example questions: - How can I get data X out of SUMO? @@ -798,6 +802,10 @@ being seen. To avoid this, you may [increase the *Delay*-value](sumo-gui.md#usage_description) to slow down the simulation. - [You might have outdated graphic card drivers](sumo-gui.md#windows_and_buttons_appear_but_no_netcars_are_visible_vehicles_are_not_visible_or_flicker_roads_are_drawn_on_top_of_vehicles) +- You did not [define any vehicles](Definition_of_Vehicles%2C_Vehicle_Types%2C_and_Routes.md) +- All your vehicles are set to depart before the simulation **--begin** time +- Your vehicles are set to depart much later than the simulation **--begin** time + ### Different departure times with different time step size @@ -890,6 +898,8 @@ - `` - `` (should not be lower than step-length) +See [table of insertion capacity achievable with different options and insertion attributes](Simulation/RoadCapacity.md#further_headway_effects). + ### How do I insert vehicles with a fixed density? To start a simulation with 65 evenly-spaced vehicles on a specific lane @@ -1054,7 +1064,8 @@ There is a know problem in Windows 10 with scaling and flickering in certain applications. If scaling is greater than 100%, a flickering may appear in SUMO-GUI and NETEDIT during mouse movement. -The only known solution is leaving Scaling at 100% +The only known solution is leaving Scaling at 100%. Another cause is the use of a modern graphics card. +If your computer supports it, run SUMO using the integrated graphics card (Control panel->NVidia Control Panel->Select integrated graphid card->apply) ### Missing Characters in Parameter Dialogs (i.e. Chinese Street names) on Linux diff -Nru sumo-1.11.0/docs/web/docs/Geo-Coordinates.md sumo-1.12.0/docs/web/docs/Geo-Coordinates.md --- sumo-1.11.0/docs/web/docs/Geo-Coordinates.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Geo-Coordinates.md 2022-01-24 20:43:50.000000000 +0000 @@ -41,7 +41,7 @@ geo-coordinates (lon,lat) and vice versa - using [sumolib](Tools/Sumolib.md#coordinate_transformations) , coordinates can be transformed between network-coordinates (m,m) - and geo-coordinates (lon,lat) and vice versa + and geo-coordinates (lon,lat) and vice versa. Converting back and forth between lon,lat and raw UTM (m,m) is also supported. # Obtaining output with geo-coordinates @@ -53,4 +53,4 @@ ``` - [FCD-output](Simulation/Output/FCDOutput.md) can be obtained - in geo-coordinates by adding the option **--fcd-output.geo** \ No newline at end of file + in geo-coordinates by adding the option **--fcd-output.geo** Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/docs/web/docs/images/capacity.png and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/docs/web/docs/images/capacity.png differ Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/docs/web/docs/images/show_phases.png and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/docs/web/docs/images/show_phases.png differ Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/docs/web/docs/images/track_phases.png and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/docs/web/docs/images/track_phases.png differ diff -Nru sumo-1.11.0/docs/web/docs/index.md sumo-1.12.0/docs/web/docs/index.md --- sumo-1.11.0/docs/web/docs/index.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/index.md 2022-01-24 20:43:50.000000000 +0000 @@ -131,6 +131,7 @@ - [Vehicle speed](Simulation/VehicleSpeed.md) - [Vehicle insertion](Simulation/VehicleInsertion.md) - [Vehicle permissions (access restrictions)](Simulation/VehiclePermissions.md) +- [Road capacity](Simulation/RoadCapacity.md) - [Intersection dynamics](Simulation/Intersections.md) - [Randomness](Simulation/Randomness.md) - [Routing and Re-routing](Simulation/Routing.md) diff -Nru sumo-1.11.0/docs/web/docs/Installing/Linux_Build.md sumo-1.12.0/docs/web/docs/Installing/Linux_Build.md --- sumo-1.11.0/docs/web/docs/Installing/Linux_Build.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Installing/Linux_Build.md 2022-01-24 20:43:50.000000000 +0000 @@ -16,7 +16,7 @@ For ubuntu this boils down to ``` - sudo apt-get install git cmake python3 g++ libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev + sudo apt-get install git cmake python3 g++ libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev python3-dev swig default-jdk maven libeigen3-dev  git clone --recursive https://github.com/eclipse/sumo  export SUMO_HOME="$PWD/sumo"  mkdir sumo/build/cmake-build && cd sumo/build/cmake-build @@ -38,21 +38,21 @@ network import from shapefile (arcgis). This requires the GDAL library. To compile you will need the devel versions of all packages. For openSUSE this means installing libxerces-c-devel, libproj-devel, - libgdal-devel, and fox16-devel. For ubuntu the call is: - `sudo apt-get install cmake python g++ libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev`. + libgdal-devel, and fox16-devel. For ubuntu the call is above. + The installation of swig, python3-dev and the jdk enables also the build of libsumo + wgile eigen3 is necessary for the overheadwire model. There are some outdated [platform specific and manual build instructions for the libraries](Linux_Build_Libraries.md) - Optionally you may want to add - ffmpeg-devel (for video output), - libOpenSceneGraph-devel (for the experimental 3D GUI), - - python-devel and swig (for running TraCI pythons scripts without a socket connection), - - libeigen3 (for the overheadwire model) - gtest (for unit testing) - texttest (for the acceptance tests) The package names above are for openSUSE, for ubuntu the call to get all optional libraries and tools is: + ``` - sudo apt-get install libavformat-dev libswscale-dev libopenscenegraph-dev python3-dev swig libgtest-dev libeigen3-dev python3-pip python3-setuptools default-jdk + sudo apt-get install libavformat-dev libswscale-dev libopenscenegraph-dev libgtest-dev python3-pip python3-setuptools sudo pip3 install texttest ``` diff -Nru sumo-1.11.0/docs/web/docs/Libsumo.md sumo-1.12.0/docs/web/docs/Libsumo.md --- sumo-1.11.0/docs/web/docs/Libsumo.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Libsumo.md 2022-01-24 20:43:50.000000000 +0000 @@ -60,7 +60,7 @@ libsumo.simulationStep() ``` -Existing traci scripts can mostly be reused by calling +Existing traci scripts can be reused (subject to the [limitations](#limitations) mentioned above) by calling ```py import libsumo as traci diff -Nru sumo-1.11.0/docs/web/docs/Models/Electric.md sumo-1.12.0/docs/web/docs/Models/Electric.md --- sumo-1.11.0/docs/web/docs/Models/Electric.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Models/Electric.md 2022-01-24 20:43:50.000000000 +0000 @@ -168,7 +168,7 @@ | Name | Type | Description | | ------------------ | ------ | ----------------------------------------------------------- | | id | string | ChargingStation ID | -| totalEnergyCharged | float | Total energy charged in W during the entire simulation | +| totalEnergyCharged | float | Total energy charged in Wh during the entire simulation | | chargingSteps | int | Number of steps in which charginStation was charging energy | For the current charging vehicle @@ -177,7 +177,7 @@ | ----------------------------- | ------ | ------------------------------------------------------------- | | id | string | ID of vehicle that is charging in these charging stop | | type | string | type of vehicle | -| totalEnergyChargedIntoVehicle | double | Energy charged during these charging stop | +| totalEnergyChargedIntoVehicle | double | Energy charged (in Wh) during these charging stop | | chargingBegin | float | TimeStep in which vehicle starts with the charge (in seconds) | | chargingEnd | float | TimeStep in which vehicle ends with the charge (in seconds) | diff -Nru sumo-1.11.0/docs/web/docs/Models/MMPEVEM.md sumo-1.12.0/docs/web/docs/Models/MMPEVEM.md --- sumo-1.11.0/docs/web/docs/Models/MMPEVEM.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Models/MMPEVEM.md 2022-01-24 20:43:50.000000000 +0000 @@ -4,38 +4,172 @@ # Overview -Since version 1.11.0 SUMO includes a model for electric vehicles energy -consumption from Teaching and Research Area Mechatronics in Mobile Propulsion (MMP), RWTH -Aachen. It was implemented by Kevin Badalian. -The model uses detailed characterstic maps to describe the a specific vehicle -powertrain. +Since version 1.11.0, SUMO comes with an energy consumption model for electric +vehicles (EVs) developed by the Teaching and Research Area Mechatronics in +Mobile Propulsion (MMP) of RWTH Aachen University. MMPEVEM (**MMP**'s +**E**lectric **V**ehicle **E**mission **M**odel), as it is called, is +implemented as a SUMO emission model (hence the name) and considers the +components of the powertrain individually in order to accurately compute the +power consumption in every simulation step. This includes the transmission +(i.e. a single reduction gear and a differential) with constant efficiency, the +electric motor (as well as its inverter) whose power losses are +read/interpolated from a characteristic map, a constant power consumer to +represent auxiliary devices such as air conditioning, and the battery. + + + +# Using the Model + +To utilise MMPEVEM, set `emissionClass="MMPEVEM"` in the `vType` definitions of +the vehicles you are interested in and add the following parameter: +``` + +``` +Equipping the `vType` with a battery device is necessary because it triggers the +parsing and loading of all energy-related quantities. Other than that, there is +currently no interaction between MMPEVEM and said device. This especially +entails that the battery's state and output are *not* affected by or based on +the former. + + +Although default parameters are available, it is strongly advised to explicitly +specify *all* the model parameters listed below and to make sure that they are +compatible with one another. Failing to do so may lead to wrong or even invalid +operating points (cf. [Output](#output)) which skew the overall energy +consumption. + + +## Model Parameters + +MMPEVEM shares a lot of SUMO's +[native electric vehicle parameters](Electric.md#defining-electric-vehicles) and +introduces only a couple of new ones. You can find exemplary vehicle type +definitions at `{SUMO_HOME}/data/emissions/MMPEVEM`[^1]. + +| Key | Value Type | Default | Description | +|---------------------------|--------------|---------------------------------------|-----------------------------------------------------------------------| +| vehicleMass | float (> 0) | 1000.0 [kg] | Mass of the vehicle | +| wheelRadius | float (> 0) | 0.3588 [m] | Wheel radius | +| internalMomentOfInertia | float (>= 0) | 0.01 [kg * m^2] | Internal components' moment of inertia | +| rollDragCoefficient | float (>= 0) | 0.01 [1] | Rolling resistance coefficient | +| airDragCoefficient | float (>= 0) | 0.6 [1] | Air drag coefficient | +| frontSurfaceArea | float (>= 0) | 5.0 [m^2] | Cross-sectional area of the front of the vehicle | +| gearRatio | float (> 0) | 10.0 [1] | Combined ratio of the single reduction gear and the differential | +| gearEfficiency | float (> 0) | 0.96 [1] | Combined efficiency of the single reduction gear and the differential | +| maximumTorque | float (>= 0) | 310.0 [Nm] | Maximum generative torque of the electric motor | +| maximumPower | float (>= 0) | 107000.0 [W] | Maximum generative power of the electric motor | +| maximumRecuperationTorque | float (>= 0) | 95.5 [Nm] | Maximum recuperation torque of the electric motor | +| maximumRecuperationPower | float (>= 0) | 42800.0 [W] | Maximum recuperation power of the electric motor | +| internalBatteryResistance | float (> 0) | 0.1142 [Ohm] | Internal battery resistance | +| nominalBatteryVoltage | float (>= 0) | 396.0 [V] | Nominal battery voltage | +| constantPowerIntake | float | 100.0 [W] | Constant power consumption of auxiliary devices | +| powerLossMap | string | `2,1\|-1e9,1e9;-1e9,1e9\|0,0,0,0`[^2] | String representation of the electric motor's power loss map | + + +[^1]: For the sake of compatibility, the XMLs in + `{SUMO_HOME}/data/emissions/MMPEVEM` contain all + [native electric vehicle parameters](Electric.md#defining-electric-vehicles). +[^2]: All operating points result in a power loss of 0 W in the default map. + + +## Power Loss Map + +The power loss map describes the electric motor's power loss (in W) as a +function of motor speed (in rpm) and torque (in Nm). It is passed to the model +using a custom string format which shall be explicated using the mock power loss +map below. + +| | **0 rpm** | **4000 rpm** | **8000 rpm** | +|-------------|---------------|---------------|---------------| +| **-100 Nm** | 826.7 W | 4295.6 W | | +| **0 Nm** | 0.0 W | 2162.9 W | 6137.4 W | +| **100 Nm** | 826.7 W | 4295.6 W | 9317.5 W | +| **200 Nm** | 3297.4 W | 8361.2 W | 14988.6 W | + +Its string representation is: +``` +2,1|0,4000,8000;-100,0,100,200|826.7,4295.6,nan,0.0,2162.9,6137.4,826.7,4295.6,9317.5,3297.4,8361.2,14988.6 +``` +The string consists of three parts delimited by the `|` character: +- The first part signifies that it maps from ℝ² to ℝ¹ and does not change + for MMPEVEM's power loss maps. +- The middle section contains the axis values in ascending order. Axes are + separated by semi-colons while commas are used to delimit the values of each + axis. +- The final part contains the row-major flattened entries of the map (i.e. the + first row of the table followed by the second row etc.) separated by commas. + Undefined operating points (e.g. (8000 rpm, -100 Nm) in this example) are + passed as `nan`. + + +### Tools + +For permanent magnet synchronous machines (PMSMs), power loss maps can be +generated with the +[Electric Machine Design Tool](https://github.com/TUMFTM/Electric_Machine_Design) +developed by Kalt et al.[^3] and converted into the expected format using +`{SUMO_HOME}/tools/contributed/convertMapMat2XML.M`. The tool and the conversion +script require MATLAB® 2017 or newer. + +[^3]: [S. Kalt, J. Erhard, B. Danquah and M. Lienkamp, "Electric Machine Design + Tool for Permanent Magnet Synchronous Machines," 2019 Fourteenth International + Conference on Ecological Vehicles and Renewable Energies (EVER), 2019, + pp. 1-7, doi: + 10.1109/EVER.2019.8813601](https://doi.org/10.1109/EVER.2019.8813601) + + + +## Example + +This is an example `vType` definition of a generic electric SUV and was taken +from `{SUMO_HOME}/data/emissions/MMPEVEM/SUV.xml`. +``` + + + + + + + + + + + + + + + + + + + +``` + + + +# Output + +Start SUMO with the `--emission-output` option in order to generate an XML file +with the emissions of all vehicles. In the XML, the attribute `electricity` +shows the electric energy consumption (in Wh) of a vehicle in a given time step. +Please note that this value is only provided by MMPEVEM if and only if the +`vtype` definition of the vehicle in question was set accordingly. + + +MMPEVEM is a backward-facing model, meaning that it expects a velocity, +acceleration, slope, and time step size to calculate the energy demand. This +also means that it has no way to stop the vehicle from running into invalid +operating points. The latter can be caused by implausible accelerations (for +instance due to teleportations), wrong vehicle parameters, etc. If the model +finds itself in such a state, it returns `nan`. On a related note, MMPEVEM +assumes that the driver perfectly operates the mechanical brakes such that +torque and power are clipped to the motor's limits during recuperation. + + + +# Publications +- [L. Koch et al., "Accurate physics-based modeling of electric vehicle energy +consumption in the SUMO traffic microsimulator," 2021 IEEE International +Intelligent Transportation Systems Conference (ITSC), 2021, pp. 1650-1657, doi: +10.1109/ITSC48978.2021.9564463](https://doi.org/10.1109/ITSC48978.2021.9564463) -You can find test cases for example vehicle type configurations at {SUMO_HOME} / -data/emissions/MMPEVEM - - -# Using the model - -To use the model define a `` with emissionClass "MMPEVEM". - -To also track the battery state, the vehicle must be equipped with a [battery -device](Electric.md#defining_electric_vehicles). The model is fully compatible -with charging infrastructure and related outputs as described in [Electric -Vehicles](Electric.md). - -Additional properties of the vehicle and its electrical components must -then be defined via [parameters of the vehicle or its -type](../Simulation/GenericParameters.md). - -These values have the following meanings: - -| key | Value Type | Default | Description | -| ----------------------- | ---------- | ---------- | ------------------------------------------------------- | -| maximumBatteryCapacity | float | 0 (Wh) | Maximum battery capacity *Emax* | - - - -## Publications - -"Accurate physics-based modeling of electric vehicle energy - consumption in the SUMO traffic microsimulator" (DOI: 10.1109/ITSC48978.2021.9564463). diff -Nru sumo-1.11.0/docs/web/docs/netconvert.md sumo-1.12.0/docs/web/docs/netconvert.md --- sumo-1.11.0/docs/web/docs/netconvert.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/netconvert.md 2022-01-24 20:43:50.000000000 +0000 @@ -401,6 +401,7 @@ | **--junctions.limit-turn-speed.warn.turn** {{DT_FLOAT}} | Warn about turn speed limits that reduce the speed of turning connections (no u-turns) by more than FLOAT; *default:* **22** | | **--junctions.small-radius** {{DT_FLOAT}} | Default radius for junctions that do not require wide vehicle turns; *default:* **1.5** | | **--junctions.higher-speed** {{DT_BOOL}} | Use maximum value of incoming and outgoing edge speed on junction instead of average; *default:* **false** | +| **--internal-junctions.vehicle-width** {{DT_FLOAT}} | Assumed vehicle width for computing internal junction positions; *default:* **1.8** | | **--rectangular-lane-cut** {{DT_BOOL}} | Forces rectangular cuts between lanes and intersections; *default:* **false** | | **--check-lane-foes.roundabout** {{DT_BOOL}} | Allow driving onto a multi-lane road if there are foes on other lanes (at roundabouts); *default:* **true** | | **--check-lane-foes.all** {{DT_BOOL}} | Allow driving onto a multi-lane road if there are foes on other lanes (everywhere); *default:* **false** | @@ -441,6 +442,7 @@ | **--railway.topology.all-bidi** {{DT_BOOL}} | Make all rails usable in both direction; *default:* **false** | | **--railway.topology.all-bidi.input-file** {{DT_FILE}} | Make all rails edge ids from FILE usable in both direction | | **--railway.topology.direction-priority** {{DT_BOOL}} | Set edge priority values based on estimated main direction; *default:* **false** | +| **--railway.topology.extend-priority** {{DT_BOOL}} | Extend loaded edge priority values based on estimated main direction; *default:* **false** | | **--railway.access-distance** {{DT_FLOAT}} | The search radius for finding suitable road accesses for rail stops; *default:* **150** | | **--railway.max-accesses** {{DT_INT}} | The maximum roud accesses registered per rail stops; *default:* **5** | | **--railway.access-factor** {{DT_FLOAT}} | The walking length of the access is computed as air-line distance multiplied by FLOAT; *default:* **1.5** | @@ -459,6 +461,7 @@ | **--osm.lane-access** {{DT_BOOL}} | Import lane-specific access restrictions; *default:* **false** | | **--osm.bike-access** {{DT_BOOL}} | Check additional attributes to fix directions and permissions on bike paths; *default:* **false** | | **--osm.sidewalks** {{DT_BOOL}} | Import sidewalks; *default:* **false** | +| **--osm.turn-lanes** {{DT_BOOL}} | Import turning arrows from OSM to help with connection building; *default:* **false** | | **--osm.stop-output.length** {{DT_FLOAT}} | The default length of a public transport stop in FLOAT m; *default:* **25** | | **--osm.stop-output.length.bus** {{DT_FLOAT}} | The default length of a bus stop in FLOAT m; *default:* **15** | | **--osm.stop-output.length.tram** {{DT_FLOAT}} | The default length of a tram stop in FLOAT m; *default:* **25** | @@ -502,6 +505,8 @@ | **--opendrive.advance-stopline** {{DT_FLOAT}} | Allow stop lines to be built beyond the start of the junction if the geometries allow so; *default:* **0** | | **--opendrive.min-width** {{DT_FLOAT}} | The minimum lane width for determining start or end of variable-width lanes; *default:* **1.8** | | **--opendrive.internal-shapes** {{DT_BOOL}} | Import internal lane shapes; *default:* **false** | +| **--opendrive.position-ids** {{DT_BOOL}} | Sets edge-id based on road-id and offset in m (legacy); *default:* **false** | +| **--opendrive.lane-shapes** {{DT_BOOL}} | Use custom lane shapes to compensate discarded lane types; *default:* **false** | ### Report diff -Nru sumo-1.11.0/docs/web/docs/Netedit/editModesDemand.md sumo-1.12.0/docs/web/docs/Netedit/editModesDemand.md --- sumo-1.11.0/docs/web/docs/Netedit/editModesDemand.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Netedit/editModesDemand.md 2022-01-24 20:43:50.000000000 +0000 @@ -22,7 +22,7 @@ ## Vehicle mode -Vehicles, flows and trips can be created using this mode. The term "vehicle" includes three different elements: Vehicles, flows (both placed over a Route) and Trips (placed over a "from" edge). Also every vehicle need to be a "Vehicle Type", therefore both parameters has to be selected in both list of left frame. +Vehicles, flows and trips can be created using this mode. The term "vehicle" includes three different elements: Vehicles, flows (both placed over a Route) and Trips (placed over a "from" edge). Also every vehicle need to have a "Vehicle Type", therefore both parameters has to be selected in both list of left frame. ![](../images/neteditVehicleMode1.png) General view of vehicle mode, highlighting the list of vehicles and vehicle types diff -Nru sumo-1.11.0/docs/web/docs/Netedit/neteditUsageExamples.md sumo-1.12.0/docs/web/docs/Netedit/neteditUsageExamples.md --- sumo-1.11.0/docs/web/docs/Netedit/neteditUsageExamples.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Netedit/neteditUsageExamples.md 2022-01-24 20:43:50.000000000 +0000 @@ -174,3 +174,15 @@ 3. optionally: use inspect mode and enable 'show connections' (Alt+5). Click on the zipper connections (brown) and customize 'visibilityDistance' to set the range where vehicles start zipper merging. ![](../images/neteditZipper.png) + +## Simplify TLS program state after changing connections + +After deleting connections at a junction of type traffic_light, the traffic light program will remain unchanged by default. +This stability implies that the length of the phase state may be longer than needed and the list of used can contain gaps (where the unused states are). +To clean up the states: + +1. enter traffic light mode (T) +2. click on the junction +3. press the 'Clean States' button (this shortens the state and re-assigns indices to controlled connections) +4. save the program +5. recompute the network (F5) to see updated tls indices (when inspecting connections or drawing 'tls link index') diff -Nru sumo-1.11.0/docs/web/docs/netgenerate.md sumo-1.12.0/docs/web/docs/netgenerate.md --- sumo-1.11.0/docs/web/docs/netgenerate.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/netgenerate.md 2022-01-24 20:43:50.000000000 +0000 @@ -258,6 +258,7 @@ | **--junctions.limit-turn-speed.warn.turn** {{DT_FLOAT}} | Warn about turn speed limits that reduce the speed of turning connections (no u-turns) by more than FLOAT; *default:* **22** | | **--junctions.small-radius** {{DT_FLOAT}} | Default radius for junctions that do not require wide vehicle turns; *default:* **1.5** | | **--junctions.higher-speed** {{DT_BOOL}} | Use maximum value of incoming and outgoing edge speed on junction instead of average; *default:* **false** | +| **--internal-junctions.vehicle-width** {{DT_FLOAT}} | Assumed vehicle width for computing internal junction positions; *default:* **1.8** | | **--rectangular-lane-cut** {{DT_BOOL}} | Forces rectangular cuts between lanes and intersections; *default:* **false** | | **--check-lane-foes.roundabout** {{DT_BOOL}} | Allow driving onto a multi-lane road if there are foes on other lanes (at roundabouts); *default:* **true** | | **--check-lane-foes.all** {{DT_BOOL}} | Allow driving onto a multi-lane road if there are foes on other lanes (everywhere); *default:* **false** | diff -Nru sumo-1.11.0/docs/web/docs/Networks/Import/OpenStreetMap.md sumo-1.12.0/docs/web/docs/Networks/Import/OpenStreetMap.md --- sumo-1.11.0/docs/web/docs/Networks/Import/OpenStreetMap.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Networks/Import/OpenStreetMap.md 2022-01-24 20:43:50.000000000 +0000 @@ -95,11 +95,12 @@ \[ usage information for railways (main,branch,industrial,...). This typemap only works in combination with other typemaps. -- **osmBidiRailNetconvert.typ.xml**. Changes the default from +- **osmNetconvertBidiRail.typ.xml**. Changes the default from uni-directional railroads to bi-directional railroads. This may be useful in some regions of the world where OSM contributors used this style of date representation. The use of this typemap supplants the older option **--osm.railway.oneway-default** {{DT_BOOL}}. +- **osmNetconvertAirport.typ.xml**. Imports aeroways (runway, taxiway, etc.) !!! caution When specifying a typemap using the option **--type-files**, the defaults are not loaded. To achieve the desired types, the user should load the default typemap along with the desired modification (**--type-files /data/typemap/osmNetconvert.typ.xml,/data/typemap/osmNetconvertUrbanDe.typ.xml**) or create a fully specified typemap file by himself. @@ -112,6 +113,18 @@ for existing lanes and streets. If you want to add further bike lanes use the bicycle type map mentioned above. +### Pedestrian Traffic + +By default only footpaths (osm ways dedicated for pedestrian use) are imported. +To import all sidewalk related information, the option **--sidewalks** can be set. Alternatively, sidwalks can be added heuristically via typemaps (see above) or [guessing-options](../../Simulation/Pedestrians.md#generating_a_network_with_sidewalks) + +### Lane-To-Lane Connections + +By default, lane-to-lane connections are guessed by [netconvert](../../netconvert.md) and only turning restrictions are loaded from OSM to influence connection generation. When setting option **--osm.turn-lanes**, the turn direction road markings form OSM are evaluated to guide connection generation. + +!!! caution + At roads where some lanes have turn markings and others do not, the unmarked lanes are interpreted as through-lanes. This may not be correct in all cases. + # Importing additional Polygons (Buildings, Water, etc.) OSM-data not only contains the road network but also a wide range of diff -Nru sumo-1.11.0/docs/web/docs/Networks/PlainXML.md sumo-1.12.0/docs/web/docs/Networks/PlainXML.md --- sumo-1.11.0/docs/web/docs/Networks/PlainXML.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Networks/PlainXML.md 2022-01-24 20:43:50.000000000 +0000 @@ -108,6 +108,7 @@ | shape | List of positions; each position is encoded in x,y or x,y,z in meters (do not separate the numbers with a space\!). | A custom shape for that node. If less than two positions are given, netconvert will reset that node to use a computed shape. | | keepClear | bool | Whether the [junction-blocking-heuristic](../Simulation/Intersections.md#junction_blocking) should be activated at this node *(default true)* | | rightOfWay | string | Set algorithm for computing [\#Right-of-way](#right-of-way). Allowed values are *default* and *edgePriority* | +| fringe | string | Clarify whether this junction is on the [nework fringe](#fringe). Allowed values are *default*, *outer* and *inner* | | controlledInner | list of edge ids | Edges which shall be controlled by a joined TLS despite being incoming as well as outgoing to the jointly controlled nodes | !!! note @@ -279,6 +280,18 @@ !!! caution Never attempt to modify the junction logic within a ***.net.xml*** file manually as there are subtle inter-dependencies with other data structures in the network. Nevertheless, it may be useful to [look into the .net.xml to understand right-of-way](../Networks/SUMO_Road_Networks.md#requests) +## Fringe + +For route generation it may be relevant to know whether a particular junction or edge is at boundary of a network where other roads (that exist in the real world) were cut off. This can specified using the 'fringe' attrribute: + +- default: this junction is not part of the fringe +- outer: this junction is connected to additional edges in the real world. It is part of the outer boundary of the network +- inner: this junction is connected to additional edges in the real world. It lies within the network but other roads (i.e. with a lower road class) were removed from the simulation + +The fringe attribut can be determined automatically for the outer fringe based on the pareto frontier by setting netconvert option **--fringe.guess**. It is also set automatically by [netgenerate](../netgenerate.md) when option **--attach-length** is used. Editing the attribute in [netedit](../Netedit/index.md) is also supported. + +The 'fringe' attribute is used by [randomTrips.py](../Tools/Trip.md#randomtripspy) when setting option **--fringe-junctions**. + ## Joining Nodes Sometimes your network may contain nodes which are very close together diff -Nru sumo-1.11.0/docs/web/docs/Other/Projects.md sumo-1.12.0/docs/web/docs/Other/Projects.md --- sumo-1.11.0/docs/web/docs/Other/Projects.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Other/Projects.md 2022-01-24 20:43:50.000000000 +0000 @@ -49,7 +49,7 @@ management approaches - [OIS](https://web.archive.org/web/20040826034935/http://www.dlr.de/vf/forschung/projekte/ois): Verification of using optical sensors for optimization of traffic lights -- [CityMobil](http://www.citymobil.org/) Automatic urban +- [CityMobil](https://web.archive.org/web/20191204150245/http://www.citymobil-project.eu:80/) Automatic urban transportation. A [simulation for a parking lot](../Tutorials/CityMobil.md) inspired by the Rome demonstrator is included with SUMO. - [DRIVE C2X](https://web.archive.org/web/20170311043037/http://www.drive-c2x.eu/project) Driving implementation diff -Nru sumo-1.11.0/docs/web/docs/Simulation/Basic_Definition.md sumo-1.12.0/docs/web/docs/Simulation/Basic_Definition.md --- sumo-1.11.0/docs/web/docs/Simulation/Basic_Definition.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Simulation/Basic_Definition.md 2022-01-24 20:43:50.000000000 +0000 @@ -25,11 +25,12 @@ (or **-r** {{DT_Routes}}\[,{{DT_Routes}}]\*). As you can see, you can use more than one route file within a single simulation run. -The routes MUST be sorted. The reason is that we want to simulate large -road networks with up to millions of routes. Using a plain PC this is -only possible if you do not keep all routes in memory. All files given -as parameter to **--route-files** {{DT_Routes}}\[,{{DT_Routes}}]\* are read step-wise. Starting at the begin time step, -new routes are loaded every n time steps for the next n time steps. n +!!! caution + The vehicular elements (trips, vehicles, flows) must be sorted by depart / begin time. + +The reason is that route files are read incrementally to conserve memory and enable large simulations. +All files given as parameter to **--route-files** {{DT_Routes}}\[,{{DT_Routes}}]\* are read step-wise. +Starting at the begin time step, new routes are loaded every n time steps for the next n time steps. n may be controlled using the **--route-steps** {{DT_INT}} where <=0 forces [sumo](../sumo.md)/[sumo-gui](../sumo-gui.md) to load the file completely. Fetching routes for the next steps only implies that the @@ -39,6 +40,9 @@ You may also give routes including vehicle definitions as {{AdditionalFile}} to [sumo](../sumo.md)/[sumo-gui](../sumo-gui.md). +!!! caution + vTypes and named routes must preceed vehicle definitions which reference those types and routes. + ## Additional Files One ore more {{AdditionalFile}}(s) are used to load additional entities: @@ -60,10 +64,8 @@ [routes](../Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md#vehicles_and_routes) All these additional structures / definitions are given to the -simulation using the **--additional-files** {{DT_FILE}}\[,{{DT_FILE}}]\*. The list of given files is processed -incrementally, this means each file is read completely from top to -bottom and the list is processed starting with the first file of the -list. +simulation using the **--additional-files** {{DT_FILE}}\[,{{DT_FILE}}]\*. +Each file is read completely into memory and the list of files is processed from left to right. ## Parsing Order diff -Nru sumo-1.11.0/docs/web/docs/Simulation/Motorways.md sumo-1.12.0/docs/web/docs/Simulation/Motorways.md --- sumo-1.11.0/docs/web/docs/Simulation/Motorways.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Simulation/Motorways.md 2022-01-24 20:43:50.000000000 +0000 @@ -18,13 +18,13 @@ If the network does not contain detailed ramp data, [netconvert](../netconvert.md) can be [configured to add them heuristically](../Networks/Further_Options.md#guessing_on-_and_off-ramps). -This basically adds acceleration at on-ramps and deceleration lanes at -off-ramps. +This basically adds acceleration lanes at on-ramps and deceleration lanes at +off-ramps by increasing the lane count of one or more edges. Ramps usually merge into the main road via an acceleration lane. This acceleration lane opens up where the ramp enters the motorway and is modelled as a dead-end lane (no outgoing connection). This forces on-ramp vehicles to change lanes in order to continue their route. It may be useful to make acceleration lanes in SUMO somewhat longer than in reality. -This compensates the cautious default behavior of SUMO drivers: Vehicles on the acceleration lane will decelerate when approaching the end of that lane since they cannot anticipate with certainty whether their lanechange will be successful. In contrast, human drivers are better at predicting the future and may accelerate up to the end of the acceleration lane (and then change into the anticipated gap at the last moment) +This compensates for the cautious default behavior of SUMO drivers: Vehicles on the acceleration lane will decelerate when approaching the end of that lane since they cannot anticipate with certainty whether their lanechange will be successful. In contrast, human drivers are better at predicting the future and may accelerate up to the end of the acceleration lane (and then change into the anticipated gap at the last moment) ### Reduction in the number of lanes diff -Nru sumo-1.11.0/docs/web/docs/Simulation/NEMA.md sumo-1.12.0/docs/web/docs/Simulation/NEMA.md --- sumo-1.11.0/docs/web/docs/Simulation/NEMA.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Simulation/NEMA.md 2022-01-24 20:43:50.000000000 +0000 @@ -28,7 +28,7 @@ ``` - + @@ -36,9 +36,11 @@ - - + + + + @@ -57,7 +59,7 @@ | **id** | id (string) | The id of the traffic light. This must be an existing traffic light id in the .net.xml file. Typically the id for a traffic light is identical with the junction id. The name may be obtained by right-clicking the red/green bars in front of a controlled intersection. | | **type** | NEMA (string) | This value should be kept as *NEMA* to activate the NEMA-phase controller module | | **programID** | id (string) | The id of the traffic light program. | -| **offset** | int | The offset value here will be overwritten by the param *offset* below| +| **offset** | int | The offset value in seconds. Default to *0*. Only effective when the controller is in coordinated mode. The reference to the offset is always the end of the coordinated phases. ## Attributes @@ -72,9 +74,11 @@ | **ring2** | string | The phase numbers in ring 2 seperated by comma (','). Fill *0* if a phase does not exist. Repeat the ring 1 phases of the side of barrier if that side of barrier does not have any phases.| | **barrierPhases** | string | One set of phases, seperated by comma (','), that need to end together. This defines a barrier. Usually phase 4 and 8, i.e., "4,8".| | **coordinate-mode** | bool (true or false) | Default to *false*. True if the controller is in coordinated mode.| -| **coordinatePhases** | string | One set of phases, seperated by comma (','), that need to end together. This defines another barrier. If in coordinated mode, this set of phases are the coordinated phases. Usually phase 2 and 6, i.e., "2,6".| -| **offset** | double | The offset value in seconds. Default to *0*. Only effective when the controller is in coordinated mode. The reference to the offset is always the end of the coordinated phases.| -|**whetherOutputState** | bool (true or false) | Whether record the signal phase change events. This could be used for generating Automated Traffic Signal Performance Measures (ATSPM).| +| **barrier2Phases** | string | One set of phases, seperated by comma (','), that need to end together. This defines another barrier. If in coordinated mode, this set of phases are the coordinated phases. Usually phase 2 and 6, i.e., "2,6".| +| **minRecall** | string | One set of phases, seperated by comma (','), that will get activated no matter if the corresponding detectors will be activated or not. The duration of the phase activation will be between minDur and maxDur of the phase. E.g., "2,6". The value will be default to "1,2,3,4,5,6,7,8" if not set (all the existing phases will be called).| +| **maxRecall** | string | One set of phases, seperated by comma (','), that will get activated no matter if the corresponding detectors will be activated or not. The duration of the phase activation will be the maxDur of the phase. If you set all the phases to have maxRecall, the controller will behave as a fixed time controller with the green times being the maxDur of the phases. The value will be default to empty ("") if not set.| +|**fixForceOff** | bool (true or false) | If true, the controller will be in fixed force-off mode. This permits non-coordinated phases to use the unused time of previous phases. If false, the controller will be in floating force-off mode. default *false*| +|**whetherOutputState** | bool (true or false) | Whether record the signal phase change events. This could be used for generating Automated Traffic Signal Performance Measures (ATSPM). The value will be default to false if not set.| |**show-detectors** | bool (true or false) | It controls whether generated detectors will be visible or hidden in sumo-gui. The default for all traffic lights can be set with option --tls.actuated.show-detectors. It is also possible to toggle this value from within the GUI by right-clicking on a traffic light. ## Attributes @@ -102,3 +106,12 @@ - **traci.trafficlight.setNemaCycleLength(tlsID, cycleLength)**: the cycle length may change when you update the splits/max green. You need to set the new cycle length to make the new timing work without problems. All the updates in the signal timing parameters in the NEMA-phase controller will happen after the current cycle ended. + +# Configuration Errors + +The following errors may be raised: + +- **the phases before barrier X from both rings do not add up**: EXPLANATION FORTHCOMING +- **Ring X does not add to cycle length**: EXPLANATION FORTHCOMING + +To simulate misconfigured controllers, both errors may be ignored by setting ``. diff -Nru sumo-1.11.0/docs/web/docs/Simulation/Output/FCDOutput.md sumo-1.12.0/docs/web/docs/Simulation/Output/FCDOutput.md --- sumo-1.11.0/docs/web/docs/Simulation/Output/FCDOutput.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Simulation/Output/FCDOutput.md 2022-01-24 20:43:50.000000000 +0000 @@ -125,7 +125,7 @@ information](../../TraCI/Vehicle_Signalling.md) to the output - **--fcd-output.distance** will add [kilometrage](../Railways.md#kilometrage-mileage-chainage) information to the output - **--fcd-output.acceleration** will add acceleration data to the output (also lateral acceleration when using the [sublane model](../SublaneModel.md) -- **--fcd-output.max-leader-distance FLOAT** will add attributes leaderGap, leaderSpeed, leaderID whenever a vehicle has a leader within the given distance +- **--fcd-output.max-leader-distance FLOAT** will add attributes leaderGap, leaderSpeed, leaderID whenever a vehicle has a leader within the given distance. Otherwise, leaderID will be "" and leaderGap, leaderSpeed will be -1. - **--fcd-output.params KEY1,KEY2,...** adds [generic parameters](../GenericParameters.md) to the output (supports device and carfollowmodel parameters as well as arbitrary user-define values) - **--fcd-output.attributes ATTR1,ATTR2,...** restricts written attributes to the given list (to reduce output). - The special attribute `vehicle` may be given to add a vehicle attribute to each person (and thereby distinguish riding from walking persons). diff -Nru sumo-1.11.0/docs/web/docs/Simulation/Output/Induction_Loops_Detectors_(E1).md sumo-1.12.0/docs/web/docs/Simulation/Output/Induction_Loops_Detectors_(E1).md --- sumo-1.11.0/docs/web/docs/Simulation/Output/Induction_Loops_Detectors_(E1).md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Simulation/Output/Induction_Loops_Detectors_(E1).md 2022-01-24 20:43:50.000000000 +0000 @@ -98,6 +98,7 @@ ## Further Notes - [Simulated induction loops can be accessed using - TraCI](../../TraCI/Induction_Loop_Value_Retrieval.md) + TraCI](../../TraCI/Induction_Loop_Value_Retrieval.md). If no XML output is + needed, the attribute `file="NUL"` may be used. - You can generate detector definitions automatically. See [output tools](../../Tools/Output.md) for more information. diff -Nru sumo-1.11.0/docs/web/docs/Simulation/Output/Lanearea_Detectors_(E2).md sumo-1.12.0/docs/web/docs/Simulation/Output/Lanearea_Detectors_(E2).md --- sumo-1.11.0/docs/web/docs/Simulation/Output/Lanearea_Detectors_(E2).md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Simulation/Output/Lanearea_Detectors_(E2).md 2022-01-24 20:43:50.000000000 +0000 @@ -134,8 +134,8 @@ | end | (simulation) seconds | The last time step + DELTA_T the values were collected in (may be equal to begin) | | id | id | The id of the detector (needed if several detectors share an output file) | | sampledSeconds | s | The total time all vehicles which contributed data were on the detector. this may be fractional even if the time step is one second, because the times when the vehicle enters and leaves are interpolated. | -| nVehEntered | \# | The number of vehicles that entered the detector in the corresponding interval. | -| nVehLeft | \# | The number of vehicles that left the detector in the corresponding interval. | +| nVehEntered | \# | The number of vehicles that entered the detector in the corresponding interval. (vehicle front has passed 'pos') | +| nVehLeft | \# | The number of vehicles that left the detector in the corresponding interval. (vehicle back has passed 'endPos') | | nVehSeen | \# | The number of vehicles that were on the detector in the corresponding interval (were "seen" by the detector). | | meanSpeed | m/s | The mean velocity over all collected data samples. | | meanTimeLoss | s | The average time loss per vehicle in the corresponding interval. The total time loss can be obtained by multiplying this value with nVehSeen. | @@ -159,6 +159,9 @@ # Further notes +- [Simulated lane area detectors can be accessed using + TraCI](../../TraCI/Lane_Area_Detector_Value_Retrieval.md). If no XML output is + needed, the attribute `file="NUL"` may be used. - You can generate detector definitions automatically. See [output tools](../../Tools/Output.md) for more information. - The mean speed given by the detector is rather the length divided by diff -Nru sumo-1.11.0/docs/web/docs/Simulation/Output/Multi-Entry-Exit_Detectors_(E3).md sumo-1.12.0/docs/web/docs/Simulation/Output/Multi-Entry-Exit_Detectors_(E3).md --- sumo-1.11.0/docs/web/docs/Simulation/Output/Multi-Entry-Exit_Detectors_(E3).md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Simulation/Output/Multi-Entry-Exit_Detectors_(E3).md 2022-01-24 20:43:50.000000000 +0000 @@ -110,7 +110,8 @@ - All measurements concerning durations refer to the end of the relevant interval - Simulated multi-entry-exit detectors can be accessed using - [TraCI](../../TraCI/Multi-Entry-Exit_Detectors_Value_Retrieval.md) + [TraCI](../../TraCI/Multi-Entry-Exit_Detectors_Value_Retrieval.md). If no XML output is + needed, the attribute `file="NUL"` may be used. - You can generate detector definitions automatically. See [output tools](../../Tools/Output.md) for more information. - The simulation does not check whether the area defined by the diff -Nru sumo-1.11.0/docs/web/docs/Simulation/Output/StopOutput.md sumo-1.12.0/docs/web/docs/Simulation/Output/StopOutput.md --- sumo-1.11.0/docs/web/docs/Simulation/Output/StopOutput.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Simulation/Output/StopOutput.md 2022-01-24 20:43:50.000000000 +0000 @@ -34,6 +34,8 @@ | parking | bool | Whether the vehicle left the road (*true*) or stayed on it (*false*) | | started | time (s) | The time at which the vehicle stopped | | ended | time (s) | The time at which the vehicle resumed driving | +| delay | time (s) | The difference between 'ended' and 'until' (or -1 if until was not set) | +| arrivalDelay | time (s) | The difference betweend 'started' and 'arrival' (only if stop had attribute 'arrival' set) | | initialPersons | int | The number of persons in the vehicle when arriving at the stop | | loadedPersons | int | The number of persons that entered the vehicle at this stop | | unloadedPersons | int | The number of persons that left the vehicle at this stop | @@ -43,4 +45,4 @@ | busStop | id (optional) | The id of the busStop if this stop took place at a named ``| | containerStop | id (optional) | The id of the containerStop if this stop took place at a named `` | | parkingArea | id (optional) | The id of the parkingArea if this stop took place at a named `` | -| chargingStation | id (optional) | The id of the chargingStation if this stop took place at a named `` | \ No newline at end of file +| chargingStation | id (optional) | The id of the chargingStation if this stop took place at a named `` | diff -Nru sumo-1.11.0/docs/web/docs/Simulation/Pedestrians.md sumo-1.12.0/docs/web/docs/Simulation/Pedestrians.md --- sumo-1.11.0/docs/web/docs/Simulation/Pedestrians.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Simulation/Pedestrians.md 2022-01-24 20:43:50.000000000 +0000 @@ -69,6 +69,10 @@ !!! note The heuristic methods described below, also perform automatic connection shifting and removal of pedestrian permissions from non-sidewalk lanes. +### Direct Import + +When importing [OSM](../Networks/Import/OpenStreetMap.md), the option **--osm.sidwalks** may be used to import sidwalks for all roads that carry this information. + ### Type-base generation When importing edges with defined types, it is also possible to declare diff -Nru sumo-1.11.0/docs/web/docs/Simulation/RoadCapacity.md sumo-1.12.0/docs/web/docs/Simulation/RoadCapacity.md --- sumo-1.11.0/docs/web/docs/Simulation/RoadCapacity.md 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Simulation/RoadCapacity.md 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,103 @@ +--- +title: RoadCapacity +--- + +# Introduction + +The capacity of a road is typically expressed as vehicles/hour and describes the +maximum traffic flow that a road can handle. + +As a rule of thumb, the capacity of a multi-lane road is the product of the +capacity of a single lane multiplied by the number of lanes. The exact relationship +is more complex and depends on the distribution of vehicle speeds and the +lane changing dynamics. + +# Lane Capacity + +The capacity of a single lane is inversely proportional to time headways +between successive vehicles. Assuming homogeneous traffic and equal headways: + +`capacity = 3600 / grossTimeHeadway` + +Where `grossTimeHeadway` denotes the time it takes for two successive vehicle +front-bumpers to pass the same location. + +In contrast `netTimeHeadway` denotes the time it takes for the follower vehicles +front-bumper to reach the location of the leaders rear-bumper. + +# Computing Headways + +The exact time headways observed in the simulation depend on the used +carFollowModel and it's parameters. The easiest case to analyze is the one where all +vehicles drive at the same speed *s*. + +Let `grossHeadway` denote the distance between successive vehicle front-bumpers +and `netHeadway` denote the distance from follower front-bumper to leader +rear-bumper. + +For the default 'Krauss'-Model, the following vType attributes are relevant for +the minimum time headway (corresponding to maximum flow and hence lane +capacity): + +- *length*: the physical length of a vehicle in m (default 5) +- *minGap*: the minimum gap between vehicles in a standing queue in m (default 2.5) +- *tau*: the desired minimum time headway in seconds (default 1) + +Assuming that all vehicles are driving at at constant speed *s*, the following +headways hold for 'Krauss': + +- `netHeadway = minGap + tau * s` +- `grossHeadway = length + minGap + tau * s` + +From this we can directly compute the time headways: + +- `netTimeHeadway = minGap / s + tau` +- `grossTimeHeadway = (length + minGap) / s + tau` + +Due to length and minGap, the capacity of a road depends on it's speed limit (whereas +the tau component is independent of speed). +At high road speeds, the tau component is the dominant factor whereas length and minGap dominate at low speeds. + +The following graph shows the ideal time headways and road capacities for different +road speeds with the default model parameters for length, minGap and tau. + +![capacity.png](../images/capacity.png "road capacity and time headways") + +# Further headway effects + +The above computation only holds for vehicles driving at constant speeds and +with minimum distances. This rarely occurs in a simulation for the following +reasons + +- vehicles have different desired speeds ([modeled as a speedFactor distribution](../Definition_of_Vehicles%2C_Vehicle_Types%2C_and_Routes.md#speed_distributions)) +- vehicles have randomized slow-downs ([depending on the carFollowModel](../Definition_of_Vehicles%2C_Vehicle_Types%2C_and_Routes.md#car-following_models)). +- vehicles are not always in a configuration of minimum following distances. Care must be taken especially for [vehicle insertion](VehicleInsertion.md#effect_of_simulation_step-length) + +The following table shows road capacities that can be achieved at vehicle +insertion depending on the used vType and insertion parameters. The road speed limit was 16.66m/s which gives a theoretical capacity of 2482 veh/hour. +The script which produces the data points for the table below can be found [here](https://github.com/eclipse/sumo/tree/main/tests/complex/sumo/insertionCapacity). + +| sigma | speedDev | departSpeed | capacity | capacity
        --step-length 0.1 | capacity
        --extrapolate-departpos | capacity
        --step-length 0.1
        --extrapolate-departpos | +| ----- | -------- | ----------- | -------- | ---------- | -------- | -------- | +| 0.5 | 0.1 | 0 | 1198 | 1368 | 1198 | 1368 | +| 0.5 | 0.1 | max | 1635 | 2183 | 1653 | 2186 | +| 0.5 | 0.1 | desired | 1522 | 2052 | 1921 | 2154 | +| 0.5 | 0.1 | avg | 1933 | 2206 | 1974 | 2217 | +| 0.5 | 0 | 0 | 1200 | 1368 | 1200 | 1368 | +| 0.5 | 0 | max | 1643 | 2188 | 1664 | 2188 | +| 0.5 | 0 | desired | 1800 | 2400 | 2128 | 2441 | +| 0.5 | 0 | avg | 1800 | 2400 | 2142 | 2446 | +| 0 | 0.1 | 0 | 1440 | 1500 | 1440 | 1500 | +| 0 | 0.1 | max | 2075 | 2276 | 2087 | 2276 | +| 0 | 0.1 | desired | 1663 | 2080 | 2190 | 2183 | +| 0 | 0.1 | avg | 2199 | 2238 | 2235 | 2243 | +| 0 | 0 | 0 | 1440 | 1500 | 1440 | 1500 | +| 0 | 0 | max | 2073 | 2489 | 2083 | 2489 | +| 0 | 0 | desired | 1800 | 2400 | 2482 | 2483 | +| 0 | 0 | avg | 1800 | 2400 | 2482 | 2483 | + + +Comments + +- default departSpeed is '0' which gives the worst possible insertion capacity +- step-length has a side effect on the average speed reduction from sigma (this is an implementation problem that should be fixed eventually) diff -Nru sumo-1.11.0/docs/web/docs/Simulation/Safety.md sumo-1.12.0/docs/web/docs/Simulation/Safety.md --- sumo-1.11.0/docs/web/docs/Simulation/Safety.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Simulation/Safety.md 2022-01-24 20:43:50.000000000 +0000 @@ -13,7 +13,7 @@ reduced. When setting **--collision.mingap-factor 0**, only *physical collisions* (i.e. front and back bumper meet or overlap) are registered. -When setting the option **--collisions.check-junctions**, collisions between vehicles on the same +When setting the option **--collision.check-junctions**, collisions between vehicles on the same intersection are also checked by detecting overlap of the vehicles shapes. diff -Nru sumo-1.11.0/docs/web/docs/Simulation/SaveAndLoad.md sumo-1.12.0/docs/web/docs/Simulation/SaveAndLoad.md --- sumo-1.11.0/docs/web/docs/Simulation/SaveAndLoad.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Simulation/SaveAndLoad.md 2022-01-24 20:43:50.000000000 +0000 @@ -32,6 +32,13 @@ is desired as output (instead of the compressed format .xml.gz) the file names should be given (with suffix .xml). +## Further options + +- **--save-state.rng**: Save random number generator states +- **--save-state.transportables**: Save person and container states +- **--save-state.constraints**: Save rail signal constraints +- **--save-state.precision**: Set decimal precision when saving states + # Loading The option **--load-state** {{DT_FILE}} is used to initialize the simulation with the given state @@ -64,10 +71,9 @@ # Know Issues +- flows cannot be loaded from a state file alone (the original route file must be loaded as well) - The internal state of the laneChangeModel is not saved - the internal state of the carFollowModel is not saved (not all models have this). -- Persons are not saved -- Traffic light states with dynamic / modified timings may not be restored correctly. # Older Versions of SUMO diff -Nru sumo-1.11.0/docs/web/docs/Simulation/Taxi.md sumo-1.12.0/docs/web/docs/Simulation/Taxi.md --- sumo-1.11.0/docs/web/docs/Simulation/Taxi.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Simulation/Taxi.md 2022-01-24 20:43:50.000000000 +0000 @@ -93,11 +93,13 @@ By default, taxis will remain in the simulation until all persons have left. To make them leave the simulation at an earlier time, the end time can be defined using a generic parameter in their ```vType``` or ```vehicle```-definition: ``` +``` ``` +``` ## Idle Behavior By default, vehicles will leave the simulation after reaching the end of their final edge. To avoid this, taxis have an idling behavior configurable with option **--device.taxi.idle-algorithm**: @@ -105,6 +107,24 @@ - "stop" (default): stop at the current location (off-road) after delivering the last customer of the current service request. - "randomCircling": continue driving to random edges until the next request is received. (caution: taxi might get stuck in a cul-de-sac if the network has those) +## Customer Stops + +Taxis will stop to pick-up and drop-off customers. The 'actType' attribute of a stop indicates the purpose ('pickup' / 'dropOff') as well as the ids of the customers and their reservation id. Stop attributes can be configured using [generic parameters]() `` or `` definition of the taxi: + +``` + + + + + + +``` + +- duration for pick-up stop can be configurd with vType/vehicle param "device.taxi.pickupDuration" (default "0") +- duration for drop-off stop can be configurd with vType/vehicle param "device.taxi.dropOffDuration" (default "60") + +By default, vehicle stops will have attribute `parking="true"` which means that the taxi will not block a driving lane. This can be changed by setting +param "device.taxi.parking" to "false". # TraCI To couple an external dispatch algorithm to SUMO, the following [TraCI](../TraCI.md) functions are provided: diff -Nru sumo-1.11.0/docs/web/docs/Simulation/Traffic_Lights.md sumo-1.12.0/docs/web/docs/Simulation/Traffic_Lights.md --- sumo-1.11.0/docs/web/docs/Simulation/Traffic_Lights.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Simulation/Traffic_Lights.md 2022-01-24 20:43:50.000000000 +0000 @@ -295,10 +295,16 @@ In the current implementation, detectors for actuation are only used if all connections from the detector lane gets the unconditional green light ('G') in a particular phase. This is done to prevent useless phase extensions when the first vehicle on a given lane is not allowed to drive. A simple fix is often the provide dedicate left turn lanes. +The detector names take the form `TLSID_PROGRAMID_EDGEINDEX.LANEINDEX` where + +- **TLSID** is the id of the tlLogic element +- **PROGRAMID** is the value attribute 'programID' +- **EDGEINDEX** is a running index that starts at 0 for edge that approaches tls linkIndex 0 (typically the northern approach) +- **LANEINDEX** is a running index for the current edge that starts at the first vehicular lane (sidewalks do not count) + !!! note Sumo will issue a warning of the form "... has no controlling detector" if a phase or link index does not have usable detectors. - ### Example ``` @@ -328,6 +334,8 @@ - **show-detectors** controls whether generated detectors will be visible or hidden in [sumo-gui](../sumo-gui.md). The default for all traffic lights can be set with option **--tls.actuated.show-detectors**. It is also possible to toggle this value from within the GUI by right-clicking on a traffic light. - parameters **vTypes**, **file** and **freq** have the same meaning as for [regular induction loop detectors](../Simulation/Output/Induction_Loops_Detectors_(E1).md). +- **coordinated** (true/false) Influence there reference point for time-in-cycle when using [coordination](#coordination) +- **cycleTime** sets the cycle time (in s) when using [coordination](#coordination). Defaults to the sum of all phase 'durations' values. Some parameters are only used when a signal plan with [dynamic phase selection](#dynamic_phase_selection_phase_skipping) is active: @@ -351,6 +359,33 @@ ``` +### Coordination + +Actuated phases (minDur != maxDur) can be coordinated by adding attributes 'earliestEnd' and 'latestEnd'. +If these values are used, each step in the traffic light plan is assigned a 'timeInCycle' value depending on the value of param 'coordinated' (default 'false'). + +- coordinated=true: timeInCycle = *(simulationTime - offset) % cycleTime* (where cycleTime is taken from the param with key=cycleTime) +- coordinated=false: timeInCycle = *time since last switching into phase 0* + +If 'earliestEnd' is set, a phase can not end while *timeInCycle < earliestEnd* (effectively increasing minDur) +If 'latestEnd' is set, a phase cannot be prolonged when *timeInCycle = latestEnd* (effectively reducing maxDur). + +When setting 'latestEnd' < 'earliestEnd', the phase can be extended into the next cycle. +If both values are defined and a phase has already started and ended in the +current cycle, both values will be shifted into the next cycle to avoid having a +phase run more than once in the same cycle (this only happens when param +'coordinated' is set to 'true'). + +``` + + + + + + ... + +``` + ### Dynamic Phase Selection (Phase Skipping) When a phase uses attribute 'next' with a list of indices. The next phase is chosen dynamically based on the detector status of all candidate phases according to the following algorithm: @@ -367,6 +402,103 @@ The helper script [tls_buildTransitions.py] can be used to generate such logics from simplified definitions. +### Custom Switching Rules + +By default, all detectors use the same time gaps and there are pre-defined rules +that govern which detectors are used or ignored in each phase. If more +flexibility is needed, custom conditions can be defined by using the phase +attributes 'earlyTarget' and 'finalTarget' to define logical expressions. + +If the controller is in an actuated phase (minDur < maxDur) and could switch +into a new phase, the attribute 'earlyTarget' of the new phase is evaluated. If +the expression evalutes to 'true', the controller switches into the new phase. +Otherwise it remains in the current phase. If the current phase has multiple successors (attribute 'next'), +the candidates are evaluated from left to right and the first candidate where 'earlyTarget' evaluates to true is used. + +If the controller has reached the maximum duration of it's current phase and +multiple successor phases are defined with attribute 'next', the +attribute 'finalTarget' of all candidate phases is evaluated from left to right. +The first phase where the expression evaluates to 'true' is used. +Otherwise, the rightmost phase in the next-list is used. + +The following elements are permitted in an expression for attributes +'earlyTarget' and 'finalTarget': + +- numbers +- comparators <,>,=,<=,>= +- mathematical operators +,-,*,/,** +- logical operators 'or', 'and', '!' +- parentheses (,) +- pre-defined functions: + - 'z:DETID': returns the time gap since the last vehicle detection for inductionLoop detector with id 'DETID' or id 'TLSID_PROGRAMID_DETID' (DETID may ommmit the the [prefix 'TLSID_PROGRAMID_'](#detectors)) + - 'a:DETID': returns true (1) if a vehicle is on detector with id 'DETID' and + false (0) otherwise. Supports inductionLoop and laneAreaDetectors. Also supports omitting the prefix of the detector id. (see 'z:') + - 'g:TLSINDEX': returns current green duration in seconds for link with the given index + - 'r:TLSINDEX': returns current red duration in seconds for link with the given index +- Symbolic names for [pre-defined expressions](#named_expressions) + +The following constraints apply to expressions: + +- all elements of an expression must be separated by a space character (' ') + with the exception of the operator '!' (logical negation) which must precede it's operand without a space. + +#### Named Expressions + +To organize expressions, the element `` may be used as a child element +of `` to define named expressions that can be referenced in other expressions: + +``` + + + + + ... +``` + +- condition id must be an alphanumeric string without spaces and without the ':'-character +- value may be any expression which is permitted for 'earlyTarget' or 'finalTarget' + +Condition values can be [visualized](Traffic_Lights.md#track_phases) while the simulation is running. It may be useful to add extra conditions that are only used for debugging purposes. + +#### Examples + +#### Diverse Logical Conditions + +``` + + + + + + + + +``` + +#### Default Gap Control Logic + +The default gap control logic, replicated with custom conditions. A complete scenario including network and detector definitions can be downloaded [here](https://sumo.dlr.de/extractTest.php?path=sumo/basic/tls/actuated/conditions/replicate_default): + +``` + + + + + + + + + + + + + + + +``` + +!!! note + The the expression 'z:D0.0' retrieves the detection gap of detector 'C_PI_D0.0' but the prefix 'C_PI_' may be omitted. ### Visualization By setting the sumo option **--tls.actuated.show-detectors** the default visibility of detectors can be @@ -749,3 +881,41 @@ SUMO can load multiple traffic light programs from the *.net.mxl* file and from [additional files](#defining_new_tls-programs). Using the TraCI function **setProgram**, a script can switch between them. + +# Signal Plan Visualization + +In [sumo-gui](../sumo-gui.md), right-clicking on a traffic light allows opening up a menu that contains the items 'Show Phases' and 'Track Phases'. +These items open up new windows which are explained below + +## Show Phases + +This shows the signal states of all controlled links for the complete list of defined phases. Here, time is on the x-axis and there is one row for each link index. The time axis in the bottom shows the time of each phase change starting at 0. + +The time can be switched between the following styles +- **Seconds**: absolute simulation time in seconds +- **MM::SS**: current minute and second (values repeat every hour) +- **Time in Cycle**: current second within the traffic light cycle (resets either when starting phase 0 or in some alignment to absolute simulation time). + +Optionally, the green phase durations can be written for every phase. +The top row contains the phase index but it is possible to change this so it shows phase names instead. (phase names are optional, and only the names of 'Green' phases are shown for brevity) + +![show_phases.png](../images/show_phases.png +"Show Phases Window") + +!!! note + All phases will be shown in definition order. This may be different from their operational sequence if phase attribute 'next' is used. + +## Track Phases + +This shows the evoluation of signal states for all controlled links for the last X seconds of operation (set via the 'Range' value). The basic layout is the same as for the 'Show Phases' Window. + +The following additional features may be activated via checkboxes: + +- **detector**: shows activation states of all [detectors that are controlling this traffic light](Traffic_Lights.md#detectors) +- **conditions**: shows the boolean value of [conditions that are defined for this traffic light](Traffic_Lights.md#named_expressions). A colored block wil be drawn when the numerical value of the condition is different from zero. + +!!! note + When the mouse is placed over an active condition block, the numerical value of the condition will be shown. + +![track_phases.png](../images/track_phases.png +"Track Phases Window") diff -Nru sumo-1.11.0/docs/web/docs/Simulation/VehicleInsertion.md sumo-1.12.0/docs/web/docs/Simulation/VehicleInsertion.md --- sumo-1.11.0/docs/web/docs/Simulation/VehicleInsertion.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Simulation/VehicleInsertion.md 2022-01-24 20:43:50.000000000 +0000 @@ -96,6 +96,7 @@ - insert with a fixed departSpeed (numerical value) and set option **--ignore-route-errors**. Vehicles will be inserted with unsafe speeds at the specified time if emergency-braking would still allow collision-free dynamics +- inserted vehicles with a homogeneous departSpeed by setting `departSpeed="last"` or departSpeed="avg"` - use [traci.vehicle.moveTo](../TraCI/Change_Vehicle_State.md#move_to_0x5c) or @@ -127,3 +128,4 @@ - The departure edge can be determined at run-time when using [Traffic Assignment Zones (TAZ)](../Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md#traffic_assignement_zones_taz) +- [Table of insertion capacity achievable with different options and insertion attributes](RoadCapacity.md#further_headway_effects) diff -Nru sumo-1.11.0/docs/web/docs/sumo-gui.md sumo-1.12.0/docs/web/docs/sumo-gui.md --- sumo-1.11.0/docs/web/docs/sumo-gui.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/sumo-gui.md 2022-01-24 20:43:50.000000000 +0000 @@ -180,8 +180,9 @@ - Select junction foe vehicles (vehicles). Requires coloring vehicles *by selection* to be visible - Close for traffic (edges and lanes) -- Switch programs (traffic lights) - Set speed limit (variable speed sign) +- Switch programs (traffic lights) +- [Visualize Signal Plans](Simulation/Traffic_Lights.md#signal_plan_visualization) (traffic lights) ## Selecting Objects @@ -485,6 +486,9 @@ | simple shapes | All vehicles have simple car shape | | raster images | All vehicles are drawn with a loaded bitmap defined for their type using attribute `imgFile` (using *simple shapes* as fallback) | +!!! note + When using an `imgFile` as the shape, it is necessary to select the vehicles to show as "raster images" in the viewsettings menu. + **Table 1.2 Vehicle coloring schemes and boundaries** | Name | Measure | Description | diff -Nru sumo-1.11.0/docs/web/docs/sumo.md sumo-1.12.0/docs/web/docs/sumo.md --- sumo-1.11.0/docs/web/docs/sumo.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/sumo.md 2022-01-24 20:43:50.000000000 +0000 @@ -466,6 +466,7 @@ | **--meso-jam-threshold** {{DT_FLOAT}} | Minimum percentage of occupied space to consider a segment jammed. A negative argument causes thresholds to be computed based on edge speed and tauff (default); *default:* **-1** | | **--meso-multi-queue** {{DT_BOOL}} | Enable multiple queues at edge ends; *default:* **true** | | **--meso-lane-queue** {{DT_BOOL}} | Enable separate queues for every lane; *default:* **false** | +| **--meso-ignore-lanes-by-vclass** {{DT_STR[]}} | Do not build queues (or reduce capacity) for lanes allowing only the given vclasses; *default:* **pedestrian,bicycle** | | **--meso-junction-control** {{DT_BOOL}} | Enable mesoscopic traffic light and priority junction handling; *default:* **false** | | **--meso-junction-control.limited** {{DT_BOOL}} | Enable mesoscopic traffic light and priority junction handling for saturated links. This prevents faulty traffic lights from hindering flow in low-traffic situations; *default:* **false** | | **--meso-tls-penalty** {{DT_FLOAT}} | Apply scaled travel time penalties when driving across tls controlled junctions based on green split instead of checking actual phases; *default:* **0** | diff -Nru sumo-1.11.0/docs/web/docs/Tools/Misc.md sumo-1.12.0/docs/web/docs/Tools/Misc.md --- sumo-1.11.0/docs/web/docs/Tools/Misc.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Tools/Misc.md 2022-01-24 20:43:50.000000000 +0000 @@ -72,6 +72,38 @@ ``` - or use the [online test extraction](https://sumo.dlr.de/extractTest.php). In the online tool you enter the path to the test you like (e.g. [{{SUMO}}/tests/sumo/extended/rerouter/use_routing_device](https://github.com/eclipse/sumo/blob/master/tests/sumo/extended/rerouter/use_routing_device) into the form and get a zip containing all the files. +# generateParkingAreas.py + +This tool generates parking areas for a network, and saves them in an additional file. If the output filename is not defined (using -o or --output-file), it will use as default *parkingareas.add.xml*. + +Most basic call: +``` +python tools/generateParkingAreas.py -n +``` +Other Example: +``` +python tools/generateParkingAreas.py -n -o --space-length --min --max +``` + +The required parameter is the network (-n or --net-file). More options can be obtained by calling `python tools/generateParkingAreas.py --help`. + +Additional options: + +- **--output-file** define the output filename +- **--probability** probability for an edge to receive a parkingArea +- **--length** length required per parking space +- **--space-length** visual length of each parking space +- **--width** visual width of each parking space +- **--random-capacity** randomize roadsideCapacity +- **--min** minimum capacity for parkingAreas +- **--max** maximum capacity for parkingAreas +- **--angle** parking area angle +- **--prefix** prefix for the parkingArea ids +- **--seed** random seed +- **--random** use a random seed to initialize the random number generator +- **--vclass** only use edges which permit the given vehicle class +- **--verbose** tell me what you are doing + # generateParkingLots.py This script generates parking lots. Example: @@ -175,6 +207,8 @@ A *ptlines-file* is typically created by [netconvert](../netconvert.md) option **--ptlines-output** when importing OSM data. However it can also be customized or created from scratch for a non OSM network. +## Example Input + A minimal description for a bus line looks like this: ``` @@ -187,6 +221,8 @@ ``` +## Example Output + The used busStops must be defined in an additional file and passed with option **-s** when running the tool. The resulting bus definition may look like this: @@ -202,6 +238,45 @@ ``` +## Further Options + +- **--types**: only export lines with the given list of types +- **--bus.parking**: let busses clear the road while stopping +- **--vtype-prefix**: prefix for generated vehicle types (to allow combining multiple runs in the same simulation) +- **--stop-duration**: minimum duration for stops (default 20) +- **--stop-duration.slack**: time to reserve in the schedule per stop (default 10) +- **--speedfactor.bus**: assumed relative travel speed of busses (default 0.95) +- **--speedfactor.tram**: assumed relative travel speed of trams (default 1) +- **--night**: only export lines that run during the night (by default, only lines running during the day are used) +- **--begin**: flow begin time in output (default 0) +- **--end**: flow end time in output (default 3600) +- **--min-stops**: minimum number of stops to use a line (default 2) +- **--flow-attribute**: additional attributes to include in the flows (i.e. `"departSpeed=\"max\""`) +- **--extend-to-fringe**: whether vehicles should start on the first route edge rather than the first stop +- **--random-begin**: whether to set the flow begin time to a random value between options **--begin** and the period of the line +- **--no-vtypes**: whether to skip writing vTypes for the output +- **--seed**: set random seed +- **--ignore-errors**: ignore various input errors +- **--human-readable-time**: write all times as (H:M:S) +- **--verbose**: more output + +## Available ptLine Attributes + +These values have the following meanings: + +| Attribute Name | Value Type | Default | Description | +| ----------------- | --------------------------------- | ------ | --------------------------------------------------- | +| **id** | id (string) | \- | The id of the public transport relation (usually from OSM) | +| **type** | string (enum) | \- | The [route type](https://wiki.openstreetmap.org/wiki/Relation:route) [bus, tram, train, subway, light_rail, monorail, trolleybus, minibus, share_taxi ,aerialway, ferry] | +| **line** | string | \- | The official line reference (must not be unique) | +| **vClass** | string | \- | [sumo vehicle class](../Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md#abstract_vehicle_class) | +| period | time (s, H:M:S) | **--period** (600) | The service period | +| night_service | string (enum) | false | The service period | whether the line runs at night [yes, no, only] | +| name | string | | Long name for the line | +| color | [color](../Basics/Notation.md#referenced_data_types) | | Official line color | + + + # tileGet.py diff -Nru sumo-1.11.0/docs/web/docs/Tools/Output.md sumo-1.12.0/docs/web/docs/Tools/Output.md --- sumo-1.11.0/docs/web/docs/Tools/Output.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Tools/Output.md 2022-01-24 20:43:50.000000000 +0000 @@ -280,7 +280,7 @@ ``` ## parkingSearchTraffic.py -This tool reads vehicle-routes-output (with exit-times) and generates statistics for the time and the distance vehicles +This tool reads [vehroute-output](../Simulation/Output/VehRoutes.md) with [exit-times](../Simulation/Output/VehRoutes.md#further_options) and generates statistics for the time and the distance vehicles spent on searching parking locations as well as the length of the walking way back. It evaluates the time and distance between the first reroute and the arrival at the final stop. It currently outputs only basic statistics (mean, avg, quartiles etc.). diff -Nru sumo-1.11.0/docs/web/docs/Tools/Sumolib.md sumo-1.12.0/docs/web/docs/Tools/Sumolib.md --- sumo-1.11.0/docs/web/docs/Tools/Sumolib.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Tools/Sumolib.md 2022-01-24 20:43:50.000000000 +0000 @@ -68,6 +68,9 @@ avgSpeed = speedSum / edgeCount ``` +!!! note + This is just a processing example. To compute average travel speeds in a network, process [edgeData](../Simulation/Output/Lane-_or_Edge-based_Traffic_Measures.md), [tripinfos](../Simulation/Output/TripInfo.md) or [summary-output](../Simulation/Output/Summary.md) instead. + ## compute the median speed using the [Statistics](http://sumo.dlr.de/pydoc/sumolib.miscutils.html#Statistics) module ``` diff -Nru sumo-1.11.0/docs/web/docs/Tools/Turns.md sumo-1.12.0/docs/web/docs/Tools/Turns.md --- sumo-1.11.0/docs/web/docs/Tools/Turns.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Tools/Turns.md 2022-01-24 20:43:50.000000000 +0000 @@ -105,30 +105,54 @@ - **--write-flows number**: write ``-definitions instead of vehicles. The exact number of flow vehicles will be spaced evenly between the earliest and latest vehicle departures that would have been generated by default - **--write-flows probability**: write ``-definitions instead of vehicles. Flows will be defined with attribute 'probability' so that the expected number of vehicles is equal to the number of vehicles that would have been generated by default but the specific number will vary due to sampling effects - **--pedestrians**: write persons and personFlows with walks instead of vehicles and flows +- **--prefix**: prefix vehicle- and route-IDs with the given string. This is needed to combine output of multiple routeSampler runs (i.e. for different modes of traffic) into a single simulation. Otherwise there would be errors regarding duplicate IDs. ## Vehicle attributes With the option **--attributes** {{DT_STR}}, additional parameters can be given to the generated vehicles (note, usage of the quoting characters). ``` -python tools/randomTrips.py -n input_net.net.xml  +python tools/routeSampler.py -n input_net.net.xml -r candidate.rou.xml -o out.rou.xml -d data.xml --attributes="departLane=\"best\" departSpeed=\"max\" departPos=\"random\"" ``` The above attriutes would make the vehicles be distributed randomly on their starting edges and inserted with high speed on a reasonable lane. - -The distinguish vehicles of different types, the 'type' attribute may be set. The corresponding type should then be defined in an additional xml file and loaded with option **--additional-files**. - -``` -python tools/randomTrips.py -n input_net.net.xml  - --attributes="type=\"customType\"" -``` - !!! note Quoting of trip attributes on Linux may also use the style **--attributes 'departLane="best" departSpeed="max" departPos="random"'** +## Multiple vehicle types + +To distinguish vehicles of different types, routeSampler may be run multiple times with different attributes. Note, that it is also necessary to set the option **--prefix** to prevent duplicate ids. The example below creates traffic consisting of cars and trucks using two edgedata files with distinct count values (stored in the default attribute 'entered'). + +``` +python tools/routeSampler.py --attributes="type=\"car\"" --edgedata-files carcounts.xml --prefix c -o cars.rou.xml -n net.net.xml -r candidate.rou.xml +python tools/routeSampler.py --attributes="type=\"heavy\"" --edgedata-files truckcounts.xml --prefix t -o trucks.rou.xml -n net.net.xml -r candidate.rou.xml +``` + +Alternatively, the count values might also be stored in different attributes of the same file (i.e. 'count1', 'count2'): + +``` +python tools/routeSampler.py --attributes="type=\"car\"" --edgedata-files counts.xml --edgedata-attribute count1 --prefix c -o cars.rou.xml  -n net.net.xml -r candidate.rou.xml +python tools/routeSampler.py --attributes="type=\"heavy\"" --edgedata-files counts.xml --edgedata-attribute count2 --prefix t -o trucks.rou.xml -n net.net.xml -r candidate.rou.xml +``` + +When running the simulation, the types 'car' and 'heavy' (previously set as vehicle attributes), must be defined in an additional file which could look like the following example (types.add.xml): + +``` + + + + +``` + +The simulation could then be called like this: + +``` + sumo -n net.net.xml -a types.add.xml -r cars.rou.xml,trucks.rou.xml +``` + ## Sampling By default, sampling will be performed iteratively by 1) selecting a random counting location that has not yet reached it's count (and which still has viable routes) diff -Nru sumo-1.11.0/docs/web/docs/Tools/Visualization.md sumo-1.12.0/docs/web/docs/Tools/Visualization.md --- sumo-1.11.0/docs/web/docs/Tools/Visualization.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Tools/Visualization.md 2022-01-24 20:43:50.000000000 +0000 @@ -186,13 +186,14 @@ **Options** +Here the most important options are listed. Use **--help** to see all options. | Option | Description | |------------------------------------------------------|-----------------------------------------------------| | **-n** {{DT_FILE}}
        **--net** {{DT_FILE}} | Defines the network to read | | **-i** {{DT_FILE}},{{DT_FILE}}
        **--dump-inputs** {{DT_FILE}},{{DT_FILE}} | Defines the dump-output files to use as input | | **-m** {{DT_STR}},{{DT_STR}}
        **--measures** {{DT_STR}},{{DT_STR}} | Define which measure to plot;default: speed,entered | | **-w** {{DT_FLOAT}}
        **--default-width** {{DT_FLOAT}} | Defines the default edge width; default: .1 | -| **-c** {{DT_Color}}
        **--default-color** {{DT_Color}} | If set, the progress is printed on the screen | +| **-c** {{DT_Color}}
        **--default-color** {{DT_Color}} | Defines the default edge color | | **--min-width** {{DT_FLOAT}} | Defines the minimum edge width; default: .5 | | **--max-width** {{DT_FLOAT}} | Defines the maximumedge width; default: 3 | | **--log-colors** | If set, colors are log-scaled | @@ -202,6 +203,7 @@ | **--min-width-value** {{DT_FLOAT}} | If set, defines the minimum edge width value | | **--max-width-value** {{DT_FLOAT}} | If set, defines the maximum edge width value | | **-v**
        **--verbose** | If set, the progress is printed on the screen | +| **--internal** | If set, internal edges (of junctions) are included to the genrated shapes. | ## plot_net_selection.py diff -Nru sumo-1.11.0/docs/web/docs/TraCI/Calibrator.md sumo-1.12.0/docs/web/docs/TraCI/Calibrator.md --- sumo-1.11.0/docs/web/docs/TraCI/Calibrator.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/TraCI/Calibrator.md 2022-01-24 20:43:50.000000000 +0000 @@ -32,14 +32,3 @@ | type ID | string | Returns the type id for the current calibration interval | [getTypeID](https://sumo.dlr.de/pydoc/traci._calibrator.html#CalibratorDomain-getTypeID) | | vTypes | string | Returns a list of all types to which the calibrator applies (in a type filter is active) | [getVTypes](https://sumo.dlr.de/pydoc/traci._calibrator.html#CalibratorDomain-getVTypes) | | vehicle per hour | double | Returns the number of vehicles per hour in the current calibration interval | [getVehsPerHour](https://sumo.dlr.de/pydoc/traci._calibrator.html#CalibratorDomain-getVehsPerHour) | -| flow | compound (string, double, double, double, double, string, string, string, string), see below | Update or add a calibrator interval | [setFlow](https://sumo.dlr.de/pydoc/traci._calibrator.html#CalibratorDomain-setFlow) | - -# compound message details - -The message contents are as following: - -### flow - -| string | double | double | double | string | string | string | string | -| :-------------: | :-------------: | :-------------: | :-----: | :--------------: | :----------: | :------------: | :--------: | -| calibratorID | begin | end | vehsPerHour | speed | typeID | routeID | departLane='first' | departSpeed='max' | diff -Nru sumo-1.11.0/docs/web/docs/TraCI/Change_Calibrator_State.md sumo-1.12.0/docs/web/docs/TraCI/Change_Calibrator_State.md --- sumo-1.11.0/docs/web/docs/TraCI/Change_Calibrator_State.md 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/TraCI/Change_Calibrator_State.md 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,32 @@ +--- +title: Change Calibrator State +--- + +# Command 0xc4: Change Calibrator State + +| ubyte | string | ubyte | | +| :------: | :-----------: | :---------------: | :-----------: | +| Variable | Calibrator ID | Type of the value | New Value | + +Changes the state of a calibrator. Because it is possible to change +different values of a calibrator, the number of parameter to supply and +their types differ between commands. The following values can be +changed, the parameter which must be given are also shown in the table. + +
        +**Overview Changeable Calibrator Variables** +
        + +| Variable | ValueType | Description | [Python Method](../TraCI/Interfacing_TraCI_from_Python.md) | +|---------------------------|----------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------| +| flow (0x18) | compound (string, double, double, double, double, string, string, string, string), see below | Set the hourly flow and speed at the calibrator location in a given time range. Missing traffic will be added with the given routeID (or routeDistribution ID) and type. DepartLane and departSpeed default to "first" and "max" but can optionally be set. For details on calibrating only flow, speed or type individually, see [Calibrator](../Simulation/Calibrator.md). | [setFlow](https://sumo.dlr.de/pydoc/traci._calibrator.html#CalibratorDomain-setFlow) | + +# compound message details + +The message contents are as following: + +### flow (0x18) + +| byte | integer | byte | string | byte | double | byte | double | byte | double | byte | double | byte | string | byte | string | byte | string | byte | string | +| :-------------------: | :------------------: | :-----------------: | :-----------: | :-----------------: | :----------: | :-----------------: | :--------: | :-----------------: | :----------: | :-----------------: | :--------: | :-----------------: | :--------: | :-----------------: | :-----------------: | :----------------------------: | :---------------------: | :----------------------------: | :------------: | +| value type *compound* | item number (7 to 9) | value type *string* | calibrator ID | value type *double* | begin | value type *double* | end | value type *double* | vehsPerHour | value type *double* | speed | value type *string* | type id | value type *string* | route id | value type *string* (optional) | depart lane | value type *string* (optional) | depart speed | diff -Nru sumo-1.11.0/docs/web/docs/TraCI/Change_Vehicle_State.md sumo-1.12.0/docs/web/docs/TraCI/Change_Vehicle_State.md --- sumo-1.11.0/docs/web/docs/TraCI/Change_Vehicle_State.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/TraCI/Change_Vehicle_State.md 2022-01-24 20:43:50.000000000 +0000 @@ -30,6 +30,7 @@ | resume (0x19) | compound (), see below | Resumes from a stop | [resume](https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-resume) | | change target (0x31) | string (destination edge id) | The vehicle's destination edge is set to the given. The route is rebuilt. | [changeTarget](https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-changeTarget) | | speed (0x40) | double (new speed) | Sets the vehicle speed to the given value. The speed will be followed according to the current [speed mode](../TraCI/Change_Vehicle_State.md#speed_mode_0xb3). By default the vehicle may drive slower than the set speed according to the safety rules of the car-follow model. When sending a value of -1 the vehicle will revert to its original behavior (using the *maxSpeed* of its vehicle type and following all safety rules). | [setSpeed](https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-setSpeed) | +| previous speed (0x3c) | double (previous speed) | Retroactively sets the vehicle speed for the previous simulation step to the given value and also updates the previous acceleration. This speed value will be used when computing [ballistic position updates](../Simulation/Basic_Definition.md#defining_the_integration_method). Also, other vehicles will react to ego in the current step as if it had driven with the given speed in the previous step. | [setPreviousSpeed](https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-setPreviousSpeed) | | color (0x45) | ubyte,ubyte,ubyte,ubyte (RGBA) | Sets the vehicle's color. | [setColor](https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-setColor) | | change route by id (0x53) | string (route id) | Assigns the named route to the vehicle, assuming a) the named route exists, and b) it starts on the edge the vehicle is currently at(1)(2). | [setRouteID](https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-setRouteID) | | change route (0x57) | stringList (ids of edges to pass) | Assigns the list of edges as the vehicle's new route assuming the first edge given is the one the vehicle is curently at(1)(2). | [setRoute](https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-setRoute) | @@ -44,7 +45,7 @@ | replaceStop (0x17) | compound (edgeID, vehID, nextStopIndex, edgeID, pos, laneIndex, duration, flags, startPos, until, teleport) (see below) | Replaces stop at the given index with a new stop. Automatically modifies the route if the replacement stop is at another location. [See below for additional details](../TraCI/Change_Vehicle_State.md#replaceStop-0x17) | [replaceStop](https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-replaceStop) | | reroute (compute new route) by travel time (0x90) | compound (), see below | Computes a new route to the current destination that minimizes travel time. The assumed values for each edge in the network can be customized in various ways. See [Simulation/Routing#Travel-time_values_for_routing](../Simulation/Routing.md#travel-time_values_for_routing). Replaces the current route by the found(2). | [rerouteTraveltime](https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-rerouteTraveltime) | | reroute (compute new route) by effort (0x91) | compound (), see below | Computes a new route using the vehicle's internal and the global edge effort information. Replaces the current route by the found. | [rerouteEffort](https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-rerouteEffort) | -| speed mode (0xb3) | int bitset (see below) | Sets how the values set by speed (0x40) and slowdown (0x14) shall be treated. Also allows to configure the behavior at junctions. See below. | [setSpeedMode](https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-setSpeedMode) | +| speed mode (0xb3) | int bitset (see below) | Sets how the values set by speed (0x40) and slowdown (0x14) shall be treated. Also allows to configure the behavior at junctions. [See below](#speed_mode_0xb3). | [setSpeedMode](https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-setSpeedMode) | | speed factor (0x5e) | double | Sets the vehicle's speed factor to the given value | [setSpeedFactor](https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-setSpeedFactor) | | max speed (0x41) | double | Sets the vehicle's maximum speed to the given value | [setMaxSpeed](https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-setMaxSpeed) | | lane change mode (0xb6) | int bitset (see [below](../TraCI/Change_Vehicle_State.md#lane_change_mode_0xb6)) | Sets how lane changing in general and lane changing requests by TraCI are performed. See below. | [setLaneChangeMode](https://sumo.dlr.de/pydoc/traci._vehicle.html#VehicleDomain-setLaneChangeMode) | @@ -534,6 +535,17 @@ laneChangeModel](../Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md#lane-changing_models) of the vehicle. i.e. *lcStrategic*) +# Relationship between lanechange model attributes and vTypes + +All [lanechange model attributes](../Definition_of_Vehicles%2C_Vehicle_Types%2C_and_Routes.md#lane-changing_models) are initialized from the vehicles vType and then stored in the individual lane change model instance of each vehicle. This has important consequences + +- setting a new vType for a vehicle doesn't affect lane change model attributes (the vehicle keeps using it's individual values) +- changing lane change model attributes on the vType of a vehicle does not affect the vehicle (the vehicle keeps using it's individual values) +- changing lane change model attributes for a vehicle does not affect it's vType (and instead changes the individual values of the vehicle) + +!!! caution + Attribute 'minGapLat' also counts as a lanechange model attribute since version 1.12.0 + # Application order of traci commands and simulation step Step **n**: diff -Nru sumo-1.11.0/docs/web/docs/TraCI/Object_Context_Subscription.md sumo-1.12.0/docs/web/docs/TraCI/Object_Context_Subscription.md --- sumo-1.11.0/docs/web/docs/TraCI/Object_Context_Subscription.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/TraCI/Object_Context_Subscription.md 2022-01-24 20:43:50.000000000 +0000 @@ -108,6 +108,11 @@ | :---------: | :------------: | :--------------------------------: | | filter type | parameter type | parameter value | +When adding a context subscription filter, it is applied to the *vehicle* context subscription (command ID 0x84) that was created most recently. + +!!! note + Context subscription filters are only supported for ego objects of type 'vehicle'. + Currently, the following context subscription filter types are implemented: | filter name | filter type | parameter value | description | uses context range | diff -Nru sumo-1.11.0/docs/web/docs/TraCI.md sumo-1.12.0/docs/web/docs/TraCI.md --- sumo-1.11.0/docs/web/docs/TraCI.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/TraCI.md 2022-01-24 20:43:50.000000000 +0000 @@ -149,6 +149,8 @@ simulation - [Change GUI State](TraCI/Change_GUI_State.md) change the simulation visualization + - [Change Calibrator State](TraCI/Change_Calibrator_State.md) change the + calibrator state - Subscriptions - [TraCI/Object Variable Subscription](TraCI/Object_Variable_Subscription.md) diff -Nru sumo-1.11.0/docs/web/docs/Tutorials/Autobahn.md sumo-1.12.0/docs/web/docs/Tutorials/Autobahn.md --- sumo-1.11.0/docs/web/docs/Tutorials/Autobahn.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Tutorials/Autobahn.md 2022-01-24 20:43:50.000000000 +0000 @@ -53,12 +53,12 @@           -     -     -     -     -     -     +     +     +     +     +     +     ``` @@ -109,4 +109,4 @@ If you now restart SUMO with the configuration, it will automatically load the view settings stored in `autobahn.view.xml`. -Back to [Tutorials](index.md). \ No newline at end of file +Back to [Tutorials](index.md). diff -Nru sumo-1.11.0/docs/web/docs/Tutorials/PublicTransport.md sumo-1.12.0/docs/web/docs/Tutorials/PublicTransport.md --- sumo-1.11.0/docs/web/docs/Tutorials/PublicTransport.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Tutorials/PublicTransport.md 2022-01-24 20:43:50.000000000 +0000 @@ -32,10 +32,11 @@ Running the simulation: ``` -./PublicTransportTutorial.sumocfg +.docs/tutorials/public_transport/data/run.sumocfg ``` ![](../images/PublicTransport01.gif) + ## Net, routes, demand and schedules ### Net First the net has to be created and the bus stops be build. There are several ways to accomplish this. @@ -63,65 +64,65 @@ An example how an xml code for the bus stop may look like: ``` - + + + + + ``` -You can go ahead and create a basic net to your liking and save it as net.net.xml, -as well as the bus stops by just saving the additionals. +If a busStop is on an edge that does not permit pedestrians (i.e. tram track) it must be connected to the rest of the network with `` elements (also in the netedit additional-mode). + -### Routes +## Public Transport The created bus stops can be used as the stopping points within the route declaration. Those routes can later be assigned to vehicles, in this case the trams and buses. The routes are written into the routes.rou.xml file. Below you can see examples from the code for the routes of the trams and buses. -Additionally there is a duration how long the tram/bus is stopping at given stop. -``` - - - - - +To obtain a repeating schedule multiple approaches are feasible + +- define repeating vehicles (``) that disappear after running the route once. This is useful if the network does not contain the full circuit of the route +- define a single vehicle with a repeating route. This is ideal for letting delays from one round of the scheduel carry over to the next round - - - - ``` + + -You can write your own routes for your net using netedit or writing them in the xml file. -The busStop parameter in routes should be a existing busStop in the additional.add.xml file. + + + + -So far we created a net, some bus stops and routes. + -### Demand -All demands of this tutorial are written into the routes.rou.xml file. -The demand consists out of different person-, tram- and bus-flows. The vehicle flows are -getting the routes assigned that where created earlier. + + + + + +``` -The person flow defines the travel behaviour of the people. For this small example -the person flow walks from an existing edge in the net to a bus stop to wait for -their ride (lines="tram"/lines="bus") to bring them to their destination. +### Schedules -First you have to declare the type of vehicle that is used in a flow via vType. -The id from vType is then used as the type parameter within the flow. +Buses and trams usually run by strict schedules in daily life. Similar alterations are possible in Sumo and vital when using intermodal routing. +Such schedules are defined with the attribute until. The until attribute is set for the stops. +The vehicle following this schedule can't leave this stop until this time ('until') has passed and the minimum stoppping time ('duration') has also passed. -``` - - - - +## Demand - - - - +The travel demand consists of persons that can choose their mode of transport freely + +``` + + + ``` -If you don't want to write a flow, you can assign vehicles and people their routes -individually. +Instead of flows, all persons and vehicles can also be defined individually and person plans can be defined with explicit steps. +Use sumo option **--vehroute** output to learn how a `` is expanded into multiple travel stages during the simulation. ``` @@ -135,27 +136,11 @@ ``` -### Schedules -Buses and trams usually run by strict schedules in daily life. Similar alterations are possible in Sumo and vital when using intermodal routing. -Such schedules are defined with the attribute until. The until attribute is set for the stops. -The vehicle following this schedule can't leave this stop until this time has passed and the eventual added duration. -This entails that if both, until and duration are used, this might cause a traffic delay, because the vehicle still waits at the bus stop when running late. -``` - - - - -``` ![](../images/PublicTransport05.gif) *Alteration of the busRoute.The bus stops until 170 at the uppermost bus stop.* -Notice that when running the simulation that the next buses and trams have the same schedule, just adjusted -to their departure time. This is handled differently depending on you implementation of until. -It is possible to use the until attribute with flows, trips and routes. The time declaration can also be written in human-readable times. - -It is beneficial to add the schedules to your implementation and to newly added stops to avoid errors when using intermodal routing. ## sumocfg @@ -169,14 +154,10 @@ - - + + - - + ``` diff -Nru sumo-1.11.0/docs/web/docs/Tutorials/quick_start.md sumo-1.12.0/docs/web/docs/Tutorials/quick_start.md --- sumo-1.11.0/docs/web/docs/Tutorials/quick_start.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/docs/Tutorials/quick_start.md 2022-01-24 20:43:50.000000000 +0000 @@ -112,11 +112,12 @@ Now you should be able to create the rest of the given nodes and edges in this example and change the names, the number of lanes, and reset the -positions. Don't forget to save your work from time to time. The Dummy -nodes 911-914 are needed for analyzing the traffic performance on the -incoming and outgoing links in the network. More dummy nodes can be -applied if needed (such as for accurate geometric alignment or for the -specification of detector locations). +positions. Don't forget to save your work from time to time. + +The junctions 911-914 aren't really needed. +Splitting an length of road into multiple edges is necessary when an attribute such as speed or numLanes changes. +Distinct edges may also be useful for [analyzing the traffic performance](../Simulation/Output/Lane-_or_Edge-based_Traffic_Measures.md) in more detail. +To model curved roads it is sufficient to modify the *shape* of an edge using 'move mode'. - Next step would be to define the connections between the edges. To see which connections are already build automatically, please select @@ -377,4 +378,4 @@ !!! note If you start the tutorial with [sumo-gui](../sumo-gui.md), the whole network is visible at first but no vehicles can be seen because the view is zoomed out very far. You need to zoom in by holding the right mouse button and moving the mouse to be able to see any vehicles. Furthermore, you need not set the delay value to something greater than 0. Otherwise, the simulation may be over very quickly and you do not get to see vehicle movements. -Back to [Tutorials](index.md) \ No newline at end of file +Back to [Tutorials](index.md) diff -Nru sumo-1.11.0/docs/web/.link_check_config.json sumo-1.12.0/docs/web/.link_check_config.json --- sumo-1.11.0/docs/web/.link_check_config.json 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/.link_check_config.json 2022-01-24 20:43:50.000000000 +0000 @@ -19,6 +19,9 @@ "pattern": "https://elib.dlr.de/94006/1/Proceeding_SUMO2014_15%2B16May2014_Berlin-Adlershof.pdf" }, { + "pattern": "https://doi.org/10.3141/2623-01" + }, + { "pattern": "^https://www.baua.de/" } ], diff -Nru sumo-1.11.0/docs/web/mkdocs.yml sumo-1.12.0/docs/web/mkdocs.yml --- sumo-1.11.0/docs/web/mkdocs.yml 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/docs/web/mkdocs.yml 2022-01-24 20:43:50.000000000 +0000 @@ -7,7 +7,7 @@ dev_addr: 127.0.0.1:8000 #docs_dir: docs #site_dir: site -copyright: "Copyright © 2001-2021 German Aerospace Center (DLR) and others." +copyright: "Copyright © 2001-2022 German Aerospace Center (DLR) and others." nav: - Documentation: index.md @@ -57,8 +57,8 @@ - codehilite extra: - Version: 1.11.0 - ReleaseDate: 23.11.2021 + Version: 1.12.0 + ReleaseDate: 25.01.2022 AdditionalFile: '[*additional-file*](/docs/sumo.html#format_of_additional_files)' AdditionalFiles: '[*additional-files*](/docs/sumo.html#format_of_additional_files)' diff -Nru sumo-1.11.0/include/version.h sumo-1.12.0/include/version.h --- sumo-1.11.0/include/version.h 2021-11-22 23:06:34.000000000 +0000 +++ sumo-1.12.0/include/version.h 2022-01-24 23:06:39.000000000 +0000 @@ -1 +1 @@ -#define VERSION_STRING "v1_11_0+0000-d32ff7d52a3" +#define VERSION_STRING "v1_12_0+0000-800cb422fa4" diff -Nru sumo-1.11.0/NOTICE.md sumo-1.12.0/NOTICE.md --- sumo-1.11.0/NOTICE.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/NOTICE.md 2022-01-24 20:43:50.000000000 +0000 @@ -82,12 +82,17 @@ * Project: https://github.com/itm/shawn * Source: https://github.com/itm/shawn/tree/master/src/apps/tcpip -Xerces-C++ (3.2.0) +Wix Installation Framework Templates (3.6) + +* License: CPL-1.0 +* Project: https://github.com/AnalogJ/Wix3.6Toolset +* Source: https://github.com/AnalogJ/Wix3.6Toolset/tree/master/RC0-source/wix36-sources/src/ext/UIExtension/wixlib + +Xerces-C++ (3.2.3) * License: Apache-2.0 * Project: http://xerces.apache.org/xerces-c/ -* Source: - http://mirror.softaculous.com/apache//xerces/c/3/sources/xerces-c-3.2.0.tar.gz +* Source: https://dlcdn.apache.org/xerces/c/3/sources/xerces-c-3.2.3.tar.gz ## Cryptography diff -Nru sumo-1.11.0/README.md sumo-1.12.0/README.md --- sumo-1.11.0/README.md 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/README.md 2022-01-24 20:43:50.000000000 +0000 @@ -1,4 +1,4 @@ -

        +

        Eclipse SUMO - Simulation of Urban MObility =========================================== diff -Nru sumo-1.11.0/src/activitygen/activities/AGActivities.cpp sumo-1.12.0/src/activitygen/activities/AGActivities.cpp --- sumo-1.11.0/src/activitygen/activities/AGActivities.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/activities/AGActivities.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/activities/AGActivities.h sumo-1.12.0/src/activitygen/activities/AGActivities.h --- sumo-1.11.0/src/activitygen/activities/AGActivities.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/activities/AGActivities.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/activities/AGActivity.cpp sumo-1.12.0/src/activitygen/activities/AGActivity.cpp --- sumo-1.11.0/src/activitygen/activities/AGActivity.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/activities/AGActivity.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/activities/AGActivity.h sumo-1.12.0/src/activitygen/activities/AGActivity.h --- sumo-1.11.0/src/activitygen/activities/AGActivity.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/activities/AGActivity.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/activities/AGFreeTime.cpp sumo-1.12.0/src/activitygen/activities/AGFreeTime.cpp --- sumo-1.11.0/src/activitygen/activities/AGFreeTime.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/activities/AGFreeTime.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/activities/AGFreeTime.h sumo-1.12.0/src/activitygen/activities/AGFreeTime.h --- sumo-1.11.0/src/activitygen/activities/AGFreeTime.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/activities/AGFreeTime.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/activities/AGTrip.cpp sumo-1.12.0/src/activitygen/activities/AGTrip.cpp --- sumo-1.11.0/src/activitygen/activities/AGTrip.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/activities/AGTrip.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/activities/AGTrip.h sumo-1.12.0/src/activitygen/activities/AGTrip.h --- sumo-1.11.0/src/activitygen/activities/AGTrip.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/activities/AGTrip.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/activities/AGWorkAndSchool.cpp sumo-1.12.0/src/activitygen/activities/AGWorkAndSchool.cpp --- sumo-1.11.0/src/activitygen/activities/AGWorkAndSchool.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/activities/AGWorkAndSchool.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/activities/AGWorkAndSchool.h sumo-1.12.0/src/activitygen/activities/AGWorkAndSchool.h --- sumo-1.11.0/src/activitygen/activities/AGWorkAndSchool.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/activities/AGWorkAndSchool.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/activitygen_main.cpp sumo-1.12.0/src/activitygen/activitygen_main.cpp --- sumo-1.11.0/src/activitygen/activitygen_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/activitygen_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/AGActivityGen.cpp sumo-1.12.0/src/activitygen/AGActivityGen.cpp --- sumo-1.11.0/src/activitygen/AGActivityGen.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/AGActivityGen.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/AGActivityGen.h sumo-1.12.0/src/activitygen/AGActivityGen.h --- sumo-1.11.0/src/activitygen/AGActivityGen.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/AGActivityGen.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/AGActivityGenHandler.cpp sumo-1.12.0/src/activitygen/AGActivityGenHandler.cpp --- sumo-1.11.0/src/activitygen/AGActivityGenHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/AGActivityGenHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/AGActivityGenHandler.h sumo-1.12.0/src/activitygen/AGActivityGenHandler.h --- sumo-1.11.0/src/activitygen/AGActivityGenHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/AGActivityGenHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/AGActivityTripWriter.cpp sumo-1.12.0/src/activitygen/AGActivityTripWriter.cpp --- sumo-1.11.0/src/activitygen/AGActivityTripWriter.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/AGActivityTripWriter.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/AGActivityTripWriter.h sumo-1.12.0/src/activitygen/AGActivityTripWriter.h --- sumo-1.11.0/src/activitygen/AGActivityTripWriter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/AGActivityTripWriter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/AGFrame.cpp sumo-1.12.0/src/activitygen/AGFrame.cpp --- sumo-1.11.0/src/activitygen/AGFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/AGFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/AGFrame.h sumo-1.12.0/src/activitygen/AGFrame.h --- sumo-1.11.0/src/activitygen/AGFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/AGFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGAdult.cpp sumo-1.12.0/src/activitygen/city/AGAdult.cpp --- sumo-1.11.0/src/activitygen/city/AGAdult.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGAdult.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGAdult.h sumo-1.12.0/src/activitygen/city/AGAdult.h --- sumo-1.11.0/src/activitygen/city/AGAdult.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGAdult.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGBus.cpp sumo-1.12.0/src/activitygen/city/AGBus.cpp --- sumo-1.11.0/src/activitygen/city/AGBus.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGBus.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGBus.h sumo-1.12.0/src/activitygen/city/AGBus.h --- sumo-1.11.0/src/activitygen/city/AGBus.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGBus.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGBusLine.cpp sumo-1.12.0/src/activitygen/city/AGBusLine.cpp --- sumo-1.11.0/src/activitygen/city/AGBusLine.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGBusLine.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGBusLine.h sumo-1.12.0/src/activitygen/city/AGBusLine.h --- sumo-1.11.0/src/activitygen/city/AGBusLine.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGBusLine.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGCar.cpp sumo-1.12.0/src/activitygen/city/AGCar.cpp --- sumo-1.11.0/src/activitygen/city/AGCar.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGCar.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGCar.h sumo-1.12.0/src/activitygen/city/AGCar.h --- sumo-1.11.0/src/activitygen/city/AGCar.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGCar.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGChild.cpp sumo-1.12.0/src/activitygen/city/AGChild.cpp --- sumo-1.11.0/src/activitygen/city/AGChild.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGChild.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGChild.h sumo-1.12.0/src/activitygen/city/AGChild.h --- sumo-1.11.0/src/activitygen/city/AGChild.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGChild.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGCity.cpp sumo-1.12.0/src/activitygen/city/AGCity.cpp --- sumo-1.11.0/src/activitygen/city/AGCity.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGCity.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGCity.h sumo-1.12.0/src/activitygen/city/AGCity.h --- sumo-1.11.0/src/activitygen/city/AGCity.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGCity.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGDataAndStatistics.cpp sumo-1.12.0/src/activitygen/city/AGDataAndStatistics.cpp --- sumo-1.11.0/src/activitygen/city/AGDataAndStatistics.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGDataAndStatistics.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGDataAndStatistics.h sumo-1.12.0/src/activitygen/city/AGDataAndStatistics.h --- sumo-1.11.0/src/activitygen/city/AGDataAndStatistics.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGDataAndStatistics.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGHousehold.cpp sumo-1.12.0/src/activitygen/city/AGHousehold.cpp --- sumo-1.11.0/src/activitygen/city/AGHousehold.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGHousehold.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGHousehold.h sumo-1.12.0/src/activitygen/city/AGHousehold.h --- sumo-1.11.0/src/activitygen/city/AGHousehold.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGHousehold.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGPerson.cpp sumo-1.12.0/src/activitygen/city/AGPerson.cpp --- sumo-1.11.0/src/activitygen/city/AGPerson.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGPerson.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGPerson.h sumo-1.12.0/src/activitygen/city/AGPerson.h --- sumo-1.11.0/src/activitygen/city/AGPerson.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGPerson.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGPosition.cpp sumo-1.12.0/src/activitygen/city/AGPosition.cpp --- sumo-1.11.0/src/activitygen/city/AGPosition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGPosition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGPosition.h sumo-1.12.0/src/activitygen/city/AGPosition.h --- sumo-1.11.0/src/activitygen/city/AGPosition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGPosition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGSchool.cpp sumo-1.12.0/src/activitygen/city/AGSchool.cpp --- sumo-1.11.0/src/activitygen/city/AGSchool.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGSchool.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGSchool.h sumo-1.12.0/src/activitygen/city/AGSchool.h --- sumo-1.11.0/src/activitygen/city/AGSchool.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGSchool.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGStreet.cpp sumo-1.12.0/src/activitygen/city/AGStreet.cpp --- sumo-1.11.0/src/activitygen/city/AGStreet.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGStreet.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGStreet.h sumo-1.12.0/src/activitygen/city/AGStreet.h --- sumo-1.11.0/src/activitygen/city/AGStreet.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGStreet.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGTime.cpp sumo-1.12.0/src/activitygen/city/AGTime.cpp --- sumo-1.11.0/src/activitygen/city/AGTime.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGTime.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGTime.h sumo-1.12.0/src/activitygen/city/AGTime.h --- sumo-1.11.0/src/activitygen/city/AGTime.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGTime.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGWorkPosition.cpp sumo-1.12.0/src/activitygen/city/AGWorkPosition.cpp --- sumo-1.11.0/src/activitygen/city/AGWorkPosition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGWorkPosition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/city/AGWorkPosition.h sumo-1.12.0/src/activitygen/city/AGWorkPosition.h --- sumo-1.11.0/src/activitygen/city/AGWorkPosition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/city/AGWorkPosition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 German Aerospace Center (DLR) and others. // activitygen module // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/) // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/activitygen/CMakeLists.txt sumo-1.12.0/src/activitygen/CMakeLists.txt --- sumo-1.11.0/src/activitygen/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/activitygen/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -17,6 +17,6 @@ set_target_properties(activitygen PROPERTIES OUTPUT_NAME activitygen${BINARY_SUFFIX}) set_target_properties(activitygen PROPERTIES OUTPUT_NAME_DEBUG activitygen${BINARY_SUFFIX}D) target_link_libraries(activitygen activitygen_activities activitygen_city router ${commonvehiclelibs}) -add_dependencies(activitygen generate-version-h) +add_dependencies(activitygen generate-version-h install_dll) install(TARGETS activitygen RUNTIME DESTINATION bin) diff -Nru sumo-1.11.0/src/CMakeLists.txt sumo-1.12.0/src/CMakeLists.txt --- sumo-1.11.0/src/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -49,7 +49,7 @@ if (JPS_FOUND) target_link_libraries(sumo jps) endif() -add_dependencies(sumo generate-version-h) +add_dependencies(sumo generate-version-h install_dll) if (FOX_FOUND) add_executable(sumo-gui guisim_main.cpp sumo-gui.rc) @@ -70,7 +70,7 @@ endif () target_link_libraries(sumo-gui opengl32 glu32) endif () - add_dependencies(sumo-gui generate-version-h) + add_dependencies(sumo-gui generate-version-h install_dll) install(TARGETS sumo-gui RUNTIME DESTINATION bin) endif () @@ -78,13 +78,13 @@ set_target_properties(netconvert PROPERTIES OUTPUT_NAME netconvert${BINARY_SUFFIX}) set_target_properties(netconvert PROPERTIES OUTPUT_NAME_DEBUG netconvert${BINARY_SUFFIX}D) target_link_libraries(netconvert ${netconvertlibs}) -add_dependencies(netconvert generate-version-h) +add_dependencies(netconvert generate-version-h install_dll) add_executable(od2trips od2trips_main.cpp) set_target_properties(od2trips PROPERTIES OUTPUT_NAME od2trips${BINARY_SUFFIX}) set_target_properties(od2trips PROPERTIES OUTPUT_NAME_DEBUG od2trips${BINARY_SUFFIX}D) target_link_libraries(od2trips od router ${commonvehiclelibs}) -add_dependencies(od2trips generate-version-h) +add_dependencies(od2trips generate-version-h install_dll) install(TARGETS sumo netconvert od2trips RUNTIME DESTINATION bin) install(DIRECTORY libsumo DESTINATION include diff -Nru sumo-1.11.0/src/config.h.cmake sumo-1.12.0/src/config.h.cmake --- sumo-1.11.0/src/config.h.cmake 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/config.h.cmake 2022-01-24 20:43:50.000000000 +0000 @@ -189,7 +189,7 @@ //#define HAVE_VERSION_H #ifndef HAVE_VERSION_H /* Define if auto-generated version.h is unavailable. */ - #define VERSION_STRING "1.11.0" + #define VERSION_STRING "1.12.0" #endif /* defines the epsilon to use on general floating point comparison */ diff -Nru sumo-1.11.0/src/dfrouter/CMakeLists.txt sumo-1.12.0/src/dfrouter/CMakeLists.txt --- sumo-1.11.0/src/dfrouter/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -25,6 +25,6 @@ set_target_properties(dfrouter PROPERTIES OUTPUT_NAME dfrouter${BINARY_SUFFIX}) set_target_properties(dfrouter PROPERTIES OUTPUT_NAME_DEBUG dfrouter${BINARY_SUFFIX}D) target_link_libraries(dfrouter router ${commonvehiclelibs}) -add_dependencies(dfrouter generate-version-h) +add_dependencies(dfrouter generate-version-h install_dll) install(TARGETS dfrouter RUNTIME DESTINATION bin) diff -Nru sumo-1.11.0/src/dfrouter/dfrouter_main.cpp sumo-1.12.0/src/dfrouter/dfrouter_main.cpp --- sumo-1.11.0/src/dfrouter/dfrouter_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/dfrouter_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFDetector.cpp sumo-1.12.0/src/dfrouter/RODFDetector.cpp --- sumo-1.11.0/src/dfrouter/RODFDetector.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFDetector.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFDetectorFlow.cpp sumo-1.12.0/src/dfrouter/RODFDetectorFlow.cpp --- sumo-1.11.0/src/dfrouter/RODFDetectorFlow.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFDetectorFlow.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFDetectorFlow.h sumo-1.12.0/src/dfrouter/RODFDetectorFlow.h --- sumo-1.11.0/src/dfrouter/RODFDetectorFlow.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFDetectorFlow.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFDetector.h sumo-1.12.0/src/dfrouter/RODFDetector.h --- sumo-1.11.0/src/dfrouter/RODFDetector.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFDetector.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFDetectorHandler.cpp sumo-1.12.0/src/dfrouter/RODFDetectorHandler.cpp --- sumo-1.11.0/src/dfrouter/RODFDetectorHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFDetectorHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFDetectorHandler.h sumo-1.12.0/src/dfrouter/RODFDetectorHandler.h --- sumo-1.11.0/src/dfrouter/RODFDetectorHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFDetectorHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFDetFlowLoader.cpp sumo-1.12.0/src/dfrouter/RODFDetFlowLoader.cpp --- sumo-1.11.0/src/dfrouter/RODFDetFlowLoader.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFDetFlowLoader.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFDetFlowLoader.h sumo-1.12.0/src/dfrouter/RODFDetFlowLoader.h --- sumo-1.11.0/src/dfrouter/RODFDetFlowLoader.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFDetFlowLoader.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFEdgeBuilder.cpp sumo-1.12.0/src/dfrouter/RODFEdgeBuilder.cpp --- sumo-1.11.0/src/dfrouter/RODFEdgeBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFEdgeBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFEdgeBuilder.h sumo-1.12.0/src/dfrouter/RODFEdgeBuilder.h --- sumo-1.11.0/src/dfrouter/RODFEdgeBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFEdgeBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFEdge.cpp sumo-1.12.0/src/dfrouter/RODFEdge.cpp --- sumo-1.11.0/src/dfrouter/RODFEdge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFEdge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFEdge.h sumo-1.12.0/src/dfrouter/RODFEdge.h --- sumo-1.11.0/src/dfrouter/RODFEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFFrame.cpp sumo-1.12.0/src/dfrouter/RODFFrame.cpp --- sumo-1.11.0/src/dfrouter/RODFFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFFrame.h sumo-1.12.0/src/dfrouter/RODFFrame.h --- sumo-1.11.0/src/dfrouter/RODFFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFNet.cpp sumo-1.12.0/src/dfrouter/RODFNet.cpp --- sumo-1.11.0/src/dfrouter/RODFNet.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFNet.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFNet.h sumo-1.12.0/src/dfrouter/RODFNet.h --- sumo-1.11.0/src/dfrouter/RODFNet.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFNet.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFRouteCont.cpp sumo-1.12.0/src/dfrouter/RODFRouteCont.cpp --- sumo-1.11.0/src/dfrouter/RODFRouteCont.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFRouteCont.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFRouteCont.h sumo-1.12.0/src/dfrouter/RODFRouteCont.h --- sumo-1.11.0/src/dfrouter/RODFRouteCont.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFRouteCont.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/dfrouter/RODFRouteDesc.h sumo-1.12.0/src/dfrouter/RODFRouteDesc.h --- sumo-1.11.0/src/dfrouter/RODFRouteDesc.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/dfrouter/RODFRouteDesc.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/duarouter/CMakeLists.txt sumo-1.12.0/src/duarouter/CMakeLists.txt --- sumo-1.11.0/src/duarouter/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/duarouter/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -10,6 +10,6 @@ set_target_properties(duarouter PROPERTIES OUTPUT_NAME duarouter${BINARY_SUFFIX}) set_target_properties(duarouter PROPERTIES OUTPUT_NAME_DEBUG duarouter${BINARY_SUFFIX}D) target_link_libraries(duarouter router ${commonvehiclelibs}) -add_dependencies(duarouter generate-version-h) +add_dependencies(duarouter generate-version-h install_dll) install(TARGETS duarouter RUNTIME DESTINATION bin) diff -Nru sumo-1.11.0/src/duarouter/duarouter_main.cpp sumo-1.12.0/src/duarouter/duarouter_main.cpp --- sumo-1.11.0/src/duarouter/duarouter_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/duarouter/duarouter_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/duarouter/RODUAEdgeBuilder.cpp sumo-1.12.0/src/duarouter/RODUAEdgeBuilder.cpp --- sumo-1.11.0/src/duarouter/RODUAEdgeBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/duarouter/RODUAEdgeBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/duarouter/RODUAEdgeBuilder.h sumo-1.12.0/src/duarouter/RODUAEdgeBuilder.h --- sumo-1.11.0/src/duarouter/RODUAEdgeBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/duarouter/RODUAEdgeBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/duarouter/RODUAFrame.cpp sumo-1.12.0/src/duarouter/RODUAFrame.cpp --- sumo-1.11.0/src/duarouter/RODUAFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/duarouter/RODUAFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -85,6 +85,9 @@ oc.doRegister("write-trips.junctions", new Option_Bool(false)); oc.addDescription("write-trips.junctions", "Output", "Write trips with fromJunction and toJunction"); + oc.doRegister("write-costs", new Option_Bool(false)); + oc.addDescription("write-costs", "Output", "Include the cost attribute in route output"); + // register import options oc.doRegister("weight-files", 'w', new Option_FileName()); oc.addSynonyme("weight-files", "weights"); diff -Nru sumo-1.11.0/src/duarouter/RODUAFrame.h sumo-1.12.0/src/duarouter/RODUAFrame.h --- sumo-1.11.0/src/duarouter/RODUAFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/duarouter/RODUAFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/fmi/fmi2Functions.c sumo-1.12.0/src/fmi/fmi2Functions.c --- sumo-1.11.0/src/fmi/fmi2Functions.c 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/fmi/fmi2Functions.c 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2020-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2020-2022 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/ diff -Nru sumo-1.11.0/src/fmi/libsumocpp2c.cpp sumo-1.12.0/src/fmi/libsumocpp2c.cpp --- sumo-1.11.0/src/fmi/libsumocpp2c.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/fmi/libsumocpp2c.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2020-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2020-2022 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/ diff -Nru sumo-1.11.0/src/fmi/libsumocpp2c.h sumo-1.12.0/src/fmi/libsumocpp2c.h --- sumo-1.11.0/src/fmi/libsumocpp2c.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/fmi/libsumocpp2c.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2020-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2020-2022 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/ diff -Nru sumo-1.11.0/src/fmi/sumo2fmi_bridge.c sumo-1.12.0/src/fmi/sumo2fmi_bridge.c --- sumo-1.11.0/src/fmi/sumo2fmi_bridge.c 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/fmi/sumo2fmi_bridge.c 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2020-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2020-2022 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/ diff -Nru sumo-1.11.0/src/fmi/sumo2fmi_bridge.h sumo-1.12.0/src/fmi/sumo2fmi_bridge.h --- sumo-1.11.0/src/fmi/sumo2fmi_bridge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/fmi/sumo2fmi_bridge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2020-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2020-2022 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/ diff -Nru sumo-1.11.0/src/foreign/PHEMlight/cpp/CEP.cpp sumo-1.12.0/src/foreign/PHEMlight/cpp/CEP.cpp --- sumo-1.11.0/src/foreign/PHEMlight/cpp/CEP.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/foreign/PHEMlight/cpp/CEP.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. // PHEMlight module // Copyright (C) 2016-2017 Technische Universitaet Graz, https://www.tugraz.at/ // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/foreign/PHEMlight/cpp/CEP.h sumo-1.12.0/src/foreign/PHEMlight/cpp/CEP.h --- sumo-1.11.0/src/foreign/PHEMlight/cpp/CEP.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/foreign/PHEMlight/cpp/CEP.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. // PHEMlight module // Copyright (C) 2016-2017 Technische Universitaet Graz, https://www.tugraz.at/ // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/foreign/PHEMlight/cpp/CEPHandler.cpp sumo-1.12.0/src/foreign/PHEMlight/cpp/CEPHandler.cpp --- sumo-1.11.0/src/foreign/PHEMlight/cpp/CEPHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/foreign/PHEMlight/cpp/CEPHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. // PHEMlight module // Copyright 2016 Technische Universitaet Graz, https://www.tugraz.at/ // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/foreign/PHEMlight/cpp/CEPHandler.h sumo-1.12.0/src/foreign/PHEMlight/cpp/CEPHandler.h --- sumo-1.11.0/src/foreign/PHEMlight/cpp/CEPHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/foreign/PHEMlight/cpp/CEPHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. // PHEMlight module // Copyright 2016 Technische Universitaet Graz, https://www.tugraz.at/ // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/foreign/PHEMlight/cpp/Constants.cpp sumo-1.12.0/src/foreign/PHEMlight/cpp/Constants.cpp --- sumo-1.11.0/src/foreign/PHEMlight/cpp/Constants.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/foreign/PHEMlight/cpp/Constants.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. // PHEMlight module // Copyright (C) 2016-2017 Technische Universitaet Graz, https://www.tugraz.at/ // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/foreign/PHEMlight/cpp/Constants.h sumo-1.12.0/src/foreign/PHEMlight/cpp/Constants.h --- sumo-1.11.0/src/foreign/PHEMlight/cpp/Constants.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/foreign/PHEMlight/cpp/Constants.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. // PHEMlight module // Copyright (C) 2016-2017 Technische Universitaet Graz, https://www.tugraz.at/ // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/foreign/PHEMlight/cpp/Helpers.cpp sumo-1.12.0/src/foreign/PHEMlight/cpp/Helpers.cpp --- sumo-1.11.0/src/foreign/PHEMlight/cpp/Helpers.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/foreign/PHEMlight/cpp/Helpers.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. // PHEMlight module // Copyright 2016 Technische Universitaet Graz, https://www.tugraz.at/ // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/foreign/PHEMlight/cpp/Helpers.h sumo-1.12.0/src/foreign/PHEMlight/cpp/Helpers.h --- sumo-1.11.0/src/foreign/PHEMlight/cpp/Helpers.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/foreign/PHEMlight/cpp/Helpers.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. // PHEMlight module // Copyright 2016 Technische Universitaet Graz, https://www.tugraz.at/ // This program and the accompanying materials are made available under the diff -Nru sumo-1.11.0/src/foreign/rtree/LayeredRTree.h sumo-1.12.0/src/foreign/rtree/LayeredRTree.h --- sumo-1.11.0/src/foreign/rtree/LayeredRTree.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/foreign/rtree/LayeredRTree.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/foreign/rtree/SUMORTree.h sumo-1.12.0/src/foreign/rtree/SUMORTree.h --- sumo-1.11.0/src/foreign/rtree/SUMORTree.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/foreign/rtree/SUMORTree.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/dialogs/CMakeLists.txt sumo-1.12.0/src/gui/dialogs/CMakeLists.txt --- sumo-1.11.0/src/gui/dialogs/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/dialogs/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -7,6 +7,8 @@ GUIDialog_Breakpoints.h GUIDialog_HallOfFame.cpp GUIDialog_HallOfFame.h + GUIDialog_GLObjChooser.cpp + GUIDialog_GLObjChooser.h ) add_library(gui_dialogs STATIC ${gui_dialogs_STAT_SRCS}) diff -Nru sumo-1.11.0/src/gui/dialogs/GUIDialog_AboutSUMO.cpp sumo-1.12.0/src/gui/dialogs/GUIDialog_AboutSUMO.cpp --- sumo-1.11.0/src/gui/dialogs/GUIDialog_AboutSUMO.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/dialogs/GUIDialog_AboutSUMO.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -53,7 +53,7 @@ new FXLabel(descriptionFrame, HAVE_ENABLED, nullptr, GUIDesignLabelAboutInfo); // copyright notice - new FXLabel(this, "Copyright (C) 2001-2021 German Aerospace Center (DLR) and others.", nullptr, GUIDesignLabelAboutInfo); + new FXLabel(this, "Copyright (C) 2001-2022 German Aerospace Center (DLR) and others.", nullptr, GUIDesignLabelAboutInfo); new FXLabel(this, "This application is based on code provided by the Eclipse SUMO project.", nullptr, GUIDesignLabelAboutInfo); new FXLabel(this, "These core components are available under the conditions of the Eclipse Public License v2.", nullptr, GUIDesignLabelAboutInfo); (new FXLinkLabel(this, "SPDX-License-Identifier: EPL-2.0", nullptr, GUIDesignLabelAboutInfo))->setTipText("https://www.eclipse.org/legal/epl-v20.html"); diff -Nru sumo-1.11.0/src/gui/dialogs/GUIDialog_AboutSUMO.h sumo-1.12.0/src/gui/dialogs/GUIDialog_AboutSUMO.h --- sumo-1.11.0/src/gui/dialogs/GUIDialog_AboutSUMO.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/dialogs/GUIDialog_AboutSUMO.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/dialogs/GUIDialog_AppSettings.cpp sumo-1.12.0/src/gui/dialogs/GUIDialog_AppSettings.cpp --- sumo-1.11.0/src/gui/dialogs/GUIDialog_AppSettings.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/dialogs/GUIDialog_AppSettings.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/dialogs/GUIDialog_AppSettings.h sumo-1.12.0/src/gui/dialogs/GUIDialog_AppSettings.h --- sumo-1.11.0/src/gui/dialogs/GUIDialog_AppSettings.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/dialogs/GUIDialog_AppSettings.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/dialogs/GUIDialog_Breakpoints.cpp sumo-1.12.0/src/gui/dialogs/GUIDialog_Breakpoints.cpp --- sumo-1.11.0/src/gui/dialogs/GUIDialog_Breakpoints.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/dialogs/GUIDialog_Breakpoints.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/dialogs/GUIDialog_Breakpoints.h sumo-1.12.0/src/gui/dialogs/GUIDialog_Breakpoints.h --- sumo-1.11.0/src/gui/dialogs/GUIDialog_Breakpoints.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/dialogs/GUIDialog_Breakpoints.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/dialogs/GUIDialog_GLObjChooser.cpp sumo-1.12.0/src/gui/dialogs/GUIDialog_GLObjChooser.cpp --- sumo-1.11.0/src/gui/dialogs/GUIDialog_GLObjChooser.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/gui/dialogs/GUIDialog_GLObjChooser.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,54 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GUIDialog_GLObjChooser.cpp +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @date Sept 2002 +/// +// Class for the window that allows to choose a street, junction or vehicle +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "GUIDialog_GLObjChooser.h" + + +// =========================================================================== +// method definitions +// =========================================================================== +GUIDialog_GLObjChooser::GUIDialog_GLObjChooser(GUISUMOViewParent* SUMOViewParent, int messageId, + FXIcon* icon, const FXString& title, const std::vector& ids, GUIGlObjectStorage& glStorage) : + GUIDialog_ChooserAbstract(SUMOViewParent, messageId, icon, title, ids, glStorage), + mySUMOViewParent(SUMOViewParent) { +} + + +GUIDialog_GLObjChooser::~GUIDialog_GLObjChooser() { + mySUMOViewParent->eraseGLObjChooser(this); +} + +/****************************************************************************/ diff -Nru sumo-1.11.0/src/gui/dialogs/GUIDialog_GLObjChooser.h sumo-1.12.0/src/gui/dialogs/GUIDialog_GLObjChooser.h --- sumo-1.11.0/src/gui/dialogs/GUIDialog_GLObjChooser.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/gui/dialogs/GUIDialog_GLObjChooser.h 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,67 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GUIDialog_GLObjChooser.h +/// @author Daniel Krajzewicz +/// @author Jakob Erdmann +/// @author Michael Behrisch +/// @date Sept 2002 +/// +// Class for the window that allows to choose a street, junction or vehicle +/****************************************************************************/ +#pragma once +#include + +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class GUISUMOViewParent; +class GUIGlChildWindow; +class GUIGlObjectStorage; +class GUIGlObject; + + +// =========================================================================== +// class definition +// =========================================================================== +/** + * @class GUIDialog_GLObjChooser + * Instances of this class are windows that display the list of instances + * from a given artifact like vehicles, edges or junctions and allow + * one of their items + */ +class GUIDialog_GLObjChooser : public GUIDialog_ChooserAbstract { + + +public: + /** @brief Constructor + * @param[in] SUMOViewParent The calling view (SUMO-GUI) + * @param[in] viewParent The calling view (NETEDIT) + * @param[in] icon The icon to use + * @param[in] title The title to use + * @param[in] glStorage The storage to retrieve ids from + */ + GUIDialog_GLObjChooser(GUISUMOViewParent* SUMOViewParent, int messageId, + FXIcon* icon, const FXString& title, const std::vector& ids, + GUIGlObjectStorage& glStorage); + + /// @brief Destructor + virtual ~GUIDialog_GLObjChooser(); + +private: + /// @brief SUMO-GUI View parent + GUISUMOViewParent* mySUMOViewParent; +}; diff -Nru sumo-1.11.0/src/gui/dialogs/GUIDialog_HallOfFame.cpp sumo-1.12.0/src/gui/dialogs/GUIDialog_HallOfFame.cpp --- sumo-1.11.0/src/gui/dialogs/GUIDialog_HallOfFame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/dialogs/GUIDialog_HallOfFame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/dialogs/GUIDialog_HallOfFame.h sumo-1.12.0/src/gui/dialogs/GUIDialog_HallOfFame.h --- sumo-1.11.0/src/gui/dialogs/GUIDialog_HallOfFame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/dialogs/GUIDialog_HallOfFame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/GUIApplicationWindow.cpp sumo-1.12.0/src/gui/GUIApplicationWindow.cpp --- sumo-1.11.0/src/gui/GUIApplicationWindow.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUIApplicationWindow.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -1434,23 +1434,23 @@ myEvents.pop(); // process switch (e->getOwnType()) { - case EVENT_SIMULATION_LOADED: + case GUIEventType::SIMULATION_LOADED: handleEvent_SimulationLoaded(e); break; - case EVENT_SIMULATION_STEP: + case GUIEventType::SIMULATION_STEP: if (myRunThread->simulationAvailable()) { // avoid race-condition related crash if reload was pressed handleEvent_SimulationStep(e); } break; - case EVENT_MESSAGE_OCCURRED: - case EVENT_WARNING_OCCURRED: - case EVENT_ERROR_OCCURRED: - case EVENT_DEBUG_OCCURRED: - case EVENT_GLDEBUG_OCCURRED: - case EVENT_STATUS_OCCURRED: + case GUIEventType::MESSAGE_OCCURRED: + case GUIEventType::WARNING_OCCURRED: + case GUIEventType::ERROR_OCCURRED: + case GUIEventType::DEBUG_OCCURRED: + case GUIEventType::GLDEBUG_OCCURRED: + case GUIEventType::STATUS_OCCURRED: handleEvent_Message(e); break; - case EVENT_SIMULATION_ENDED: + case GUIEventType::SIMULATION_ENDED: handleEvent_SimulationEnded(e); break; default: @@ -1645,7 +1645,7 @@ void GUIApplicationWindow::handleEvent_Message(GUIEvent* e) { GUIEvent_Message* ec = static_cast(e); - if (ec->getOwnType() == EVENT_STATUS_OCCURRED) { + if (ec->getOwnType() == GUIEventType::STATUS_OCCURRED) { setStatusBarText(ec->getMsg()); } else { myMessageWindow->appendMsg(ec->getOwnType(), ec->getMsg()); diff -Nru sumo-1.11.0/src/gui/GUIApplicationWindow.h sumo-1.12.0/src/gui/GUIApplicationWindow.h --- sumo-1.11.0/src/gui/GUIApplicationWindow.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUIApplicationWindow.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/GUIEvent_SimulationEnded.h sumo-1.12.0/src/gui/GUIEvent_SimulationEnded.h --- sumo-1.11.0/src/gui/GUIEvent_SimulationEnded.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUIEvent_SimulationEnded.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -42,7 +42,7 @@ * @param[in] step The time step the simulation has ended at */ GUIEvent_SimulationEnded(MSNet::SimulationState reason, SUMOTime step) - : GUIEvent(EVENT_SIMULATION_ENDED), myReason(reason), myStep(step) {} + : GUIEvent(GUIEventType::SIMULATION_ENDED), myReason(reason), myStep(step) {} /// @brief Destructor diff -Nru sumo-1.11.0/src/gui/GUIEvent_SimulationLoaded.h sumo-1.12.0/src/gui/GUIEvent_SimulationLoaded.h --- sumo-1.11.0/src/gui/GUIEvent_SimulationLoaded.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUIEvent_SimulationLoaded.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -53,7 +53,7 @@ const std::vector& settingsFiles, const bool osgView, const bool viewportFromRegistry) - : GUIEvent(EVENT_SIMULATION_LOADED), + : GUIEvent(GUIEventType::SIMULATION_LOADED), myNet(net), myBegin(startTime), myEnd(endTime), myFile(file), mySettingsFiles(settingsFiles), myOsgView(osgView), diff -Nru sumo-1.11.0/src/gui/GUIGlobals.cpp sumo-1.12.0/src/gui/GUIGlobals.cpp --- sumo-1.11.0/src/gui/GUIGlobals.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUIGlobals.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/GUIGlobals.h sumo-1.12.0/src/gui/GUIGlobals.h --- sumo-1.11.0/src/gui/GUIGlobals.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUIGlobals.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/GUILoadThread.cpp sumo-1.12.0/src/gui/GUILoadThread.cpp --- sumo-1.11.0/src/gui/GUILoadThread.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUILoadThread.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/GUILoadThread.h sumo-1.12.0/src/gui/GUILoadThread.h --- sumo-1.11.0/src/gui/GUILoadThread.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUILoadThread.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/gui/GUIManipulator.cpp sumo-1.12.0/src/gui/GUIManipulator.cpp --- sumo-1.11.0/src/gui/GUIManipulator.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUIManipulator.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/GUIManipulator.h sumo-1.12.0/src/gui/GUIManipulator.h --- sumo-1.11.0/src/gui/GUIManipulator.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUIManipulator.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/GUIRunThread.cpp sumo-1.12.0/src/gui/GUIRunThread.cpp --- sumo-1.11.0/src/gui/GUIRunThread.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUIRunThread.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/GUIRunThread.h sumo-1.12.0/src/gui/GUIRunThread.h --- sumo-1.11.0/src/gui/GUIRunThread.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUIRunThread.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/GUISUMOViewParent.cpp sumo-1.12.0/src/gui/GUISUMOViewParent.cpp --- sumo-1.11.0/src/gui/GUISUMOViewParent.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUISUMOViewParent.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include #include @@ -178,6 +178,10 @@ } gCurrentFolder = opendialog.getDirectory(); std::string file = opendialog.getFilename().text(); + if (file.find(".") == std::string::npos) { + file.append(".png"); + WRITE_MESSAGE("No file extension was specified - saving Snapshot as PNG."); + } std::string error = myView->makeSnapshot(file); if (error == "video") { button->setChecked(!button->amChecked()); diff -Nru sumo-1.11.0/src/gui/GUISUMOViewParent.h sumo-1.12.0/src/gui/GUISUMOViewParent.h --- sumo-1.11.0/src/gui/GUISUMOViewParent.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUISUMOViewParent.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/GUITLLogicPhasesTrackerWindow.cpp sumo-1.12.0/src/gui/GUITLLogicPhasesTrackerWindow.cpp --- sumo-1.11.0/src/gui/GUITLLogicPhasesTrackerWindow.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUITLLogicPhasesTrackerWindow.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -27,6 +27,7 @@ #include #include "GUITLLogicPhasesTrackerWindow.h" #include +#include #include #include #include @@ -40,6 +41,11 @@ // =========================================================================== +// static member initialisation +// =========================================================================== +int GUITLLogicPhasesTrackerWindow::myLastY(-1); + +// =========================================================================== // member method definitions // =========================================================================== /* ------------------------------------------------------------------------- @@ -48,6 +54,7 @@ FXDEFMAP(GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel) GUITLLogicPhasesTrackerPanelMap[] = { FXMAPFUNC(SEL_CONFIGURE, 0, GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onConfigure), FXMAPFUNC(SEL_PAINT, 0, GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onPaint), + FXMAPFUNC(SEL_MOTION, 0, GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onMouseMove), }; @@ -61,17 +68,17 @@ * ----------------------------------------------------------------------- */ GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::GUITLLogicPhasesTrackerPanel( FXComposite* c, GUIMainWindow& app, - GUITLLogicPhasesTrackerWindow& parent) - : FXGLCanvas(c, app.getGLVisual(), app.getBuildGLCanvas(), (FXObject*) nullptr, (FXSelector) 0, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y/*, 0, 0, 300, 200*/), - myParent(&parent) {} + GUITLLogicPhasesTrackerWindow& parent) : + FXGLCanvas(c, app.getGLVisual(), app.getBuildGLCanvas(), (FXObject*) nullptr, (FXSelector) 0, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y/*, 0, 0, 300, 200*/), + myParent(&parent) +{} GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::~GUITLLogicPhasesTrackerPanel() {} long -GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onConfigure( - FXObject*, FXSelector, void*) { +GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onConfigure(FXObject*, FXSelector, void*) { if (makeCurrent()) { int widthInPixels = getWidth(); int heightInPixels = getHeight(); @@ -82,6 +89,7 @@ glDisable(GL_LIGHTING); glDisable(GL_LINE_SMOOTH); glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_ALPHA_TEST); glDisable(GL_COLOR_MATERIAL); glLineWidth(1); @@ -108,6 +116,7 @@ glDisable(GL_LIGHTING); glDisable(GL_LINE_SMOOTH); glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_ALPHA_TEST); glDisable(GL_COLOR_MATERIAL); glLineWidth(1); @@ -123,6 +132,14 @@ } +long +GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerPanel::onMouseMove(FXObject*, FXSelector, void* ptr) { + FXEvent* event = (FXEvent*) ptr; + myMousePos.setx(event->win_x); + myMousePos.sety(event->win_y); + onPaint(nullptr, 0, nullptr); + return 1; +} /* ------------------------------------------------------------------------- * GUITLLogicPhasesTrackerWindow - FOX callback mapping @@ -143,51 +160,51 @@ GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow( GUIMainWindow& app, MSTrafficLightLogic& logic, GUITrafficLightLogicWrapper& wrapper, - ValueSource >* src) - : FXMainWindow(app.getApp(), "TLS-Tracker", nullptr, nullptr, DECOR_ALL, - 20, 20, 300, 200), - myApplication(&app), myTLLogic(&logic), myAmInTrackingMode(true) { - // build the toolbar - myToolBarDrag = new FXToolBarShell(this, GUIDesignToolBar); - myToolBar = new FXToolBar(this, myToolBarDrag, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | FRAME_RAISED); - new FXToolBarGrip(myToolBar, myToolBar, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); - // interval manipulation - myBeginOffset = new FXRealSpinner(myToolBar, 10, this, MID_SIMSTEP, LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); - //myBeginOffset->setFormatString("%.0f"); - //myBeginOffset->setIncrements(1, 10, 100); - myBeginOffset->setIncrement(10); - myBeginOffset->setRange(60, 3600); - myBeginOffset->setValue(240); - new FXLabel(myToolBar, "(s)", nullptr, LAYOUT_CENTER_Y); - // + ValueSource >* src) : + FXMainWindow(app.getApp(), "TLS-Tracker", nullptr, nullptr, DECOR_ALL, 20, 20, 300, 200), + myApplication(&app), + myTLLogic(&logic), + myAmInTrackingMode(true) { + initToolBar(); myConnector = new GLObjectValuePassConnector >(wrapper, src, this); app.addChild(this); for (int i = 0; i < (int)myTLLogic->getLinks().size(); ++i) { myLinkNames.push_back(toString(i)); } + for (auto item : myTLLogic->getDetectorStates()) { + std::string detID = item.first; + if (detID.size() > 4) { + detID = detID.substr(detID.size() - 4); + } + myDetectorNames.push_back(detID); + } + for (auto item : myTLLogic->getConditions()) { + myConditionNames.push_back(item.first); + } FXVerticalFrame* glcanvasFrame = new FXVerticalFrame(this, FRAME_SUNKEN | LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0); - myPanel = new - GUITLLogicPhasesTrackerPanel(glcanvasFrame, *myApplication, *this); + myPanel = new GUITLLogicPhasesTrackerPanel(glcanvasFrame, *myApplication, *this); setTitle((logic.getID() + " - " + logic.getProgramID() + " - tracker").c_str()); setIcon(GUIIconSubSys::getIcon(GUIIcon::APP_TLSTRACKER)); - setHeight((FXint)(myTLLogic->getLinks().size() * 20 + 30 + 8 + 30)); - setWidth(700); + loadSettings(); + setHeight(computeHeight()); } GUITLLogicPhasesTrackerWindow::GUITLLogicPhasesTrackerWindow( GUIMainWindow& app, MSTrafficLightLogic& logic, GUITrafficLightLogicWrapper& /*wrapper*/, - const MSSimpleTrafficLightLogic::Phases& /*phases*/) - : FXMainWindow(app.getApp(), "TLS-Tracker", nullptr, nullptr, DECOR_ALL, - 20, 20, 300, 200), - myApplication(&app), myTLLogic(&logic), myAmInTrackingMode(false), - myToolBarDrag(nullptr), myBeginOffset(nullptr) { + const MSSimpleTrafficLightLogic::Phases& /*phases*/) : + FXMainWindow(app.getApp(), "TLS-Tracker", nullptr, nullptr, DECOR_ALL, 20, 20, 300, 200), + myApplication(&app), + myTLLogic(&logic), + myAmInTrackingMode(false), + myToolBarDrag(nullptr), + myBeginOffset(nullptr) { myConnector = nullptr; - setTitle("TLS-Tracker"); + initToolBar(); app.addChild(this); for (int i = 0; i < (int)myTLLogic->getLinks().size(); ++i) { myLinkNames.push_back(toString(i)); @@ -196,16 +213,19 @@ new FXVerticalFrame(this, FRAME_SUNKEN | LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0, 0, 0, 0, 0); - myPanel = new - GUITLLogicPhasesTrackerPanel(glcanvasFrame, *myApplication, *this); - setTitle((logic.getID() + " - " + logic.getProgramID() + " - tracker").c_str()); + myPanel = new GUITLLogicPhasesTrackerPanel(glcanvasFrame, *myApplication, *this); + setTitle((logic.getID() + " - " + logic.getProgramID() + " - phases").c_str()); setIcon(GUIIconSubSys::getIcon(GUIIcon::APP_TLSTRACKER)); - setHeight((FXint)(myTLLogic->getLinks().size() * 20 + 30 + 8)); + setHeight(computeHeight()); setWidth(700); } GUITLLogicPhasesTrackerWindow::~GUITLLogicPhasesTrackerWindow() { + if (myAmInTrackingMode) { + saveSettings(); + myLastY = -1; + } myApplication->removeChild(this); delete myConnector; // just to quit cleanly on a failure @@ -215,6 +235,48 @@ delete myToolBarDrag; } +void +GUITLLogicPhasesTrackerWindow::initToolBar() { + myToolBarDrag = new FXToolBarShell(this, GUIDesignToolBar); + myToolBar = new FXToolBar(this, myToolBarDrag, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | FRAME_RAISED); + new FXToolBarGrip(myToolBar, myToolBar, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); + + if (myAmInTrackingMode) { + // interval manipulation + new FXLabel(myToolBar, "range (s):", nullptr, LAYOUT_CENTER_Y); + myBeginOffset = new FXRealSpinner(myToolBar, 4, this, MID_SIMSTEP, LAYOUT_TOP | FRAME_SUNKEN | FRAME_THICK); + //myBeginOffset->setFormatString("%.0f"); + //myBeginOffset->setIncrements(1, 10, 100); + myBeginOffset->setIncrement(10); + myBeginOffset->setRange(60, 3600); + myBeginOffset->setValue(240); + } + + new FXLabel(myToolBar, "time style:", nullptr, LAYOUT_CENTER_Y); + myTimeMode = new FXComboBox(myToolBar, 11, this, MID_SIMSTEP, GUIDesignViewSettingsComboBox1); + myTimeMode->appendItem("seconds"); + myTimeMode->appendItem("MM:SS"); + myTimeMode->appendItem("time in cycle"); + myTimeMode->setNumVisible(3); + + new FXLabel(myToolBar, "green time", nullptr, LAYOUT_CENTER_Y); + myGreenMode = new FXComboBox(myToolBar, 6, this, MID_SIMSTEP, GUIDesignViewSettingsComboBox1); + myGreenMode->appendItem("off"); + myGreenMode->appendItem("phase"); + myGreenMode->appendItem("running"); + myGreenMode->setNumVisible(3); + + myIndexMode = new FXCheckButton(myToolBar, "phase names", this, MID_SIMSTEP); + + if (myAmInTrackingMode) { + myDetectorMode = new FXCheckButton(myToolBar, "detectors", this, MID_SIMSTEP); + myConditionMode = new FXCheckButton(myToolBar, "conditions", this, MID_SIMSTEP); + } else { + myDetectorMode = nullptr; + myConditionMode = nullptr; + } +} + void GUITLLogicPhasesTrackerWindow::create() { @@ -224,6 +286,20 @@ } } +int +GUITLLogicPhasesTrackerWindow::computeHeight() { + int newHeight = (int)myTLLogic->getLinks().size() * 20 + 30 + 8 + 30 + 60; + if (myAmInTrackingMode) { + newHeight += 20; // time bar + if (myDetectorMode->getCheck()) { + newHeight += (int)myTLLogic->getDetectorStates().size() * 20 + 5; + } + if (myConditionMode->getCheck()) { + newHeight += (int)myTLLogic->getConditions().size() * 20 + 5; + } + } + return newHeight; +} void GUITLLogicPhasesTrackerWindow::drawValues(GUITLLogicPhasesTrackerPanel& caller) { @@ -231,23 +307,30 @@ myFirstPhase2Show = 0; myFirstPhaseOffset = 0; SUMOTime leftOffset = 0; + myFirstDet2Show = 0; + myFirstDetOffset = 0; + myFirstCond2Show = 0; + myFirstCondOffset = 0; myFirstTime2Show = 0; if (!myAmInTrackingMode) { myPhases.clear(); myDurations.clear(); + myTimeInCycle.clear(); + myPhaseIndex.clear(); // insert phases MSSimpleTrafficLightLogic* simpleTLLogic = dynamic_cast(myTLLogic); if (simpleTLLogic == nullptr) { return; } - const MSSimpleTrafficLightLogic::Phases& phases = simpleTLLogic->getPhases(); - MSSimpleTrafficLightLogic::Phases::const_iterator j; myLastTime = 0; myBeginTime = 0; - for (j = phases.begin(); j != phases.end(); ++j) { - myPhases.push_back(*(*j)); - myDurations.push_back((*j)->duration); - myLastTime += (*j)->duration; + int idx = 0; + for (MSPhaseDefinition* const phase : simpleTLLogic->getPhases()) { + myPhases.push_back(*phase); + myDurations.push_back(phase->duration); + myTimeInCycle.push_back(myLastTime); + myPhaseIndex.push_back(idx++); + myLastTime += phase->duration; } if (myLastTime <= myBeginTime) { WRITE_ERROR("Overflow in time computation occurred."); @@ -279,6 +362,46 @@ leftOffset = beginOffset - durs; } } + if (myDetectorDurations.size() != 0) { + SUMOTime durs = 0; + int phaseOffset = (int)myDetectorDurations.size() - 1; + DurationsVector::reverse_iterator i = myDetectorDurations.rbegin(); + while (i != myDetectorDurations.rend()) { + if (durs + (*i) > beginOffset) { + myFirstDet2Show = phaseOffset; + myFirstDetOffset = (durs + (*i)) - beginOffset; + break; + } + durs += (*i); + phaseOffset--; + ++i; + } + if (i == myDetectorDurations.rend()) { + // there are too few information stored; + myFirstDet2Show = 0; + myFirstDetOffset = 0; + } + } + if (myConditionDurations.size() != 0) { + SUMOTime durs = 0; + int phaseOffset = (int)myConditionDurations.size() - 1; + DurationsVector::reverse_iterator i = myConditionDurations.rbegin(); + while (i != myConditionDurations.rend()) { + if (durs + (*i) > beginOffset) { + myFirstCond2Show = phaseOffset; + myFirstCondOffset = (durs + (*i)) - beginOffset; + break; + } + durs += (*i); + phaseOffset--; + ++i; + } + if (i == myConditionDurations.rend()) { + // there are too few information stored; + myFirstCond2Show = 0; + myFirstCondOffset = 0; + } + } } // begin drawing glMatrixMode(GL_PROJECTION); @@ -294,44 +417,83 @@ const double panelHeight = (double) caller.getHeight(); const double panelWidth = (double) caller.getWidth(); const double barWidth = MAX2(1.0, panelWidth - 31); - const double fontHeight = 0.08 * 300. / panelHeight; - const double fontWidth = 0.08 * 300. / panelWidth; + const double fontHeight = 0.06 * 300. / panelHeight; + const double fontWidth = 0.06 * 300. / panelWidth; const double h9 = 9. / panelHeight; - const double h10 = 10. / panelHeight; + const double hTop = 20. / panelHeight; const double h11 = 11. / panelHeight; - const double h16 = 16. / panelHeight; + const double stateHeight = 16. / panelHeight; const double h20 = 20. / panelHeight; + const double h30 = 15. / panelHeight; + const double h35 = 34. / panelHeight; + const double h60 = 70. / panelHeight; + const double h75 = 73. / panelHeight; + const double h80 = 90. / panelHeight; + const double w30 = 30 / panelWidth; + double h = 1. - hTop; + // draw the line below indices + glColor3d(1, 1, 1); + glBegin(GL_LINES); + glVertex2d(0, h); + glVertex2d(1, h); + glEnd(); // draw the link names and the lines dividing them - double h = 1. - h10; - double h2 = 12.; - for (int i = 0; i < (int)myTLLogic->getLinks().size() + 1; ++i) { - // draw the bar - glBegin(GL_LINES); - glVertex2d(0, h); - glVertex2d((double)(30. / panelWidth), h); - glEnd(); - // draw the name - if (i < (int)myTLLogic->getLinks().size()) { - glTranslated(0, h - h20, 0); - GLHelper::drawText(myLinkNames[i], Position(0, 0), 1, fontHeight, RGBColor::WHITE, 0, FONS_ALIGN_LEFT | FONS_ALIGN_BOTTOM, fontWidth); - glTranslated(0, -h + h20, 0); - h2 += 20; - } - h -= h20; - } + drawNames(myLinkNames, fontHeight, fontWidth, h20, w30, h, 0); glBegin(GL_LINES); glVertex2d(0, h + h20); glVertex2d(1.0, h + h20); glEnd(); // draw the names closure (vertical line) - h += 20. / panelHeight; + h += h20; glColor3d(1, 1, 1); glBegin(GL_LINES); - glVertex2d(30. / panelWidth, 1.); - glVertex2d(30. / panelWidth, h); + glVertex2d(w30, 1.); + glVertex2d(w30, h); glEnd(); + if (myAmInTrackingMode) { + // optionally draw detector names + h -= h60; + if (myDetectorMode->getCheck()) { + const double top = h; + glBegin(GL_LINES); + glVertex2d(0, h); + glVertex2d(1.0, h); + glEnd(); + drawNames(myDetectorNames, fontHeight * 0.7, fontWidth * 0.7, h20, w30, h, 3); + glBegin(GL_LINES); + glVertex2d(0, h + h20); + glVertex2d(1.0, h + h20); + glEnd(); + // draw the names closure (vertical line) + glColor3d(1, 1, 1); + glBegin(GL_LINES); + glVertex2d(30. / panelWidth, top); + glVertex2d(30. / panelWidth, h + h20); + glEnd(); + h -= h30; + } + // optionally draw condition names + if (myConditionMode->getCheck()) { + const double top = h; + glBegin(GL_LINES); + glVertex2d(0, h); + glVertex2d(1.0, h); + glEnd(); + drawNames(myConditionNames, fontHeight * 0.7, fontWidth * 0.7, h20, w30, h, 3); + glBegin(GL_LINES); + glVertex2d(0, h + h20); + glVertex2d(1.0, h + h20); + glEnd(); + // draw the names closure (vertical line) + glColor3d(1, 1, 1); + glBegin(GL_LINES); + glVertex2d(30. / panelWidth, top); + glVertex2d(30. / panelWidth, h + h20); + glEnd(); + } + } // draw the phases // disable value addition while drawing @@ -344,16 +506,21 @@ // and the initial phase information PhasesVector::iterator pi = myPhases.begin() + myFirstPhase2Show; + IndexVector::iterator ii = myPhaseIndex.begin() + myFirstPhase2Show; SUMOTime fpo = myFirstPhaseOffset; + const bool phaseNames = myIndexMode->getCheck(); + std::string lastName = ""; + double spaceForName = 0; // start drawing + std::vector runningGreen(myTLLogic->getLinks().size(), 0); for (DurationsVector::iterator pd = myDurations.begin() + myFirstPhase2Show; pd != myDurations.end(); ++pd) { SUMOTime i = 30; // the first phase may be drawn incompletely SUMOTime duration = *pd - fpo; // compute the height and the width of the phase - h = 1. - h10; + h = 1. - hTop; double a = (double) duration / panelWidth; a *= barWidth / ((double)(myLastTime - myBeginTime)); const double x2 = x + a; @@ -378,68 +545,358 @@ default: // draw a thick block glBegin(GL_QUADS); - glVertex2d(x, h - h16); + glVertex2d(x, h - stateHeight); glVertex2d(x, h); glVertex2d(x2, h); - glVertex2d(x2, h - h16); + glVertex2d(x2, h - stateHeight); glEnd(); break; } + if (myGreenMode->getCurrentItem() != 0) { + SUMOTime drawnDuration = 0; + double xOffset = 0; + if (state == LINKSTATE_TL_GREEN_MINOR || state == LINKSTATE_TL_GREEN_MAJOR) { + if (myGreenMode->getCurrentItem() == 1) { + drawnDuration = *pd; + } else { + runningGreen[j] += *pd; + if (pd + 1 == myDurations.end()) { + drawnDuration = runningGreen[j]; + xOffset = -(drawnDuration - *pd) / panelWidth * (barWidth / ((double)(myLastTime - myBeginTime))); + } + } + } else { + if (runningGreen[j] > 0) { + drawnDuration = runningGreen[j]; + xOffset = -drawnDuration / panelWidth * (barWidth / ((double)(myLastTime - myBeginTime))); + } + runningGreen[j] = 0; + } + if (drawnDuration > 0) { + GLHelper::drawText(toString((int)STEPS2TIME(drawnDuration)), + Position(x + xOffset, h - h9), + 0, fontHeight, RGBColor::BLACK, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, fontWidth); + } + } // proceed to next link h -= h20; } + + // draw phase index / name (no names for intermediate) + std::string name = phaseNames ? pi->getName() : toString(*ii); + if (name != lastName) { + const double lastNameWidth = GLHelper::getTextWidth(lastName, fontWidth); + if (spaceForName < lastNameWidth) { + // clear space to avoid overdrawn text + glColor3d(0, 0, 0); + glBegin(GL_QUADS); + glVertex2d(x, 1 - fontHeight); + glVertex2d(x, 1); + glVertex2d(1, 1); + glVertex2d(1, 1 - fontHeight); + glEnd(); + } + spaceForName = a; + GLHelper::drawText(name, Position(x, 1 - hTop), 0, fontHeight, RGBColor::WHITE, 0, FONS_ALIGN_LEFT | FONS_ALIGN_BOTTOM, fontWidth); + } else { + spaceForName += a; + } + lastName = name; // proceed to next phase i += duration; ++pi; + ++ii; x = x2; // all further phases are drawn in full fpo = 0; } + + if (myAmInTrackingMode) { + h -= h75; + if (myDetectorMode->getCheck()) { + glColor3d(0.7, 0.7, 1.0); + drawAdditionalStates(caller, myDetectorStates, myDetectorDurations, myFirstDetOffset, myFirstDet2Show, h, + panelWidth, (double)leftOffset, barWidth, stateHeight, h20, h); + h -= h35; + } + if (myConditionMode->getCheck()) { + glColor3d(0.9, 0.6, 0.9); + drawAdditionalStates(caller, myConditionStates, myConditionDurations, myFirstCondOffset, myFirstCond2Show, h, + panelWidth, (double)leftOffset, barWidth, stateHeight, h20, h); + } + } // allow value addition myLock.unlock(); - glColor3d(1, 1, 1); if (myPhases.size() != 0) { + const double timeRange = STEPS2TIME(myLastTime - myBeginTime); SUMOTime tickDist = TIME2STEPS(10); // patch distances - hack - double t = myBeginOffset != nullptr ? myBeginOffset->getValue() : STEPS2TIME(myLastTime - myBeginTime); + double t = myBeginOffset != nullptr ? myBeginOffset->getValue() : timeRange; while (t > barWidth / 4.) { tickDist += TIME2STEPS(10); t -= barWidth / 4.; } // draw time information //h = (double)(myTLLogic->getLinks().size() * 20 + 12); - double glh = (double)(1.0 - myTLLogic->getLinks().size() * h20 - h10); + double glh = (double)(1.0 - myTLLogic->getLinks().size() * h20 - hTop); // current begin time // time ticks SUMOTime currTime = myFirstTime2Show; - int pos = 31;// + /*!!!currTime*/ - myFirstTime2Show; - double glpos = (double) pos / panelWidth; + double glpos = (double) 31 / panelWidth; const double ticSize = 4. / panelHeight; - while (pos < panelWidth + 50.) { - const std::string timeStr = (gHumanReadableTime - ? time2string(currTime % 3600000).substr(3) // only write mn:ss - : toString((int)STEPS2TIME(currTime))); - const double w = 50. / panelWidth; - glTranslated(glpos - w / 2., glh - h20, 0); + if (leftOffset > 0) { + const double a = STEPS2TIME(leftOffset) * barWidth / timeRange; + glpos += a / panelWidth; + currTime += leftOffset; + } else if (myFirstPhaseOffset > 0) { + const double a = STEPS2TIME(-myFirstPhaseOffset) * barWidth / timeRange; + glpos += a / panelWidth; + currTime -= myFirstPhaseOffset; + } + int ticShift = myFirstPhase2Show; + const bool mmSS = myTimeMode->getCurrentItem() == 1; + const bool cycleTime = myTimeMode->getCurrentItem() == 2; + SUMOTime lastTimeInCycle = -1; + lastName = ""; + pi = myPhases.begin() + myFirstPhase2Show; + for (DurationsVector::iterator pd = myDurations.begin() + myFirstPhase2Show; pd != myDurations.end(); ++pd) { + const SUMOTime timeInCycle = myTimeInCycle[pd - myDurations.begin()]; + // draw times at different heights + ticShift = (ticShift % 3) + 1; + const std::string timeStr = (mmSS + ? StringUtils::padFront(toString((currTime % 3600000) / 60000), 2, '0') + ":" + + StringUtils::padFront(toString((currTime % 60000) / 1000), 2, '0') + : toString((int)STEPS2TIME(cycleTime ? timeInCycle : currTime))); + const double w = 10 * timeStr.size() / panelWidth; + glTranslated(glpos - w / 2., glh - h20 * ticShift, 0); GLHelper::drawText(timeStr, Position(0, 0), 1, fontHeight, RGBColor::WHITE, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, fontWidth); - glTranslated(-glpos + w / 2., -glh + h20, 0); + glTranslated(-glpos + w / 2., -glh + h20 * ticShift, 0); + // draw tic + glColor3d(1, 1, 1); glBegin(GL_LINES); glVertex2d(glpos, glh); - glVertex2d(glpos, glh - ticSize); + glVertex2d(glpos, glh - ticSize * ticShift); glEnd(); - const double a = STEPS2TIME(tickDist) * barWidth / STEPS2TIME(myLastTime - myBeginTime); - pos += (int) a; + // draw vertical lines for names, detectors and conditions on each phase switch + if (myAmInTrackingMode) { + double hStart = 1; + if (!phaseNames || (pi->getName() != lastName)) { + glColor3d(0.4, 0.4, 0.4); + glBegin(GL_LINES); + glVertex2d(glpos, hStart); + hStart -= h20; + glVertex2d(glpos, hStart); + glEnd(); + } + lastName = pi->getName(); + + hStart = glh - h60; + if (myDetectorMode->getCheck() && glpos >= w30) { + glColor3d(0.4, 0.4, 0.4); + glBegin(GL_LINES); + glVertex2d(glpos, hStart); + hStart -= myDetectorNames.size() * h20; + glVertex2d(glpos, hStart); + glEnd(); + hStart -= h35; + } + if (myConditionMode->getCheck() && glpos >= w30) { + glColor3d(0.4, 0.4, 0.4); + glBegin(GL_LINES); + glVertex2d(glpos, hStart); + glVertex2d(glpos, hStart - myConditionNames.size() * h20); + glEnd(); + } + } + + // draw vertical line for cycle reset + if (timeInCycle == 0 || timeInCycle < lastTimeInCycle) { + const double cycle0pos = glpos - STEPS2TIME(timeInCycle) * barWidth / timeRange / panelWidth; + if (cycle0pos >= 31 / panelWidth) { + glColor3d(0.6, 0.6, 0.6); + glBegin(GL_LINES); + glVertex2d(cycle0pos, 1); + glVertex2d(cycle0pos, glh); + glEnd(); + glColor3d(1, 1, 1); + } + } + + lastTimeInCycle = timeInCycle; + tickDist = *pd; + const double a = STEPS2TIME(tickDist) * barWidth / timeRange; glpos += a / panelWidth; currTime += tickDist; + ++pi; + } + + // draw bottom time bar with fixed spacing + if (myAmInTrackingMode && (myDetectorMode->getCheck() || myConditionMode->getCheck()) && glpos >= w30) { + glColor3d(1, 1, 1); + tickDist = TIME2STEPS(10); + // patch distances - hack + t = myBeginOffset != nullptr ? myBeginOffset->getValue() : STEPS2TIME(myLastTime - myBeginTime); + while (t > barWidth / 4.) { + tickDist += TIME2STEPS(10); + t -= barWidth / 4.; + } + glh = (double)(1.0 - myLinkNames.size() * h20 - h80); + glh -= h20 * (myDetectorMode->getCheck() ? myDetectorNames.size() : myConditionNames.size()); + currTime = myFirstTime2Show; + int pos = 31; + glpos = (double) pos / panelWidth; + if (leftOffset > 0) { + const double a = STEPS2TIME(leftOffset) * barWidth / timeRange; + pos += (int)a; + glpos += a / panelWidth; + currTime += leftOffset; + } else if (myFirstPhaseOffset > 0) { + const double a = -STEPS2TIME(myBeginTime % tickDist) * barWidth / timeRange; + pos += (int)a; + glpos += a / panelWidth; + currTime = myBeginTime - (myBeginTime % tickDist); + } + while (pos < panelWidth + 50.) { + const std::string timeStr = (mmSS + ? StringUtils::padFront(toString((currTime % 3600000) / 60000), 2, '0') + ":" + + StringUtils::padFront(toString((currTime % 60000) / 1000), 2, '0') + : toString((int)STEPS2TIME(cycleTime ? findTimeInCycle(currTime) : currTime))); + const double w = 10 * timeStr.size() / panelWidth; + glTranslated(glpos - w / 2., glh - h20, 0); + GLHelper::drawText(timeStr, Position(0, 0), 1, fontHeight, RGBColor::WHITE, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, fontWidth); + glTranslated(-glpos + w / 2., -glh + h20, 0); + + glBegin(GL_LINES); + glVertex2d(glpos, glh); + glVertex2d(glpos, glh - ticSize); + glEnd(); + + const double a = STEPS2TIME(tickDist) * barWidth / STEPS2TIME(myLastTime - myBeginTime); + pos += (int) a; + glpos += a / panelWidth; + currTime += tickDist; + } } } } void +GUITLLogicPhasesTrackerWindow::drawNames(const std::vector& names, double fontHeight, double fontWidth, double divHeight, double divWidth, double& h, int extraLines) { + int i = 0; + for (const std::string& name : names) { + // draw the bar + glBegin(GL_LINES); + glVertex2d(0, h); + glVertex2d(divWidth, h); + glEnd(); + // draw the name + glTranslated(0, h - divHeight, 0); + GLHelper::drawText(name, Position(0, 0), 1, fontHeight, RGBColor::WHITE, 0, FONS_ALIGN_LEFT | FONS_ALIGN_BOTTOM, fontWidth); + glTranslated(0, -h + divHeight, 0); + + if (extraLines > 0 && i > 0 && i % extraLines == 0) { + glColor3d(0.4, 0.4, 0.4); + glBegin(GL_LINES); + glVertex2d(divWidth, h); + glVertex2d(1.0, h); + glEnd(); + glColor3d(1, 1, 1); + } + h -= divHeight; + i++; + } + h -= divHeight; +} + + +void +GUITLLogicPhasesTrackerWindow::drawAdditionalStates(GUITLLogicPhasesTrackerPanel& caller, + const AdditionalStatesVector& states, + const DurationsVector& durations, SUMOTime firstOffset, int first2Show, double hStart, + double panelWidth, double leftOffset, double barWidth, double stateHeight, double h20, double& h) { + double x = 31. / panelWidth; + double ta = leftOffset / panelWidth; + ta *= barWidth / ((double)(myLastTime - myBeginTime)); + x += ta; + auto di = states.begin() + first2Show; + SUMOTime fpo = firstOffset; + + double mx = caller.getMousePos().x() / caller.getWidth(); + double my = 1 - caller.getMousePos().y() / caller.getHeight(); + std::string tooltip = ""; + // start drawing + for (auto pd = durations.begin() + first2Show; pd != durations.end(); ++pd) { + SUMOTime i = 30; + // the first phase may be drawn incompletely + SUMOTime duration = *pd - fpo; + // compute the height and the width of the phase + h = hStart; + double a = (double) duration / panelWidth; + a *= barWidth / ((double)(myLastTime - myBeginTime)); + const double x2 = x + a; + const bool tooltipX = x < mx && mx < x2; + //std::cout << SIMTIME << " detStates=" << toString(*di) << "\n"; + // go through the detectors + for (double j : *di) { + if (j != 0) { + // draw a thick block + glBegin(GL_QUADS); + glVertex2d(x, h - stateHeight); + glVertex2d(x, h); + glVertex2d(x2, h); + glVertex2d(x2, h - stateHeight); + glEnd(); + if (tooltipX) { + const bool tooltipY = (h - stateHeight) < my && my < h; + if (tooltipY) { + tooltip = toString((int)j); + } + } + } + // proceed to next link + h -= h20; + } + // proceed to next phase + i += duration; + ++di; + x = x2; + // all further phases are drawn in full + fpo = 0; + } + if (tooltip != "") { + // delay tool tip drawing until all bars are drawn to prevent overwriting + GLHelper::drawText(tooltip, Position(mx, my), 0, h20, RGBColor::YELLOW, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, 20 / caller.getWidth()); + } +} + +SUMOTime +GUITLLogicPhasesTrackerWindow::findTimeInCycle(SUMOTime t) { + // find latest cycle reset before t + int i = (int)myPhases.size() - 1; + SUMOTime lookBack = myLastTime - t - myDurations.back(); + //std::cout << SIMTIME << " findTimeInCycle t=" << STEPS2TIME(t) + // << " last=" << STEPS2TIME(myLastTime) + // << " lastDur=" << STEPS2TIME(myDurations.back()) + // << " lookBack=" << STEPS2TIME(lookBack) + // << " i0=" << i; + // look backwards through the phases until to the first cycle crossing before t + while (lookBack > 0 && i >= 0) { + i--; + lookBack -= myDurations[i]; + } + SUMOTime timeInCycle = myTimeInCycle[i < 0 ? 0 : i]; + //std::cout << " iF=" << i << " lookBack2=" << STEPS2TIME(lookBack) << " tic=" << STEPS2TIME(timeInCycle) << "\n"; + if (lookBack <= 0) { + return timeInCycle - lookBack; + } + return myTLLogic->mapTimeInCycle(t); +} + +void GUITLLogicPhasesTrackerWindow::addValue(std::pair def) { // do not draw while adding myLock.lock(); @@ -448,11 +905,35 @@ myBeginTime = def.first; } // append or set the phase - if (myPhases.size() == 0 || *(myPhases.end() - 1) != def.second) { + if (myPhases.size() == 0 || myPhases.back() != def.second) { myPhases.push_back(def.second); myDurations.push_back(DELTA_T); + myTimeInCycle.push_back(myTLLogic->mapTimeInCycle(def.first - DELTA_T)); + myPhaseIndex.push_back(myTLLogic->getCurrentPhaseIndex()); + } else { + myDurations.back() += DELTA_T; + } + // updated detector states + std::vector detectorStates; + for (auto item : myTLLogic->getDetectorStates()) { + detectorStates.push_back(item.second); + } + if (myDetectorStates.size() == 0 || myDetectorStates.back() != detectorStates) { + myDetectorStates.push_back(detectorStates); + myDetectorDurations.push_back(DELTA_T); + } else { + myDetectorDurations.back() += DELTA_T; + } + // updated condition states + std::vector conditionStates; + for (auto item : myTLLogic->getConditions()) { + conditionStates.push_back(item.second); + } + if (myConditionStates.size() == 0 || myConditionStates.back() != conditionStates) { + myConditionStates.push_back(conditionStates); + myConditionDurations.push_back(DELTA_T); } else { - *(myDurations.end() - 1) += DELTA_T; + myConditionDurations.back() += DELTA_T; } // set the last time a phase was added at myLastTime = def.first; @@ -476,7 +957,10 @@ long -GUITLLogicPhasesTrackerWindow::onSimStep(FXObject*, FXSelector, void*) { +GUITLLogicPhasesTrackerWindow::onSimStep(FXObject* sender, FXSelector, void*) { + if (sender == myDetectorMode || sender == myConditionMode) { + resize(getWidth(), computeHeight()); + } update(); return 1; } @@ -488,4 +972,42 @@ } +void +GUITLLogicPhasesTrackerWindow::saveSettings() { + getApp()->reg().writeIntEntry("TL_TRACKER", "x", getX()); + getApp()->reg().writeIntEntry("TL_TRACKER", "y", getY()); + getApp()->reg().writeIntEntry("TL_TRACKER", "width", getWidth()); + getApp()->reg().writeIntEntry("TL_TRACKER", "timeRange", (int)myBeginOffset->getValue()); + getApp()->reg().writeIntEntry("TL_TRACKER", "timeMode", myTimeMode->getCurrentItem()); + getApp()->reg().writeIntEntry("TL_TRACKER", "greenMode", (myGreenMode->getCurrentItem())); + getApp()->reg().writeIntEntry("TL_TRACKER", "indexMode", (int)(myIndexMode->getCheck())); + getApp()->reg().writeIntEntry("TL_TRACKER", "detectorMode", (int)(myDetectorMode->getCheck())); + getApp()->reg().writeIntEntry("TL_TRACKER", "conditionMode", (int)(myConditionMode->getCheck())); +} + + +void +GUITLLogicPhasesTrackerWindow::loadSettings() { + // ensure window is visible after switching screen resolutions + const FXint minSize = 400; + const FXint minTitlebarHeight = 20; + setX(MAX2(0, MIN2(getApp()->reg().readIntEntry("TL_TRACKER", "x", 150), + getApp()->getRootWindow()->getWidth() - minSize))); + if (myLastY == -1) { + myLastY = MAX2(minTitlebarHeight, + MIN2(getApp()->reg().readIntEntry("TL_TRACKER", "y", 150), + getApp()->getRootWindow()->getHeight() - minSize)); + } else { + myLastY += getHeight() + 20; + } + setY(myLastY); + setWidth(MAX2(getApp()->reg().readIntEntry("TL_TRACKER", "width", 700), minSize)); + myBeginOffset->setValue(getApp()->reg().readIntEntry("TL_TRACKER", "timeRange", (int)myBeginOffset->getValue())); + myTimeMode->setCurrentItem(getApp()->reg().readIntEntry("TL_TRACKER", "timeMode", myTimeMode->getCurrentItem())); + myGreenMode->setCurrentItem((bool)getApp()->reg().readIntEntry("TL_TRACKER", "greenMode", (int)(myGreenMode->getCurrentItem()))); + myIndexMode->setCheck((bool)getApp()->reg().readIntEntry("TL_TRACKER", "indexMode", (int)(myIndexMode->getCheck()))); + myDetectorMode->setCheck((bool)getApp()->reg().readIntEntry("TL_TRACKER", "detectorMode", (int)(myDetectorMode->getCheck()))); + myConditionMode->setCheck((bool)getApp()->reg().readIntEntry("TL_TRACKER", "conditionMode", (int)(myConditionMode->getCheck()))); +} + /****************************************************************************/ diff -Nru sumo-1.11.0/src/gui/GUITLLogicPhasesTrackerWindow.h sumo-1.12.0/src/gui/GUITLLogicPhasesTrackerWindow.h --- sumo-1.11.0/src/gui/GUITLLogicPhasesTrackerWindow.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUITLLogicPhasesTrackerWindow.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -117,9 +117,11 @@ /// @brief called on a simulation step long onSimStep(FXObject* sender, FXSelector sel, void* ptr); + /// } + public: /// @brief Definition of a storage for phases typedef std::vector PhasesVector; @@ -127,6 +129,11 @@ /// @brief Definition of a storage for durations typedef std::vector DurationsVector; + /// @brief Definition of a storage for indices + typedef std::vector IndexVector; + + /// @brief Definition of a storage for detector and condition states + typedef std::vector > AdditionalStatesVector; /** * @class GUITLLogicPhasesTrackerPanel @@ -160,13 +167,21 @@ /// @brief called if the widget shall be repainted long onPaint(FXObject*, FXSelector, void*); + + /// @brief called on mouse movement (for updating tooltip) + long onMouseMove(FXObject*, FXSelector, void*); /// } + const Position& getMousePos() const { + return myMousePos; + }; private: /// @brief The parent window GUITLLogicPhasesTrackerWindow* myParent; + Position myMousePos; + protected: /// @brief protected constructor for FOX GUITLLogicPhasesTrackerPanel() { } @@ -193,6 +208,20 @@ /// @brief The list of phase durations DurationsVector myDurations; + /// @brief The time within the cycle for the current phase + DurationsVector myTimeInCycle; + + /// @brief The index of the current phase + IndexVector myPhaseIndex; + + /// @brief The state of all used detectors of the current phase + AdditionalStatesVector myDetectorStates; + AdditionalStatesVector myConditionStates; + + /// @brief The list of detector state durations + DurationsVector myDetectorDurations; + DurationsVector myConditionDurations; + /// @brief The panel to draw on GUITLLogicPhasesTrackerPanel* myPanel; @@ -203,12 +232,18 @@ * * This holds an enumeration only - used to avoid time consuming string representation of ints */ std::vector myLinkNames; + std::vector myDetectorNames; + std::vector myConditionNames; /// @brief The index of the first phase that fits into the window int myFirstPhase2Show; + int myFirstDet2Show; + int myFirstCond2Show; /// @brief The offset to draw the first phase (left offset) SUMOTime myFirstPhaseOffset; + SUMOTime myFirstDetOffset; + SUMOTime myFirstCondOffset; /// @brief The time the diagram begins at SUMOTime myFirstTime2Show; @@ -234,6 +269,45 @@ /// @brief The offset changer (tracking mode) FXRealSpinner* myBeginOffset; + /// @brief The time mode + FXComboBox* myTimeMode; + + /// @brief Whether green durations are printed + FXComboBox* myGreenMode; + + /// @brief Whether phase names shall be printed instead of indices + FXCheckButton* myIndexMode; + + /// @brief Whether detector states are drawn + FXCheckButton* myDetectorMode; + + /// @brief Whether detector states are drawn + FXCheckButton* myConditionMode; + + /// @brief y-Position of previously opened window + static int myLastY; + +private: + + void initToolBar(); + + void saveSettings(); + void loadSettings(); + + /// @brief compute required windowHeight + int computeHeight(); + + /// @brief draw row title + void drawNames(const std::vector& names, double fontHeight, double fontWidth, double divHeight, double divWidth, double& h, int extraLines); + + /// @brief draw detector and condition states + void drawAdditionalStates(GUITLLogicPhasesTrackerPanel& caller, + const AdditionalStatesVector& states, const DurationsVector& durations, + SUMOTime firstOffset, int first2Show, double hStart, + double panelWidth, double leftOffset, double barWidth, double stateHeight, double h20, double& h); + + /// @brief find time in cycle based on myTimeInCycle + SUMOTime findTimeInCycle(SUMOTime t); protected: /// protected constructor for FOX diff -Nru sumo-1.11.0/src/gui/GUIViewTraffic.cpp sumo-1.12.0/src/gui/GUIViewTraffic.cpp --- sumo-1.11.0/src/gui/GUIViewTraffic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUIViewTraffic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/GUIViewTraffic.h sumo-1.12.0/src/gui/GUIViewTraffic.h --- sumo-1.11.0/src/gui/GUIViewTraffic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/GUIViewTraffic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/TraCIServerAPI_GUI.cpp sumo-1.12.0/src/gui/TraCIServerAPI_GUI.cpp --- sumo-1.11.0/src/gui/TraCIServerAPI_GUI.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/TraCIServerAPI_GUI.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/gui/TraCIServerAPI_GUI.h sumo-1.12.0/src/gui/TraCIServerAPI_GUI.h --- sumo-1.11.0/src/gui/TraCIServerAPI_GUI.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/gui/TraCIServerAPI_GUI.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guinetload/GUIDetectorBuilder.cpp sumo-1.12.0/src/guinetload/GUIDetectorBuilder.cpp --- sumo-1.11.0/src/guinetload/GUIDetectorBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guinetload/GUIDetectorBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guinetload/GUIDetectorBuilder.h sumo-1.12.0/src/guinetload/GUIDetectorBuilder.h --- sumo-1.11.0/src/guinetload/GUIDetectorBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guinetload/GUIDetectorBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guinetload/GUIEdgeControlBuilder.cpp sumo-1.12.0/src/guinetload/GUIEdgeControlBuilder.cpp --- sumo-1.11.0/src/guinetload/GUIEdgeControlBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guinetload/GUIEdgeControlBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guinetload/GUIEdgeControlBuilder.h sumo-1.12.0/src/guinetload/GUIEdgeControlBuilder.h --- sumo-1.11.0/src/guinetload/GUIEdgeControlBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guinetload/GUIEdgeControlBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guinetload/GUITriggerBuilder.cpp sumo-1.12.0/src/guinetload/GUITriggerBuilder.cpp --- sumo-1.11.0/src/guinetload/GUITriggerBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guinetload/GUITriggerBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guinetload/GUITriggerBuilder.h sumo-1.12.0/src/guinetload/GUITriggerBuilder.h --- sumo-1.11.0/src/guinetload/GUITriggerBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guinetload/GUITriggerBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIBaseVehicle.cpp sumo-1.12.0/src/guisim/GUIBaseVehicle.cpp --- sumo-1.11.0/src/guisim/GUIBaseVehicle.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIBaseVehicle.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -61,6 +61,7 @@ #include "GUINet.h" #include "GUIEdge.h" #include "GUILane.h" +#include "GUIParkingArea.h" //#define DRAW_BOUNDING_BOX @@ -399,7 +400,8 @@ double GUIBaseVehicle::getExaggeration(const GUIVisualizationSettings& s) const { - return s.vehicleSize.getExaggeration(s, this); + return (s.vehicleSize.getExaggeration(s, this) * + s.vehicleScaler.getScheme().getColor(getScaleValue(s, s.vehicleScaler.getActive()))); } @@ -440,7 +442,7 @@ } glScaled(upscale, upscaleLength, 1); /* - MSLCM_DK2004 &m2 = static_cast(veh->getLaneChangeModel()); + MSLaneChangeModel::DK2004 &m2 = static_cast(veh->getLaneChangeModel()); if((m2.getState()&LCA_URGENT)!=0) { glColor3d(1, .4, .4); } else if((m2.getState()&LCA_SPEEDGAIN)!=0) { @@ -468,7 +470,7 @@ case 2: drawCarriages = drawAction_drawVehicleAsPolyWithCarriagges(s, scaledLength); // draw flashing blue light for emergency vehicles - if (getVType().getGuiShape() == SVS_EMERGENCY) { + if (getVType().getGuiShape() == SUMOVehicleShape::EMERGENCY) { glTranslated(0, 0, .1); drawAction_drawVehicleBlueLight(); } @@ -515,22 +517,22 @@ if (s.showBlinker) { glTranslated(0, 0, .1); switch (getVType().getGuiShape()) { - case SVS_PEDESTRIAN: - case SVS_BICYCLE: - case SVS_SCOOTER: - case SVS_ANT: - case SVS_SHIP: - case SVS_RAIL: - case SVS_RAIL_CARGO: - case SVS_RAIL_CAR: + case SUMOVehicleShape::PEDESTRIAN: + case SUMOVehicleShape::BICYCLE: + case SUMOVehicleShape::SCOOTER: + case SUMOVehicleShape::ANT: + case SUMOVehicleShape::SHIP: + case SUMOVehicleShape::RAIL: + case SUMOVehicleShape::RAIL_CARGO: + case SUMOVehicleShape::RAIL_CAR: break; - case SVS_MOTORCYCLE: - case SVS_MOPED: + case SUMOVehicleShape::MOTORCYCLE: + case SUMOVehicleShape::MOPED: drawAction_drawVehicleBlinker(scaledLength); drawAction_drawVehicleBrakeLight(scaledLength, true); break; default: - // only SVS_RAIL_CAR has blinkers and brake lights but they are drawn along with the carriages + // only SUMOVehicleShape::RAIL_CAR has blinkers and brake lights but they are drawn along with the carriages if (!drawCarriages) { drawAction_drawVehicleBlinker(scaledLength); drawAction_drawVehicleBrakeLight(scaledLength); @@ -542,7 +544,7 @@ if (s.drawLaneChangePreference) { /* if(gSelected.isSelected(GLO_VEHICLE, veh->getGlID())) { - MSLCM_DK2004 &m = static_cast(veh->getLaneChangeModel()); + MSLaneChangeModel::DK2004 &m = static_cast(veh->getLaneChangeModel()); glColor3d(.5, .5, 1); glBegin(GL_LINES); glVertex2f(0, 0); @@ -568,20 +570,27 @@ glScaled(1 / upscale, 1 / upscaleLength, 1); glRotated(-degAngle, 0, 0, 1); drawName(Position(0, 0), s.scale, s.vehicleName, s.angle); - if (s.vehicleName.show && myVehicle.getParameter().line != "") { + if (s.vehicleName.show(this) && myVehicle.getParameter().line != "") { glRotated(-s.angle, 0, 0, 1); glTranslated(0, 0.7 * s.vehicleName.scaledSize(s.scale), 0); glRotated(s.angle, 0, 0, 1); GLHelper::drawTextSettings(s.vehicleName, "line:" + myVehicle.getParameter().line, Position(0, 0), s.scale, s.angle); } - if (s.vehicleValue.show) { + if (s.vehicleValue.show(this)) { glRotated(-s.angle, 0, 0, 1); glTranslated(0, 0.7 * s.vehicleName.scaledSize(s.scale), 0); glRotated(s.angle, 0, 0, 1); const double value = getColorValue(s, s.vehicleColorer.getActive()); GLHelper::drawTextSettings(s.vehicleValue, toString(value), Position(0, 0), s.scale, s.angle); } - if (s.vehicleText.show) { + if (s.vehicleScaleValue.show(this)) { + glRotated(-s.angle, 0, 0, 1); + glTranslated(0, 0.7 * s.vehicleName.scaledSize(s.scale), 0); + glRotated(s.angle, 0, 0, 1); + const double value = getScaleValue(s, s.vehicleScaler.getActive()); + GLHelper::drawTextSettings(s.vehicleScaleValue, toString(value), Position(0, 0), s.scale, s.angle); + } + if (s.vehicleText.show(this)) { std::string error; std::string value = myVehicle.getPrefixedParameter(s.vehicleTextParam, error); if (value != "") { @@ -597,6 +606,14 @@ } } } + if (s.showParkingInfo && myAdditionalVisualizations.size() != 0 && hasActiveAddVisualisation( + myAdditionalVisualizations.begin()->first, VO_SHOW_ROUTE | VO_SHOW_FUTURE_ROUTE | VO_SHOW_ALL_ROUTES)) { + glRotated(-s.angle, 0, 0, 1); + glTranslated(0, 0.7 * s.vehicleName.scaledSize(s.scale), 0); + glRotated(s.angle, 0, 0, 1); + const double value = myVehicle.getNumberParkingReroutes(); + GLHelper::drawTextSettings(s.vehicleName, toString(value), Position(0, 0), s.scale, s.angle); + } if (!drawCarriages) { mySeatPositions.clear(); @@ -684,17 +701,17 @@ switch (activeScheme) { case 0: { //test for emergency vehicle - if (veh->getVehicleType().getGuiShape() == SVS_EMERGENCY) { + if (veh->getVehicleType().getGuiShape() == SUMOVehicleShape::EMERGENCY) { col = RGBColor::WHITE; return true; } //test for firebrigade - if (veh->getVehicleType().getGuiShape() == SVS_FIREBRIGADE) { + if (veh->getVehicleType().getGuiShape() == SUMOVehicleShape::FIREBRIGADE) { col = RGBColor::RED; return true; } //test for police car - if (veh->getVehicleType().getGuiShape() == SVS_POLICE) { + if (veh->getVehicleType().getGuiShape() == SUMOVehicleShape::POLICE) { col = RGBColor::BLUE; return true; } @@ -779,6 +796,73 @@ } +double +GUIBaseVehicle::getScaleValue(const GUIVisualizationSettings& s, int activeScheme) const { + switch (activeScheme) { + case 0: // uniform + return 0; + case 1: // selection + return myVehicle.isSelected(); + case 2: // by speed + if (myVehicle.isStopped()) { + return myVehicle.isParking() ? -2 : -1; + } + return myVehicle.getSpeed(); + case 3: + return myVehicle.getWaitingSeconds(); + case 4: { + MSVehicle* microVeh = dynamic_cast(&myVehicle); + return (microVeh != nullptr ? microVeh->getAccumulatedWaitingSeconds() : 0); + } + case 5: { + MSVehicle* microVeh = dynamic_cast(&myVehicle); + return (microVeh != nullptr ? microVeh->getLane()->getVehicleMaxSpeed(microVeh) : myVehicle.getEdge()->getVehicleMaxSpeed(&myVehicle)); + } + case 6: + return myVehicle.getNumberReroutes(); + case 7: { + MSVehicle* microVeh = dynamic_cast(&myVehicle); + return (microVeh != nullptr + ? (microVeh->getLaneChangeModel().isOpposite() ? -100 : microVeh->getBestLaneOffset()) + : 0); + } + case 8: + return myVehicle.getAcceleration(); + case 9: { + MSVehicle* microVeh = dynamic_cast(&myVehicle); + return (microVeh != nullptr ? microVeh->getTimeGapOnLane() : 0); + } + case 10: + return STEPS2TIME(myVehicle.getDepartDelay()); + case 11: + return myVehicle.getTimeLossSeconds(); + case 12: + return myVehicle.getStopDelay(); + case 13: + return myVehicle.getStopArrivalDelay(); + case 14: // by numerical param value + std::string error; + std::string val = myVehicle.getPrefixedParameter(s.vehicleScaleParam, error); + try { + if (val == "") { + return 0; + } else { + return StringUtils::toDouble(val); + } + } catch (NumberFormatException&) { + try { + return StringUtils::toBool(val); + } catch (BoolFormatException&) { + WRITE_WARNING("Vehicle parameter '" + myVehicle.getParameter().getParameter(s.vehicleScaleParam, "0") + + "' key '" + s.vehicleScaleParam + "' is not a number for vehicle '" + myVehicle.getID() + "'"); + return -1; + } + } + } + return 0; +} + + // ------------ Additional visualisations bool GUIBaseVehicle::hasActiveAddVisualisation(GUISUMOAbstractView* const parent, int which) const { @@ -905,6 +989,29 @@ } } +void +GUIBaseVehicle::drawParkingInfo(const GUIVisualizationSettings& s, const RGBColor& /*col*/) const { + if (s.showParkingInfo) { + const MSBaseVehicle::ParkingMemory* pm = myVehicle.getParkingMemory(); + if (pm != nullptr) { + for (auto item : *pm) { + const GUIParkingArea* pa = dynamic_cast(item.first); + if (item.second.blockedAtTime >= 0) { + std::string seenAgo = time2string(SIMSTEP - item.second.blockedAtTime); + //if (item.second.blockedAtTime >= 0) { + // seenAgo += ", " + time2string(SIMSTEP - item.second.blockedAtTimeLocal); + //} + GLHelper::drawTextSettings(s.vehicleValue, seenAgo, pa->getSignPos(), s.scale, s.angle, 1.0); + } + if (item.second.score != "") { + const double dist = 0.4 * (s.vehicleText.scaledSize(s.scale) + s.vehicleValue.scaledSize(s.scale)); + Position shift(0, -dist); + GLHelper::drawTextSettings(s.vehicleText, item.second.score, pa->getSignPos() + shift, s.scale, s.angle, 1.0); + } + } + } + } +} const GUIBaseVehicle::Seat& GUIBaseVehicle::getSeatPosition(int personIndex) const { @@ -942,19 +1049,22 @@ } } #ifdef DRAW_BOUNDING_BOX - GLHelper::pushName(getGlID()); - GLHelper::pushMatrix(); - glTranslated(0, 0, getType()); - PositionVector boundingBox = getBoundingBox(); - boundingBox.push_back(boundingBox.front()); - PositionVector smallBB = getBoundingPoly(); - glColor3d(0, .8, 0); - GLHelper::drawLine(boundingBox); - glColor3d(0.5, .8, 0); - GLHelper::drawLine(smallBB); - //GLHelper::drawBoxLines(getBoundingBox(), 0.5); - GLHelper::popMatrix(); - GLHelper::popName(); + if (!MSGlobals::gUseMesoSim) { + MSVehicle& microVeh = dynamic_cast(myVehicle); + GLHelper::pushName(getGlID()); + GLHelper::pushMatrix(); + glTranslated(0, 0, getType()); + PositionVector smallBB = microVeh.getBoundingPoly(); + glColor3d(0.5, .8, 0); + GLHelper::drawBoxLines(smallBB, 0.3); + glTranslated(0, 0, 0.1); + PositionVector boundingBox = microVeh.getBoundingBox(); + boundingBox.push_back(boundingBox.front()); + glColor3d(1, 0, 0); + GLHelper::drawBoxLines(boundingBox, 0.15); + GLHelper::popMatrix(); + GLHelper::popName(); + } #endif } diff -Nru sumo-1.11.0/src/guisim/GUIBaseVehicle.h sumo-1.12.0/src/guisim/GUIBaseVehicle.h --- sumo-1.11.0/src/guisim/GUIBaseVehicle.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIBaseVehicle.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -334,12 +334,16 @@ void drawStopLabels(const GUIVisualizationSettings& s, bool noLoop, const RGBColor& col) const; + void drawParkingInfo(const GUIVisualizationSettings& s, const RGBColor& col) const; /// @} const MSBaseVehicle& getVehicle() { return myVehicle; } + /// @brief gets the size multiplier value according to the current scheme index + double getScaleValue(const GUIVisualizationSettings& s, int activeScheme) const; + /// @brief sets the color according to the current scheme index and some vehicle function static bool setFunctionalColor(int activeScheme, const MSBaseVehicle* veh, RGBColor& col); diff -Nru sumo-1.11.0/src/guisim/GUIBusStop.cpp sumo-1.12.0/src/guisim/GUIBusStop.cpp --- sumo-1.11.0/src/guisim/GUIBusStop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIBusStop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -178,8 +178,8 @@ glTranslated(0, 0, getType()); GLHelper::setColor(color); const double exaggeration = getExaggeration(s); - const double offset = myWidth * 0.5 * MAX2(0.0, exaggeration - 1); - GLHelper::drawBoxLines(myFGShape, myFGShapeRotations, myFGShapeLengths, myWidth * 0.5 * exaggeration, 0, offset); + // only shrink the box but never enlarge it (only enlarge the sign) + GLHelper::drawBoxLines(myFGShape, myFGShapeRotations, myFGShapeLengths, myWidth * 0.5 * MIN2(1.0, exaggeration), 0, 0); // draw details unless zoomed out to far if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, exaggeration)) { GLHelper::pushMatrix(); @@ -227,7 +227,7 @@ } GLHelper::popMatrix(); } - if (s.addFullName.show && getMyName() != "") { + if (s.addFullName.show(this) && getMyName() != "") { GLHelper::drawTextSettings(s.addFullName, getMyName(), myFGSignPos, s.scale, s.getTextAngle(myFGSignRot), GLO_MAX - getType()); } GLHelper::popMatrix(); diff -Nru sumo-1.11.0/src/guisim/GUIBusStop.h sumo-1.12.0/src/guisim/GUIBusStop.h --- sumo-1.11.0/src/guisim/GUIBusStop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIBusStop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUICalibrator.cpp sumo-1.12.0/src/guisim/GUICalibrator.cpp --- sumo-1.11.0/src/guisim/GUICalibrator.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUICalibrator.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUICalibrator.h sumo-1.12.0/src/guisim/GUICalibrator.h --- sumo-1.11.0/src/guisim/GUICalibrator.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUICalibrator.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIChargingStation.cpp sumo-1.12.0/src/guisim/GUIChargingStation.cpp --- sumo-1.11.0/src/guisim/GUIChargingStation.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIChargingStation.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -149,7 +149,7 @@ GLHelper::setColor(s.colorSettings.chargingStationColor); } const double exaggeration = getExaggeration(s); - GLHelper::drawBoxLines(myFGShape, myFGShapeRotations, myFGShapeLengths, exaggeration); + GLHelper::drawBoxLines(myFGShape, myFGShapeRotations, myFGShapeLengths, MIN2(1.0, exaggeration)); // draw details unless zoomed out to far if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, exaggeration)) { @@ -184,7 +184,7 @@ GLHelper::popMatrix(); } - if (s.addFullName.show && getMyName() != "") { + if (s.addFullName.show(this) && getMyName() != "") { GLHelper::drawTextSettings(s.addFullName, getMyName(), myFGSignPos, s.scale, s.getTextAngle(myFGSignRot), GLO_MAX - getType()); } GLHelper::popMatrix(); diff -Nru sumo-1.11.0/src/guisim/GUIChargingStation.h sumo-1.12.0/src/guisim/GUIChargingStation.h --- sumo-1.11.0/src/guisim/GUIChargingStation.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIChargingStation.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIContainer.cpp sumo-1.12.0/src/guisim/GUIContainer.cpp --- sumo-1.11.0/src/guisim/GUIContainer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIContainer.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIContainer.h sumo-1.12.0/src/guisim/GUIContainer.h --- sumo-1.11.0/src/guisim/GUIContainer.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIContainer.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIDetectorWrapper.cpp sumo-1.12.0/src/guisim/GUIDetectorWrapper.cpp --- sumo-1.11.0/src/guisim/GUIDetectorWrapper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIDetectorWrapper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIDetectorWrapper.h sumo-1.12.0/src/guisim/GUIDetectorWrapper.h --- sumo-1.11.0/src/guisim/GUIDetectorWrapper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIDetectorWrapper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIE2Collector.cpp sumo-1.12.0/src/guisim/GUIE2Collector.cpp --- sumo-1.11.0/src/guisim/GUIE2Collector.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIE2Collector.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -143,7 +143,7 @@ ret->mkItem("started halts [#]", true, new FunctionBinding(&myDetector, &MSE2Collector::getCurrentStartedHalts)); // close building - ret->closeBuilding(); + ret->closeBuilding(&myDetector); return ret; } diff -Nru sumo-1.11.0/src/guisim/GUIE2Collector.h sumo-1.12.0/src/guisim/GUIE2Collector.h --- sumo-1.11.0/src/guisim/GUIE2Collector.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIE2Collector.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIE3Collector.cpp sumo-1.12.0/src/guisim/GUIE3Collector.cpp --- sumo-1.11.0/src/guisim/GUIE3Collector.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIE3Collector.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -83,7 +83,7 @@ ret->mkItem("haltings [#]", true, new FunctionBinding(&myDetector, &MSE3Collector::getCurrentHaltingNumber)); // close building - ret->closeBuilding(); + ret->closeBuilding(&myDetector); return ret; } diff -Nru sumo-1.11.0/src/guisim/GUIE3Collector.h sumo-1.12.0/src/guisim/GUIE3Collector.h --- sumo-1.11.0/src/guisim/GUIE3Collector.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIE3Collector.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIEdge.cpp sumo-1.12.0/src/guisim/GUIEdge.cpp --- sumo-1.11.0/src/guisim/GUIEdge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIEdge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -218,7 +218,7 @@ GUIEdge::getTypeParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this); - const MSNet::MesoEdgeType& edgeType = MSNet::getInstance()->getMesoType(getEdgeType()); + const MESegment::MesoEdgeType& edgeType = MSNet::getInstance()->getMesoType(getEdgeType()); // add items ret->mkItem("Type Information:", false, ""); ret->mkItem("type [id]", false, getEdgeType()); @@ -278,16 +278,17 @@ } GLHelper::popName(); // (optionally) draw the name and/or the street name - const bool drawEdgeName = s.edgeName.show && myFunction == SumoXMLEdgeFunc::NORMAL; - const bool drawInternalEdgeName = s.internalEdgeName.show && myFunction == SumoXMLEdgeFunc::INTERNAL; - const bool drawCwaEdgeName = s.cwaEdgeName.show && (myFunction == SumoXMLEdgeFunc::CROSSING || myFunction == SumoXMLEdgeFunc::WALKINGAREA); - const bool drawStreetName = s.streetName.show && myStreetName != ""; - const bool drawEdgeValue = s.edgeValue.show && (myFunction == SumoXMLEdgeFunc::NORMAL + GUILane* lane2 = dynamic_cast((*myLanes).back()); + const GUIGlObject* selCheck = gSelected.isSelected(this) ? (GUIGlObject*)this : (GUIGlObject*)lane2; + const bool drawEdgeName = s.edgeName.show(selCheck) && myFunction == SumoXMLEdgeFunc::NORMAL; + const bool drawInternalEdgeName = s.internalEdgeName.show(selCheck) && myFunction == SumoXMLEdgeFunc::INTERNAL; + const bool drawCwaEdgeName = s.cwaEdgeName.show(selCheck) && (myFunction == SumoXMLEdgeFunc::CROSSING || myFunction == SumoXMLEdgeFunc::WALKINGAREA); + const bool drawStreetName = s.streetName.show(selCheck) && myStreetName != ""; + const bool drawEdgeValue = s.edgeValue.show(selCheck) && (myFunction == SumoXMLEdgeFunc::NORMAL || (myFunction == SumoXMLEdgeFunc::INTERNAL && !s.drawJunctionShape) || ((myFunction == SumoXMLEdgeFunc::CROSSING || myFunction == SumoXMLEdgeFunc::WALKINGAREA) && s.drawCrossingsAndWalkingareas)); if (drawEdgeName || drawInternalEdgeName || drawCwaEdgeName || drawStreetName || drawEdgeValue) { GUILane* lane1 = dynamic_cast((*myLanes)[0]); - GUILane* lane2 = dynamic_cast((*myLanes).back()); if (lane1 != nullptr && lane2 != nullptr) { const bool spreadSuperposed = s.spreadSuperposed && getBidiEdge() != nullptr && lane2->drawAsRailway(s); Position p = lane1->getShape().positionAtOffset(lane1->getShape().length() / (double) 2.); @@ -302,11 +303,11 @@ } double angle = s.getTextAngle(lane1->getShape().rotationDegreeAtOffset(lane1->getShape().length() / (double) 2.) + 90); if (drawEdgeName) { - drawName(p, s.scale, s.edgeName, angle); + drawName(p, s.scale, s.edgeName, angle, true); } else if (drawInternalEdgeName) { - drawName(p, s.scale, s.internalEdgeName, angle); + drawName(p, s.scale, s.internalEdgeName, angle, true); } else if (drawCwaEdgeName) { - drawName(p, s.scale, s.cwaEdgeName, angle); + drawName(p, s.scale, s.cwaEdgeName, angle, true); } if (drawStreetName) { GLHelper::drawTextSettings(s.streetName, getStreetName(), p, s.scale, angle); diff -Nru sumo-1.11.0/src/guisim/GUIEdge.h sumo-1.12.0/src/guisim/GUIEdge.h --- sumo-1.11.0/src/guisim/GUIEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIEventControl.cpp sumo-1.12.0/src/guisim/GUIEventControl.cpp --- sumo-1.11.0/src/guisim/GUIEventControl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIEventControl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIEventControl.h sumo-1.12.0/src/guisim/GUIEventControl.h --- sumo-1.11.0/src/guisim/GUIEventControl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIEventControl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIInductLoop.cpp sumo-1.12.0/src/guisim/GUIInductLoop.cpp --- sumo-1.11.0/src/guisim/GUIInductLoop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIInductLoop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -121,7 +121,7 @@ ret->mkItem("empty time [s]", true, new FunctionBinding(&myDetector, &GUIInductLoop::getTimeSinceLastDetection)); // close building - ret->closeBuilding(); + ret->closeBuilding(&myDetector); return ret; } diff -Nru sumo-1.11.0/src/guisim/GUIInductLoop.h sumo-1.12.0/src/guisim/GUIInductLoop.h --- sumo-1.11.0/src/guisim/GUIInductLoop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIInductLoop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIInstantInductLoop.cpp sumo-1.12.0/src/guisim/GUIInstantInductLoop.cpp --- sumo-1.11.0/src/guisim/GUIInstantInductLoop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIInstantInductLoop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2003-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2003-2022 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/ @@ -95,7 +95,7 @@ ret->mkItem("lane", false, myDetector.getLane()->getID()); // values // close building - ret->closeBuilding(); + ret->closeBuilding(&myDetector); return ret; } diff -Nru sumo-1.11.0/src/guisim/GUIInstantInductLoop.h sumo-1.12.0/src/guisim/GUIInstantInductLoop.h --- sumo-1.11.0/src/guisim/GUIInstantInductLoop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIInstantInductLoop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIJunctionWrapper.cpp sumo-1.12.0/src/guisim/GUIJunctionWrapper.cpp --- sumo-1.11.0/src/guisim/GUIJunctionWrapper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIJunctionWrapper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -178,19 +178,19 @@ drawName(myJunction.getPosition(), s.scale, s.internalJunctionName, s.angle); } else { drawName(myJunction.getPosition(), s.scale, s.junctionID, s.angle); - if (s.junctionName.show && myJunction.getName() != "") { + if (s.junctionName.show(this) && myJunction.getName() != "") { GLHelper::drawTextSettings(s.junctionName, myJunction.getName(), myJunction.getPosition(), s.scale, s.angle); } - if ((s.tlsPhaseIndex.show || s.tlsPhaseName.show) && myTLLID != "") { + if ((s.tlsPhaseIndex.show(this) || s.tlsPhaseName.show(this)) && myTLLID != "") { const MSTrafficLightLogic* active = MSNet::getInstance()->getTLSControl().getActive(myTLLID); - if (s.tlsPhaseIndex.show) { + if (s.tlsPhaseIndex.show(this)) { const int index = active->getCurrentPhaseIndex(); GLHelper::drawTextSettings(s.tlsPhaseIndex, toString(index), myJunction.getPosition(), s.scale, s.angle); } - if (s.tlsPhaseName.show) { + if (s.tlsPhaseName.show(this)) { const std::string& name = active->getCurrentPhaseDef().getName(); if (name != "") { - const Position offset = (s.tlsPhaseIndex.show ? + const Position offset = (s.tlsPhaseIndex.show(this) ? Position(0, 0.8 * s.tlsPhaseIndex.scaledSize(s.scale)).rotateAround2D(DEG2RAD(-s.angle), Position(0, 0)) : Position(0, 0)); GLHelper::drawTextSettings(s.tlsPhaseName, name, myJunction.getPosition() - offset, s.scale, s.angle); diff -Nru sumo-1.11.0/src/guisim/GUIJunctionWrapper.h sumo-1.12.0/src/guisim/GUIJunctionWrapper.h --- sumo-1.11.0/src/guisim/GUIJunctionWrapper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIJunctionWrapper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUILane.cpp sumo-1.12.0/src/guisim/GUILane.cpp --- sumo-1.11.0/src/guisim/GUILane.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUILane.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -79,6 +80,7 @@ const std::string& type) : MSLane(id, maxSpeed, length, edge, numericalID, shape, width, permissions, changeLeft, changeRight, index, isRampAccel, type), GUIGlObject(GLO_LANE, id), + myParkingAreas(nullptr), #ifdef HAVE_OSG myGeom(0), #endif @@ -110,6 +112,7 @@ if (myLock.locked()) { myLock.unlock(); } + delete myParkingAreas; } @@ -663,10 +666,10 @@ drawArrows(); } glTranslated(0, 0, 1000); - if (s.drawLinkJunctionIndex.show) { + if (s.drawLinkJunctionIndex.show(nullptr)) { drawLinkNo(s); } - if (s.drawLinkTLIndex.show) { + if (s.drawLinkTLIndex.show(nullptr)) { drawTLSLinkNo(s, *net); } glTranslated(0, 0, -1000); @@ -729,40 +732,7 @@ if (myIndex > 0 && (myEdge->getLanes()[myIndex - 1]->getPermissions() & myPermissions) != 0) { const bool cl = myEdge->getLanes()[myIndex - 1]->allowsChangingLeft(SVC_PASSENGER); const bool cr = allowsChangingRight(SVC_PASSENGER); - double mw = (myHalfLaneWidth + SUMO_const_laneMarkWidth * (cl ? 0.6 : 0.2)) * scale; - double mw2 = (myHalfLaneWidth - SUMO_const_laneMarkWidth * (cr ? 0.6 : 0.2)) * scale; - if (cl || cr) { - if (MSGlobals::gLefthand) { - mw *= -1; - mw2 *= -1; - } - int e = (int) getShape().size() - 1; - for (int i = 0; i < e; ++i) { - GLHelper::pushMatrix(); - glTranslated(getShape()[i].x(), getShape()[i].y(), 2.1); - glRotated(myShapeRotations[i], 0, 0, 1); - for (double t = 0; t < myShapeLengths[i]; t += 6) { - const double length = MIN2((double)3, myShapeLengths[i] - t); - glBegin(GL_QUADS); - glVertex2d(-mw, -t); - glVertex2d(-mw, -t - length); - glVertex2d(-mw2, -t - length); - glVertex2d(-mw2, -t); - glEnd(); - if (!cl || !cr) { - // draw inverse marking between asymmetrical lane markings - const double length2 = MIN2((double)6, myShapeLengths[i] - t); - glBegin(GL_QUADS); - glVertex2d(-myHalfLaneWidth + 0.02, -t - length2); - glVertex2d(-myHalfLaneWidth + 0.02, -t - length); - glVertex2d(-myHalfLaneWidth - 0.02, -t - length); - glVertex2d(-myHalfLaneWidth - 0.02, -t - length2); - glEnd(); - } - } - GLHelper::popMatrix(); - } - } + GLHelper::drawInverseMarkings(getShape(), myShapeRotations, myShapeLengths, 3, 6, myHalfLaneWidth, cl, cr, MSGlobals::gLefthand, scale); } // draw white boundings and white markings glColor3d(1, 1, 1); @@ -1338,6 +1308,22 @@ case 37: { return myRNGIndex % MSGlobals::gNumSimThreads; } + case 38: { + if (myParkingAreas == nullptr) { + // init + myParkingAreas = new std::vector(); + for (auto& item : MSNet::getInstance()->getStoppingPlaces(SUMO_TAG_PARKING_AREA)) { + if (&item.second->getLane().getEdge() == myEdge) { + myParkingAreas->push_back(dynamic_cast(item.second)); + } + } + } + int capacity = 0; + for (MSParkingArea* pa : *myParkingAreas) { + capacity += pa->getCapacity() - pa->getOccupancy(); + } + return capacity; + } } return 0; } diff -Nru sumo-1.11.0/src/guisim/GUILane.h sumo-1.12.0/src/guisim/GUILane.h --- sumo-1.11.0/src/guisim/GUILane.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUILane.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -363,6 +363,9 @@ /// @brief the time distance from a particular edge double myReachability; + /// @brief list of parkingAreas on this lane + mutable std::vector* myParkingAreas; + #ifdef HAVE_OSG osg::Geometry* myGeom; #endif diff -Nru sumo-1.11.0/src/guisim/GUILaneSpeedTrigger.cpp sumo-1.12.0/src/guisim/GUILaneSpeedTrigger.cpp --- sumo-1.11.0/src/guisim/GUILaneSpeedTrigger.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUILaneSpeedTrigger.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUILaneSpeedTrigger.h sumo-1.12.0/src/guisim/GUILaneSpeedTrigger.h --- sumo-1.11.0/src/guisim/GUILaneSpeedTrigger.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUILaneSpeedTrigger.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUINet.cpp sumo-1.12.0/src/guisim/GUINet.cpp --- sumo-1.11.0/src/guisim/GUINet.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUINet.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -142,11 +142,9 @@ void GUINet::initTLMap() { - // get the list of loaded tl-logics - const std::vector& logics = getTLSControl().getAllLogics(); - // go through the logics - for (std::vector::const_iterator i = logics.begin(); i != logics.end(); ++i) { - createTLWrapper(*i); + // go through the loaded tl-logics + for (MSTrafficLightLogic* const tll : getTLSControl().getAllLogics()) { + createTLWrapper(tll); } } @@ -174,7 +172,6 @@ } myGrid.addAdditionalGLObject(tllw); myLogics2Wrapper[tll] = tllw; - return; } diff -Nru sumo-1.11.0/src/guisim/GUINet.h sumo-1.12.0/src/guisim/GUINet.h --- sumo-1.11.0/src/guisim/GUINet.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUINet.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIOverheadWire.cpp sumo-1.12.0/src/guisim/GUIOverheadWire.cpp --- sumo-1.11.0/src/guisim/GUIOverheadWire.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIOverheadWire.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIOverheadWire.h sumo-1.12.0/src/guisim/GUIOverheadWire.h --- sumo-1.11.0/src/guisim/GUIOverheadWire.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIOverheadWire.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIParkingArea.cpp sumo-1.12.0/src/guisim/GUIParkingArea.cpp --- sumo-1.11.0/src/guisim/GUIParkingArea.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIParkingArea.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -126,9 +126,9 @@ // draw the area glTranslated(0, 0, getType()); GLHelper::setColor(blue); - GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, myWidth / 2.); - // draw details unless zoomed out to far const double exaggeration = getExaggeration(s); + GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, myWidth / 2. * MIN2(1.0, exaggeration)); + // draw details unless zoomed out to far if (s.scale * exaggeration >= 1) { // draw the lots glTranslated(0, 0, .1); @@ -179,7 +179,7 @@ } } GLHelper::popMatrix(); - if (s.addFullName.show && getMyName() != "") { + if (s.addFullName.show(this) && getMyName() != "") { GLHelper::drawTextSettings(s.addFullName, getMyName(), mySignPos, s.scale, s.getTextAngle(mySignRot), GLO_MAX - getType()); } GLHelper::popName(); diff -Nru sumo-1.11.0/src/guisim/GUIParkingArea.h sumo-1.12.0/src/guisim/GUIParkingArea.h --- sumo-1.11.0/src/guisim/GUIParkingArea.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIParkingArea.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -133,6 +133,9 @@ void drawGL(const GUIVisualizationSettings& s) const; //@} + const Position& getSignPos() const { + return mySignPos; + } private: /// @brief The rotations of the shape parts diff -Nru sumo-1.11.0/src/guisim/GUIPerson.cpp sumo-1.12.0/src/guisim/GUIPerson.cpp --- sumo-1.11.0/src/guisim/GUIPerson.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIPerson.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -227,6 +228,7 @@ ret->mkItem("stage index", true, new FunctionBindingString(this, &GUIPerson::getStageIndexDescription)); ret->mkItem("start edge [id]", true, new FunctionBindingString(this, &GUIPerson::getFromEdgeID)); ret->mkItem("dest edge [id]", true, new FunctionBindingString(this, &GUIPerson::getDestinationEdgeID)); + ret->mkItem("dest stop [id]", true, new FunctionBindingString(this, &GUIPerson::getDestinationStopID)); ret->mkItem("arrivalPos [m]", true, new FunctionBinding(this, &GUIPerson::getStageArrivalPos)); ret->mkItem("edge [id]", true, new FunctionBindingString(this, &GUIPerson::getEdgeID)); ret->mkItem("position [m]", true, new FunctionBinding(this, &GUIPerson::getEdgePos)); @@ -234,6 +236,8 @@ ret->mkItem("speed factor", false, getSpeedFactor()); ret->mkItem("angle [degree]", true, new FunctionBinding(this, &GUIPerson::getNaviDegree)); ret->mkItem("waiting time [s]", true, new FunctionBinding(this, &GUIPerson::getWaitingSeconds)); + ret->mkItem("vehicle [id]", true, new FunctionBindingString(this, &GUIPerson::getVehicleID)); + ret->mkItem("stop duration [s]", true, new FunctionBinding(this, &GUIPerson::getStopDuration)); ret->mkItem("desired depart [s]", false, time2string(getParameter().depart)); // close building ret->closeBuilding(&getParameter()); @@ -308,7 +312,7 @@ drawAction_drawWalkingareaPath(s); #endif drawName(p1, s.scale, s.personName, s.angle); - if (s.personValue.show) { + if (s.personValue.show(this)) { Position p2 = p1 + Position(0, 0.6 * s.personName.scaledSize(s.scale)); const double value = getColorValue(s, s.personColorer.getActive()); GLHelper::drawTextSettings(s.personValue, toString(value), p2, s.scale, s.angle, GLO_MAX - getType()); @@ -601,6 +605,50 @@ } +std::string +GUIPerson::getDestinationStopID() const { + FXMutexLock locker(myLock); + if (hasArrived()) { + return ""; + } + MSStoppingPlace* destStop = getCurrentStage()->getDestinationStop(); + if (destStop != nullptr) { + return destStop->getID(); + } else { + return ""; + } +} + + +std::string +GUIPerson::getVehicleID() const { + FXMutexLock locker(myLock); + if (hasArrived()) { + return ""; + } + SUMOVehicle* veh = getCurrentStage()->getVehicle(); + if (veh != nullptr) { + return veh->getID(); + } else { + return ""; + } +} + + +double +GUIPerson::getStopDuration() const { + FXMutexLock locker(myLock); + if (hasArrived()) { + return -1; + } + if (getCurrentStage()->getStageType() == MSStageType::WAITING) { + return STEPS2TIME(dynamic_cast(getCurrentStage())->getStopEnd() - SIMSTEP); + } else { + return -1; + } +} + + double GUIPerson::getStageArrivalPos() const { FXMutexLock locker(myLock); @@ -612,13 +660,10 @@ bool GUIPerson::proceed(MSNet* net, SUMOTime time, const bool vehicleArrived) { - const MSEdge* current = getEdge(); // acquire lock before locking the person to avoid mutual deadlock (#9468) - current->lock(); + ScopedLocker edgeLocker(*getEdge()); FXMutexLock locker(myLock); - const bool planContinues = MSTransportable::proceed(net, time, vehicleArrived); - current->unlock(); - return planContinues; + return MSTransportable::proceed(net, time, vehicleArrived); } // ------------------------------------------------------------------------- diff -Nru sumo-1.11.0/src/guisim/GUIPerson.h sumo-1.12.0/src/guisim/GUIPerson.h --- sumo-1.11.0/src/guisim/GUIPerson.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIPerson.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -156,6 +156,15 @@ /// @brief get destination edge ID std::string getDestinationEdgeID() const; + /// @brief get destination stop ID + std::string getDestinationStopID() const; + + /// @brief get current vehicle id if applicable + std::string getVehicleID() const; + + /// @brief get remaining duration of current stop or -1 + double getStopDuration() const; + /// @brief get stage arrival position double getStageArrivalPos() const; diff -Nru sumo-1.11.0/src/guisim/GUITrafficLightLogicWrapper.cpp sumo-1.12.0/src/guisim/GUITrafficLightLogicWrapper.cpp --- sumo-1.11.0/src/guisim/GUITrafficLightLogicWrapper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUITrafficLightLogicWrapper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -118,6 +119,7 @@ } } } + myParent->update(); return 1; } @@ -126,6 +128,7 @@ FXObject*, FXSelector /*sel*/, void*) { assert(myObject->getType() == GLO_TLLOGIC); static_cast(myObject)->switchTLSLogic(-1); + myParent->update(); return 1; } @@ -135,6 +138,7 @@ FXObject*, FXSelector sel, void*) { assert(myObject->getType() == GLO_TLLOGIC); static_cast(myObject)->switchTLSLogic(FXSELID(sel) - MID_SWITCH); + myParent->update(); return 1; } @@ -166,14 +170,17 @@ std::vector::const_iterator i; int index = 0; for (i = logics.begin(); i != logics.end(); ++i, ++index) { - if (!vars.isActive(*i)) { + if (!vars.isActive(*i) && dynamic_cast(*i) == nullptr) { GUIDesigns::buildFXMenuCommand(ret, ("Switch to '" + (*i)->getProgramID() + "'").c_str(), GUIIconSubSys::getIcon(GUIIcon::FLAG_MINUS), ret, (FXSelector)(MID_SWITCH + index)); } } new FXMenuSeparator(ret); } - GUIDesigns::buildFXMenuCommand(ret, "Switch off", GUIIconSubSys::getIcon(GUIIcon::FLAG_MINUS), ret, MID_SWITCH_OFF); + MSOffTrafficLightLogic* offLogic = dynamic_cast(&myTLLogic); + if (offLogic == nullptr) { + GUIDesigns::buildFXMenuCommand(ret, "Switch off", GUIIconSubSys::getIcon(GUIIcon::FLAG_MINUS), ret, MID_SWITCH_OFF); + } GUIDesigns::buildFXMenuCommand(ret, "Track Phases", nullptr, ret, MID_TRACKPHASES); GUIDesigns::buildFXMenuCommand(ret, "Show Phases", nullptr, ret, MID_SHOWPHASES); MSActuatedTrafficLightLogic* act = dynamic_cast(&myTLLogic); @@ -239,6 +246,10 @@ ret->mkItem("minDur", true, new FunctionBinding(this, &GUITrafficLightLogicWrapper::getCurrentMinDur)); ret->mkItem("maxDur", true, new FunctionBinding(this, &GUITrafficLightLogicWrapper::getCurrentMaxDur)); ret->mkItem("running duration", true, new FunctionBinding(this, &GUITrafficLightLogicWrapper::getRunningDuration)); + ret->mkItem("earliestEnd", true, new FunctionBinding(this, &GUITrafficLightLogicWrapper::getCurrentEarliestEnd)); + ret->mkItem("latestEnd", true, new FunctionBinding(this, &GUITrafficLightLogicWrapper::getCurrentLatestEnd)); + ret->mkItem("time in cycle", true, new FunctionBinding(this, &GUITrafficLightLogicWrapper::getCurrentTimeInCycle)); + ret->mkItem("cycle time", true, new FunctionBinding(this, &GUITrafficLightLogicWrapper::getDefaultCycleTime)); MSRailSignal* rs = dynamic_cast(&myTLLogic); if (rs != nullptr) { ret->mkItem("blocking", true, new FunctionBindingString(rs, &MSRailSignal::getBlockingVehicleIDs)); @@ -374,6 +385,28 @@ } int +GUITrafficLightLogicWrapper::getCurrentEarliestEnd() const { + const SUMOTime earliestEnd = getActiveTLLogic()->getCurrentPhaseDef().earliestEnd; + return earliestEnd == MSPhaseDefinition::UNSPECIFIED_DURATION ? -1 : (int)STEPS2TIME(earliestEnd); +} + +int +GUITrafficLightLogicWrapper::getCurrentLatestEnd() const { + const SUMOTime latestEnd = getActiveTLLogic()->getCurrentPhaseDef().latestEnd; + return latestEnd == MSPhaseDefinition::UNSPECIFIED_DURATION ? -1 : (int)STEPS2TIME(latestEnd); +} + +int +GUITrafficLightLogicWrapper::getDefaultCycleTime() const { + return (int)STEPS2TIME(getActiveTLLogic()->getDefaultCycleTime()); +} + +int +GUITrafficLightLogicWrapper::getCurrentTimeInCycle() const { + return (int)STEPS2TIME(getActiveTLLogic()->getTimeInCycle()); +} + +int GUITrafficLightLogicWrapper::getRunningDuration() const { return (int)(SIMTIME - STEPS2TIME(getActiveTLLogic()->getCurrentPhaseDef().myLastSwitch)); } diff -Nru sumo-1.11.0/src/guisim/GUITrafficLightLogicWrapper.h sumo-1.12.0/src/guisim/GUITrafficLightLogicWrapper.h --- sumo-1.11.0/src/guisim/GUITrafficLightLogicWrapper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUITrafficLightLogicWrapper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -119,6 +119,10 @@ int getCurrentDuration() const; int getCurrentMinDur() const; int getCurrentMaxDur() const; + int getCurrentEarliestEnd() const; + int getCurrentLatestEnd() const; + int getDefaultCycleTime() const; + int getCurrentTimeInCycle() const; int getRunningDuration() const; public: diff -Nru sumo-1.11.0/src/guisim/GUITransportableControl.cpp sumo-1.12.0/src/guisim/GUITransportableControl.cpp --- sumo-1.11.0/src/guisim/GUITransportableControl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUITransportableControl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUITransportableControl.h sumo-1.12.0/src/guisim/GUITransportableControl.h --- sumo-1.11.0/src/guisim/GUITransportableControl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUITransportableControl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUITriggeredRerouter.cpp sumo-1.12.0/src/guisim/GUITriggeredRerouter.cpp --- sumo-1.11.0/src/guisim/GUITriggeredRerouter.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUITriggeredRerouter.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -392,12 +392,16 @@ const std::vector& lanes = edge->getLanes(); myFGPositions.reserve(lanes.size()); myFGRotations.reserve(lanes.size()); - for (std::vector::const_iterator i = lanes.begin(); i != lanes.end(); ++i) { - const PositionVector& v = (*i)->getShape(); - const double pos = edgeType == REROUTER_TRIGGER_EDGE ? v.length() - (double) 6. : 3; - myFGPositions.push_back((*i)->geometryPositionAtOffset(pos)); + for (const MSLane* lane : lanes) { + if ((lane->getPermissions() & ~SVC_PEDESTRIAN) == 0) { + continue; + } + const PositionVector& v = lane->getShape(); + const double pos = edgeType == REROUTER_TRIGGER_EDGE ? MAX2(0.0, v.length() - 6) : MIN2(v.length(), 3.0); + myFGPositions.push_back(v.positionAtOffset(pos)); myFGRotations.push_back(-v.rotationDegreeAtOffset(pos)); myBoundary.add(myFGPositions.back()); + myHalfWidths.push_back(lane->getWidth() * 0.5 * 0.875); } } @@ -475,6 +479,7 @@ for (int i = 0; i < (int)myFGPositions.size(); ++i) { const Position& pos = myFGPositions[i]; double rot = myFGRotations[i]; + const double w = myHalfWidths[i]; GLHelper::pushMatrix(); glTranslated(pos.x(), pos.y(), 0); glRotated(rot, 0, 0, 1); @@ -485,16 +490,16 @@ glBegin(GL_TRIANGLES); glColor3d(1, .8f, 0); // base - glVertex2d(0 - 1.4, 0); - glVertex2d(0 - 1.4, 6); - glVertex2d(0 + 1.4, 6); - glVertex2d(0 + 1.4, 0); - glVertex2d(0 - 1.4, 0); - glVertex2d(0 + 1.4, 6); + glVertex2d(0 - w, 0); + glVertex2d(0 - w, 6); + glVertex2d(0 + w, 6); + glVertex2d(0 + w, 0); + glVertex2d(0 - w, 0); + glVertex2d(0 + w, 6); glEnd(); // draw "U" - GLHelper::drawText("U", Position(0, 2), .1, 3, RGBColor::BLACK, 180); + GLHelper::drawText("U", Position(0, 2), .1, 3 * (w / 1.4), RGBColor::BLACK, 180); // draw Probability GLHelper::drawText((toString((int)(prob * 100)) + "%").c_str(), Position(0, 4), .1, 0.7, RGBColor::BLACK, 180); @@ -509,6 +514,7 @@ for (int i = 0; i < (int)myFGPositions.size(); ++i) { const Position& pos = myFGPositions[i]; double rot = myFGRotations[i]; + const double w = myHalfWidths[i]; GLHelper::pushMatrix(); glTranslated(pos.x(), pos.y(), 0); glRotated(rot, 0, 0, 1); @@ -520,10 +526,10 @@ glColor3d(0, 1, 1); // base glVertex2d(0 - 0.0, 0); - glVertex2d(0 - 1.4, 6); - glVertex2d(0 + 1.4, 6); + glVertex2d(0 - w, 6); + glVertex2d(0 + w, 6); glVertex2d(0 + 0.0, 0); - glVertex2d(0 + 1.4, 6); + glVertex2d(0 + w, 6); glEnd(); // draw "P" diff -Nru sumo-1.11.0/src/guisim/GUITriggeredRerouter.h sumo-1.12.0/src/guisim/GUITriggeredRerouter.h --- sumo-1.11.0/src/guisim/GUITriggeredRerouter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUITriggeredRerouter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -213,6 +213,9 @@ /// The boundary of this rerouter Boundary myBoundary; + /// The sign half-widths + std::vector myHalfWidths; + /// @brief the index for this in edge in routeProbs int myDistIndex; }; diff -Nru sumo-1.11.0/src/guisim/GUIVehicleControl.cpp sumo-1.12.0/src/guisim/GUIVehicleControl.cpp --- sumo-1.11.0/src/guisim/GUIVehicleControl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIVehicleControl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIVehicleControl.h sumo-1.12.0/src/guisim/GUIVehicleControl.h --- sumo-1.11.0/src/guisim/GUIVehicleControl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIVehicleControl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2003-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2003-2022 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/ diff -Nru sumo-1.11.0/src/guisim/GUIVehicle.cpp sumo-1.12.0/src/guisim/GUIVehicle.cpp --- sumo-1.11.0/src/guisim/GUIVehicle.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIVehicle.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -111,7 +111,7 @@ ret->mkItem("target lane [id]", true, new FunctionBindingString(this, &GUIVehicle::getTargetLaneID)); } if (isSelected()) { - ret->mkItem("back lane [id]", true, new FunctionBindingString(this, &GUIVehicle::getBackLaneID)); + ret->mkItem("back lanes [id,..]", true, new FunctionBindingString(this, &GUIVehicle::getBackLaneIDs)); } ret->mkItem("position [m]", true, new FunctionBinding(this, &MSVehicle::getPositionOnLane)); @@ -230,6 +230,7 @@ ret->mkItem("apparent deceleration [m/s^2]", false, getCarFollowModel().getApparentDecel()); ret->mkItem("imperfection (sigma)", false, getCarFollowModel().getImperfection()); ret->mkItem("desired headway (tau)", false, getCarFollowModel().getHeadwayTime()); + ret->mkItem("speedFactor", false, myType->getParameter().speedFactor.toStr(gPrecision)); if (myType->getParameter().wasSet(VTYPEPARS_ACTIONSTEPLENGTH_SET)) { ret->mkItem("action step length [s]", false, myType->getActionStepLengthSecs()); } @@ -295,7 +296,8 @@ GUIVehicle::drawAction_drawCarriageClass(const GUIVisualizationSettings& s, bool asImage) const { RGBColor current = GLHelper::getColor(); RGBColor darker = current.changedBrightness(-51); - const double exaggeration = s.vehicleSize.getExaggeration(s, this); + const double exaggeration = (s.vehicleSize.getExaggeration(s, this) + * s.vehicleScaler.getScheme().getColor(getScaleValue(s, s.vehicleScaler.getActive()))); const double totalLength = getVType().getLength(); double upscaleLength = exaggeration; if (exaggeration > 1 && totalLength > 5) { @@ -327,8 +329,8 @@ carriageLength = carriageLengthWithGap - carriageGap; } const int firstPassengerCarriage = defaultLength == locomotiveLength || numCarriages == 1 || (getVClass() & SVC_RAIL_CLASSES) == 0 ? 0 : 1; - const int noPersonsBackCarriages = (getVehicleType().getGuiShape() == SVS_TRUCK_SEMITRAILER || getVehicleType().getGuiShape() == SVS_TRUCK_1TRAILER) ? 1 : 0; - const int firstContainerCarriage = numCarriages == 1 || getVehicleType().getGuiShape() == SVS_TRUCK_1TRAILER ? 0 : 1; + const int noPersonsBackCarriages = (getVehicleType().getGuiShape() == SUMOVehicleShape::TRUCK_SEMITRAILER || getVehicleType().getGuiShape() == SUMOVehicleShape::TRUCK_1TRAILER) && numCarriages > 1 ? 1 : 0; + const int firstContainerCarriage = numCarriages == 1 || getVehicleType().getGuiShape() == SUMOVehicleShape::TRUCK_1TRAILER ? 0 : 1; const int seatsPerCarriage = (int)ceil(getVType().getPersonCapacity() / (numCarriages - firstPassengerCarriage - noPersonsBackCarriages)); const int containersPerCarriage = (int)ceil(getVType().getContainerCapacity() / (numCarriages - firstContainerCarriage)); // lane on which the carriage front is situated @@ -400,8 +402,8 @@ glRotated(angle, 0, 0, 1); if (!asImage || !GUIBaseVehicleHelper::drawAction_drawVehicleAsImage(s, getVType().getImgFile(), this, getVType().getWidth(), curCLength / exaggeration)) { switch (getVType().getGuiShape()) { - case SVS_TRUCK_SEMITRAILER: - case SVS_TRUCK_1TRAILER: + case SUMOVehicleShape::TRUCK_SEMITRAILER: + case SUMOVehicleShape::TRUCK_1TRAILER: if (i == 0) { GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly(s, getVType().getGuiShape(), getVType().getWidth() * exaggeration, curCLength, i); } else { @@ -433,7 +435,7 @@ carriageOffset -= (curCLength + carriageGap); carriageBackOffset -= carriageLengthWithGap; } - if (getVType().getGuiShape() == SVS_RAIL_CAR) { + if (getVType().getGuiShape() == SUMOVehicleShape::RAIL_CAR) { GLHelper::pushMatrix(); glTranslated(front.x(), front.y(), getType()); glRotated(angle, 0, 0, 1); @@ -703,6 +705,7 @@ } } drawStopLabels(s, noLoop, col); + drawParkingInfo(s, col); } @@ -949,8 +952,8 @@ } std::string -GUIVehicle::getBackLaneID() const { - return myFurtherLanes.size() > 0 ? myFurtherLanes.back()->getID() : getLaneID(); +GUIVehicle::getBackLaneIDs() const { + return toString(myFurtherLanes); } std::string diff -Nru sumo-1.11.0/src/guisim/GUIVehicle.h sumo-1.12.0/src/guisim/GUIVehicle.h --- sumo-1.11.0/src/guisim/GUIVehicle.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim/GUIVehicle.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -148,7 +148,7 @@ /// @brief return vehicle lane id std::string getLaneID() const; - std::string getBackLaneID() const; + std::string getBackLaneIDs() const; std::string getShadowLaneID() const; std::string getTargetLaneID() const; diff -Nru sumo-1.11.0/src/guisim_main.cpp sumo-1.12.0/src/guisim_main.cpp --- sumo-1.11.0/src/guisim_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/guisim_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/jtrrouter/CMakeLists.txt sumo-1.12.0/src/jtrrouter/CMakeLists.txt --- sumo-1.11.0/src/jtrrouter/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/jtrrouter/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -16,6 +16,6 @@ set_target_properties(jtrrouter PROPERTIES OUTPUT_NAME jtrrouter${BINARY_SUFFIX}) set_target_properties(jtrrouter PROPERTIES OUTPUT_NAME_DEBUG jtrrouter${BINARY_SUFFIX}D) target_link_libraries(jtrrouter router ${commonvehiclelibs}) -add_dependencies(jtrrouter generate-version-h) +add_dependencies(jtrrouter generate-version-h install_dll) install(TARGETS jtrrouter RUNTIME DESTINATION bin) diff -Nru sumo-1.11.0/src/jtrrouter/jtrrouter_main.cpp sumo-1.12.0/src/jtrrouter/jtrrouter_main.cpp --- sumo-1.11.0/src/jtrrouter/jtrrouter_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/jtrrouter/jtrrouter_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/jtrrouter/ROJTREdgeBuilder.cpp sumo-1.12.0/src/jtrrouter/ROJTREdgeBuilder.cpp --- sumo-1.11.0/src/jtrrouter/ROJTREdgeBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/jtrrouter/ROJTREdgeBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/jtrrouter/ROJTREdgeBuilder.h sumo-1.12.0/src/jtrrouter/ROJTREdgeBuilder.h --- sumo-1.11.0/src/jtrrouter/ROJTREdgeBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/jtrrouter/ROJTREdgeBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/jtrrouter/ROJTREdge.cpp sumo-1.12.0/src/jtrrouter/ROJTREdge.cpp --- sumo-1.11.0/src/jtrrouter/ROJTREdge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/jtrrouter/ROJTREdge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/jtrrouter/ROJTREdge.h sumo-1.12.0/src/jtrrouter/ROJTREdge.h --- sumo-1.11.0/src/jtrrouter/ROJTREdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/jtrrouter/ROJTREdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/jtrrouter/ROJTRFrame.cpp sumo-1.12.0/src/jtrrouter/ROJTRFrame.cpp --- sumo-1.11.0/src/jtrrouter/ROJTRFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/jtrrouter/ROJTRFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/jtrrouter/ROJTRFrame.h sumo-1.12.0/src/jtrrouter/ROJTRFrame.h --- sumo-1.11.0/src/jtrrouter/ROJTRFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/jtrrouter/ROJTRFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/jtrrouter/ROJTRRouter.cpp sumo-1.12.0/src/jtrrouter/ROJTRRouter.cpp --- sumo-1.11.0/src/jtrrouter/ROJTRRouter.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/jtrrouter/ROJTRRouter.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/jtrrouter/ROJTRRouter.h sumo-1.12.0/src/jtrrouter/ROJTRRouter.h --- sumo-1.11.0/src/jtrrouter/ROJTRRouter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/jtrrouter/ROJTRRouter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/jtrrouter/ROJTRTurnDefLoader.cpp sumo-1.12.0/src/jtrrouter/ROJTRTurnDefLoader.cpp --- sumo-1.11.0/src/jtrrouter/ROJTRTurnDefLoader.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/jtrrouter/ROJTRTurnDefLoader.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/jtrrouter/ROJTRTurnDefLoader.h sumo-1.12.0/src/jtrrouter/ROJTRTurnDefLoader.h --- sumo-1.11.0/src/jtrrouter/ROJTRTurnDefLoader.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/jtrrouter/ROJTRTurnDefLoader.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/BusStop.cpp sumo-1.12.0/src/libsumo/BusStop.cpp --- sumo-1.11.0/src/libsumo/BusStop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/BusStop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/BusStop.h sumo-1.12.0/src/libsumo/BusStop.h --- sumo-1.11.0/src/libsumo/BusStop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/BusStop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Calibrator.cpp sumo-1.12.0/src/libsumo/Calibrator.cpp --- sumo-1.11.0/src/libsumo/Calibrator.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Calibrator.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Calibrator.h sumo-1.12.0/src/libsumo/Calibrator.h --- sumo-1.11.0/src/libsumo/Calibrator.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Calibrator.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/ChargingStation.cpp sumo-1.12.0/src/libsumo/ChargingStation.cpp --- sumo-1.11.0/src/libsumo/ChargingStation.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/ChargingStation.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/ChargingStation.h sumo-1.12.0/src/libsumo/ChargingStation.h --- sumo-1.11.0/src/libsumo/ChargingStation.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/ChargingStation.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/CMakeLists.txt sumo-1.12.0/src/libsumo/CMakeLists.txt --- sumo-1.11.0/src/libsumo/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -63,7 +63,7 @@ ) add_library(libsumostatic STATIC ${libsumostatic_STAT_SRCS}) -add_dependencies(libsumostatic generate-version-h) +add_dependencies(libsumostatic generate-version-h install_dll) set_property(TARGET libsumostatic PROPERTY FOLDER "libsumo") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/bin) @@ -75,6 +75,8 @@ set_target_properties(libsumocpp PROPERTIES OUTPUT_NAME_DEBUG libsumocpp${BINARY_SUFFIX}D) target_include_directories(libsumocpp PUBLIC $) install(TARGETS libsumocpp EXPORT SUMOConfig + DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) diff -Nru sumo-1.11.0/src/libsumo/Edge.cpp sumo-1.12.0/src/libsumo/Edge.cpp --- sumo-1.11.0/src/libsumo/Edge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Edge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Edge.h sumo-1.12.0/src/libsumo/Edge.h --- sumo-1.11.0/src/libsumo/Edge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Edge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/GUI.h sumo-1.12.0/src/libsumo/GUI.h --- sumo-1.11.0/src/libsumo/GUI.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/GUI.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Helper.cpp sumo-1.12.0/src/libsumo/Helper.cpp --- sumo-1.11.0/src/libsumo/Helper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Helper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ @@ -1020,6 +1020,10 @@ void Helper::applySubscriptionFilterLanes(const Subscription& s, std::set& vehs, std::vector& filterLanes, double downstreamDist, double upstreamDist, bool disregardOppositeDirection) { + if (!s.isVehicleToVehicleContextSubscription()) { + WRITE_WARNINGF("Lanes filter is only feasible for context domain 'vehicle' (current is '%'), ignoring filter...", toHex(s.contextDomain, 2)); + return; + } assert(filterLanes.size() > 0); MSVehicle* v = dynamic_cast(getVehicle(s.id)); const MSLane* vehLane = v->getLane(); @@ -1113,6 +1117,10 @@ void Helper::applySubscriptionFilterTurn(const Subscription& s, std::set& vehs) { + if (!s.isVehicleToVehicleContextSubscription()) { + WRITE_WARNINGF("Turn filter is only feasible for context domain 'vehicle' (current is '%'), ignoring filter...", toHex(s.contextDomain, 2)); + return; + } // Get upcoming junctions and vialanes within downstream distance, where foe links exist or at least the link direction is not straight MSVehicle* v = dynamic_cast(getVehicle(s.id)); const MSLane* lane = v->getLane(); @@ -1126,6 +1134,12 @@ std::cout << " On junction '" << l->getJunction()->getID() << "' (no. foe links = " << l->getFoeLinks().size() << "):" << std::endl; #endif for (auto& foeLane : l->getFoeLanes()) { + if (foeLane->getEdge().isCrossing()) { +#ifdef DEBUG_SURROUNDING + std::cout << " skipping crossing foeLane '" << foeLane->getID() << "'" << std::endl; +#endif + continue; + } #ifdef DEBUG_SURROUNDING std::cout << " foeLane '" << foeLane->getID() << "'" << std::endl; #endif @@ -1304,7 +1318,7 @@ SUMOTrafficObject* obj = getTrafficObject(s.contextDomain, *i); double minPerpendicularDist = combinedShape.distance2D(obj->getPosition(), true); #ifdef DEBUG_SURROUNDING - std::cout << (isDownstream? "DOWN" : "UP") << " obj " << obj->getID() << " perpendicular dist=" << minPerpendicularDist << " filterLateralDist=" << s.filterLateralDist << "\n"; + std::cout << (isDownstream ? "DOWN" : "UP") << " obj " << obj->getID() << " perpendicular dist=" << minPerpendicularDist << " filterLateralDist=" << s.filterLateralDist << "\n"; #endif if ((minPerpendicularDist != GeomHelper::INVALID_OFFSET) && (minPerpendicularDist <= s.filterLateralDist)) { vehs.insert(obj); diff -Nru sumo-1.11.0/src/libsumo/Helper.h sumo-1.12.0/src/libsumo/Helper.h --- sumo-1.11.0/src/libsumo/Helper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Helper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/InductionLoop.cpp sumo-1.12.0/src/libsumo/InductionLoop.cpp --- sumo-1.11.0/src/libsumo/InductionLoop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/InductionLoop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/InductionLoop.h sumo-1.12.0/src/libsumo/InductionLoop.h --- sumo-1.11.0/src/libsumo/InductionLoop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/InductionLoop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Junction.cpp sumo-1.12.0/src/libsumo/Junction.cpp --- sumo-1.11.0/src/libsumo/Junction.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Junction.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Junction.h sumo-1.12.0/src/libsumo/Junction.h --- sumo-1.11.0/src/libsumo/Junction.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Junction.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/LaneArea.cpp sumo-1.12.0/src/libsumo/LaneArea.cpp --- sumo-1.11.0/src/libsumo/LaneArea.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/LaneArea.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/LaneArea.h sumo-1.12.0/src/libsumo/LaneArea.h --- sumo-1.11.0/src/libsumo/LaneArea.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/LaneArea.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Lane.cpp sumo-1.12.0/src/libsumo/Lane.cpp --- sumo-1.11.0/src/libsumo/Lane.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Lane.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Lane.h sumo-1.12.0/src/libsumo/Lane.h --- sumo-1.11.0/src/libsumo/Lane.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Lane.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/libsumo.h sumo-1.12.0/src/libsumo/libsumo.h --- sumo-1.11.0/src/libsumo/libsumo.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/libsumo.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/libsumo_typemap.i sumo-1.12.0/src/libsumo/libsumo_typemap.i --- sumo-1.11.0/src/libsumo/libsumo_typemap.i 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/libsumo_typemap.i 2022-01-24 20:43:50.000000000 +0000 @@ -341,6 +341,9 @@ %} +%include "std_shared_ptr.i" +%shared_ptr(libsumo::TraCIPhase) + // replacing vector instances of standard types, see https://stackoverflow.com/questions/8469138 %include "std_string.i" %include "std_vector.i" diff -Nru sumo-1.11.0/src/libsumo/libtraci.h sumo-1.12.0/src/libsumo/libtraci.h --- sumo-1.11.0/src/libsumo/libtraci.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/libtraci.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/MeanData.cpp sumo-1.12.0/src/libsumo/MeanData.cpp --- sumo-1.11.0/src/libsumo/MeanData.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/MeanData.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/MeanData.h sumo-1.12.0/src/libsumo/MeanData.h --- sumo-1.11.0/src/libsumo/MeanData.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/MeanData.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/MultiEntryExit.cpp sumo-1.12.0/src/libsumo/MultiEntryExit.cpp --- sumo-1.11.0/src/libsumo/MultiEntryExit.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/MultiEntryExit.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/MultiEntryExit.h sumo-1.12.0/src/libsumo/MultiEntryExit.h --- sumo-1.11.0/src/libsumo/MultiEntryExit.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/MultiEntryExit.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/OverheadWire.cpp sumo-1.12.0/src/libsumo/OverheadWire.cpp --- sumo-1.11.0/src/libsumo/OverheadWire.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/OverheadWire.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/OverheadWire.h sumo-1.12.0/src/libsumo/OverheadWire.h --- sumo-1.11.0/src/libsumo/OverheadWire.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/OverheadWire.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/ParkingArea.cpp sumo-1.12.0/src/libsumo/ParkingArea.cpp --- sumo-1.11.0/src/libsumo/ParkingArea.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/ParkingArea.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/ParkingArea.h sumo-1.12.0/src/libsumo/ParkingArea.h --- sumo-1.11.0/src/libsumo/ParkingArea.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/ParkingArea.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Person.cpp sumo-1.12.0/src/libsumo/Person.cpp --- sumo-1.11.0/src/libsumo/Person.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Person.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ @@ -518,8 +518,8 @@ vehicleParams.depart = MSNet::getInstance()->getCurrentTimeStep(); } else if (depart < MSNet::getInstance()->getCurrentTimeStep()) { vehicleParams.depart = MSNet::getInstance()->getCurrentTimeStep(); - WRITE_WARNING("Departure time " + toString(departInSecs) + " for person '" + personID - + "' is in the past; using current time " + time2string(vehicleParams.depart) + " instead."); + WRITE_WARNING("Departure time=" + toString(departInSecs) + " for person '" + personID + + "' is in the past; using current time=" + time2string(vehicleParams.depart) + " instead."); } else { vehicleParams.depart = depart; } diff -Nru sumo-1.11.0/src/libsumo/Person.h sumo-1.12.0/src/libsumo/Person.h --- sumo-1.11.0/src/libsumo/Person.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Person.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/POI.cpp sumo-1.12.0/src/libsumo/POI.cpp --- sumo-1.11.0/src/libsumo/POI.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/POI.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/POI.h sumo-1.12.0/src/libsumo/POI.h --- sumo-1.11.0/src/libsumo/POI.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/POI.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Polygon.cpp sumo-1.12.0/src/libsumo/Polygon.cpp --- sumo-1.11.0/src/libsumo/Polygon.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Polygon.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Polygon.h sumo-1.12.0/src/libsumo/Polygon.h --- sumo-1.11.0/src/libsumo/Polygon.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Polygon.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Rerouter.cpp sumo-1.12.0/src/libsumo/Rerouter.cpp --- sumo-1.11.0/src/libsumo/Rerouter.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Rerouter.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Rerouter.h sumo-1.12.0/src/libsumo/Rerouter.h --- sumo-1.11.0/src/libsumo/Rerouter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Rerouter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Route.cpp sumo-1.12.0/src/libsumo/Route.cpp --- sumo-1.11.0/src/libsumo/Route.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Route.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Route.h sumo-1.12.0/src/libsumo/Route.h --- sumo-1.11.0/src/libsumo/Route.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Route.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/RouteProbe.cpp sumo-1.12.0/src/libsumo/RouteProbe.cpp --- sumo-1.11.0/src/libsumo/RouteProbe.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/RouteProbe.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/RouteProbe.h sumo-1.12.0/src/libsumo/RouteProbe.h --- sumo-1.11.0/src/libsumo/RouteProbe.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/RouteProbe.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Simulation.cpp sumo-1.12.0/src/libsumo/Simulation.cpp --- sumo-1.11.0/src/libsumo/Simulation.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Simulation.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ @@ -649,7 +649,7 @@ } } std::vector items; - if (router.compute(fromEdge, toEdge, departPos, arrivalPos, destStop, + if (router.compute(fromEdge, toEdge, departPos, "", arrivalPos, destStop, speed * walkFactor, vehicle, modeSet, departStep, items, externalFactor)) { double cost = 0; for (std::vector::iterator it = items.begin(); it != items.end(); ++it) { @@ -793,7 +793,6 @@ const SUMOTime newTime = MSStateHandler::MSStateTimeHandler::getTime(fileName); // clean up state MSNet::getInstance()->clearState(newTime); - MSNet::getInstance()->getVehicleControl().initDefaultTypes(); // load state MSStateHandler h(fileName, 0); XMLSubSys::runParser(h, fileName); diff -Nru sumo-1.11.0/src/libsumo/Simulation.h sumo-1.12.0/src/libsumo/Simulation.h --- sumo-1.11.0/src/libsumo/Simulation.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Simulation.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/StorageHelper.h sumo-1.12.0/src/libsumo/StorageHelper.h --- sumo-1.11.0/src/libsumo/StorageHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/StorageHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Subscription.h sumo-1.12.0/src/libsumo/Subscription.h --- sumo-1.11.0/src/libsumo/Subscription.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Subscription.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/TraCIConstants.h sumo-1.12.0/src/libsumo/TraCIConstants.h --- sumo-1.11.0/src/libsumo/TraCIConstants.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/TraCIConstants.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/TraCIDefs.h sumo-1.12.0/src/libsumo/TraCIDefs.h --- sumo-1.11.0/src/libsumo/TraCIDefs.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/TraCIDefs.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ @@ -299,7 +299,7 @@ #ifdef SWIG -%template(TraCIPhaseVector) std::vector; // *NOPAD* +%template(TraCIPhaseVector) std::vector >; // *NOPAD* #endif @@ -308,14 +308,14 @@ public: TraCILogic() {} TraCILogic(const std::string& _programID, const int _type, const int _currentPhaseIndex, - const std::vector& _phases = std::vector()) + const std::vector >& _phases = std::vector >()) : programID(_programID), type(_type), currentPhaseIndex(_currentPhaseIndex), phases(_phases) {} ~TraCILogic() {} std::string programID; int type; int currentPhaseIndex; - std::vector phases; + std::vector > phases; std::map subParameter; }; diff -Nru sumo-1.11.0/src/libsumo/TrafficLight.cpp sumo-1.12.0/src/libsumo/TrafficLight.cpp --- sumo-1.11.0/src/libsumo/TrafficLight.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/TrafficLight.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ @@ -584,7 +584,11 @@ std::string TrafficLight::getParameter(const std::string& tlsID, const std::string& paramName) { - return Helper::getTLS(tlsID).getActive()->getParameter(paramName, ""); + MSTrafficLightLogic* tll = Helper::getTLS(tlsID).getActive(); + if (StringUtils::startsWith(paramName, "NEMA.") && tll->getLogicType() != TrafficLightType::NEMA) { + throw TraCIException("'" + tlsID + "' is not a NEMA controller"); + } + return tll->getParameter(paramName, ""); } @@ -642,8 +646,12 @@ throw TraCIException("set program: parameter index must be less than parameter phase number."); } std::vector phases; - for (TraCIPhase* phase : logic.phases) { - phases.push_back(new MSPhaseDefinition(TIME2STEPS(phase->duration), phase->state, TIME2STEPS(phase->minDur), TIME2STEPS(phase->maxDur), phase->next, phase->name)); + for (const std::shared_ptr& phase : logic.phases) { + MSPhaseDefinition* sumoPhase = new MSPhaseDefinition(TIME2STEPS(phase->duration), phase->state, phase->name); + sumoPhase->minDuration = TIME2STEPS(phase->minDur); + sumoPhase->maxDuration = TIME2STEPS(phase->maxDur); + sumoPhase->nextPhases = phase->next; + phases.push_back(sumoPhase); } if (vars.getLogic(logic.programID) == nullptr) { MSTLLogicControl& tlc = MSNet::getInstance()->getTLSControl(); @@ -654,25 +662,25 @@ switch ((TrafficLightType)logic.type) { case TrafficLightType::ACTUATED: tlLogic = new MSActuatedTrafficLightLogic(tlc, - tlsID, logic.programID, + tlsID, logic.programID, 0, phases, step, nextSwitch, logic.subParameter, basePath); break; case TrafficLightType::NEMA: tlLogic = new NEMALogic(tlc, - tlsID, logic.programID, + tlsID, logic.programID, 0, phases, step, nextSwitch, logic.subParameter, basePath); break; case TrafficLightType::DELAYBASED: tlLogic = new MSDelayBasedTrafficLightLogic(tlc, - tlsID, logic.programID, + tlsID, logic.programID, 0, phases, step, nextSwitch, logic.subParameter, basePath); break; case TrafficLightType::STATIC: tlLogic = new MSSimpleTrafficLightLogic(tlc, - tlsID, logic.programID, TrafficLightType::STATIC, + tlsID, logic.programID, 0, TrafficLightType::STATIC, phases, step, nextSwitch, logic.subParameter); break; @@ -683,6 +691,7 @@ // XXX pass GUIDetectorBuilder when running with gui NLDetectorBuilder db(*MSNet::getInstance()); tlLogic->init(db); + MSNet::getInstance()->createTLWrapper(tlLogic); } else { static_cast(vars.getLogic(logic.programID))->setPhases(phases, logic.currentPhaseIndex); } diff -Nru sumo-1.11.0/src/libsumo/TrafficLight.h sumo-1.12.0/src/libsumo/TrafficLight.h --- sumo-1.11.0/src/libsumo/TrafficLight.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/TrafficLight.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/VariableSpeedSign.cpp sumo-1.12.0/src/libsumo/VariableSpeedSign.cpp --- sumo-1.11.0/src/libsumo/VariableSpeedSign.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/VariableSpeedSign.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/VariableSpeedSign.h sumo-1.12.0/src/libsumo/VariableSpeedSign.h --- sumo-1.11.0/src/libsumo/VariableSpeedSign.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/VariableSpeedSign.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/Vehicle.cpp sumo-1.12.0/src/libsumo/Vehicle.cpp --- sumo-1.11.0/src/libsumo/Vehicle.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Vehicle.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ @@ -880,7 +880,12 @@ double Vehicle::getMinGapLat(const std::string& vehID) { - return Helper::getVehicleType(vehID).getMinGapLat(); + try { + return StringUtils::toDouble(getParameter(vehID, "laneChangeModel.minGapLat")); + } catch (const TraCIException&) { + // legacy behavior + return Helper::getVehicleType(vehID).getMinGapLat(); + } } @@ -1872,7 +1877,12 @@ void Vehicle::setMinGapLat(const std::string& vehID, double minGapLat) { - Helper::getVehicle(vehID)->getSingularType().setMinGapLat(minGapLat); + try { + setParameter(vehID, "laneChangeModel.minGapLat", toString(minGapLat)); + } catch (TraCIException&) { + // legacy behavior + Helper::getVehicle(vehID)->getSingularType().setMinGapLat(minGapLat); + } } @@ -2304,6 +2314,8 @@ return wrapper->wrapDouble(objID, variable, getStopArrivalDelay(objID)); case VAR_TIMELOSS: return wrapper->wrapDouble(objID, variable, getTimeLoss(objID)); + case VAR_MINGAP_LAT: + return wrapper->wrapDouble(objID, variable, getMinGapLat(objID)); case VAR_LEADER: { paramData->readUnsignedByte(); const double dist = paramData->readDouble(); diff -Nru sumo-1.11.0/src/libsumo/Vehicle.h sumo-1.12.0/src/libsumo/Vehicle.h --- sumo-1.11.0/src/libsumo/Vehicle.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/Vehicle.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/VehicleType.cpp sumo-1.12.0/src/libsumo/VehicleType.cpp --- sumo-1.11.0/src/libsumo/VehicleType.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/VehicleType.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libsumo/VehicleType.h sumo-1.12.0/src/libsumo/VehicleType.h --- sumo-1.11.0/src/libsumo/VehicleType.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libsumo/VehicleType.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/BusStop.cpp sumo-1.12.0/src/libtraci/BusStop.cpp --- sumo-1.11.0/src/libtraci/BusStop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/BusStop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/Calibrator.cpp sumo-1.12.0/src/libtraci/Calibrator.cpp --- sumo-1.11.0/src/libtraci/Calibrator.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/Calibrator.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/ChargingStation.cpp sumo-1.12.0/src/libtraci/ChargingStation.cpp --- sumo-1.11.0/src/libtraci/ChargingStation.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/ChargingStation.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/CMakeLists.txt sumo-1.12.0/src/libtraci/CMakeLists.txt --- sumo-1.11.0/src/libtraci/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -37,7 +37,7 @@ ) add_library(libtracistatic STATIC ${libtracistatic_STAT_SRCS}) -add_dependencies(libtracistatic generate-version-h) +add_dependencies(libtracistatic generate-version-h install_dll) set_property(TARGET libtracistatic PROPERTY FOLDER "libtraci") if (MSVC) @@ -55,6 +55,8 @@ set_target_properties(libtracicpp PROPERTIES OUTPUT_NAME_DEBUG libtracicpp${BINARY_SUFFIX}D) target_include_directories(libtracicpp PUBLIC $) install(TARGETS libtracicpp EXPORT SUMOConfig + DESTINATION bin + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) diff -Nru sumo-1.11.0/src/libtraci/Connection.cpp sumo-1.12.0/src/libtraci/Connection.cpp --- sumo-1.11.0/src/libtraci/Connection.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/Connection.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/Connection.h sumo-1.12.0/src/libtraci/Connection.h --- sumo-1.11.0/src/libtraci/Connection.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/Connection.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/Domain.h sumo-1.12.0/src/libtraci/Domain.h --- sumo-1.11.0/src/libtraci/Domain.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/Domain.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/Edge.cpp sumo-1.12.0/src/libtraci/Edge.cpp --- sumo-1.11.0/src/libtraci/Edge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/Edge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/GUI.cpp sumo-1.12.0/src/libtraci/GUI.cpp --- sumo-1.11.0/src/libtraci/GUI.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/GUI.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/InductionLoop.cpp sumo-1.12.0/src/libtraci/InductionLoop.cpp --- sumo-1.11.0/src/libtraci/InductionLoop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/InductionLoop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/Junction.cpp sumo-1.12.0/src/libtraci/Junction.cpp --- sumo-1.11.0/src/libtraci/Junction.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/Junction.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/LaneArea.cpp sumo-1.12.0/src/libtraci/LaneArea.cpp --- sumo-1.11.0/src/libtraci/LaneArea.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/LaneArea.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/Lane.cpp sumo-1.12.0/src/libtraci/Lane.cpp --- sumo-1.11.0/src/libtraci/Lane.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/Lane.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/MeanData.cpp sumo-1.12.0/src/libtraci/MeanData.cpp --- sumo-1.11.0/src/libtraci/MeanData.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/MeanData.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/MultiEntryExit.cpp sumo-1.12.0/src/libtraci/MultiEntryExit.cpp --- sumo-1.11.0/src/libtraci/MultiEntryExit.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/MultiEntryExit.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/OverheadWire.cpp sumo-1.12.0/src/libtraci/OverheadWire.cpp --- sumo-1.11.0/src/libtraci/OverheadWire.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/OverheadWire.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/ParkingArea.cpp sumo-1.12.0/src/libtraci/ParkingArea.cpp --- sumo-1.11.0/src/libtraci/ParkingArea.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/ParkingArea.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/Person.cpp sumo-1.12.0/src/libtraci/Person.cpp --- sumo-1.11.0/src/libtraci/Person.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/Person.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/POI.cpp sumo-1.12.0/src/libtraci/POI.cpp --- sumo-1.11.0/src/libtraci/POI.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/POI.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/Polygon.cpp sumo-1.12.0/src/libtraci/Polygon.cpp --- sumo-1.11.0/src/libtraci/Polygon.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/Polygon.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/Rerouter.cpp sumo-1.12.0/src/libtraci/Rerouter.cpp --- sumo-1.11.0/src/libtraci/Rerouter.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/Rerouter.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/Route.cpp sumo-1.12.0/src/libtraci/Route.cpp --- sumo-1.11.0/src/libtraci/Route.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/Route.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/RouteProbe.cpp sumo-1.12.0/src/libtraci/RouteProbe.cpp --- sumo-1.11.0/src/libtraci/RouteProbe.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/RouteProbe.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/Simulation.cpp sumo-1.12.0/src/libtraci/Simulation.cpp --- sumo-1.11.0/src/libtraci/Simulation.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/Simulation.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/TrafficLight.cpp sumo-1.12.0/src/libtraci/TrafficLight.cpp --- sumo-1.11.0/src/libtraci/TrafficLight.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/TrafficLight.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ @@ -277,7 +277,7 @@ StoHelp::writeTypedInt(content, logic.type); StoHelp::writeTypedInt(content, logic.currentPhaseIndex); StoHelp::writeCompound(content, (int)logic.phases.size()); - for (const libsumo::TraCIPhase* const phase : logic.phases) { + for (const std::shared_ptr& phase : logic.phases) { StoHelp::writeCompound(content, 6); StoHelp::writeTypedDouble(content, phase->duration); StoHelp::writeTypedString(content, phase->state); diff -Nru sumo-1.11.0/src/libtraci/VariableSpeedSign.cpp sumo-1.12.0/src/libtraci/VariableSpeedSign.cpp --- sumo-1.11.0/src/libtraci/VariableSpeedSign.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/VariableSpeedSign.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/Vehicle.cpp sumo-1.12.0/src/libtraci/Vehicle.cpp --- sumo-1.11.0/src/libtraci/Vehicle.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/Vehicle.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/libtraci/VehicleType.cpp sumo-1.12.0/src/libtraci/VehicleType.cpp --- sumo-1.11.0/src/libtraci/VehicleType.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/libtraci/VehicleType.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/marouter/CMakeLists.txt sumo-1.12.0/src/marouter/CMakeLists.txt --- sumo-1.11.0/src/marouter/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/marouter/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -16,6 +16,6 @@ set_target_properties(marouter PROPERTIES OUTPUT_NAME marouter${BINARY_SUFFIX}) set_target_properties(marouter PROPERTIES OUTPUT_NAME_DEBUG marouter${BINARY_SUFFIX}D) target_link_libraries(marouter router od ${commonvehiclelibs}) -add_dependencies(marouter generate-version-h) +add_dependencies(marouter generate-version-h install_dll) install(TARGETS marouter RUNTIME DESTINATION bin) diff -Nru sumo-1.11.0/src/marouter/marouter_main.cpp sumo-1.12.0/src/marouter/marouter_main.cpp --- sumo-1.11.0/src/marouter/marouter_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/marouter/marouter_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -69,17 +69,6 @@ #include "ROMARouteHandler.h" #include "ROMAEdge.h" -// =========================================================================== -// method declaration -// =========================================================================== - -void initNet(RONet& net, ROLoader& loader, OptionsCont& oc); -double getTravelTime(const ROEdge* const edge, const ROVehicle* const veh, double time); -void computeAllPairs(RONet& net, OptionsCont& oc); -void writeInterval(OutputDevice& dev, const SUMOTime begin, const SUMOTime end, const RONet& net, const ROVehicle* const veh); -void writeInterval(OutputDevice& dev, const SUMOTime begin, const SUMOTime end, const RONet& net, const ROVehicle* const veh); -void computeRoutes(RONet& net, OptionsCont& oc, ODMatrix& matrix); - // =========================================================================== // Method implementation @@ -151,37 +140,6 @@ /** - * Writes the travel times for a single interval - */ -void -writeInterval(OutputDevice& dev, const SUMOTime begin, const SUMOTime end, const RONet& net, const ROMAAssignments& a) { - dev.openTag(SUMO_TAG_INTERVAL).writeAttr(SUMO_ATTR_BEGIN, time2string(begin)).writeAttr(SUMO_ATTR_END, time2string(end)); - for (std::map::const_iterator i = net.getEdgeMap().begin(); i != net.getEdgeMap().end(); ++i) { - ROMAEdge* edge = static_cast(i->second); - if (edge->getFunction() == SumoXMLEdgeFunc::NORMAL) { - dev.openTag(SUMO_TAG_EDGE).writeAttr(SUMO_ATTR_ID, edge->getID()); - const double traveltime = edge->getTravelTime(a.getDefaultVehicle(), STEPS2TIME(begin)); - const double speed = edge->getLength() / traveltime; - const double flow = edge->getFlow(STEPS2TIME(begin)); - const double timeGap = STEPS2TIME(end - begin) / flow; - const double spaceGap = timeGap * speed; - const double density = 1000.0 / spaceGap; - const double laneDensity = density / edge->getNumLanes(); - dev.writeAttr(SUMO_ATTR_TRAVELTIME, traveltime); - dev.writeAttr(SUMO_ATTR_SPEED, speed); - dev.writeAttr("speedRelative", speed / edge->getSpeedLimit()); - dev.writeAttr(SUMO_ATTR_ENTERED, flow); - dev.writeAttr(SUMO_ATTR_DENSITY, density); - dev.writeAttr(SUMO_ATTR_LANEDENSITY, laneDensity); - dev.writeAttr("flowCapacityRatio", 100. * flow / a.getCapacity(edge)); - dev.closeTag(); - } - } - dev.closeTag(); -} - - -/** * Computes the routes saving them */ void @@ -262,9 +220,11 @@ matrix.applyCurve(matrix.parseTimeLine(oc.getStringVector("timeline"), oc.getBool("timeline.day-in-hours"))); } matrix.sortByBeginTime(); + bool haveOutput = OutputDevice::createDeviceByOption("netload-output", "meandata"); ROVehicle defaultVehicle(SUMOVehicleParameter(), nullptr, net.getVehicleTypeSecure(DEFAULT_VTYPE_ID), &net); ROMAAssignments a(begin, end, oc.getBool("additive-traffic"), oc.getFloat("weight-adaption"), - oc.getInt("max-alternatives"), oc.getBool("capacities.default"), net, matrix, *router); + oc.getInt("max-alternatives"), oc.getBool("capacities.default"), net, matrix, *router, + haveOutput ? &OutputDevice::getDeviceByOption("netload-output") : nullptr); a.resetFlows(); #ifdef HAVE_FOX // this is just to init the CHRouter with the default vehicle @@ -286,7 +246,6 @@ oc.getInt("paths"), oc.getFloat("paths.penalty"), oc.getFloat("tolerance"), oc.getString("route-choice-method")); } // update path costs and output - bool haveOutput = false; OutputDevice* dev = net.getRouteOutput(); if (dev != nullptr) { std::vector tazParamKeys; @@ -319,7 +278,7 @@ od.openTag(SUMO_TAG_ROUTE_DISTRIBUTION); for (RORoute* const r : c->pathsVector) { r->setCosts(router->recomputeCosts(r->getEdgeVector(), &defaultVehicle, begin)); - r->writeXMLDefinition(od, nullptr, true, false); + r->writeXMLDefinition(od, nullptr, true, true, false, false); } od.closeTag(); od.closeTag(); @@ -337,7 +296,7 @@ od.openTag(SUMO_TAG_ROUTE_DISTRIBUTION); for (RORoute* const r : c->pathsVector) { r->setCosts(router->recomputeCosts(r->getEdgeVector(), &defaultVehicle, begin)); - r->writeXMLDefinition(od, nullptr, true, false); + r->writeXMLDefinition(od, nullptr, true, true, false, false); } od.closeTag(); if (!tazParamKeys.empty()) { @@ -360,23 +319,6 @@ } haveOutput = true; } - if (OutputDevice::createDeviceByOption("netload-output", "meandata")) { - if (oc.getBool("additive-traffic")) { - writeInterval(OutputDevice::getDeviceByOption("netload-output"), begin, end, net, a); - } else { - SUMOTime lastCell = 0; - for (std::vector::const_iterator i = matrix.getCells().begin(); i != matrix.getCells().end(); ++i) { - if ((*i)->end > lastCell) { - lastCell = (*i)->end; - } - } - const SUMOTime interval = string2time(OptionsCont::getOptions().getString("aggregation-interval")); - for (SUMOTime start = begin; start < MIN2(end, lastCell); start += interval) { - writeInterval(OutputDevice::getDeviceByOption("netload-output"), start, start + interval, net, a); - } - } - haveOutput = true; - } if (!haveOutput) { throw ProcessError("No output file given."); } diff -Nru sumo-1.11.0/src/marouter/ROMAAssignments.cpp sumo-1.12.0/src/marouter/ROMAAssignments.cpp --- sumo-1.11.0/src/marouter/ROMAAssignments.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/marouter/ROMAAssignments.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -47,9 +47,11 @@ ROMAAssignments::ROMAAssignments(const SUMOTime begin, const SUMOTime end, const bool additiveTraffic, const double adaptionFactor, const int maxAlternatives, const bool defaultCapacities, - RONet& net, ODMatrix& matrix, SUMOAbstractRouter& router) + RONet& net, ODMatrix& matrix, SUMOAbstractRouter& router, + OutputDevice* netloadOutput) : myBegin(begin), myEnd(end), myAdditiveTraffic(additiveTraffic), myAdaptionFactor(adaptionFactor), - myMaxAlternatives(maxAlternatives), myUseDefaultCapacities(defaultCapacities), myNet(net), myMatrix(matrix), myRouter(router) { + myMaxAlternatives(maxAlternatives), myUseDefaultCapacities(defaultCapacities), + myNet(net), myMatrix(matrix), myRouter(router), myNetloadOutput(netloadOutput) { myDefaultVehicle = new ROVehicle(SUMOVehicleParameter(), nullptr, net.getVehicleTypeSecure(DEFAULT_VTYPE_ID), &net); } @@ -245,6 +247,36 @@ void +ROMAAssignments::writeInterval(const SUMOTime begin, const SUMOTime end) { + if (myNetloadOutput != nullptr) { + myNetloadOutput->openTag(SUMO_TAG_INTERVAL).writeAttr(SUMO_ATTR_BEGIN, time2string(begin)).writeAttr(SUMO_ATTR_END, time2string(end)); + for (std::map::const_iterator i = myNet.getEdgeMap().begin(); i != myNet.getEdgeMap().end(); ++i) { + ROMAEdge* edge = static_cast(i->second); + if (edge->getFunction() == SumoXMLEdgeFunc::NORMAL) { + myNetloadOutput->openTag(SUMO_TAG_EDGE).writeAttr(SUMO_ATTR_ID, edge->getID()); + const double traveltime = edge->getTravelTime(getDefaultVehicle(), STEPS2TIME(begin)); + const double speed = edge->getLength() / traveltime; + const double flow = edge->getFlow(STEPS2TIME(begin)); + const double timeGap = STEPS2TIME(end - begin) / flow; + const double spaceGap = timeGap * speed; + const double density = 1000.0 / spaceGap; + const double laneDensity = density / edge->getNumLanes(); + myNetloadOutput->writeAttr(SUMO_ATTR_TRAVELTIME, traveltime); + myNetloadOutput->writeAttr(SUMO_ATTR_SPEED, speed); + myNetloadOutput->writeAttr(SUMO_ATTR_SPEEDREL, speed / edge->getSpeedLimit()); + myNetloadOutput->writeAttr(SUMO_ATTR_ENTERED, flow); + myNetloadOutput->writeAttr(SUMO_ATTR_DENSITY, density); + myNetloadOutput->writeAttr(SUMO_ATTR_LANEDENSITY, laneDensity); + myNetloadOutput->writeAttr("flowCapacityRatio", 100. * flow / getCapacity(edge)); + myNetloadOutput->closeTag(); + } + } + myNetloadOutput->closeTag(); + } +} + + +void ROMAAssignments::incremental(const int numIter, const bool verbose) { SUMOTime lastBegin = -1; std::vector intervals; @@ -258,11 +290,12 @@ } lastBegin = -1; for (std::vector::const_iterator offset = intervals.begin(); offset != intervals.end(); offset++) { - std::vector::const_iterator cellsEnd = myMatrix.getCells().end(); + std::vector::const_iterator firstCell = myMatrix.getCells().begin() + (*offset); + std::vector::const_iterator lastCell = myMatrix.getCells().end(); if (offset != intervals.end() - 1) { - cellsEnd = myMatrix.getCells().begin() + (*(offset + 1)); + lastCell = myMatrix.getCells().begin() + (*(offset + 1)); } - const SUMOTime intervalStart = (*(myMatrix.getCells().begin() + (*offset)))->begin; + const SUMOTime intervalStart = (*firstCell)->begin; if (verbose) { WRITE_MESSAGE(" starting interval " + time2string(intervalStart)); } @@ -273,13 +306,17 @@ loadedTravelTimes[edge] = edge->getTravelTime(myDefaultVehicle, STEPS2TIME(intervalStart)); } } + if (loadedTravelTimes.empty()) { + // we don't have loaded travel times for this interval but we may have set ourselves some for the interval before but no need to warn + ROEdge::disableTimelineWarning(); + } for (int t = 0; t < numIter; t++) { if (verbose) { WRITE_MESSAGE(" starting iteration " + toString(t)); } std::string lastOrigin = ""; int workerIndex = 0; - for (std::vector::const_iterator i = myMatrix.getCells().begin() + (*offset); i != cellsEnd; i++) { + for (std::vector::const_iterator i = firstCell; i != lastCell; i++) { ODCell* const c = *i; const double linkFlow = c->vehicleNumber / numIter; const SUMOTime begin = myAdditiveTraffic ? myBegin : c->begin; @@ -310,7 +347,7 @@ myNet.getThreadPool().waitAll(); } #endif - for (std::vector::const_iterator i = myMatrix.getCells().begin() + (*offset); i != cellsEnd; i++) { + for (std::vector::const_iterator i = firstCell; i != lastCell; i++) { ODCell* const c = *i; const double linkFlow = c->vehicleNumber / numIter; const SUMOTime begin = myAdditiveTraffic ? myBegin : c->begin; @@ -334,6 +371,7 @@ } myRouter.reset(myDefaultVehicle); } + writeInterval(intervalStart, (*(lastCell - 1))->end); lastBegin = intervalStart; } } @@ -342,12 +380,12 @@ void ROMAAssignments::sue(const int maxOuterIteration, const int maxInnerIteration, const int kPaths, const double penalty, const double tolerance, const std::string /* routeChoiceMethod */) { getKPaths(kPaths, penalty); - std::map intervals; + std::map intervals; if (myAdditiveTraffic) { - intervals[STEPS2TIME(myBegin)] = STEPS2TIME(myEnd); + intervals[myBegin] = myEnd; } else { for (const ODCell* const c : myMatrix.getCells()) { - intervals[STEPS2TIME(c->begin)] = STEPS2TIME(c->end); + intervals[c->begin] = c->end; } } for (int outer = 0; outer < maxOuterIteration; outer++) { @@ -359,7 +397,7 @@ for (std::vector::const_iterator j = c->pathsVector.begin(); j != c->pathsVector.end(); ++j) { RORoute* r = *j; r->setCosts(myRouter.recomputeCosts(r->getEdgeVector(), myDefaultVehicle, 0)); -// std::cout << std::setprecision(20) << r->getID() << ":" << r->getCosts() << std::endl; + // std::cout << std::setprecision(20) << r->getID() << ":" << r->getCosts() << std::endl; } // calculate route utilities and probabilities RouteCostCalculator::getCalculator().calculateProbabilities(c->pathsVector, myDefaultVehicle, 0); @@ -376,16 +414,18 @@ } // calculate new edge flows and check for stability int unstableEdges = 0; - for (std::map::const_iterator i = intervals.begin(); i != intervals.end(); ++i) { - const double intervalLengthInHours = STEPS2TIME(i->second - i->first) / 3600.; + for (const auto& it : intervals) { + const double intervalLengthInHours = STEPS2TIME(it.second - it.first) / 3600.; + const double intBegin = STEPS2TIME(it.first); + const double intEnd = STEPS2TIME(it.second); for (std::map::const_iterator e = myNet.getEdgeMap().begin(); e != myNet.getEdgeMap().end(); ++e) { ROMAEdge* edge = static_cast(e->second); - const double oldFlow = edge->getFlow(i->first); + const double oldFlow = edge->getFlow(intBegin); double newFlow = oldFlow; if (inner == 0 && outer == 0) { - newFlow += edge->getHelpFlow(i->first); + newFlow += edge->getHelpFlow(intBegin); } else { - newFlow += (edge->getHelpFlow(i->first) - oldFlow) / (inner + 1); + newFlow += (edge->getHelpFlow(intBegin) - oldFlow) / (inner + 1); } // if not lohse: if (newFlow > 0.) { @@ -400,10 +440,10 @@ unstableEdges++; newFlow = 0.; } - edge->setFlow(i->first, i->second, newFlow); + edge->setFlow(intBegin, intEnd, newFlow); const double travelTime = capacityConstraintFunction(edge, newFlow / intervalLengthInHours); - edge->addTravelTime(travelTime, i->first, i->second); - edge->setHelpFlow(i->first, i->second, 0.); + edge->addTravelTime(travelTime, intBegin, intEnd); + edge->setHelpFlow(intBegin, intEnd, 0.); } } // if stable break @@ -437,6 +477,9 @@ r->setProbability(r->getProbability() * c->vehicleNumber); } } + for (const auto& it : intervals) { + writeInterval(it.first, it.second); + } } diff -Nru sumo-1.11.0/src/marouter/ROMAAssignments.h sumo-1.12.0/src/marouter/ROMAAssignments.h --- sumo-1.11.0/src/marouter/ROMAAssignments.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/marouter/ROMAAssignments.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -50,7 +50,8 @@ /// Constructor ROMAAssignments(const SUMOTime begin, const SUMOTime end, const bool additiveTraffic, const double adaptionFactor, const int maxAlternatives, const bool defaultCapacities, - RONet& net, ODMatrix& matrix, SUMOAbstractRouter& router); + RONet& net, ODMatrix& matrix, SUMOAbstractRouter& router, + OutputDevice* netloadOutput); /// Destructor ~ROMAAssignments(); @@ -68,6 +69,9 @@ // @brief clear effort storage void resetFlows(); + // @brief Writes the travel times for a single interval + void writeInterval(const SUMOTime begin, const SUMOTime end); + // @brief incremental method void incremental(const int numIter, const bool verbose); @@ -137,6 +141,7 @@ SUMOAbstractRouter& myRouter; static std::map myPenalties; ROVehicle* myDefaultVehicle; + OutputDevice* const myNetloadOutput; #ifdef HAVE_FOX private: diff -Nru sumo-1.11.0/src/marouter/ROMAEdgeBuilder.cpp sumo-1.12.0/src/marouter/ROMAEdgeBuilder.cpp --- sumo-1.11.0/src/marouter/ROMAEdgeBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/marouter/ROMAEdgeBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/marouter/ROMAEdgeBuilder.h sumo-1.12.0/src/marouter/ROMAEdgeBuilder.h --- sumo-1.11.0/src/marouter/ROMAEdgeBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/marouter/ROMAEdgeBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/marouter/ROMAEdge.cpp sumo-1.12.0/src/marouter/ROMAEdge.cpp --- sumo-1.11.0/src/marouter/ROMAEdge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/marouter/ROMAEdge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/marouter/ROMAEdge.h sumo-1.12.0/src/marouter/ROMAEdge.h --- sumo-1.11.0/src/marouter/ROMAEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/marouter/ROMAEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/marouter/ROMAFrame.cpp sumo-1.12.0/src/marouter/ROMAFrame.cpp --- sumo-1.11.0/src/marouter/ROMAFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/marouter/ROMAFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -304,13 +304,16 @@ ROMAFrame::checkOptions() { OptionsCont& oc = OptionsCont::getOptions(); if (oc.isSet("assignment-method") && oc.getString("assignment-method") != "incremental" && oc.getString("assignment-method") != "UE" && oc.getString("assignment-method") != "SUE") { - WRITE_ERROR("invalid assignment method"); + WRITE_ERROR("Invalid assignment method '" + oc.getString("assignment-method") + "'."); return false; } if (oc.getString("route-choice-method") != "gawron" && oc.getString("route-choice-method") != "logit" && oc.getString("route-choice-method") != "lohse") { - WRITE_ERROR("invalid route choice method"); + WRITE_ERROR("Invalid route choice method '" + oc.getString("route-choice-method") + "'."); return false; } + if (oc.getInt("paths") > 1 && (oc.getString("routing-algorithm") == "CH" || oc.getString("routing-algorithm") == "CHWrapper")) { + WRITE_WARNING("Contraction hierarchies do not work with k shortest path search (please use a different routing algorithm)!"); + } return true; } diff -Nru sumo-1.11.0/src/marouter/ROMAFrame.h sumo-1.12.0/src/marouter/ROMAFrame.h --- sumo-1.11.0/src/marouter/ROMAFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/marouter/ROMAFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/marouter/ROMARouteHandler.cpp sumo-1.12.0/src/marouter/ROMARouteHandler.cpp --- sumo-1.11.0/src/marouter/ROMARouteHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/marouter/ROMARouteHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/marouter/ROMARouteHandler.h sumo-1.12.0/src/marouter/ROMARouteHandler.h --- sumo-1.11.0/src/marouter/ROMARouteHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/marouter/ROMARouteHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/mesogui/GUIMEInductLoop.cpp sumo-1.12.0/src/mesogui/GUIMEInductLoop.cpp --- sumo-1.11.0/src/mesogui/GUIMEInductLoop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesogui/GUIMEInductLoop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/mesogui/GUIMEInductLoop.h sumo-1.12.0/src/mesogui/GUIMEInductLoop.h --- sumo-1.11.0/src/mesogui/GUIMEInductLoop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesogui/GUIMEInductLoop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/mesogui/GUIMEVehicleControl.cpp sumo-1.12.0/src/mesogui/GUIMEVehicleControl.cpp --- sumo-1.11.0/src/mesogui/GUIMEVehicleControl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesogui/GUIMEVehicleControl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/mesogui/GUIMEVehicleControl.h sumo-1.12.0/src/mesogui/GUIMEVehicleControl.h --- sumo-1.11.0/src/mesogui/GUIMEVehicleControl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesogui/GUIMEVehicleControl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/mesogui/GUIMEVehicle.cpp sumo-1.12.0/src/mesogui/GUIMEVehicle.cpp --- sumo-1.11.0/src/mesogui/GUIMEVehicle.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesogui/GUIMEVehicle.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -235,6 +235,7 @@ repeatLane[lane]++; } drawStopLabels(s, noLoop, col); + drawParkingInfo(s, col); } @@ -285,20 +286,32 @@ GUIMEVehicle::getCenteringBoundary() const { // getPosition returns the start of the first lane, so we do not use it here getEdge()->lock(); - const MSLane* const lane = getEdge()->getLanes()[getQueIndex()]; - double offset = 0; - if (getSegment() != nullptr) { - offset = getSegment()->getLength(); - const std::vector& queue = getSegment()->getQueue(getQueIndex()); - for (int i = (int)queue.size() - 1; i >= 0 && queue[i] != this; i--) { - offset -= queue[i]->getVehicleType().getLengthWithGap(); + const double curTime = SIMTIME; + double vehiclePosition = 0.; + const MESegment* const segment = getSegment(); + const int queIdx = getQueIndex(); + if (segment != nullptr && queIdx != MESegment::PARKING_QUEUE) { + vehiclePosition = segment->getLength(); + const std::vector& queue = segment->getQueue(queIdx); + for (auto it = queue.rbegin(); it != queue.rend(); ++it) { + const MEVehicle* const v = *it; + const double intendedLeave = MIN2(v->getEventTimeSeconds(), v->getBlockTimeSeconds()); + const double entry = v->getLastEntryTimeSeconds(); + const double offset = segment->getLength() * (curTime - entry) / (intendedLeave - entry); + if (offset < vehiclePosition) { + vehiclePosition = offset; + } + if (v == this) { + break; + } + vehiclePosition -= v->getVehicleType().getLengthWithGap(); } } - getEdge()->unlock(); - Position pos = lane->geometryPositionAtOffset(getPositionOnLane() + offset); Boundary b; - b.add(pos); + const MSLane* const lane = getEdge()->getLanes()[queIdx == MESegment::PARKING_QUEUE ? 0 : queIdx]; + b.add(lane->geometryPositionAtOffset(getPositionOnLane() + vehiclePosition)); b.grow(getVehicleType().getLength()); + getEdge()->unlock(); return b; } diff -Nru sumo-1.11.0/src/mesogui/GUIMEVehicle.h sumo-1.12.0/src/mesogui/GUIMEVehicle.h --- sumo-1.11.0/src/mesogui/GUIMEVehicle.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesogui/GUIMEVehicle.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/mesosim/MEInductLoop.cpp sumo-1.12.0/src/mesosim/MEInductLoop.cpp --- sumo-1.11.0/src/mesosim/MEInductLoop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesosim/MEInductLoop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -65,7 +65,7 @@ mySegment->prepareDetectorForWriting(myMeanData); dev.openTag(SUMO_TAG_INTERVAL).writeAttr(SUMO_ATTR_BEGIN, time2string(startTime)).writeAttr(SUMO_ATTR_END, time2string(stopTime)); dev.writeAttr(SUMO_ATTR_ID, StringUtils::escapeXML(myID)).writeAttr("sampledSeconds", myMeanData.getSamples()); - myMeanData.write(dev, 0, stopTime - startTime, (double)mySegment->getEdge().getLanes().size(), -1.0); + myMeanData.write(dev, 0, stopTime - startTime, (double)mySegment->getEdge().getLanes().size(), mySegment->getEdge().getSpeedLimit(), -1.0); myMeanData.reset(); } diff -Nru sumo-1.11.0/src/mesosim/MEInductLoop.h sumo-1.12.0/src/mesosim/MEInductLoop.h --- sumo-1.11.0/src/mesosim/MEInductLoop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesosim/MEInductLoop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/mesosim/MELoop.cpp sumo-1.12.0/src/mesosim/MELoop.cpp --- sumo-1.11.0/src/mesosim/MELoop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesosim/MELoop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -86,7 +86,7 @@ if (onSegment != nullptr) { onSegment->send(veh, toSegment, qIdx, leaveTime, reason); } else { - WRITE_WARNINGF("Vehicle '%' teleports beyond arrival edge '%', time %.", + WRITE_WARNINGF("Vehicle '%' teleports beyond arrival edge '%', time=%.", veh->getID(), veh->getEdge()->getID(), time2string(leaveTime)); } veh->setSegment(toSegment); // signal arrival @@ -106,7 +106,7 @@ } toSegment->receive(veh, qIdx, leaveTime, false, ignoreLink, &onSegment->getEdge() != &toSegment->getEdge()); } else { - WRITE_WARNINGF("Vehicle '%' ends teleporting on edge '%':%, time %.", + WRITE_WARNINGF("Vehicle '%' ends teleporting on edge '%':%, time=%.", veh->getID(), toSegment->getEdge().getID(), toSegment->getIndex(), time2string(leaveTime)); // this is not quite correct but suffices for interrogation by // subsequent methods (veh->getSpeed() needs segment != 0) @@ -173,7 +173,7 @@ if (teleSegment != nullptr) { if (!teleporting) { // we managed to teleport in a single jump - WRITE_WARNINGF("Teleporting vehicle '%'; waited too long, from edge '%':% to edge '%':%, time %.", + WRITE_WARNINGF("Teleporting vehicle '%'; waited too long, from edge '%':% to edge '%':%, time=%.", veh->getID(), onSegment->getEdge().getID(), onSegment->getIndex(), teleSegment->getEdge().getID(), teleSegment->getIndex(), time2string(leaveTime)); MSNet::getInstance()->getVehicleControl().registerTeleportJam(); @@ -183,7 +183,7 @@ if (!teleporting) { int qIdx = 0; // announce start of multi-step teleport, arrival will be announced in changeSegment() - WRITE_WARNINGF("Teleporting vehicle '%'; waited too long, from edge '%':%, time %.", + WRITE_WARNINGF("Teleporting vehicle '%'; waited too long, from edge '%':%, time=%.", veh->getID(), onSegment->getEdge().getID(), onSegment->getIndex(), time2string(leaveTime)); MSNet::getInstance()->getVehicleControl().registerTeleportJam(); // remove from current segment @@ -276,7 +276,7 @@ void MELoop::buildSegmentsFor(const MSEdge& e, const OptionsCont& oc) { - const MSNet::MesoEdgeType& edgeType = MSNet::getInstance()->getMesoType(e.getEdgeType()); + const MESegment::MesoEdgeType& edgeType = MSNet::getInstance()->getMesoType(e.getEdgeType()); const double length = e.getLength(); const int numSegments = numSegmentsFor(length, oc.getFloat("meso-edgelength")); const double slength = length / (double)numSegments; @@ -298,12 +298,12 @@ void -MELoop::updateSegementsForEdge(const MSEdge& e) { +MELoop::updateSegmentsForEdge(const MSEdge& e) { if (e.getNumericalID() < (int)myEdges2FirstSegments.size()) { - const MSNet::MesoEdgeType& edgeType = MSNet::getInstance()->getMesoType(e.getEdgeType()); + const MESegment::MesoEdgeType& edgeType = MSNet::getInstance()->getMesoType(e.getEdgeType()); MESegment* s = myEdges2FirstSegments[e.getNumericalID()]; while (s != nullptr) { - s->initSegment(edgeType, e); + s->initSegment(edgeType, e, s->getCapacity()); s = s->getNextSegment(); } } diff -Nru sumo-1.11.0/src/mesosim/MELoop.h sumo-1.12.0/src/mesosim/MELoop.h --- sumo-1.11.0/src/mesosim/MELoop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesosim/MELoop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -23,6 +23,7 @@ #include #include #include +#include // =========================================================================== @@ -90,7 +91,7 @@ * additional file * @param[in] e the edge to update */ - void updateSegementsForEdge(const MSEdge& e); + void updateSegmentsForEdge(const MSEdge& e); /** @brief Get the segment for a given edge at a given position * diff -Nru sumo-1.11.0/src/mesosim/MESegment.cpp sumo-1.12.0/src/mesosim/MESegment.cpp --- sumo-1.11.0/src/mesosim/MESegment.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesosim/MESegment.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -43,8 +43,6 @@ #define DEFAULT_VEH_LENGTH_WITH_GAP (SUMOVTypeParameter::getDefault().length + SUMOVTypeParameter::getDefault().minGap) // avoid division by zero when driving very slowly #define MESO_MIN_SPEED (0.05) -// divide tau by lane number unless we have multiple queues -#define SCALED_TAU(x) (multiQueue ? x : (SUMOTime)(x / parent.getLanes().size())) //#define DEBUG_OPENED //#define DEBUG_JAMTHRESHOLD @@ -91,22 +89,27 @@ const double length, const double speed, const int idx, const bool multiQueue, - const MSNet::MesoEdgeType& edgeType): + const MesoEdgeType& edgeType): Named(id), myEdge(parent), myNextSegment(next), myLength(length), myIndex(idx), - myTau_length(SCALED_TAU(TIME2STEPS(1)) / MAX2(MESO_MIN_SPEED, speed)), - myCapacity(length * parent.getLanes().size()), - myQueueCapacity(multiQueue ? length : length * parent.getLanes().size()), + myTau_length(TIME2STEPS(1) / MAX2(MESO_MIN_SPEED, speed)), myNumVehicles(0), myLastHeadway(TIME2STEPS(-1)), myMeanSpeed(speed), myLastMeanSpeedUpdate(SUMOTime_MIN) { - if (multiQueue) { - const std::vector& lanes = parent.getLanes(); - for (MSLane* const l : lanes) { - myQueues.push_back(Queue(l->getPermissions())); + const std::vector& lanes = parent.getLanes(); + int usableLanes = 0; + for (MSLane* const l : lanes) { + const SVCPermissions allow = MSEdge::getMesoPermissions(l->getPermissions()); + if (multiQueue) { + myQueues.push_back(Queue(allow)); + } + if (allow != 0) { + usableLanes++; } + } + if (multiQueue) { if (next == nullptr) { for (const MSEdge* const edge : parent.getSuccessors()) { const std::vector* const allowed = parent.allowedLanes(*edge); @@ -118,23 +121,33 @@ } } } + myQueueCapacity = length; } else { myQueues.push_back(Queue(parent.getPermissions())); } - initSegment(edgeType, parent); + initSegment(edgeType, parent, length * usableLanes); } void -MESegment::initSegment(const MSNet::MesoEdgeType& edgeType, const MSEdge& parent) { - - const bool multiQueue = myQueues.size() > 1; +MESegment::initSegment(const MesoEdgeType& edgeType, const MSEdge& parent, const double capacity) { - // Eissfeldt p. 90 and 151 ff. - myTau_ff = SCALED_TAU(edgeType.tauff); - myTau_fj = SCALED_TAU(edgeType.taufj); - myTau_jf = SCALED_TAU(edgeType.taujf); - myTau_jj = SCALED_TAU(edgeType.taujj); + myCapacity = capacity; + if (myQueues.size() == 1) { + const double laneScale = capacity / myLength; + myQueueCapacity = capacity; + myTau_length = TIME2STEPS(1) / MAX2(MESO_MIN_SPEED, myMeanSpeed) / laneScale; + // Eissfeldt p. 90 and 151 ff. + myTau_ff = (SUMOTime)(edgeType.tauff / laneScale); + myTau_fj = (SUMOTime)(edgeType.taufj / laneScale); + myTau_jf = (SUMOTime)(edgeType.taujf / laneScale); + myTau_jj = (SUMOTime)(edgeType.taujj / laneScale); + } else { + myTau_ff = edgeType.tauff; + myTau_fj = edgeType.taufj; + myTau_jf = edgeType.taujf; + myTau_jj = edgeType.taujj; + } myJunctionControl = myNextSegment == nullptr && (edgeType.junctionControl || MELoop::isEnteringRoundabout(parent)); myTLSPenalty = ((edgeType.tlsPenalty > 0 || edgeType.tlsFlowPenalty > 0) && @@ -169,11 +182,21 @@ myMinorPenalty(0), myJunctionControl(false), myOvertaking(false), - myTau_length(1), - myCapacity(0), myQueueCapacity(0) { + myTau_length(1) { } +void +MESegment::updatePermissions() { + if (myQueues.size() > 1) { + for (MSLane* lane : myEdge.getLanes()) { + myQueues[lane->getIndex()].setPermissions(lane->getPermissions()); + } + } else { + myQueues.back().setPermissions(myEdge.getPermissions()); + } +} + void MESegment::recomputeJamThreshold(double jamThresh) { @@ -250,12 +273,16 @@ SUMOTime MESegment::hasSpaceFor(const MEVehicle* const veh, const SUMOTime entryTime, int& qIdx, const bool init) const { + SUMOTime earliestEntry = SUMOTime_MAX; qIdx = 0; if (myNumVehicles == 0 && myQueues.size() == 1) { // we have always space for at least one vehicle - return entryTime; + if (myQueues.front().allows(veh->getVClass())) { + return entryTime; + } else { + return earliestEntry; + } } - SUMOTime earliestEntry = SUMOTime_MAX; const SUMOVehicleClass svc = veh->getVClass(); int minSize = std::numeric_limits::max(); const MSEdge* const succ = myNextSegment == nullptr ? veh->succEdge(1) : nullptr; @@ -470,6 +497,9 @@ if (link != nullptr) { link->removeApproaching(veh); } + if (veh->isStopped()) { + veh->processStop(); + } MEVehicle* lc = removeCar(veh, time, reason); // new leaderCar q.setBlockTime(time); if (!isInvalid(next)) { @@ -492,9 +522,6 @@ lc->setEventTime(MAX2(lc->getEventTime(), q.getBlockTime())); MSGlobals::gMesoNet->addLeaderCar(lc, getLink(lc)); } - if (veh->isStopped()) { - veh->processStop(); - } } SUMOTime diff -Nru sumo-1.11.0/src/mesosim/MESegment.h sumo-1.12.0/src/mesosim/MESegment.h --- sumo-1.11.0/src/mesosim/MESegment.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesosim/MESegment.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -21,8 +21,11 @@ #include #include +#include +#include #include #include +#include // =========================================================================== @@ -30,7 +33,6 @@ // =========================================================================== class MSEdge; class MSLink; -class MSMoveReminder; class MSDetectorFileOutput; class MSVehicleControl; class MEVehicle; @@ -49,6 +51,21 @@ static const double DO_NOT_PATCH_JAM_THRESHOLD; static const int PARKING_QUEUE = -1; + /// @brief edge type specific meso parameters + struct MesoEdgeType { + SUMOTime tauff; + SUMOTime taufj; + SUMOTime taujf; + SUMOTime taujj; + double jamThreshold; + bool junctionControl; + double tlsPenalty; + double tlsFlowPenalty; + SUMOTime minorPenalty; + bool overtaking; + }; + + private: class Queue { public: @@ -90,9 +107,13 @@ myBlockTime = t; } + inline void setPermissions(SVCPermissions p) { + myPermissions = p; + } + private: /// The vClass permissions for this queue - const SVCPermissions myPermissions; + SVCPermissions myPermissions; std::vector myVehicles; @@ -118,24 +139,18 @@ * @param[in] length The segment's length * @param[in] speed The speed allowed on this segment * @param[in] idx The running index of this segment within the segment's edge - * @param[in] tauff The factor for free-free headway time - * @param[in] taufj The factor for free-jam headway time - * @param[in] taujf The factor for jam-free headway time - * @param[in] taujj The factor for jam-jam headway time - * @param[in] jamThresh percentage of occupied space before the segment is jammed * @param[in] multiQueue whether to install multiple queues on this segment - * @param[in] junctionControl whether junction control is enabled on this segment - * @todo recheck the id; using a ':' as divider is not really nice + * @param[in] edgeType edge type specific meso parameters such as the different taus */ MESegment(const std::string& id, const MSEdge& parent, MESegment* next, const double length, const double speed, const int idx, const bool multiQueue, - const MSNet::MesoEdgeType& edgeTyp); + const MesoEdgeType& edgeType); /// @brief set model parameters (may be updated from additional file after network loading is complete) - void initSegment(const MSNet::MesoEdgeType& edgeType, const MSEdge& parent); + void initSegment(const MesoEdgeType& edgeType, const MSEdge& parent, const double capacity); /// @name Measure collection /// @{ @@ -221,6 +236,14 @@ return myLength; } + /** @brief Returns the sum of the lengths of all usable lanes of the segment in meters. + * + * @return the capacity of the segment + */ + inline double getCapacity() const { + return myCapacity; + } + /** @brief Returns the occupany of the segment (the sum of the vehicle lengths + minGaps) * * @return the occupany of the segment in meters @@ -445,6 +468,9 @@ */ SUMOTime getLinkPenalty(const MEVehicle* veh) const; + /// @brief called when permissions change due to Rerouter or TraCI + void updatePermissions(); + private: bool overtake(); @@ -514,10 +540,10 @@ double myTau_length; /// @brief The number of lanes represented by the queue * the length of the lane - const double myCapacity; + double myCapacity = 0.; /// @brief The number of lanes represented by the queue * the length of the lane - double myQueueCapacity; + double myQueueCapacity = 0.; /// @brief The space (in m) which needs to be occupied before the segment is considered jammed double myJamThreshold; diff -Nru sumo-1.11.0/src/mesosim/METriggeredCalibrator.cpp sumo-1.12.0/src/mesosim/METriggeredCalibrator.cpp --- sumo-1.11.0/src/mesosim/METriggeredCalibrator.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesosim/METriggeredCalibrator.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -134,7 +134,7 @@ while ((calibrateFlow || calibrateSpeed) && invalidJam()) { hadInvalidJam = true; if (!myHaveWarnedAboutClearingJam) { - WRITE_WARNING("Clearing jam at calibrator '" + getID() + "' at time " + time2string(currentTime)); + WRITE_WARNINGF("Clearing jam at calibrator '%' at time=%.", getID(), time2string(currentTime)); } // remove one vehicle currently on the segment if (mySegment->vaporizeAnyCar(currentTime, this)) { @@ -142,7 +142,7 @@ } else { if (!myHaveWarnedAboutClearingJam) { // this frequenly happens for very short edges - WRITE_WARNING("Could not clear jam at calibrator '" + getID() + "' at time " + time2string(currentTime)); + WRITE_WARNINGF("Could not clear jam at calibrator '%' at time=%.", getID(), time2string(currentTime)); } break; } @@ -237,7 +237,7 @@ } //assert(!invalidJam()); if (invalidJam()) { - WRITE_WARNING("DEBUG: Could not clear jam at calibrator '" + getID() + "' at time " + time2string(currentTime)); + WRITE_WARNINGF("DEBUG: Could not clear jam at calibrator '%' at time=%.", getID(), time2string(currentTime)); } return myFrequency; } diff -Nru sumo-1.11.0/src/mesosim/METriggeredCalibrator.h sumo-1.12.0/src/mesosim/METriggeredCalibrator.h --- sumo-1.11.0/src/mesosim/METriggeredCalibrator.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesosim/METriggeredCalibrator.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/mesosim/MEVehicleControl.cpp sumo-1.12.0/src/mesosim/MEVehicleControl.cpp --- sumo-1.11.0/src/mesosim/MEVehicleControl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesosim/MEVehicleControl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/mesosim/MEVehicleControl.h sumo-1.12.0/src/mesosim/MEVehicleControl.h --- sumo-1.11.0/src/mesosim/MEVehicleControl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesosim/MEVehicleControl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/mesosim/MEVehicle.cpp sumo-1.12.0/src/mesosim/MEVehicle.cpp --- sumo-1.11.0/src/mesosim/MEVehicle.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesosim/MEVehicle.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -211,12 +212,13 @@ SUMOTime MEVehicle::checkStop(SUMOTime time) { + const SUMOTime initialTime = time; bool hadStop = false; MSNet* const net = MSNet::getInstance(); SUMOTime dummy = -1; // boarding- and loading-time are not considered for (MSStop& stop : myStops) { if (stop.edge != myCurrEdge || stop.segment != mySegment) { - return time; + break; } const SUMOTime cur = time; if (stop.duration > 0) { // it might be a triggered stop with duration -1 @@ -238,7 +240,7 @@ if (!hadStop) { MSStopOut::getInstance()->stopStarted(this, getPersonNumber(), getContainerNumber(), myLastEntryTime); } else { - WRITE_WARNINGF("Vehicle '%' has multiple stops on segment '%', time % (stop-output will be merged).", + WRITE_WARNINGF("Vehicle '%' has multiple stops on segment '%', time=% (stop-output will be merged).", getID(), mySegment->getID(), time2string(time)); } } @@ -262,6 +264,10 @@ } hadStop = true; } + MSDevice_Tripinfo* tripinfo = static_cast(getDevice(typeid(MSDevice_Tripinfo))); + if (tripinfo != nullptr) { + tripinfo->updateStopTime(time - initialTime); + } return time; } diff -Nru sumo-1.11.0/src/mesosim/MEVehicle.h sumo-1.12.0/src/mesosim/MEVehicle.h --- sumo-1.11.0/src/mesosim/MEVehicle.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/mesosim/MEVehicle.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -186,7 +186,8 @@ bool resumeFromStopping(); /// @brief get distance for coming to a stop (used for rerouting checks) - double getBrakeGap() const { + double getBrakeGap(bool delayed = false) const { + UNUSED_PARAMETER(delayed); return 0; } @@ -297,17 +298,6 @@ } - /** @brief Returns the number of seconds waited (speed was lesser than 0.1m/s) - * - * The value is reset if the vehicle moves faster than 0.1m/s - * Intentional stopping does not count towards this time. - * @return The time the vehicle is standing - */ - double getWaitingSeconds() const { - return STEPS2TIME(getWaitingTime()); - } - - /// @brief Returns the earliest leave time for the current segment double getEventTimeSeconds() const { return STEPS2TIME(getEventTime()); diff -Nru sumo-1.11.0/src/microsim/actions/Command_SaveTLCoupledDet.cpp sumo-1.12.0/src/microsim/actions/Command_SaveTLCoupledDet.cpp --- sumo-1.11.0/src/microsim/actions/Command_SaveTLCoupledDet.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/actions/Command_SaveTLCoupledDet.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/actions/Command_SaveTLCoupledDet.h sumo-1.12.0/src/microsim/actions/Command_SaveTLCoupledDet.h --- sumo-1.11.0/src/microsim/actions/Command_SaveTLCoupledDet.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/actions/Command_SaveTLCoupledDet.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp sumo-1.12.0/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp --- sumo-1.11.0/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/actions/Command_SaveTLCoupledLaneDet.h sumo-1.12.0/src/microsim/actions/Command_SaveTLCoupledLaneDet.h --- sumo-1.11.0/src/microsim/actions/Command_SaveTLCoupledLaneDet.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/actions/Command_SaveTLCoupledLaneDet.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/actions/Command_SaveTLSProgram.cpp sumo-1.12.0/src/microsim/actions/Command_SaveTLSProgram.cpp --- sumo-1.11.0/src/microsim/actions/Command_SaveTLSProgram.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/actions/Command_SaveTLSProgram.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -54,7 +54,7 @@ myTLSID = myLogics.getActive()->getID(); } if (myPreviousStates.size() == 0 || myPreviousStates.back().getState() != state) { - myPreviousStates.push_back(MSPhaseDefinition(0, state, std::vector(), name)); + myPreviousStates.push_back(MSPhaseDefinition(0, state, name)); } myPreviousStates.back().duration += DELTA_T; return DELTA_T; diff -Nru sumo-1.11.0/src/microsim/actions/Command_SaveTLSProgram.h sumo-1.12.0/src/microsim/actions/Command_SaveTLSProgram.h --- sumo-1.11.0/src/microsim/actions/Command_SaveTLSProgram.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/actions/Command_SaveTLSProgram.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/actions/Command_SaveTLSState.cpp sumo-1.12.0/src/microsim/actions/Command_SaveTLSState.cpp --- sumo-1.11.0/src/microsim/actions/Command_SaveTLSState.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/actions/Command_SaveTLSState.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/actions/Command_SaveTLSState.h sumo-1.12.0/src/microsim/actions/Command_SaveTLSState.h --- sumo-1.11.0/src/microsim/actions/Command_SaveTLSState.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/actions/Command_SaveTLSState.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/actions/Command_SaveTLSSwitches.cpp sumo-1.12.0/src/microsim/actions/Command_SaveTLSSwitches.cpp --- sumo-1.11.0/src/microsim/actions/Command_SaveTLSSwitches.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/actions/Command_SaveTLSSwitches.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/actions/Command_SaveTLSSwitches.h sumo-1.12.0/src/microsim/actions/Command_SaveTLSSwitches.h --- sumo-1.11.0/src/microsim/actions/Command_SaveTLSSwitches.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/actions/Command_SaveTLSSwitches.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/actions/Command_SaveTLSSwitchStates.cpp sumo-1.12.0/src/microsim/actions/Command_SaveTLSSwitchStates.cpp --- sumo-1.11.0/src/microsim/actions/Command_SaveTLSSwitchStates.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/actions/Command_SaveTLSSwitchStates.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/actions/Command_SaveTLSSwitchStates.h sumo-1.12.0/src/microsim/actions/Command_SaveTLSSwitchStates.h --- sumo-1.11.0/src/microsim/actions/Command_SaveTLSSwitchStates.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/actions/Command_SaveTLSSwitchStates.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/CC_Const.h sumo-1.12.0/src/microsim/cfmodels/CC_Const.h --- sumo-1.11.0/src/microsim/cfmodels/CC_Const.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/CC_Const.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/CC_VehicleVariables.cpp sumo-1.12.0/src/microsim/cfmodels/CC_VehicleVariables.cpp --- sumo-1.11.0/src/microsim/cfmodels/CC_VehicleVariables.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/CC_VehicleVariables.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/CC_VehicleVariables.h sumo-1.12.0/src/microsim/cfmodels/CC_VehicleVariables.h --- sumo-1.11.0/src/microsim/cfmodels/CC_VehicleVariables.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/CC_VehicleVariables.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_ACC.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_ACC.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_ACC.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_ACC.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_ACC.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_ACC.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_ACC.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_ACC.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_CACC.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_CACC.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_CACC.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_CACC.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -309,7 +309,7 @@ // gap closing mode #if DEBUG_CACC == 1 if (DEBUG_COND) { - std::cout << " applying gap closing" << std::endl; + std::cout << " applying gap closing err=" << spacingErr << " err1=" << spacingErr1 << " predSpeed=" << predSpeed << " speed=" << speed << " accel=" << accel << "\n"; } #endif newSpeed = speed + myGapClosingControlGainGap * spacingErr + myGapClosingControlGainGapDot * spacingErr1; @@ -441,13 +441,21 @@ //std::cout << veh->getID() << " commMode: " << commMode << ", caccVehicleMode: " << VehicleModeNames[vehMode] // << ", gap2pred: " << gap2pred << ", newSpeed: " << newSpeed << std::endl; + // newSpeed is meant for step length 0.1 but this would cause extreme + // accelerations at lower step length + double newSpeedScaled = newSpeed; + if (DELTA_T < 100) { + const double accel01 = (newSpeed - speed) * 10; + newSpeedScaled = speed + ACCEL2SPEED(accel01); + } + #if DEBUG_CACC == 1 if (DEBUG_COND) { - std::cout << " result: accel=" << SPEED2ACCEL(newSpeed - speed) << " newSpeed=" << newSpeed << std::endl; + std::cout << " result: rawAccel=" << SPEED2ACCEL(newSpeed - speed) << " newSpeed=" << newSpeed << " newSpeedScaled=" << newSpeedScaled << "\n"; } #endif - return MAX2(0., newSpeed); + return MAX2(0., newSpeedScaled); } diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_CACC.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_CACC.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_CACC.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_CACC.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_CC.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_CC.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_CC.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_CC.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_CC.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_CC.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_CC.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_CC.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -713,12 +713,12 @@ double -MSCFModel::maximumSafeStopSpeed(double g /*gap*/, double decel, double v /*currentSpeed*/, bool onInsertion, double headway) const { +MSCFModel::maximumSafeStopSpeed(double gap, double decel, double currentSpeed, bool onInsertion, double headway) const { double vsafe; if (MSGlobals::gSemiImplicitEulerUpdate) { - vsafe = maximumSafeStopSpeedEuler(g, decel, headway); + vsafe = maximumSafeStopSpeedEuler(gap, decel, onInsertion, headway); } else { - vsafe = maximumSafeStopSpeedBallistic(g, decel, v, onInsertion, headway); + vsafe = maximumSafeStopSpeedBallistic(gap, decel, currentSpeed, onInsertion, headway); } // if (myDecel != myEmergencyDecel) { @@ -763,17 +763,16 @@ double -MSCFModel::maximumSafeStopSpeedEuler(double gap, double decel, double headway) const { - gap -= NUMERICAL_EPS; // lots of code relies on some slack XXX: it shouldn't... - if (gap <= 0) { - return 0; +MSCFModel::maximumSafeStopSpeedEuler(double gap, double decel, bool /* onInsertion */, double headway) const { + // decrease gap slightly (to avoid passing end of lane by values of magnitude ~1e-12, when exact stop is required) + const double g = gap - NUMERICAL_EPS; + if (g < 0.) { + return 0.; } - const double g = gap; const double b = ACCEL2SPEED(decel); const double t = headway >= 0 ? headway : myHeadwayTime; const double s = TS; - // h = the distance that would be covered if it were possible to stop // exactly after gap and decelerate with b every simulation step // h = 0.5 * n * (n-1) * b * s + n * b * t (solve for n) @@ -787,13 +786,14 @@ const double x = n * b + r; assert(x >= 0); return x; +// return onInsertion ? x + b: x; // see #2574 } double -MSCFModel::maximumSafeStopSpeedBallistic(double g /*gap*/, double decel, double v /*currentSpeed*/, bool onInsertion, double headway) const { +MSCFModel::maximumSafeStopSpeedBallistic(double gap, double decel, double currentSpeed, bool onInsertion, double headway) const { // decrease gap slightly (to avoid passing end of lane by values of magnitude ~1e-12, when exact stop is required) - g = MAX2(0., g - NUMERICAL_EPS); + const double g = MAX2(0., gap - NUMERICAL_EPS); headway = headway >= 0 ? headway : myHeadwayTime; // (Leo) Note that in contrast to the Euler update, for the ballistic update @@ -820,7 +820,7 @@ // still allows us to stop in time. const double tau = headway == 0 ? TS : headway; - const double v0 = MAX2(0., v); + const double v0 = MAX2(0., currentSpeed); // We first consider the case that a stop has to take place within time tau if (v0 * tau >= 2 * g) { if (g == 0.) { diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Daniel1.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Daniel1.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Daniel1.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Daniel1.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Daniel1.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Daniel1.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Daniel1.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Daniel1.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_EIDM.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_EIDM.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_EIDM.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_EIDM.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -180,12 +180,48 @@ } double +MSCFModel_EIDM::patchSpeedBeforeLCEIDM(const MSVehicle* /*veh*/, double vMin, double vMax, VehicleVariables* vars) const { + // The default value of SUMO_ATTR_JM_SIGMA_MINOR is sigma, not sigmaerror (used in EIDM), + // so we do not use SUMO_ATTR_JM_SIGMA_MINOR as parameter here, because this could confuse users... + //const double sigma = (veh->passingMinor() + // ? veh->getVehicleType().getParameter().getJMParam(SUMO_ATTR_JM_SIGMA_MINOR, myDawdle) + // : myDawdle); + + // dawdling/drivingerror is now calculated here (in finalizeSpeed, not in stop-/follow-/freeSpeed anymore): + // Instead of just multiplying mySigmaerror with vars->myw_error, we add a factor depending on the criticality of the situation, + // measured with s*/gap. Because when the driver drives "freely" (nothing in front) he may dawdle more than in e.g. congested traffic! + double drivingerror = 0.0; + const double s = myType->getMinGap() + MAX2(0., vars->myv_est * myHeadwayTime + vars->myv_est * (vars->myv_est - vars->myv_est_l) / myTwoSqrtAccelDecel); + if (vMax > EST_REAC_THRESHOLD) { + if (s / vars->mys_est >= 0.5) { + drivingerror = mySigmaerror * vars->myw_error; + } else if (s / vars->mys_est < 0.1) { + drivingerror = mySigmaerror * vars->myw_error * 2.5; + } else if (s / vars->mys_est < 0.15) { + drivingerror = mySigmaerror * vars->myw_error * 2.1; + } else if (s / vars->mys_est < 0.2) { + drivingerror = mySigmaerror * vars->myw_error * 1.8; + } else if (s / vars->mys_est < 0.25) { + drivingerror = mySigmaerror * vars->myw_error * 1.5; + } else if (s / vars->mys_est < 0.3) { + drivingerror = mySigmaerror * vars->myw_error * 1.3; + } else if (s / vars->mys_est < 0.5) { + drivingerror = mySigmaerror * vars->myw_error * 1.1; + } + } + + //const double vDawdle = MAX2(vMin, dawdle2(vMax, sigma, veh->getRNG())); + const double vDawdle = MAX2(vMin, vMax + ACCEL2SPEED(drivingerror)); + return vDawdle; +} + +double MSCFModel_EIDM::finalizeSpeed(MSVehicle* const veh, double vPos) const { // finalizeSpeed is only called once every timestep! VehicleVariables* vars = (VehicleVariables*)veh->getCarFollowVariables(); - - const double oldV = veh->getSpeed(); // save old v for optional acceleration computation + // save old v for optional acceleration computation + const double oldV = veh->getSpeed(); // @ToDo: Maybe change whole calculation to calculate real freeSpeed/stopSpeed/followSpeed in every call and here calculate resulting speed with reaction Time and update?! // @ToDo: Could check which call resulted in speed update with stop-vector containing all calculated accelerations! @@ -198,19 +234,24 @@ } } - double vSafe = MIN2(vPos, veh->processNextStop(vPos)); // process stops (includes update of stopping state) - + // process stops (includes update of stopping state) + const double vStop = MIN2(vPos, veh->processNextStop(vPos)); + // apply deceleration bounds + const double vMinEmergency = minNextSpeedEmergency(oldV, veh); + // vPos contains the uppper bound on safe speed. allow emergency braking here + const double vMin = MIN2(minNextSpeed(oldV, veh), MAX2(vPos, vMinEmergency)); // apply planned speed constraints and acceleration constraints - const double vMax = MIN2(maxNextSpeed(oldV, veh), vSafe); + double vMax = MIN2(maxNextSpeed(oldV, veh), vStop); + vMax = MAX2(vMin, vMax); + + // apply further speed adaptations + double vNext = patchSpeedBeforeLCEIDM(veh, vMin, vMax, vars); - double vMin, vNext; if (MSGlobals::gSemiImplicitEulerUpdate) { - // we cannot rely on never braking harder than maxDecel because TraCI or strange cf models may decide to do so - vMin = MIN2(getSpeedAfterMaxDecel(oldV), vMax); - // Using the original MSCFModel::finalizeSpeed function, the vehicle could brake with its EmergencyDecel, - // to let other vehicles change to the respected lane. This is not allowed here. - vNext = veh->getLaneChangeModel().patchSpeed(vMin, vMax, vMax, *this); + // The model does not directly use vNext from patchSpeed (like the original MSCFModel::finalizeSpeed function), + // but rather slowly adapts to vNext. + vNext = veh->getLaneChangeModel().patchSpeed(vMin, vNext, vMax, *this); // Bound the positive change of the acceleration with myJerkmax if (vNext > oldV && oldV > EST_REAC_THRESHOLD) { @@ -240,7 +281,6 @@ // for ballistic update, negative vnext must be allowed to // indicate a stop within the coming timestep (i.e., to attain negative values) - vMin = MIN2(minNextSpeed(oldV, veh), vMax); vNext = veh->getLaneChangeModel().patchSpeed(vMin, vMax, vMax, *this); // (Leo) finalizeSpeed() is responsible for assuring that the next // velocity is chosen in accordance with maximal decelerations. @@ -734,7 +774,6 @@ // ToDo: The headway can change for IDMM based on the scenario, should something like that also be integrated here??? double headwayTime = myHeadwayTime; - double drivingerror = 0; double korrektor = 0.5; MSVehicle* leader; @@ -768,41 +807,20 @@ } } - // drivingerror is calculated here: - // Instead of just multiplying mySigmaerror with vars->myw_error, we add a factor depending on the criticality of the situation, - // measured with s*/gap. Because when the driver drives "freely" (nothing in front) he may dawdle more than in e.g. congested traffic! - if (current_estSpeed > EST_REAC_THRESHOLD) { - if (s / estGap >= 0.5) { - drivingerror = mySigmaerror * vars->myw_error; - } else if (s / estGap < 0.5) { - drivingerror = mySigmaerror * vars->myw_error * 1.1; - } else if (s / estGap < 0.3) { - drivingerror = mySigmaerror * vars->myw_error * 1.3; - } else if (s / estGap < 0.25) { - drivingerror = mySigmaerror * vars->myw_error * 1.5; - } else if (s / estGap < 0.2) { - drivingerror = mySigmaerror * vars->myw_error * 1.8; - } else if (s / estGap < 0.15) { - drivingerror = mySigmaerror * vars->myw_error * 2.1; - } else if (s / estGap < 0.1) { - drivingerror = mySigmaerror * vars->myw_error * 2.5; - } - } - double a_corr = 1; // Variable for correction term // initialised here with 1., because wantedacc and wouldacc is used and calculation without the correction term (is added/multiplied later) // IDM calculation: - // wantedacc = a_corr*myAccel * (1. - pow(estSpeed / v0, myDelta) - (s * s) / (estGap * estGap)) + drivingerror; + // wantedacc = a_corr*myAccel * (1. - pow(estSpeed / v0, myDelta) - (s * s) / (estGap * estGap)); // IIDM calculation -NOT- from the original Treiber/Kesting publication: // With the saved variables from the last Action Point /*double wantedacc; double a_free = a_corr*myAccel * (1. - pow(estSpeed / v0, myDelta)); if (s >= estGap) { // This is the IIDM - wantedacc = a_corr*myAccel * (1. - (s * s) / (estGap * estGap)) + drivingerror; + wantedacc = a_corr*myAccel * (1. - (s * s) / (estGap * estGap)); } else { - wantedacc = a_free * (1. - pow(s / estGap, 2*a_corr*myAccel / fabs(a_free))) + drivingerror; + wantedacc = a_free * (1. - pow(s / estGap, 2*a_corr*myAccel / fabs(a_free))); }*/ // Old calculation form without the distinction between v > v0 and v <= v0!!! Published it in the EIDM with this form, but may be worse than original IIDM! // IIDM calculation from the original Treiber/Kesting publication: @@ -810,16 +828,16 @@ if (estSpeed <= v0) { a_free = a_corr * myAccel * (1. - pow(estSpeed / v0, myDelta)); if (s >= estGap) { - wantedacc = a_corr * myAccel * (1. - (s * s) / (estGap * estGap)) + drivingerror; + wantedacc = a_corr * myAccel * (1. - (s * s) / (estGap * estGap)); } else { - wantedacc = a_free * (1. - pow(s / estGap, 2 * a_corr * myAccel / a_free)) + drivingerror; + wantedacc = a_free * (1. - pow(s / estGap, 2 * a_corr * myAccel / a_free)); } } else { // estSpeed > v0 a_free = - a_corr * myDecel * (1. - pow(v0 / estSpeed, myAccel * myDelta / myDecel)); if (s >= estGap) { - wantedacc = a_free + a_corr * myAccel * (1. - (s * s) / (estGap * estGap)) + drivingerror; + wantedacc = a_free + a_corr * myAccel * (1. - (s * s) / (estGap * estGap)); } else { - wantedacc = a_free + drivingerror; + wantedacc = a_free; } } @@ -832,16 +850,16 @@ if (current_estSpeed <= v0) { woulda_free = a_corr * myAccel * (1. - pow(current_estSpeed / v0, myDelta)); if (woulds >= current_estGap) { - wouldacc = a_corr * myAccel * (1. - (woulds * woulds) / (current_estGap * current_estGap)) + drivingerror; + wouldacc = a_corr * myAccel * (1. - (woulds * woulds) / (current_estGap * current_estGap)); } else { - wouldacc = woulda_free * (1. - pow(woulds / current_estGap, 2 * a_corr * myAccel / woulda_free)) + drivingerror; + wouldacc = woulda_free * (1. - pow(woulds / current_estGap, 2 * a_corr * myAccel / woulda_free)); } } else { // current_estSpeed > v0 woulda_free = - a_corr * myDecel * (1. - pow(v0 / current_estSpeed, myAccel * myDelta / myDecel)); if (woulds >= current_estGap) { - wouldacc = woulda_free + a_corr * myAccel * (1. - (woulds * woulds) / (current_estGap * current_estGap)) + drivingerror; + wouldacc = woulda_free + a_corr * myAccel * (1. - (woulds * woulds) / (current_estGap * current_estGap)); } else { - wouldacc = woulda_free + drivingerror; + wouldacc = woulda_free; } } } @@ -878,29 +896,29 @@ double calc_gap = estGap; /*a_free = a_corr*myAccel * (1. - pow(estSpeed / v0, myDelta)); if (s >= calc_gap) { // This is the IIDM - acc = a_corr*myAccel * (1. - (s * s) / (calc_gap * calc_gap)) + drivingerror; + acc = a_corr*myAccel * (1. - (s * s) / (calc_gap * calc_gap)); } else { - acc = a_free * (1. - pow(s / calc_gap, 2*a_corr*myAccel / fabs(a_free))) + drivingerror; + acc = a_free * (1. - pow(s / calc_gap, 2*a_corr*myAccel / fabs(a_free))); } */ // Old calculation form without the distinction between v > v0 and v <= v0!!! Published it in the EIDM with this form, but may be worse than original IIDM! // IDM calculation: - // acc = a_corr*myAccel * (1. - pow(estSpeed / v0, myDelta) - (s * s) / (calc_gap * calc_gap)) + drivingerror; + // acc = a_corr*myAccel * (1. - pow(estSpeed / v0, myDelta) - (s * s) / (calc_gap * calc_gap)); // IIDM calculation from the original Treiber/Kesting publication: // Resulting acceleration also with the correct drive off term. if (estSpeed <= v0) { a_free = a_corr * myAccel * (1. - pow(estSpeed / v0, myDelta)); if (s >= calc_gap) { - acc = a_corr * myAccel * (1. - (s * s) / (calc_gap * calc_gap)) + drivingerror; + acc = a_corr * myAccel * (1. - (s * s) / (calc_gap * calc_gap)); } else { - acc = a_free * (1. - pow(s / calc_gap, 2 * a_corr * myAccel / a_free)) + drivingerror; + acc = a_free * (1. - pow(s / calc_gap, 2 * a_corr * myAccel / a_free)); } } else { // estSpeed > v0 a_free = - a_corr * myDecel * (1. - pow(v0 / estSpeed, myAccel * myDelta / myDecel)); if (s >= calc_gap) { - acc = a_free + a_corr * myAccel * (1. - (s * s) / (calc_gap * calc_gap)) + drivingerror; + acc = a_free + a_corr * myAccel * (1. - (s * s) / (calc_gap * calc_gap)); } else { - acc = a_free + drivingerror; + acc = a_free; } } diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_EIDM.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_EIDM.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_EIDM.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_EIDM.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -262,6 +262,15 @@ }; private: + + /** @brief Applies dawdling / driving error + * @param[in] veh The ego vehicle + * @param[in] vMin The minimum possible speed in the next time step + * @param[in] vMax The wanted speed in the next time step + * @return The corrected speed with dawdling / driving error + */ + double patchSpeedBeforeLCEIDM(const MSVehicle* veh, double vMin, double vMax, VehicleVariables* vars) const; + // @brief contains the main CF-model calculations double _v(const MSVehicle* const veh, const double gap2pred, const double mySpeed, const double predSpeed, const double desSpeed, const bool respectMinGap, const int update) const; diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -558,8 +558,8 @@ /** @brief Returns the maximum next velocity for stopping within gap * @param[in] gap The (netto) distance to the desired stopping point - * @param[in] currentSpeed The current speed of the ego vehicle * @param[in] decel The desired deceleration rate + * @param[in] currentSpeed The current speed of the ego vehicle * @param[in] onInsertion Indicator whether the call is triggered during vehicle insertion * @param[in] headway The desired time headway to be included in the calculations (default argument -1 induces the use of myHeadway) */ @@ -570,8 +570,10 @@ * when using the semi-implicit Euler update * @param[in] gap The (netto) distance to the LEADER * @param[in] decel The desired deceleration rate + * @param[in] onInsertion Indicator whether the call is triggered during vehicle insertion + * @param[in] headway The desired time headway to be included in the calculations (-1 induces the use of myHeadway) */ - double maximumSafeStopSpeedEuler(double gap, double decel, double headway = -1) const; + double maximumSafeStopSpeedEuler(double gap, double decel, bool onInsertion, double headway) const; /** @brief Returns the maximum next velocity for stopping within gap diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_IDM.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_IDM.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_IDM.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_IDM.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_IDM.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_IDM.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_IDM.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_IDM.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Kerner.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Kerner.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Kerner.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Kerner.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Kerner.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Kerner.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Kerner.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Kerner.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Krauss.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Krauss.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Krauss.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Krauss.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Krauss.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Krauss.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Krauss.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Krauss.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_KraussOrig1.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_KraussOrig1.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_KraussOrig1.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_KraussOrig1.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_KraussPS.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_KraussPS.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_KraussPS.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_KraussPS.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_KraussPS.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_KraussPS.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_KraussPS.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_KraussPS.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_KraussX.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_KraussX.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_KraussX.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_KraussX.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_KraussX.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_KraussX.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_KraussX.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_KraussX.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_PWag2009.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_PWag2009.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_PWag2009.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_PWag2009.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_PWag2009.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_PWag2009.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_PWag2009.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_PWag2009.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Rail.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Rail.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Rail.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Rail.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Rail.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Rail.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Rail.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Rail.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_SmartSK.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_SmartSK.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_SmartSK.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_SmartSK.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_SmartSK.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_SmartSK.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_SmartSK.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_SmartSK.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_W99.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_W99.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_W99.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_W99.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2011-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_W99.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_W99.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_W99.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_W99.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2011-2022 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/ @@ -22,6 +22,9 @@ // Andre Stebens - Traffic simulation with the Wiedemann model // Werner - Integration von Fahrzeugfolge- und Fahrstreifenwechselmodellen in die Nachtfahrsimulation LucidDrive // Olstam, Tapani - Comparison of Car-following models +// Higgs, B. et.al - Analysis of theWiedemann car following model over different speeds using naturalistic data. +// Ahmed, H.U.; Huang, Y.; Lu, P. - A Review of Car-Following Models and Modeling Tools forHuman and Autonomous-Ready Driving Behaviors in Micro-Simulation + /****************************************************************************/ #include @@ -40,6 +43,10 @@ // magic constant proposed by Wiedemann (based on real world measurements) const double MSCFModel_Wiedemann::D_MAX = 150; +#define B_MIN_MULT 0 +#define B_MIN_ADD -1 +#define PRED_DECEL_MULT 0.5 +#define PRED_DECEL_MULT_EMERGENCY 0.55 // =========================================================================== // method definitions @@ -50,7 +57,8 @@ myEstimation(vtype->getParameter().getCFParam(SUMO_ATTR_CF_WIEDEMANN_ESTIMATION, 0.5)), myAX(vtype->getLength() + 1. + 2. * mySecurity), myCX(25. *(1. + mySecurity + myEstimation)), - myMinAccel(0.2 * myAccel) { // +noise? + myMinAccel(0.2 * myAccel), + myMaxApproachingDecel((myDecel + myEmergencyDecel) / 2) { // Wiedemann does not drive very precise and may violate minGap on occasion myCollisionMinGapFactor = vtype->getParameter().getCFParam(SUMO_ATTR_COLLISION_MINGAP_FACTOR, 0.1); } @@ -69,8 +77,8 @@ double -MSCFModel_Wiedemann::followSpeed(const MSVehicle* const veh, double /* speed */, double gap2pred, double predSpeed, double /*predMaxDecel*/, const MSVehicle* const /*pred*/) const { - return _v(veh, predSpeed, gap2pred); +MSCFModel_Wiedemann::followSpeed(const MSVehicle* const veh, double /* speed */, double gap2pred, double predSpeed, double /*predMaxDecel*/, const MSVehicle* const pred) const { + return _v(veh, predSpeed, gap2pred, pred != nullptr ? pred->getAcceleration() : 0); } @@ -108,7 +116,7 @@ double -MSCFModel_Wiedemann::_v(const MSVehicle* veh, double predSpeed, double gap) const { +MSCFModel_Wiedemann::_v(const MSVehicle* veh, double predSpeed, double gap, double predAccel) const { const VehicleVariables* vars = (VehicleVariables*)veh->getCarFollowVariables(); const double dx = gap + myType->getLength(); // wiedemann uses brutto gap const double v = veh->getSpeed(); @@ -123,36 +131,51 @@ const double sdv = sdv_root * sdv_root; const double cldv = sdv * ex * ex; const double opdv = cldv * (-1 - 2 * RandHelper::randNorm(0.5, 0.15, veh->getRNG())); + // D_MAX is too low to brake safely when driving at speeds above 36m/s + const double dmax = MAX2(D_MAX, brakeGap(v, myDecel, 0)); // select the regime, get new acceleration, compute new speed based double accel; + int branch = 0; if (dx <= abx) { - accel = emergency(dv, dx); + accel = emergency(dv, dx, predAccel, v, gap, abx, bx); + branch = 1; } else if (dx < sdx) { if (dv > cldv) { - accel = approaching(dv, dx, abx); + accel = approaching(dv, dx, abx, predAccel); + branch = 2; } else if (dv > opdv) { accel = following(vars->accelSign); + branch = 3; } else { accel = fullspeed(v, vpref, dx, abx); + branch = 4; } } else { - if (dv > sdv && dx < D_MAX) { //@note other versions have an disjunction instead of conjunction - accel = approaching(dv, dx, abx); + if (dv > sdv && dx < dmax) { //@note other versions have an disjunction instead of conjunction + accel = approaching(dv, dx, abx, predAccel); + branch = 5; } else { accel = fullspeed(v, vpref, dx, abx); + branch = 6; } } - // since we have hard constrainst on accel we may as well use them here + // since we have hard constraints on accel we may as well use them here +#ifdef DEBUG_V + const double rawAccel = accel; +#endif accel = MAX2(MIN2(accel, myAccel), -myEmergencyDecel); const double vNew = MAX2(0., v + ACCEL2SPEED(accel)); // don't allow negative speeds #ifdef DEBUG_V - if (veh->isSelected()) { + if (veh->isSelected() && !MSGlobals::gComputeLC) { std::cout << SIMTIME << " Wiedemann::_v veh=" << veh->getID() - << " predSpeed=" << predSpeed << " gap=" << gap + << " v=" << v << " pV=" << predSpeed << " pA=" << predAccel << " gap=" << gap << " dv=" << dv << " dx=" << dx << " ax=" << myAX << " bx=" << bx << " abx=" << abx << " sdx=" << sdx << " sdv=" << sdv << " cldv=" << cldv << " opdv=" << opdv + << " branch=" << branch << " rawAccel=" << rawAccel << " accel=" << accel << " vNew=" << vNew << "\n"; } +#else + UNUSED_PARAMETER(branch); #endif return vNew; } @@ -178,22 +201,28 @@ double -MSCFModel_Wiedemann::approaching(double dv, double dx, double abx) const { +MSCFModel_Wiedemann::approaching(double dv, double dx, double abx, double predAccel) const { // there is singularity in the formula. we do the sanity check outside assert(abx < dx); - return 0.5 * dv * dv / (abx - dx); // + predAccel at t-reaction_time if this is value is above a treshold + // @note: the original model does not have a limit on maximum deceleration here. + // We add this to avoid cascading emergency deceleration + // also, the multiplier on predAccel is always 1 in the original model + return MAX2(0.5 * dv * dv / (abx - dx) + predAccel * PRED_DECEL_MULT, -myMaxApproachingDecel); } double -MSCFModel_Wiedemann::emergency(double dv, double dx) const { +MSCFModel_Wiedemann::emergency(double dv, double dx, double predAccel, double v, double gap, double abx, double bx) const { // wiedemann assumes that dx will always be larger than myAX (sumo may // violate this assumption when crashing (-: + // + // predAccel is called b_(n-1) in the literature and it's multipleir is always 1 + if (dx > myAX) { - double accel = 0.5 * dv * dv / (myAX - dx); // + predAccel at t-reaction_time if this is value is above a treshold - // one would assume that in an emergency accel must be negative. However the - // wiedemann formula allows for accel = 0 whenever dv = 0 - assert(accel <= 0); + const double bmin = B_MIN_ADD + B_MIN_MULT * v; + const double accel = (0.5 * dv * dv / (myAX - dx) + + predAccel * PRED_DECEL_MULT_EMERGENCY + + bmin * (abx - gap) / bx); return accel; } else { return -myEmergencyDecel; diff -Nru sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Wiedemann.h sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Wiedemann.h --- sumo-1.11.0/src/microsim/cfmodels/MSCFModel_Wiedemann.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/MSCFModel_Wiedemann.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -136,14 +136,14 @@ /* @brief the main enty point for the speed computation * @param[in] gap The netto gap (front bumper of ego to back bumper of leader) */ - double _v(const MSVehicle* veh, double predSpeed, double gap) const; + double _v(const MSVehicle* veh, double predSpeed, double gap, double predAccel) const; /// @name acceleration based on the 'driving regime' /// @{ double fullspeed(double v, double vpref, double dx, double bx) const; // also 'WUNSCH' double following(double sign) const; // also 'FOLGEN' - double approaching(double dv, double dx, double abx) const; // also 'BREMSBX' - double emergency(double dv, double dx) const; // also 'BREMSAX' + double approaching(double dv, double dx, double abx, double predAccel) const; // also 'BREMSBX' + double emergency(double dv, double dx, double predAccel, double v, double gap, double abx, double bx) const; // also 'BREMSAX' /// @} private: @@ -165,6 +165,9 @@ /// @brief The vehicle's minimum acceleration [m/s^2] // also b_null const double myMinAccel; + /// @brief The maximum deceleration when approaching + const double myMaxApproachingDecel; + /// @brief free-flow distance in m static const double D_MAX; /// @} diff -Nru sumo-1.11.0/src/microsim/cfmodels/ParBuffer.h sumo-1.12.0/src/microsim/cfmodels/ParBuffer.h --- sumo-1.11.0/src/microsim/cfmodels/ParBuffer.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/cfmodels/ParBuffer.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Battery.cpp sumo-1.12.0/src/microsim/devices/MSDevice_Battery.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_Battery.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Battery.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Battery.h sumo-1.12.0/src/microsim/devices/MSDevice_Battery.h --- sumo-1.11.0/src/microsim/devices/MSDevice_Battery.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Battery.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Bluelight.cpp sumo-1.12.0/src/microsim/devices/MSDevice_Bluelight.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_Bluelight.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Bluelight.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -63,9 +64,13 @@ MSDevice_Bluelight::buildVehicleDevices(SUMOVehicle& v, std::vector& into) { OptionsCont& oc = OptionsCont::getOptions(); if (equippedByDefaultAssignmentOptions(oc, "bluelight", v, false)) { - MSDevice_Bluelight* device = new MSDevice_Bluelight(v, "bluelight_" + v.getID(), - getFloatParam(v, oc, "bluelight.reactiondist", oc.getFloat("device.bluelight.reactiondist"), false)); - into.push_back(device); + if (MSGlobals::gUseMesoSim) { + WRITE_WARNINGF("bluelight device is not compatible with mesosim (ignored for vehicle '%')", v.getID()); + } else { + MSDevice_Bluelight* device = new MSDevice_Bluelight(v, "bluelight_" + v.getID(), + getFloatParam(v, oc, "bluelight.reactiondist", oc.getFloat("device.bluelight.reactiondist"), false)); + into.push_back(device); + } } } @@ -98,83 +103,100 @@ //violate red lights this only need to be done once so shift it todo MSVehicle& ego = dynamic_cast(veh); MSVehicle::Influencer& redLight = ego.getInfluencer(); + const double vMax = ego.getLane()->getVehicleMaxSpeed(&ego); redLight.setSpeedMode(7); - if (veh.getWaitingTime() > TIME2STEPS(1)) { + if (ego.getSpeed() < 0.5 * vMax) { // advance as far as possible (assume vehicles will keep moving out of the way) ego.getLaneChangeModel().setParameter(toString(SUMO_ATTR_LCA_STRATEGIC_PARAM), "-1"); ego.getLaneChangeModel().setParameter(toString(SUMO_ATTR_LCA_SPEEDGAIN_LOOKAHEAD), "0"); + try { + ego.getLaneChangeModel().setParameter(toString(SUMO_ATTR_MINGAP_LAT), "0"); + } catch (InvalidArgument&) { + // not supported by the current laneChangeModel + } } else { // restore defaults ego.getLaneChangeModel().setParameter(toString(SUMO_ATTR_LCA_STRATEGIC_PARAM), ego.getVehicleType().getParameter().getLCParamString(SUMO_ATTR_LCA_STRATEGIC_PARAM, "1")); ego.getLaneChangeModel().setParameter(toString(SUMO_ATTR_LCA_SPEEDGAIN_LOOKAHEAD), ego.getVehicleType().getParameter().getLCParamString(SUMO_ATTR_LCA_SPEEDGAIN_LOOKAHEAD, "5")); + try { + ego.getLaneChangeModel().setParameter(toString(SUMO_ATTR_MINGAP_LAT), + toString(ego.getVehicleType().getMinGapLat())); + } catch (InvalidArgument&) { + // not supported by the current laneChangeModel + } } // build a rescue lane for all vehicles on the route of the emergency vehicle within the range of the siren MSVehicleType* vt = MSNet::getInstance()->getVehicleControl().getVType(veh.getVehicleType().getID()); vt->setPreferredLateralAlignment(LatAlignmentDefinition::ARBITRARY); MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl(); - //std::string currentEdgeID = veh.getEdge()->getID(); - //use edges on the way of the emergency vehicle - std::vector myUpcomingLanes = ego.getUpcomingLanesUntil(myReactionDist); - std::vector myUpcomingEdges; - std::set myUpcomingVehicles; - std::set lastStepInfluencedVehicles = influencedVehicles; - //get edgeIDs from Lanes - for (const MSLane* const l : myUpcomingLanes) { - myUpcomingEdges.push_back(&l->getEdge()); + // use edges on the way of the emergency vehicle + std::vector upcomingEdges; + std::set upcomingVehicles; + std::set lastStepInfluencedVehicles = myInfluencedVehicles; + std::vector upcomingLinks; + double affectedJunctionDist = ego.getPositionOnLane() + myReactionDist; + for (const MSLane* const l : ego.getUpcomingLanesUntil(myReactionDist)) { + upcomingEdges.push_back(&l->getEdge()); + + affectedJunctionDist -= l->getLength(); + if (affectedJunctionDist > 0 && l->isInternal()) { + upcomingLinks.push_back(l->getIncomingLanes()[0].viaLink); + } } - for (const MSEdge* const e : myUpcomingEdges) { - //inform all vehicles on myUpcomingEdges + for (const MSEdge* const e : upcomingEdges) { + //inform all vehicles on upcomingEdges for (const SUMOVehicle* v : e->getVehicles()) { - myUpcomingVehicles.insert(v->getID()); + upcomingVehicles.insert(dynamic_cast(const_cast(v))); if (lastStepInfluencedVehicles.count(v->getID()) > 0) { lastStepInfluencedVehicles.erase(v->getID()); } } } - // reset all vehicles that were in influencedVehicles in the previous step but not in the current step todo refactor - for (auto elem : lastStepInfluencedVehicles) { - influencedVehicles.erase(elem); - std::map::iterator it = influencedTypes.find(elem); - MSVehicle* veh2 = dynamic_cast(vc.getVehicle(elem)); - if (veh2 != nullptr && it != influencedTypes.end()) { + // reset all vehicles that were in myInfluencedVehicles in the previous step but not in the current step todo refactor + for (std::string vehID : lastStepInfluencedVehicles) { + myInfluencedVehicles.erase(vehID); + std::map::iterator it = myInfluencedTypes.find(vehID); + MSVehicle* veh2 = dynamic_cast(vc.getVehicle(vehID)); + if (veh2 != nullptr && it != myInfluencedTypes.end()) { // The vehicle gets back its old VehicleType after the emergency vehicle have passed them resetVehicle(veh2, it->second); } } - for (std::string vehID : myUpcomingVehicles) { - MSVehicle* veh2 = dynamic_cast(vc.getVehicle(vehID)); + for (MSVehicle* veh2 : upcomingVehicles) { assert(veh2 != nullptr); if (veh2->getLane() == nullptr) { continue; } - //Vehicle only from edge should react - if (std::find(myUpcomingEdges.begin(), myUpcomingEdges.end(), &veh2->getLane()->getEdge()) != myUpcomingEdges.end()) { //currentEdgeID == veh2->getEdge()->getID()) + if (std::find(upcomingEdges.begin(), upcomingEdges.end(), &veh2->getLane()->getEdge()) != upcomingEdges.end()) { if (veh2->getDevice(typeid(MSDevice_Bluelight)) != nullptr) { // emergency vehicles should not react continue; } - const int numLanes = (int)veh2->getEdge()->getLanes().size(); - //make sure that vehicle are still building the a rescue lane - if (influencedVehicles.count(veh2->getID()) > 0) { - //Vehicle gets a new Vehicletype to change the alignment and the lanechange options + const int numLanes = (int)veh2->getLane()->getEdge().getNumLanes(); + // make sure that vehicle are still building the a rescue lane + if (myInfluencedVehicles.count(veh2->getID()) > 0) { + // Vehicle gets a new Vehicletype to change the alignment and the lanechange options MSVehicleType& t = veh2->getSingularType(); - //Setting the lateral alignment to build a rescue lane + // Setting the lateral alignment to build a rescue lane + LatAlignmentDefinition align = LatAlignmentDefinition::RIGHT; if (veh2->getLane()->getIndex() == numLanes - 1) { - t.setPreferredLateralAlignment(LatAlignmentDefinition::LEFT); - // the alignement is changet to left for the vehicle std::cout << "New alignment to left for vehicle: " << veh2->getID() << " " << veh2->getVehicleType().getPreferredLateralAlignment() << "\n"; - } else { - t.setPreferredLateralAlignment(LatAlignmentDefinition::RIGHT); - // the alignement is changet to right for the vehicle std::cout << "New alignment to right for vehicle: " << veh2->getID() << " " << veh2->getVehicleType().getPreferredLateralAlignment() << "\n"; + align = LatAlignmentDefinition::LEFT; } + t.setPreferredLateralAlignment(align); +#ifdef DEBUG_BLUELIGHT_RESCUELANE + std::cout << "Refresh alignment for vehicle: " << veh2->getID() + << " laneIndex=" << veh2->getLane()->getIndex() << " numLanes=" << numLanes + << " alignment=" << toString(align) << "\n"; +#endif } double distanceDelta = veh.getPosition().distanceTo(veh2->getPosition()); - //emergency vehicle has to slow down when entering the resuce lane - if (distanceDelta <= 10 && veh.getID() != veh2->getID() && influencedVehicles.count(veh2->getID()) > 0 && veh2->getSpeed() < 1) { + //emergency vehicle has to slow down when entering the rescue lane + if (distanceDelta <= 10 && veh.getID() != veh2->getID() && myInfluencedVehicles.count(veh2->getID()) > 0 && veh2->getSpeed() < 1) { // set ev speed to 20 km/h 0 5.56 m/s std::vector > speedTimeLine; speedTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep(), veh.getSpeed())); @@ -184,36 +206,35 @@ // the perception of the sound of the siren should be around 25 meters // todo only vehicles in front of the emergency vehicle should react - if (distanceDelta <= myReactionDist && veh.getID() != veh2->getID() && influencedVehicles.count(veh2->getID()) == 0) { - //online a percentage of vehicles should react to the emergency vehicle to make the behaviour more realistic + if (distanceDelta <= myReactionDist && veh.getID() != veh2->getID() && myInfluencedVehicles.count(veh2->getID()) == 0) { + // only a percentage of vehicles should react to the emergency vehicle to make the behaviour more realistic double reaction = RandHelper::rand(); MSVehicle::Influencer& lanechange = veh2->getInfluencer(); //other vehicle should not use the rescue lane so they should not make any lane changes lanechange.setLaneChangeMode(1605);//todo change lane back - //const int numLanes = (int)veh2->getEdge()->getLanes().size(); // the vehicles should react according to the distance to the emergency vehicle taken from real world data double reactionProb = 0.189; // todo works only for one second steps if (distanceDelta < 12.5) { reactionProb = 0.577; } if (reaction < reactionProb) { - influencedVehicles.insert(veh2->getID()); - influencedTypes.insert(std::make_pair(veh2->getID(), veh2->getVehicleType().getID())); + myInfluencedVehicles.insert(veh2->getID()); + myInfluencedTypes.insert(std::make_pair(veh2->getID(), veh2->getVehicleType().getID())); - //Vehicle gets a new Vehicletype to change the alignment and the lanechange options + // Vehicle gets a new Vehicletype to change the alignment and the lanechange options MSVehicleType& t = veh2->getSingularType(); - //Setting the lateral alignment to build a rescue lane + // Setting the lateral alignment to build a rescue lane + LatAlignmentDefinition align = LatAlignmentDefinition::RIGHT; if (veh2->getLane()->getIndex() == numLanes - 1) { - t.setPreferredLateralAlignment(LatAlignmentDefinition::LEFT); - // the alignement is changet to left for the vehicle std::cout << "New alignment to left for vehicle: " << veh2->getID() << " " << veh2->getVehicleType().getPreferredLateralAlignment() << "\n"; - } else { - t.setPreferredLateralAlignment(LatAlignmentDefinition::RIGHT); - // the alignement is changet to right for the vehicle std::cout << "New alignment to right for vehicle: " << veh2->getID() << " " << veh2->getVehicleType().getPreferredLateralAlignment() << "\n"; + align = LatAlignmentDefinition::LEFT; } + t.setPreferredLateralAlignment(align); // disable strategic lane-changing #ifdef DEBUG_BLUELIGHT_RESCUELANE - std::cout << SIMTIME << " device=" << getID() << " createRescueLane " << veh2->getID() << "\n"; + std::cout << SIMTIME << " device=" << getID() << " formingRescueLane=" << veh2->getID() + << " laneIndex=" << veh2->getLane()->getIndex() << " numLanes=" << numLanes + << " alignment=" << toString(align) << "\n"; #endif std::vector influencedBy = StringTokenizer(veh2->getParameter().getParameter(INFLUENCED_BY, "")).getVector(); if (std::find(influencedBy.begin(), influencedBy.end(), myHolder.getID()) == influencedBy.end()) { @@ -225,12 +246,12 @@ } } else { //if vehicle is passed all vehicles which had to react should get their state back after they leave the communication range - if (influencedVehicles.count(veh2->getID()) > 0) { + if (myInfluencedVehicles.count(veh2->getID()) > 0) { double distanceDelta = veh.getPosition().distanceTo(veh2->getPosition()); if (distanceDelta > myReactionDist && veh.getID() != veh2->getID()) { - influencedVehicles.erase(veh2->getID()); - std::map::iterator it = influencedTypes.find(veh2->getID()); - if (it != influencedTypes.end()) { + myInfluencedVehicles.erase(veh2->getID()); + std::map::iterator it = myInfluencedTypes.find(veh2->getID()); + if (it != myInfluencedTypes.end()) { // The vehicle gets back its old VehicleType after the emergency vehicle have passed them resetVehicle(veh2, it->second); } @@ -238,15 +259,45 @@ } } } + // make upcoming junction foes slow down + for (MSLink* link : upcomingLinks) { + auto avi = link->getApproaching(&ego); + MSLink::BlockingFoes blockingFoes; + link->opened(avi.arrivalTime, avi.arrivalSpeed, avi.arrivalSpeed, ego.getLength(), + 0, ego.getCarFollowModel().getMaxDecel(), ego.getWaitingTime(), ego.getLateralPositionOnLane(), &blockingFoes, true, &ego); + const SUMOTime timeToArrival = avi.arrivalTime - SIMSTEP; + for (const SUMOVehicle* foe : blockingFoes) { + const double dist = ego.getPosition().distanceTo2D(foe->getPosition()); + if (dist < myReactionDist) { + MSVehicle* microFoe = dynamic_cast(const_cast(foe)); + if (microFoe->getDevice(typeid(MSDevice_Bluelight)) != nullptr) { + // emergency vehicles should not react + continue; + } + const double timeToBrake = foe->getSpeed() / 4.5; + if (timeToArrival < TIME2STEPS(timeToBrake + 1)) { + ; + std::vector > speedTimeLine; + speedTimeLine.push_back(std::make_pair(SIMSTEP, foe->getSpeed())); + speedTimeLine.push_back(std::make_pair(avi.arrivalTime, 0)); + microFoe->getInfluencer().setSpeedTimeLine(speedTimeLine); + //std::cout << SIMTIME << " foe=" << foe->getID() << " dist=" << dist << " timeToBrake= " << timeToBrake << " ttA=" << STEPS2TIME(timeToArrival) << "\n"; + } + } + } + } + // ego is at the end of its current lane and cannot continue - if (ego.getBestLanesContinuation().size() == 1 && ego.getLane()->getLength() - ego.getPositionOnLane() <= POSITION_EPS + const double distToEnd = ego.getLane()->getLength() - ego.getPositionOnLane(); + //std::cout << SIMTIME << " " << getID() << " lane=" << ego.getLane()->getID() << " pos=" << ego.getPositionOnLane() << " distToEnd=" << distToEnd << " conts=" << toString(ego.getBestLanesContinuation()) << " furtherEdges=" << upcomingEdges.size() << "\n"; + if (ego.getBestLanesContinuation().size() == 1 && distToEnd <= POSITION_EPS // route continues - && myUpcomingEdges.size() > 1) { + && upcomingEdges.size() > 1) { const MSEdge* currentEdge = &ego.getLane()->getEdge(); // move onto the intersection as if there was a connection from the current lane - const MSEdge* next = currentEdge->getInternalFollowingEdge(myUpcomingEdges[1]); + const MSEdge* next = currentEdge->getInternalFollowingEdge(upcomingEdges[1]); if (next == nullptr) { - next = myUpcomingEdges[1]; + next = upcomingEdges[1]; } // pick the lane that causes the minimizes lateral jump const std::vector* allowed = next->allowedLanes(ego.getVClass()); diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Bluelight.h sumo-1.12.0/src/microsim/devices/MSDevice_Bluelight.h --- sumo-1.11.0/src/microsim/devices/MSDevice_Bluelight.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Bluelight.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ @@ -145,10 +145,10 @@ private: // @brief collects all vehicleIDs which had to react to the emergency vehicle - std::set influencedVehicles; + std::set myInfluencedVehicles; // @brief collects all VehicleTypes of the vehicles which had to react to the emergency vehicle - std::map influencedTypes; + std::map myInfluencedTypes; /// @brief reaction distance of other vehicle (i.e. due to different noise levels of the siren) double myReactionDist; diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_BTreceiver.cpp sumo-1.12.0/src/microsim/devices/MSDevice_BTreceiver.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_BTreceiver.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_BTreceiver.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_BTreceiver.h sumo-1.12.0/src/microsim/devices/MSDevice_BTreceiver.h --- sumo-1.11.0/src/microsim/devices/MSDevice_BTreceiver.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_BTreceiver.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_BTsender.cpp sumo-1.12.0/src/microsim/devices/MSDevice_BTsender.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_BTsender.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_BTsender.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_BTsender.h sumo-1.12.0/src/microsim/devices/MSDevice_BTsender.h --- sumo-1.11.0/src/microsim/devices/MSDevice_BTsender.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_BTsender.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice.cpp sumo-1.12.0/src/microsim/devices/MSDevice.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ @@ -208,6 +208,19 @@ return deflt; } } + + +SUMOTime +MSDevice::getTimeParam(const SUMOVehicle& v, const OptionsCont& oc, std::string paramName, SUMOTime deflt, bool required) { + const std::string key = "device." + paramName; + std::string val = getStringParam(v, oc, paramName, toString(deflt), required); + try { + return string2time(val); + } catch (...) { + WRITE_ERROR("Invalid time value '" + val + "'for parameter '" + key + "'"); + return deflt; + } +} /****************************************************************************/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_DriverState.cpp sumo-1.12.0/src/microsim/devices/MSDevice_DriverState.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_DriverState.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_DriverState.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_DriverState.h sumo-1.12.0/src/microsim/devices/MSDevice_DriverState.h --- sumo-1.11.0/src/microsim/devices/MSDevice_DriverState.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_DriverState.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_ElecHybrid.cpp sumo-1.12.0/src/microsim/devices/MSDevice_ElecHybrid.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_ElecHybrid.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_ElecHybrid.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_ElecHybrid.h sumo-1.12.0/src/microsim/devices/MSDevice_ElecHybrid.h --- sumo-1.11.0/src/microsim/devices/MSDevice_ElecHybrid.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_ElecHybrid.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Emissions.cpp sumo-1.12.0/src/microsim/devices/MSDevice_Emissions.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_Emissions.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Emissions.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Emissions.h sumo-1.12.0/src/microsim/devices/MSDevice_Emissions.h --- sumo-1.11.0/src/microsim/devices/MSDevice_Emissions.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Emissions.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Example.cpp sumo-1.12.0/src/microsim/devices/MSDevice_Example.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_Example.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Example.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Example.h sumo-1.12.0/src/microsim/devices/MSDevice_Example.h --- sumo-1.11.0/src/microsim/devices/MSDevice_Example.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Example.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_FCD.cpp sumo-1.12.0/src/microsim/devices/MSDevice_FCD.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_FCD.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_FCD.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_FCD.h sumo-1.12.0/src/microsim/devices/MSDevice_FCD.h --- sumo-1.11.0/src/microsim/devices/MSDevice_FCD.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_FCD.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_GLOSA.cpp sumo-1.12.0/src/microsim/devices/MSDevice_GLOSA.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_GLOSA.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_GLOSA.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_GLOSA.h sumo-1.12.0/src/microsim/devices/MSDevice_GLOSA.h --- sumo-1.11.0/src/microsim/devices/MSDevice_GLOSA.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_GLOSA.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice.h sumo-1.12.0/src/microsim/devices/MSDevice.h --- sumo-1.11.0/src/microsim/devices/MSDevice.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ @@ -180,6 +180,7 @@ static std::string getStringParam(const SUMOVehicle& v, const OptionsCont& oc, std::string paramName, std::string deflt, bool required); static double getFloatParam(const SUMOVehicle& v, const OptionsCont& oc, std::string paramName, double deflt, bool required); static bool getBoolParam(const SUMOVehicle& v, const OptionsCont& oc, std::string paramName, bool deflt, bool required); + static SUMOTime getTimeParam(const SUMOVehicle& v, const OptionsCont& oc, std::string paramName, SUMOTime deflt, bool required); /// @} private: @@ -237,6 +238,10 @@ } else if (v.getVehicleType().getParameter().knowsParameter(key)) { parameterGiven = true; haveByParameter = StringUtils::toBool(v.getVehicleType().getParameter().getParameter(key, "false")); + } else if (v.getVehicleType().getParameter().knowsParameter(prefix + ".probability")) { + // override global options + numberGiven = true; + haveByNumber = RandHelper::rand(&myEquipmentRNG) < StringUtils::toDouble(v.getVehicleType().getParameter().getParameter(prefix + ".probability", "0")); } //std::cout << " deviceName=" << deviceName << " holder=" << v.getID() // << " nameGiven=" << nameGiven << " haveByName=" << haveByName diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Routing.cpp sumo-1.12.0/src/microsim/devices/MSDevice_Routing.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_Routing.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Routing.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ @@ -137,8 +137,8 @@ // for implicitly equipped vehicles (trips, flows), option probability // can still be used to disable periodic rerouting after insertion for // parts of the fleet - const SUMOTime period = equip || oc.isDefault("device.rerouting.probability") ? string2time(oc.getString("device.rerouting.period")) : 0; - const SUMOTime prePeriod = MAX2((SUMOTime)0, string2time(oc.getString("device.rerouting.pre-period"))); + const SUMOTime period = equip || oc.isDefault("device.rerouting.probability") ? getTimeParam(v, oc, "rerouting.period", 0, false) : 0; + const SUMOTime prePeriod = MAX2((SUMOTime)0, getTimeParam(v, oc, "rerouting.pre-period", string2time(oc.getString("device.rerouting.pre-period")), false)); MSRoutingEngine::initWeightUpdate(); // build the device into.push_back(new MSDevice_Routing(v, "routing_" + v.getID(), period, prePeriod)); diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Routing.h sumo-1.12.0/src/microsim/devices/MSDevice_Routing.h --- sumo-1.11.0/src/microsim/devices/MSDevice_Routing.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Routing.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_SSM.cpp sumo-1.12.0/src/microsim/devices/MSDevice_SSM.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_SSM.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_SSM.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ @@ -763,7 +763,7 @@ auto c = myPastConflicts.top(); myPastConflicts.pop(); if (DEBUG_COND(myHolderMS)) { - std::cout << " Conflict with foe '" << c->foe << "' (time " << c->begin << "-" << c->end << ")\n"; + std::cout << " Conflict with foe '" << c->foe << "' (time=" << c->begin << "-" << c->end << ")\n"; } if (c->begin < lastBegin) { std::cout << " Queue corrupt...\n"; @@ -1053,9 +1053,7 @@ if (eInfo.egoEstimatedConflictEntryTime == 0. && eInfo.foeEstimatedConflictEntryTime == 0. && eInfo.egoConflictExitDist >= 0 && eInfo.foeConflictExitDist >= 0) { type = ENCOUNTER_TYPE_COLLISION; - std::stringstream ss; - ss << "SSM device of vehicle '" << e->egoID << "' detected collision with vehicle '" << e->foeID << "' at time " << SIMTIME; - WRITE_WARNING(ss.str()); + WRITE_WARNINGF("SSM device of vehicle '%' detected collision with vehicle '%' at time=%.", e->egoID, e->foeID, time2string(SIMSTEP)); } else if (eInfo.egoEstimatedConflictEntryTime < eInfo.foeEstimatedConflictEntryTime) { // ego is estimated first at conflict point #ifdef DEBUG_SSM @@ -2186,7 +2184,7 @@ // (since they approach via the same link, findSurroundingVehicles() would have determined a // different conflictLane if both are not on the junction) if (egoLane != egoConflictLane || foeLane != foeConflictLane) { - WRITE_WARNINGF("Cannot classify SSM encounter between ego vehicle % and foe vehicle % at time %\n", e->ego->getID(), e->foe->getID(), SIMTIME); + WRITE_WARNINGF("Cannot classify SSM encounter between ego vehicle % and foe vehicle % at time=%\n", e->ego->getID(), e->foe->getID(), SIMTIME); return ENCOUNTER_TYPE_NOCONFLICT_AHEAD; } if (egoLane == foeLane) { diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_SSM.h sumo-1.12.0/src/microsim/devices/MSDevice_SSM.h --- sumo-1.11.0/src/microsim/devices/MSDevice_SSM.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_SSM.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Taxi.cpp sumo-1.12.0/src/microsim/devices/MSDevice_Taxi.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_Taxi.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Taxi.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ @@ -46,6 +46,8 @@ #include "MSDevice_Taxi.h" //#define DEBUG_DISPATCH + +//#define DEBUG_COND (myHolder.isSelected()) #define DEBUG_COND (true) // =========================================================================== @@ -428,7 +430,7 @@ #endif if (!myHolder.replaceRouteEdges(tmpEdges, -1, 0, "taxi:prepare_dispatch", false, false, false)) { throw ProcessError("Route replacement for taxi dispatch failed for vehicle '" + myHolder.getID() - + "' at time " + time2string(MSNet::getInstance()->getCurrentTimeStep())); + + "' at time=" + time2string(t) + "."); } #ifdef DEBUG_DISPATCH if (DEBUG_COND) std::cout << " replacedRoute=" << toString(tmpEdges) @@ -438,7 +440,7 @@ std::string error; myHolder.addStop(stop, error); if (error != "") { - WRITE_WARNINGF("Could not add taxi stop for vehicle '%' to %. time=% error=%", myHolder.getID(), stop.actType, time2string(t), error) + WRITE_WARNINGF("Could not add taxi stop for vehicle '%' to %. time=% error=%.", myHolder.getID(), stop.actType, time2string(t), error) } } SUMOAbstractRouter& router = MSRoutingEngine::getRouterTT(myHolder.getRNGIndex(), myHolder.getVClass()); @@ -459,6 +461,36 @@ double& lastPos, const MSEdge* stopEdge, double stopPos, const std::string& action) { assert(!edges.empty()); + if (stopPos < lastPos && stopPos + NUMERICAL_EPS >= lastPos) { + stopPos = lastPos; + } + + if (stops.empty()) { + // check brakeGap + double distToStop = stopPos - lastPos; + const double brakeGap = myHolder.getBrakeGap(); + if (myHolder.getLane() != nullptr && myHolder.getLane()->isInternal()) { + distToStop += myHolder.getLane()->getLength(); + } + if (stopEdge != edges.back()) { + distToStop += edges.back()->getLength(); + if (distToStop < brakeGap) { + // the distance between current edge and stop edge may be small + SUMOAbstractRouter& router = MSRoutingEngine::getRouterTT(myHolder.getRNGIndex(), myHolder.getVClass()); + ConstMSEdgeVector toFirstStop; + router.compute(edges.back(), stopEdge, &myHolder, SIMSTEP, toFirstStop, true); + for (int i = 1; i < (int)toFirstStop.size() - 1; i++) { + distToStop += toFirstStop[i]->getLength(); + } + } + } + if (distToStop < brakeGap) { + // circle back to stopEdge + //std::cout << SIMTIME << " taxi=" << getID() << " brakeGap=" << brakeGap << " distToStop=" << distToStop << "\n"; + edges.push_back(stopEdge); + } + } + if (stopEdge == edges.back() && !stops.empty()) { if (stopPos >= lastPos && stopPos <= stops.back().endPos) { // no new stop and no adaption needed @@ -568,8 +600,8 @@ if (myHolder.getPersonNumber() == 0 && myHolder.getContainerNumber() == 0) { myState &= ~OCCUPIED; if (myHolder.getStops().size() > 1 && (myState & PICKUP) == 0) { - WRITE_WARNINGF("All customers left vehicle '%' at time % but there are % remaining stops", - myHolder.getID(), time2string(MSNet::getInstance()->getCurrentTimeStep()), myHolder.getStops().size() - 1); + WRITE_WARNINGF("All customers left vehicle '%' at time=% but there are % remaining stops", + myHolder.getID(), time2string(SIMSTEP), myHolder.getStops().size() - 1); while (myHolder.getStops().size() > 1) { myHolder.abortNextStop(1); } @@ -665,9 +697,9 @@ bool MSDevice_Taxi::compatibleLine(const std::string& taxiLine, const std::string& rideLine) { - return (taxiLine == TAXI_SERVICE - || rideLine == TAXI_SERVICE - || taxiLine == rideLine); + return (taxiLine == rideLine + || (taxiLine == TAXI_SERVICE && StringUtils::startsWith(rideLine, "taxi:")) + || (rideLine == TAXI_SERVICE && StringUtils::startsWith(taxiLine, "taxi:"))); } bool diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Taxi.h sumo-1.12.0/src/microsim/devices/MSDevice_Taxi.h --- sumo-1.11.0/src/microsim/devices/MSDevice_Taxi.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Taxi.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_ToC.cpp sumo-1.12.0/src/microsim/devices/MSDevice_ToC.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_ToC.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_ToC.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_ToC.h sumo-1.12.0/src/microsim/devices/MSDevice_ToC.h --- sumo-1.11.0/src/microsim/devices/MSDevice_ToC.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_ToC.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Transportable.cpp sumo-1.12.0/src/microsim/devices/MSDevice_Transportable.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_Transportable.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Transportable.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -84,30 +84,31 @@ void MSDevice_Transportable::notifyMoveInternal(const SUMOTrafficObject& veh, const double /* frontOnLane */, - const double /* timeOnLane*/, + const double /* timeOnLane */, const double /* meanSpeedFrontOnLane */, - const double /*meanSpeedVehicleOnLane */, - const double /* travelledDistanceFrontOnLane */, + const double /* meanSpeedVehicleOnLane */, + const double travelledDistanceFrontOnLane, const double /* travelledDistanceVehicleOnLane */, const double /* meanLengthOnLane */) { - notifyMove(const_cast(veh), -1, -1, -1); + notifyMove(const_cast(veh), -1, travelledDistanceFrontOnLane, veh.getEdge()->getVehicleMaxSpeed(&veh)); } bool -MSDevice_Transportable::notifyMove(SUMOTrafficObject& /*tObject*/, double /*oldPos*/, double /*newPos*/, double /*newSpeed*/) { +MSDevice_Transportable::notifyMove(SUMOTrafficObject& /*tObject*/, double /*oldPos*/, double newPos, double newSpeed) { SUMOVehicle& veh = myHolder; + const SUMOTime currentTime = MSNet::getInstance()->getCurrentTimeStep(); if (myStopped) { if (!veh.isStopped()) { - for (std::vector::iterator i = myTransportables.begin(); i != myTransportables.end(); ++i) { - (*i)->setDeparted(MSNet::getInstance()->getCurrentTimeStep()); + const SUMOTime freeFlowTimeCorrection = MSGlobals::gUseMesoSim ? TIME2STEPS(newPos / newSpeed) : 0; + for (MSTransportable* const transportable : myTransportables) { + transportable->setDeparted(currentTime - freeFlowTimeCorrection); } myStopped = false; } } else { if (veh.isStopped()) { myStopped = true; - const SUMOTime currentTime = MSNet::getInstance()->getCurrentTimeStep(); MSStop& stop = veh.getNextStop(); const SUMOTime boardingDuration = myAmContainer ? veh.getVehicleType().getLoadingDuration() : veh.getVehicleType().getBoardingDuration(); for (std::vector::iterator i = myTransportables.begin(); i != myTransportables.end();) { @@ -123,7 +124,10 @@ stage->getDestinationStop()->addTransportable(transportable); } - if (!MSGlobals::gUseMesoSim) { + SUMOTime arrivalTime = currentTime; + if (MSGlobals::gUseMesoSim) { + arrivalTime += 1; + } else { // no boarding / unboarding time in meso if (stop.timeToBoardNextPerson > currentTime - DELTA_T) { stop.timeToBoardNextPerson += boardingDuration; @@ -139,7 +143,7 @@ if (taxiDevice != nullptr) { taxiDevice->customerArrived(transportable); } - if (!transportable->proceed(MSNet::getInstance(), MSNet::getInstance()->getCurrentTimeStep())) { + if (!transportable->proceed(MSNet::getInstance(), arrivalTime)) { if (myAmContainer) { MSNet::getInstance()->getContainerControl().erase(transportable); } else { @@ -167,8 +171,9 @@ bool MSDevice_Transportable::notifyEnter(SUMOTrafficObject& veh, MSMoveReminder::Notification reason, const MSLane* /* enteredLane */) { if (reason == MSMoveReminder::NOTIFICATION_DEPARTED) { - for (std::vector::iterator i = myTransportables.begin(); i != myTransportables.end(); ++i) { - (*i)->setDeparted(MSNet::getInstance()->getCurrentTimeStep()); + const SUMOTime currentTime = MSNet::getInstance()->getCurrentTimeStep(); + for (MSTransportable* const transportable : myTransportables) { + transportable->setDeparted(currentTime); } } if (MSGlobals::gUseMesoSim) { @@ -188,7 +193,7 @@ if (transportable->getDestination() != veh.getEdge()) { WRITE_WARNING((myAmContainer ? "Teleporting container '" : "Teleporting person '") + transportable->getID() + "' from vehicle destination edge '" + veh.getEdge()->getID() + - "' to intended destination edge '" + transportable->getDestination()->getID() + "'"); + "' to intended destination edge '" + transportable->getDestination()->getID() + "' time=" + time2string(SIMSTEP)); } if (!transportable->proceed(MSNet::getInstance(), MSNet::getInstance()->getCurrentTimeStep(), true)) { if (myAmContainer) { diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Transportable.h sumo-1.12.0/src/microsim/devices/MSDevice_Transportable.h --- sumo-1.11.0/src/microsim/devices/MSDevice_Transportable.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Transportable.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -154,7 +154,7 @@ const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane, - const double /* meanLengthOnLane */); + const double meanLengthOnLane); private: /** @brief Constructor diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Tripinfo.cpp sumo-1.12.0/src/microsim/devices/MSDevice_Tripinfo.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_Tripinfo.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Tripinfo.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2009-2022 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/ @@ -204,14 +204,11 @@ const double /* meanLengthOnLane */) { // called by meso - const MEVehicle* mesoVeh = dynamic_cast(&veh); - assert(mesoVeh); const double vmax = veh.getEdge()->getVehicleMaxSpeed(&veh); if (vmax > 0) { myMesoTimeLoss += TIME2STEPS(timeOnLane * (vmax - meanSpeedVehicleOnLane) / vmax); } myWaitingTime += veh.getWaitingTime(); - myStoppingTime += TIME2STEPS(mesoVeh->getCurrentStoppingTimeSeconds()); } void diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Tripinfo.h sumo-1.12.0/src/microsim/devices/MSDevice_Tripinfo.h --- sumo-1.11.0/src/microsim/devices/MSDevice_Tripinfo.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Tripinfo.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2009-2022 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/ @@ -178,6 +178,11 @@ */ void loadState(const SUMOSAXAttributes& attrs); + /// @brief update stopping time for meso + void updateStopTime(const SUMOTime time) { + myStoppingTime += time; + } + private: /** @brief Constructor diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Vehroutes.cpp sumo-1.12.0/src/microsim/devices/MSDevice_Vehroutes.cpp --- sumo-1.11.0/src/microsim/devices/MSDevice_Vehroutes.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Vehroutes.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2009-2022 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/ @@ -402,18 +402,7 @@ od.closeTag(); od.lf(); if (mySorted) { - myRouteInfos[tmp.depart][myHolder.getID()] = od.getString(); - myDepartureCounts[tmp.depart]--; - std::map::iterator it = myDepartureCounts.begin(); - while (it != myDepartureCounts.end() && it->second == 0) { - std::map& infos = myRouteInfos[it->first]; - for (std::map::const_iterator it2 = infos.begin(); it2 != infos.end(); ++it2) { - routeOut << it2->second; - } - myRouteInfos.erase(it->first); - myDepartureCounts.erase(it); - it = myDepartureCounts.begin(); - } + writeSortedOutput(routeOut, tmp.depart, myHolder.getID(), od.getString()); } else { routeOut << od.getString(); } @@ -470,6 +459,28 @@ void +MSDevice_Vehroutes::registerTransportableDepart(SUMOTime depart) { + myDepartureCounts[depart]++; +} + + +void +MSDevice_Vehroutes::writeSortedOutput(OutputDevice& routeOut, SUMOTime depart, const std::string& id, const std::string& xmlOutput) { + myRouteInfos[depart][id] = xmlOutput; + myDepartureCounts[depart]--; + std::map::iterator it = myDepartureCounts.begin(); + while (it != myDepartureCounts.end() && it->second == 0) { + std::map& infos = myRouteInfos[it->first]; + for (std::map::const_iterator it2 = infos.begin(); it2 != infos.end(); ++it2) { + routeOut << it2->second; + } + myRouteInfos.erase(it->first); + myDepartureCounts.erase(it); + it = myDepartureCounts.begin(); + } +} + +void MSDevice_Vehroutes::saveState(OutputDevice& out) const { out.openTag(SUMO_TAG_DEVICE); out.writeAttr(SUMO_ATTR_ID, getID()); @@ -524,8 +535,10 @@ bis >> newIndex; const MSRoute* route = MSRoute::dictionary(routeID); - route->addReference(); - myReplacedRoutes.push_back(RouteReplaceInfo(MSEdge::dictionary(edgeID), time, route, info, lastIndex, newIndex)); + if (route != nullptr) { + route->addReference(); + myReplacedRoutes.push_back(RouteReplaceInfo(MSEdge::dictionary(edgeID), time, route, info, lastIndex, newIndex)); + } } if (mySaveExits && attrs.hasAttribute(SUMO_ATTR_EXITTIMES)) { for (const std::string& t : attrs.getStringVector(SUMO_ATTR_EXITTIMES)) { diff -Nru sumo-1.11.0/src/microsim/devices/MSDevice_Vehroutes.h sumo-1.12.0/src/microsim/devices/MSDevice_Vehroutes.h --- sumo-1.11.0/src/microsim/devices/MSDevice_Vehroutes.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDevice_Vehroutes.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2009-2022 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/ @@ -143,6 +143,8 @@ */ void loadState(const SUMOSAXAttributes& attrs); + static void registerTransportableDepart(SUMOTime depart); + static void writeSortedOutput(OutputDevice& routeOut, SUMOTime depart, const std::string& id, const std::string& xmlOutput); private: /** @brief Constructor @@ -175,6 +177,7 @@ + private: /// @brief A shortcut for the Option "vehroute-output.exit-times" static bool mySaveExits; diff -Nru sumo-1.11.0/src/microsim/devices/MSDispatch.cpp sumo-1.12.0/src/microsim/devices/MSDispatch.cpp --- sumo-1.11.0/src/microsim/devices/MSDispatch.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDispatch.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ @@ -213,8 +213,8 @@ SUMOTime MSDispatch::computePickupTime(SUMOTime t, const MSDevice_Taxi* taxi, const Reservation& res, SUMOAbstractRouter& router) { ConstMSEdgeVector edges; - router.compute(taxi->getHolder().getEdge(), taxi->getHolder().getPositionOnLane(), - res.from, res.fromPos, &taxi->getHolder(), t, edges); + router.compute(taxi->getHolder().getEdge(), taxi->getHolder().getPositionOnLane() - NUMERICAL_EPS, + res.from, res.fromPos, &taxi->getHolder(), t, edges, true); return TIME2STEPS(router.recomputeCosts(edges, &taxi->getHolder(), t)); } @@ -228,12 +228,12 @@ double& timeDirect) { ConstMSEdgeVector edges; if (timeDirect < 0) { - router.compute(from, fromPos, to, toPos, &taxi->getHolder(), t, edges); + router.compute(from, fromPos, to, toPos, &taxi->getHolder(), t, edges, true); timeDirect = router.recomputeCosts(edges, &taxi->getHolder(), fromPos, toPos, t); edges.clear(); } - router.compute(from, fromPos, via, viaPos, &taxi->getHolder(), t, edges); + router.compute(from, fromPos, via, viaPos, &taxi->getHolder(), t, edges, true); const double start = STEPS2TIME(t); const double leg1 = router.recomputeCosts(edges, &taxi->getHolder(), fromPos, viaPos, t); #ifdef DEBUG_DETOUR @@ -242,7 +242,7 @@ const double wait = MAX2(0.0, STEPS2TIME(viaTime) - (start + leg1)); edges.clear(); const SUMOTime timeContinue = TIME2STEPS(start + leg1 + wait); - router.compute(via, viaPos, to, toPos, &taxi->getHolder(), timeContinue, edges); + router.compute(via, viaPos, to, toPos, &taxi->getHolder(), timeContinue, edges, true); const double leg2 = router.recomputeCosts(edges, &taxi->getHolder(), viaPos, toPos, timeContinue); const double timeDetour = leg1 + wait + leg2; #ifdef DEBUG_DETOUR diff -Nru sumo-1.11.0/src/microsim/devices/MSDispatch_Greedy.cpp sumo-1.12.0/src/microsim/devices/MSDispatch_Greedy.cpp --- sumo-1.11.0/src/microsim/devices/MSDispatch_Greedy.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDispatch_Greedy.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDispatch_Greedy.h sumo-1.12.0/src/microsim/devices/MSDispatch_Greedy.h --- sumo-1.11.0/src/microsim/devices/MSDispatch_Greedy.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDispatch_Greedy.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDispatch_GreedyShared.cpp sumo-1.12.0/src/microsim/devices/MSDispatch_GreedyShared.cpp --- sumo-1.11.0/src/microsim/devices/MSDispatch_GreedyShared.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDispatch_GreedyShared.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDispatch_GreedyShared.h sumo-1.12.0/src/microsim/devices/MSDispatch_GreedyShared.h --- sumo-1.11.0/src/microsim/devices/MSDispatch_GreedyShared.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDispatch_GreedyShared.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDispatch.h sumo-1.12.0/src/microsim/devices/MSDispatch.h --- sumo-1.11.0/src/microsim/devices/MSDispatch.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDispatch.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDispatch_RouteExtension.cpp sumo-1.12.0/src/microsim/devices/MSDispatch_RouteExtension.cpp --- sumo-1.11.0/src/microsim/devices/MSDispatch_RouteExtension.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDispatch_RouteExtension.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDispatch_RouteExtension.h sumo-1.12.0/src/microsim/devices/MSDispatch_RouteExtension.h --- sumo-1.11.0/src/microsim/devices/MSDispatch_RouteExtension.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDispatch_RouteExtension.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDispatch_TraCI.cpp sumo-1.12.0/src/microsim/devices/MSDispatch_TraCI.cpp --- sumo-1.11.0/src/microsim/devices/MSDispatch_TraCI.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDispatch_TraCI.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSDispatch_TraCI.h sumo-1.12.0/src/microsim/devices/MSDispatch_TraCI.h --- sumo-1.11.0/src/microsim/devices/MSDispatch_TraCI.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSDispatch_TraCI.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSIdling.cpp sumo-1.12.0/src/microsim/devices/MSIdling.cpp --- sumo-1.11.0/src/microsim/devices/MSIdling.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSIdling.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ @@ -105,7 +105,7 @@ const int routeLength = (int)edges.size(); while (routePos + 1 < routeLength && (remainingEdges < 2 || remainingDist < 200)) { const MSEdge* edge = edges[routePos]; - remainingDist = edge->getLength(); + remainingDist += edge->getLength(); remainingEdges++; routePos++; newEdges.push_back(edge); diff -Nru sumo-1.11.0/src/microsim/devices/MSIdling.h sumo-1.12.0/src/microsim/devices/MSIdling.h --- sumo-1.11.0/src/microsim/devices/MSIdling.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSIdling.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSRoutingEngine.cpp sumo-1.12.0/src/microsim/devices/MSRoutingEngine.cpp --- sumo-1.11.0/src/microsim/devices/MSRoutingEngine.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSRoutingEngine.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSRoutingEngine.h sumo-1.12.0/src/microsim/devices/MSRoutingEngine.h --- sumo-1.11.0/src/microsim/devices/MSRoutingEngine.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSRoutingEngine.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSTransportableDevice_FCD.cpp sumo-1.12.0/src/microsim/devices/MSTransportableDevice_FCD.cpp --- sumo-1.11.0/src/microsim/devices/MSTransportableDevice_FCD.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSTransportableDevice_FCD.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSTransportableDevice_FCD.h sumo-1.12.0/src/microsim/devices/MSTransportableDevice_FCD.h --- sumo-1.11.0/src/microsim/devices/MSTransportableDevice_FCD.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSTransportableDevice_FCD.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSTransportableDevice.h sumo-1.12.0/src/microsim/devices/MSTransportableDevice.h --- sumo-1.11.0/src/microsim/devices/MSTransportableDevice.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSTransportableDevice.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSTransportableDevice_Routing.cpp sumo-1.12.0/src/microsim/devices/MSTransportableDevice_Routing.cpp --- sumo-1.11.0/src/microsim/devices/MSTransportableDevice_Routing.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSTransportableDevice_Routing.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSTransportableDevice_Routing.h sumo-1.12.0/src/microsim/devices/MSTransportableDevice_Routing.h --- sumo-1.11.0/src/microsim/devices/MSTransportableDevice_Routing.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSTransportableDevice_Routing.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/devices/MSVehicleDevice.h sumo-1.12.0/src/microsim/devices/MSVehicleDevice.h --- sumo-1.11.0/src/microsim/devices/MSVehicleDevice.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/devices/MSVehicleDevice.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/microsim/engine/EngineParameters.cpp sumo-1.12.0/src/microsim/engine/EngineParameters.cpp --- sumo-1.11.0/src/microsim/engine/EngineParameters.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/engine/EngineParameters.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/engine/EngineParameters.h sumo-1.12.0/src/microsim/engine/EngineParameters.h --- sumo-1.11.0/src/microsim/engine/EngineParameters.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/engine/EngineParameters.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/engine/FirstOrderLagModel.cpp sumo-1.12.0/src/microsim/engine/FirstOrderLagModel.cpp --- sumo-1.11.0/src/microsim/engine/FirstOrderLagModel.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/engine/FirstOrderLagModel.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/engine/FirstOrderLagModel.h sumo-1.12.0/src/microsim/engine/FirstOrderLagModel.h --- sumo-1.11.0/src/microsim/engine/FirstOrderLagModel.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/engine/FirstOrderLagModel.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/engine/GenericEngineModel.cpp sumo-1.12.0/src/microsim/engine/GenericEngineModel.cpp --- sumo-1.11.0/src/microsim/engine/GenericEngineModel.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/engine/GenericEngineModel.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/engine/GenericEngineModel.h sumo-1.12.0/src/microsim/engine/GenericEngineModel.h --- sumo-1.11.0/src/microsim/engine/GenericEngineModel.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/engine/GenericEngineModel.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/engine/RealisticEngineModel.cpp sumo-1.12.0/src/microsim/engine/RealisticEngineModel.cpp --- sumo-1.11.0/src/microsim/engine/RealisticEngineModel.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/engine/RealisticEngineModel.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/engine/RealisticEngineModel.h sumo-1.12.0/src/microsim/engine/RealisticEngineModel.h --- sumo-1.11.0/src/microsim/engine/RealisticEngineModel.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/engine/RealisticEngineModel.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/engine/VehicleEngineHandler.cpp sumo-1.12.0/src/microsim/engine/VehicleEngineHandler.cpp --- sumo-1.11.0/src/microsim/engine/VehicleEngineHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/engine/VehicleEngineHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/engine/VehicleEngineHandler.h sumo-1.12.0/src/microsim/engine/VehicleEngineHandler.h --- sumo-1.11.0/src/microsim/engine/VehicleEngineHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/engine/VehicleEngineHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp sumo-1.12.0/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp --- sumo-1.11.0/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -43,6 +43,7 @@ #include #include #include +#include #include "MSLCM_DK2008.h" #include "MSLCM_LC2013.h" #include "MSLCM_SL2015.h" @@ -73,17 +74,17 @@ MSAbstractLaneChangeModel* MSAbstractLaneChangeModel::build(LaneChangeModel lcm, MSVehicle& v) { - if (MSGlobals::gLateralResolution > 0 && lcm != LCM_SL2015 && lcm != LCM_DEFAULT) { + if (MSGlobals::gLateralResolution > 0 && lcm != LaneChangeModel::SL2015 && lcm != LaneChangeModel::DEFAULT) { throw ProcessError("Lane change model '" + toString(lcm) + "' is not compatible with sublane simulation"); } switch (lcm) { - case LCM_DK2008: + case LaneChangeModel::DK2008: return new MSLCM_DK2008(v); - case LCM_LC2013: + case LaneChangeModel::LC2013: return new MSLCM_LC2013(v); - case LCM_SL2015: + case LaneChangeModel::SL2015: return new MSLCM_SL2015(v); - case LCM_DEFAULT: + case LaneChangeModel::DEFAULT: if (MSGlobals::gLateralResolution <= 0) { return new MSLCM_LC2013(v); } else { @@ -130,6 +131,7 @@ // prevent lateral sliding for cars but permit for two-wheelers due to better maneuverability (v.getVClass() & (SVC_BICYCLE | SVC_MOTORCYCLE | SVC_MOPED)) != 0 ? std::numeric_limits::max() : 1.6)), mySigma(v.getVehicleType().getParameter().getLCParam(SUMO_ATTR_LCA_SIGMA, 0.0)), + myHaveBlueLight(v.getDevice(typeid(MSDevice_Bluelight)) != nullptr), // see MSVehicle::initDevices myLastLaneChangeOffset(0), myAmOpposite(false), myManeuverDist(0.), diff -Nru sumo-1.11.0/src/microsim/lcmodels/MSAbstractLaneChangeModel.h sumo-1.12.0/src/microsim/lcmodels/MSAbstractLaneChangeModel.h --- sumo-1.11.0/src/microsim/lcmodels/MSAbstractLaneChangeModel.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/lcmodels/MSAbstractLaneChangeModel.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -576,6 +576,10 @@ /// @brief get vehicle position relative to the forward direction lane double getForwardPos() const; + bool hasBlueLight() const { + return myHaveBlueLight; + } + static const double NO_NEIGHBOR; protected: @@ -704,6 +708,9 @@ // @brief factor for lane keeping imperfection double mySigma; + /// @brief whether this vehicle is driving with special permissions and behavior + bool myHaveBlueLight; + /* @brief to be called by derived classes in their changed() method. * If dir=0 is given, the current value remains unchanged */ void initLastLaneChangeOffset(int dir); diff -Nru sumo-1.11.0/src/microsim/lcmodels/MSLCHelper.cpp sumo-1.12.0/src/microsim/lcmodels/MSLCHelper.cpp --- sumo-1.11.0/src/microsim/lcmodels/MSLCHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/lcmodels/MSLCHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/lcmodels/MSLCHelper.h sumo-1.12.0/src/microsim/lcmodels/MSLCHelper.h --- sumo-1.11.0/src/microsim/lcmodels/MSLCHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/lcmodels/MSLCHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/lcmodels/MSLCM_DK2008.cpp sumo-1.12.0/src/microsim/lcmodels/MSLCM_DK2008.cpp --- sumo-1.11.0/src/microsim/lcmodels/MSLCM_DK2008.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/lcmodels/MSLCM_DK2008.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ @@ -50,7 +50,7 @@ // member method definitions // =========================================================================== MSLCM_DK2008::MSLCM_DK2008(MSVehicle& v) - : MSAbstractLaneChangeModel(v, LCM_DK2008), + : MSAbstractLaneChangeModel(v, LaneChangeModel::DK2008), myChangeProbability(0), myLeadingBlockerLength(0), myLeftSpace(0) {} diff -Nru sumo-1.11.0/src/microsim/lcmodels/MSLCM_DK2008.h sumo-1.12.0/src/microsim/lcmodels/MSLCM_DK2008.h --- sumo-1.11.0/src/microsim/lcmodels/MSLCM_DK2008.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/lcmodels/MSLCM_DK2008.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ @@ -43,7 +43,7 @@ /// @brief Returns the model's id LaneChangeModel getModelID() const { - return LCM_DK2008; + return LaneChangeModel::DK2008; } /** @brief Called to examine whether the vehicle wants to change diff -Nru sumo-1.11.0/src/microsim/lcmodels/MSLCM_LC2013.cpp sumo-1.12.0/src/microsim/lcmodels/MSLCM_LC2013.cpp --- sumo-1.11.0/src/microsim/lcmodels/MSLCM_LC2013.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/lcmodels/MSLCM_LC2013.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -94,7 +94,7 @@ // member method definitions // =========================================================================== MSLCM_LC2013::MSLCM_LC2013(MSVehicle& v) : - MSAbstractLaneChangeModel(v, LCM_LC2013), + MSAbstractLaneChangeModel(v, LaneChangeModel::LC2013), mySpeedGainProbability(0), myKeepRightProbability(0), myLeadingBlockerLength(0), @@ -1811,14 +1811,24 @@ const double maxSpeed1s = (myVehicle.getSpeed() + myVehicle.getCarFollowModel().getMaxAccel() - ACCEL2SPEED(myVehicle.getCarFollowModel().getMaxAccel())); if (leader == nullptr) { - futureSpeed = getCarFollowModel().followSpeed(&myVehicle, maxSpeed1s, dist, 0, 0); + if (hasBlueLight()) { + // can continue from any lane if necessary + futureSpeed = vMax; + } else { + futureSpeed = getCarFollowModel().followSpeed(&myVehicle, maxSpeed1s, dist, 0, 0); + } } else { futureSpeed = getCarFollowModel().followSpeed(&myVehicle, maxSpeed1s, gap, leader->getSpeed(), leader->getCarFollowModel().getMaxDecel()); } } else { // onInsertion = true because the vehicle has already moved if (leader == nullptr) { - futureSpeed = getCarFollowModel().maximumSafeStopSpeed(dist, getCarFollowModel().getMaxDecel(), myVehicle.getSpeed(), true); + if (hasBlueLight()) { + // can continue from any lane if necessary + futureSpeed = vMax; + } else { + futureSpeed = getCarFollowModel().maximumSafeStopSpeed(dist, getCarFollowModel().getMaxDecel(), myVehicle.getSpeed(), true); + } } else { futureSpeed = getCarFollowModel().maximumSafeFollowSpeed(gap, myVehicle.getSpeed(), leader->getSpeed(), leader->getCarFollowModel().getMaxDecel(), true); } @@ -2040,6 +2050,12 @@ return toString(myRoundaboutBonus); } else if (key == toString(SUMO_ATTR_LCA_COOPERATIVE_SPEED)) { return toString(myCooperativeSpeed); + } else if (key == toString(SUMO_ATTR_LCA_MAXSPEEDLATSTANDING)) { + return toString(myMaxSpeedLatStanding); + } else if (key == toString(SUMO_ATTR_LCA_MAXSPEEDLATFACTOR)) { + return toString(myMaxSpeedLatFactor); + } else if (key == toString(SUMO_ATTR_LCA_MAXDISTLATSTANDING)) { + return toString(myMaxDistLatStanding); } throw InvalidArgument("Parameter '" + key + "' is not supported for laneChangeModel of type '" + toString(myModel) + "'"); } @@ -2081,6 +2097,12 @@ myRoundaboutBonus = doubleValue; } else if (key == toString(SUMO_ATTR_LCA_COOPERATIVE_SPEED)) { myCooperativeSpeed = doubleValue; + } else if (key == toString(SUMO_ATTR_LCA_MAXSPEEDLATSTANDING)) { + myMaxSpeedLatStanding = doubleValue; + } else if (key == toString(SUMO_ATTR_LCA_MAXSPEEDLATFACTOR)) { + myMaxSpeedLatFactor = doubleValue; + } else if (key == toString(SUMO_ATTR_LCA_MAXDISTLATSTANDING)) { + myMaxDistLatStanding = doubleValue; } else { throw InvalidArgument("Setting parameter '" + key + "' is not supported for laneChangeModel of type '" + toString(myModel) + "'"); } diff -Nru sumo-1.11.0/src/microsim/lcmodels/MSLCM_LC2013.h sumo-1.12.0/src/microsim/lcmodels/MSLCM_LC2013.h --- sumo-1.11.0/src/microsim/lcmodels/MSLCM_LC2013.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/lcmodels/MSLCM_LC2013.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -51,7 +51,7 @@ /// @brief Returns the model's id LaneChangeModel getModelID() const override { - return LCM_LC2013; + return LaneChangeModel::LC2013; } /// @brief init cached parameters derived directly from model parameters diff -Nru sumo-1.11.0/src/microsim/lcmodels/MSLCM_SL2015.cpp sumo-1.12.0/src/microsim/lcmodels/MSLCM_SL2015.cpp --- sumo-1.11.0/src/microsim/lcmodels/MSLCM_SL2015.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/lcmodels/MSLCM_SL2015.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ @@ -114,7 +114,7 @@ // member method definitions // =========================================================================== MSLCM_SL2015::MSLCM_SL2015(MSVehicle& v) : - MSAbstractLaneChangeModel(v, LCM_SL2015), + MSAbstractLaneChangeModel(v, LaneChangeModel::SL2015), mySpeedGainProbabilityRight(0), mySpeedGainProbabilityLeft(0), myKeepRightProbability(0), @@ -132,10 +132,11 @@ myOppositeParam(v.getVehicleType().getParameter().getLCParam(SUMO_ATTR_LCA_OPPOSITE_PARAM, 1)), mySublaneParam(v.getVehicleType().getParameter().getLCParam(SUMO_ATTR_LCA_SUBLANE_PARAM, 1)), // by default use SUMO_ATTR_LCA_PUSHY. If that is not set, try SUMO_ATTR_LCA_PUSHYGAP + myMinGapLat(v.getVehicleType().getMinGapLat()), myPushy(v.getVehicleType().getParameter().getLCParam(SUMO_ATTR_LCA_PUSHY, 1 - (v.getVehicleType().getParameter().getLCParam(SUMO_ATTR_LCA_PUSHYGAP, - MAX2(NUMERICAL_EPS, v.getVehicleType().getMinGapLat())) / - MAX2(NUMERICAL_EPS, v.getVehicleType().getMinGapLat())))), + MAX2(NUMERICAL_EPS, myMinGapLat)) / + MAX2(NUMERICAL_EPS, myMinGapLat)))), myAssertive(v.getVehicleType().getParameter().getLCParam(SUMO_ATTR_LCA_ASSERTIVE, 1)), myImpatience(v.getVehicleType().getParameter().getLCParam(SUMO_ATTR_LCA_IMPATIENCE, 0)), myMinImpatience(myImpatience), @@ -2073,9 +2074,14 @@ const double gap = ahead[sublane].second; double vSafe; if (leader == nullptr) { - const int prebIndex = isOpposite() ? (int)preb.size() - 1 : laneIndex; - const double dist = preb[prebIndex].length - myVehicle.getPositionOnLane(); - vSafe = getCarFollowModel().followSpeed(&myVehicle, vMax, dist, 0, 0); + if (hasBlueLight()) { + // can continue from any lane if necessary + vSafe = vMax; + } else { + const int prebIndex = isOpposite() ? (int)preb.size() - 1 : laneIndex; + const double dist = preb[prebIndex].length - myVehicle.getPositionOnLane(); + vSafe = getCarFollowModel().followSpeed(&myVehicle, vMax, dist, 0, 0); + } } else { if (leader->getAcceleration() > 0.5 * leader->getCarFollowModel().getMaxAccel()) { // assume that the leader will continue accelerating to its maximum speed @@ -3096,7 +3102,7 @@ std::vector* collectBlockers) { if (others.hasVehicles()) { const double halfWidth = getWidth() * 0.5 + NUMERICAL_EPS; - const double baseMinGap = myVehicle.getVehicleType().getMinGapLat(); + const double baseMinGap = myMinGapLat; for (int i = 0; i < others.numSublanes(); ++i) { if (others[i].first != 0 && others[i].second <= 0 && myCFRelated.count(others[i].first) == 0 @@ -3495,8 +3501,12 @@ return toString(myOppositeParam); } else if (key == toString(SUMO_ATTR_LCA_SUBLANE_PARAM)) { return toString(mySublaneParam); + } else if (key == toString(SUMO_ATTR_MINGAP_LAT)) { + return toString(myMinGapLat); } else if (key == toString(SUMO_ATTR_LCA_PUSHY)) { return toString(myPushy); + } else if (key == toString(SUMO_ATTR_LCA_PUSHYGAP)) { + return toString((myPushy - 1) * myMinGapLat); } else if (key == toString(SUMO_ATTR_LCA_ASSERTIVE)) { return toString(myAssertive); } else if (key == toString(SUMO_ATTR_LCA_IMPATIENCE)) { @@ -3521,6 +3531,12 @@ return toString(myRoundaboutBonus); } else if (key == toString(SUMO_ATTR_LCA_COOPERATIVE_SPEED)) { return toString(myCooperativeSpeed); + } else if (key == toString(SUMO_ATTR_LCA_MAXSPEEDLATSTANDING)) { + return toString(myMaxSpeedLatStanding); + } else if (key == toString(SUMO_ATTR_LCA_MAXSPEEDLATFACTOR)) { + return toString(myMaxSpeedLatFactor); + } else if (key == toString(SUMO_ATTR_LCA_MAXDISTLATSTANDING)) { + return toString(myMaxDistLatStanding); // access to internal state for debugging in sumo-gui (not documented since it may change at any time) } else if (key == "speedGainProbabilityRight") { return toString(mySpeedGainProbabilityRight); @@ -3563,8 +3579,12 @@ myOppositeParam = doubleValue; } else if (key == toString(SUMO_ATTR_LCA_SUBLANE_PARAM)) { mySublaneParam = doubleValue; + } else if (key == toString(SUMO_ATTR_MINGAP_LAT)) { + myMinGapLat = doubleValue; } else if (key == toString(SUMO_ATTR_LCA_PUSHY)) { myPushy = doubleValue; + } else if (key == toString(SUMO_ATTR_LCA_PUSHYGAP)) { + myPushy = 1 - doubleValue / myMinGapLat; } else if (key == toString(SUMO_ATTR_LCA_ASSERTIVE)) { myAssertive = doubleValue; } else if (key == toString(SUMO_ATTR_LCA_IMPATIENCE)) { @@ -3592,6 +3612,12 @@ myRoundaboutBonus = doubleValue; } else if (key == toString(SUMO_ATTR_LCA_COOPERATIVE_SPEED)) { myCooperativeSpeed = doubleValue; + } else if (key == toString(SUMO_ATTR_LCA_MAXSPEEDLATSTANDING)) { + myMaxSpeedLatStanding = doubleValue; + } else if (key == toString(SUMO_ATTR_LCA_MAXSPEEDLATFACTOR)) { + myMaxSpeedLatFactor = doubleValue; + } else if (key == toString(SUMO_ATTR_LCA_MAXDISTLATSTANDING)) { + myMaxDistLatStanding = doubleValue; } else { throw InvalidArgument("Setting parameter '" + key + "' is not supported for laneChangeModel of type '" + toString(myModel) + "'"); } diff -Nru sumo-1.11.0/src/microsim/lcmodels/MSLCM_SL2015.h sumo-1.12.0/src/microsim/lcmodels/MSLCM_SL2015.h --- sumo-1.11.0/src/microsim/lcmodels/MSLCM_SL2015.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/lcmodels/MSLCM_SL2015.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ @@ -41,7 +41,7 @@ /// @brief Returns the model's id LaneChangeModel getModelID() const override { - return LCM_SL2015; + return LaneChangeModel::SL2015; } /// @brief init cached parameters derived directly from model parameters @@ -416,6 +416,8 @@ double myKeepRightParam; double myOppositeParam; double mySublaneParam; + // @brief minimum lateral gap + double myMinGapLat; // @brief willingness to encroach on other vehicles laterally (pushing them around) double myPushy; // @brief willingness to undercut longitudinal safe gaps diff -Nru sumo-1.11.0/src/microsim/logging/CastingFunctionBinding.h sumo-1.12.0/src/microsim/logging/CastingFunctionBinding.h --- sumo-1.11.0/src/microsim/logging/CastingFunctionBinding.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/logging/CastingFunctionBinding.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/logging/FuncBinding_IntParam.h sumo-1.12.0/src/microsim/logging/FuncBinding_IntParam.h --- sumo-1.11.0/src/microsim/logging/FuncBinding_IntParam.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/logging/FuncBinding_IntParam.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/logging/FuncBinding_StringParam.h sumo-1.12.0/src/microsim/logging/FuncBinding_StringParam.h --- sumo-1.11.0/src/microsim/logging/FuncBinding_StringParam.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/logging/FuncBinding_StringParam.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/logging/FunctionBinding.h sumo-1.12.0/src/microsim/logging/FunctionBinding.h --- sumo-1.11.0/src/microsim/logging/FunctionBinding.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/logging/FunctionBinding.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSBaseVehicle.cpp sumo-1.12.0/src/microsim/MSBaseVehicle.cpp --- sumo-1.11.0/src/microsim/MSBaseVehicle.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSBaseVehicle.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -29,6 +29,14 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include "MSGlobals.h" #include "MSVehicleControl.h" @@ -37,27 +45,17 @@ #include "MSLane.h" #include "MSMoveReminder.h" #include "MSEdgeWeightsStorage.h" -#include "MSBaseVehicle.h" #include "MSNet.h" #include "MSStop.h" #include "MSParkingArea.h" -#include "devices/MSDevice.h" -#include "devices/MSDevice_Routing.h" -#include "devices/MSDevice_Battery.h" -#include "devices/MSDevice_ElecHybrid.h" -#include -#include -#include -#include -#include -#include #include "MSInsertionControl.h" -#include +#include "MSBaseVehicle.h" //#define DEBUG_REROUTE //#define DEBUG_ADD_STOP -//#define DEBUG_COND (getID() == "follower") +//#define DEBUG_COND (getID() == "") //#define DEBUG_COND (true) +//#define DEBUG_REPLACE_ROUTE #define DEBUG_COND (isSelected()) // =========================================================================== @@ -238,7 +236,7 @@ if (stops.size() > 0) { const double sourcePos = onInit ? 0 : getPositionOnLane(); // avoid superfluous waypoints for first and last edge - const bool skipFirst = stops.front() == source && sourcePos <= firstPos; + const bool skipFirst = stops.front() == source && (source != getEdge() || sourcePos + getBrakeGap() <= firstPos); const bool skipLast = stops.back() == sink && myArrivalPos >= lastPos; #ifdef DEBUG_REROUTE if (DEBUG_COND) { @@ -454,7 +452,7 @@ } else { // recheck old stops MSRouteIterator searchStart = myCurrEdge; - double lastPos = getPositionOnLane(); + double lastPos = getPositionOnLane() + getBrakeGap(); if (getLane() != nullptr && getLane()->isInternal() && myStops.size() > 0 && !myStops.front().lane->isInternal()) { // searchStart is still incoming to the intersection so lastPos @@ -463,7 +461,7 @@ } #ifdef DEBUG_REPLACE_ROUTE if (DEBUG_COND) { - std::cout << " replaceRoute on " << (*myCurrEdge)->getID() << " lane=" << myLane->getID() << " stopsFromScratch=" << stopsFromScratch << "\n"; + std::cout << " replaceRoute on " << (*myCurrEdge)->getID() << " lane=" << Named::getIDSecure(getLane()) << " stopsFromScratch=" << stopsFromScratch << "\n"; } #endif for (std::list::iterator iter = myStops.begin(); iter != myStops.end();) { @@ -871,12 +869,9 @@ bool -MSBaseVehicle::handleCollisionStop(MSStop& stop, const bool collision, const double distToStop, const std::string& errorMsgStart, std::string& errorMsg) { +MSBaseVehicle::handleCollisionStop(MSStop& stop, const double distToStop) { UNUSED_PARAMETER(stop); - UNUSED_PARAMETER(collision); UNUSED_PARAMETER(distToStop); - UNUSED_PARAMETER(errorMsgStart); - UNUSED_PARAMETER(errorMsg); return true; } @@ -1076,26 +1071,38 @@ stop.edge = std::find(prevStopEdge, myRoute->end(), stopEdge); } } - const bool sameEdgeAsLastStop = prevStopEdge == stop.edge && prevEdge == &stop.lane->getEdge(); - if (stop.edge == myRoute->end() || prevStopEdge > stop.edge || + const bool wasTooClose = errorMsg != "" && errorMsg.find("too close") != std::string::npos; + if (stop.edge == myRoute->end()) { + if (!wasTooClose) { + errorMsg = errorMsgStart + " for vehicle '" + myParameter->id + "' on lane '" + stop.lane->getID() + "' is not downstream the current route."; + } + return false; + } + + const bool tooClose = (prevStopEdge == stop.edge && prevEdge == &stop.lane->getEdge() && + prevStopPos + (iter == myStops.begin() ? getBrakeGap() : 0) > stop.pars.endPos + POSITION_EPS); + + if (prevStopEdge > stop.edge || // a collision-stop happens after vehicle movement and may move the // vehicle backwards on it's lane (prevStopPos is the vehicle position) - (sameEdgeAsLastStop && prevStopPos > stop.pars.endPos && !collision) + (tooClose && !collision) || (stop.lane->getEdge().isInternal() && stop.lane->getNextNormal() != *(stop.edge + 1))) { - if (stop.edge != myRoute->end()) { - // check if the edge occurs again later in the route - MSRouteIterator next = stop.edge + 1; - return addStop(stopPar, errorMsg, untilOffset, collision, &next); - } - errorMsg = errorMsgStart + " for vehicle '" + myParameter->id + "' on lane '" + stop.lane->getID() + "' is not downstream the current route."; + // check if the edge occurs again later in the route //std::cout << " could not add stop " << errorMsgStart << " prevStops=" << myStops.size() << " searchStart=" << (*searchStart - myRoute->begin()) << " route=" << toString(myRoute->getEdges()) << "\n"; - return false; + if (tooClose && prevStopPos <= stop.pars.endPos + POSITION_EPS) { + errorMsg = errorMsgStart + " for vehicle '" + myParameter->id + "' on lane '" + stop.pars.lane + "' is too close to brake."; + } + MSRouteIterator next = stop.edge + 1; + return addStop(stopPar, errorMsg, untilOffset, collision, &next); + } + if (wasTooClose) { + errorMsg = ""; } // David.C: //if (!stop.parking && (myCurrEdge == stop.edge && myState.myPos > stop.endPos - getCarFollowModel().brakeGap(myState.mySpeed))) { const double endPosOffset = stop.lane->getEdge().isInternal() ? (*stop.edge)->getLength() : 0; const double distToStop = stop.pars.endPos + endPosOffset - getPositionOnLane(); - if (!handleCollisionStop(stop, collision, distToStop, errorMsgStart, errorMsg)) { + if (collision && !handleCollisionStop(stop, distToStop)) { return false; } if (!hasDeparted() && myCurrEdge == stop.edge) { @@ -1164,7 +1171,7 @@ bool MSBaseVehicle::haveValidStopEdges() const { MSRouteIterator start = myCurrEdge; - const std::string err = "for vehicle '" + getID() + "' at time " + time2string(MSNet::getInstance()->getCurrentTimeStep()); + const std::string err = "for vehicle '" + getID() + "' at time=" + time2string(SIMSTEP); int i = 0; bool ok = true; double lastPos = getPositionOnLane(); @@ -1207,9 +1214,12 @@ WRITE_ERROR(prefix + "used invalid (relative) route index " + toString(it2 - myCurrEdge) + " expected after " + toString(start - myCurrEdge) + " " + err); ok = false; } else { - if (it != stop.edge && endPos >= lastPos) { - WRITE_WARNING(prefix + "is used in " + toString(stop.edge - myCurrEdge) + " edges but first encounter is in " - + toString(it - myCurrEdge) + " edges " + err); + if (it != stop.edge) { + double brakeGap = i == 0 ? getBrakeGap() : 0; + if (endPos >= lastPos + brakeGap) { + WRITE_WARNING(prefix + "is used in " + toString(stop.edge - myCurrEdge) + " edges but first encounter is in " + + toString(it - myCurrEdge) + " edges " + err); + } } start = stop.edge; } @@ -1269,6 +1279,7 @@ MSStop& MSBaseVehicle::getNextStop() { + assert(myStops.size() > 0); return myStops.front(); } @@ -1810,15 +1821,36 @@ } void -MSBaseVehicle::rememberBlockedParkingArea(const MSParkingArea* pa) { +MSBaseVehicle::rememberBlockedParkingArea(const MSParkingArea* pa, bool local) { if (myParkingMemory == nullptr) { myParkingMemory = new ParkingMemory(); } - (*myParkingMemory)[pa] = SIMSTEP; + (*myParkingMemory)[pa].blockedAtTime = SIMSTEP; + if (local) { + (*myParkingMemory)[pa].blockedAtTimeLocal = SIMSTEP; + } } +void +MSBaseVehicle::resetParkingAreaScores() { + if (myParkingMemory != nullptr) { + for (auto& item : *myParkingMemory) { + item.second.score = ""; + } + } +} + +void +MSBaseVehicle::rememberParkingAreaScore(const MSParkingArea* pa, const std::string& score) { + if (myParkingMemory == nullptr) { + myParkingMemory = new ParkingMemory(); + } + (*myParkingMemory)[pa].score = score; +} + + SUMOTime -MSBaseVehicle::sawBlockedParkingArea(const MSParkingArea* pa) { +MSBaseVehicle::sawBlockedParkingArea(const MSParkingArea* pa, bool local) const { if (myParkingMemory == nullptr) { return -1; } @@ -1826,7 +1858,7 @@ if (it == myParkingMemory->end()) { return -1; } else { - return it->second; + return local ? it->second.blockedAtTimeLocal : it->second.blockedAtTime; } } diff -Nru sumo-1.11.0/src/microsim/MSBaseVehicle.h sumo-1.12.0/src/microsim/MSBaseVehicle.h --- sumo-1.11.0/src/microsim/MSBaseVehicle.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSBaseVehicle.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ @@ -226,6 +226,18 @@ return 0; } + /** @brief Returns the number of seconds waited (speed was lesser than 0.1m/s) + * + * The value is reset if the vehicle moves faster than 0.1m/s + * Intentional stopping does not count towards this time. + * @return The time the vehicle is standing + */ + double getWaitingSeconds() const { + return STEPS2TIME(getWaitingTime()); + } + + + /** @brief Returns an iterator pointing to the current edge in this vehicles route * @return The current route pointer */ @@ -526,7 +538,7 @@ //@} - virtual bool handleCollisionStop(MSStop& stop, const bool collision, const double distToStop, const std::string& errorMsgStart, std::string& errorMsg); + virtual bool handleCollisionStop(MSStop& stop, const double distToStop); /** @brief Returns whether the vehicle is at a stop * @return Whether the vehicle has stopped @@ -830,8 +842,36 @@ /// @brief interpret stop lane on opposite side of the road static MSLane* interpretOppositeStop(SUMOVehicleParameter::Stop& stop); - void rememberBlockedParkingArea(const MSParkingArea* pa); - SUMOTime sawBlockedParkingArea(const MSParkingArea* pa); + /// @name state io + //@{ + void rememberBlockedParkingArea(const MSParkingArea* pa, bool local); + SUMOTime sawBlockedParkingArea(const MSParkingArea* pa, bool local) const; + + /// @brief score only needed when running with gui + void rememberParkingAreaScore(const MSParkingArea* pa, const std::string& score); + void resetParkingAreaScores(); + + /// @brief store information for a single parking area + struct PaMemory { + PaMemory() : blockedAtTime(-1), blockedAtTimeLocal(-1) {} + + SUMOTime blockedAtTime; + SUMOTime blockedAtTimeLocal; + std::string score; + }; + + int getNumberParkingReroutes() const { + return myNumberParkingReroutes; + } + void setNumberParkingReroutes(int value) { + myNumberParkingReroutes = value; + } + + typedef std::map ParkingMemory; + const ParkingMemory* getParkingMemory() const { + return myParkingMemory; + } + //@} protected: /// @brief This vehicle's parameter. @@ -904,8 +944,8 @@ int myRouteValidity; /// memory for parking search - typedef std::map ParkingMemory; ParkingMemory* myParkingMemory = nullptr; + int myNumberParkingReroutes = 0; /* @brief magic value for undeparted vehicles * @note: in previous versions this was -1 diff -Nru sumo-1.11.0/src/microsim/MSBitSetLogic.h sumo-1.12.0/src/microsim/MSBitSetLogic.h --- sumo-1.11.0/src/microsim/MSBitSetLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSBitSetLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSDriverState.cpp sumo-1.12.0/src/microsim/MSDriverState.cpp --- sumo-1.11.0/src/microsim/MSDriverState.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSDriverState.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSDriverState.h sumo-1.12.0/src/microsim/MSDriverState.h --- sumo-1.11.0/src/microsim/MSDriverState.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSDriverState.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSDynamicShapeUpdater.cpp sumo-1.12.0/src/microsim/MSDynamicShapeUpdater.cpp --- sumo-1.11.0/src/microsim/MSDynamicShapeUpdater.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSDynamicShapeUpdater.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2019-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2019-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSDynamicShapeUpdater.h sumo-1.12.0/src/microsim/MSDynamicShapeUpdater.h --- sumo-1.11.0/src/microsim/MSDynamicShapeUpdater.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSDynamicShapeUpdater.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2019-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2019-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSEdgeControl.cpp sumo-1.12.0/src/microsim/MSEdgeControl.cpp --- sumo-1.11.0/src/microsim/MSEdgeControl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSEdgeControl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -288,6 +288,9 @@ toAdd.push_back(lane); lu.amActive = true; } + if (MSGlobals::gLateralResolution > 0) { + lane->sortManeuverReservations(); + } } #ifdef PARALLEL_CHANGE_LANES } @@ -308,6 +311,9 @@ toAdd.push_back(l); lu.amActive = true; } + if (MSGlobals::gLateralResolution > 0) { + l->sortManeuverReservations(); + } } } } @@ -317,12 +323,6 @@ for (std::vector::iterator i = toAdd.begin(); i != toAdd.end(); ++i) { myActiveLanes.push_front(*i); } - if (MSGlobals::gLateralResolution > 0) { - // sort maneuver reservations - for (LaneUsageVector::iterator it = myLanes.begin(); it != myLanes.end(); ++it) { - (*it).lane->sortManeuverReservations(); - } - } } diff -Nru sumo-1.11.0/src/microsim/MSEdgeControl.h sumo-1.12.0/src/microsim/MSEdgeControl.h --- sumo-1.11.0/src/microsim/MSEdgeControl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSEdgeControl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSEdge.cpp sumo-1.12.0/src/microsim/MSEdge.cpp --- sumo-1.11.0/src/microsim/MSEdge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSEdge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -28,6 +28,9 @@ #include #include #include +#ifdef HAVE_FOX +#include +#endif #include #include #include @@ -55,6 +58,7 @@ // =========================================================================== MSEdge::DictType MSEdge::myDict; MSEdgeVector MSEdge::myEdges; +SVCPermissions MSEdge::myMesoIgnoredVClasses(0); // =========================================================================== @@ -116,7 +120,7 @@ myLength = myLanes->front()->getLength(); myEmptyTraveltime = myLength / MAX2(getSpeedLimit(), NUMERICAL_EPS); if (MSGlobals::gUseMesoSim) { - const MSNet::MesoEdgeType& edgeType = MSNet::getInstance()->getMesoType(getEdgeType()); + const MESegment::MesoEdgeType& edgeType = MSNet::getInstance()->getMesoType(getEdgeType()); if (edgeType.tlsPenalty > 0 || edgeType.minorPenalty > 0) { // add tls penalties to the minimum travel time SUMOTime minPenalty = -1; @@ -196,7 +200,7 @@ MSEdge::updateMesoType() { assert(MSGlobals::gUseMesoSim); if (!myLanes->empty()) { - MSGlobals::gMesoNet->updateSegementsForEdge(*this); + MSGlobals::gMesoNet->updateSegmentsForEdge(*this); } } @@ -256,14 +260,25 @@ } +SVCPermissions +MSEdge::getMesoPermissions(SVCPermissions p, SVCPermissions ignoreIgnored) { + SVCPermissions ignored = myMesoIgnoredVClasses & ~ignoreIgnored; + return (p | ignored) == ignored ? 0 : p; +} + + void MSEdge::rebuildAllowedLanes() { // rebuild myMinimumPermissions and myCombinedPermissions myMinimumPermissions = SVCAll; myCombinedPermissions = 0; for (MSLane* const lane : *myLanes) { - myMinimumPermissions &= lane->getPermissions(); - myCombinedPermissions |= lane->getPermissions(); + // same dedicated lanes are ignored in meso to avoid capacity errors. + // Here we have to make sure that vehicles which are set to depart on + // such lanes trigger an error. + SVCPermissions allow = getMesoPermissions(lane->getPermissions(), SVC_PEDESTRIAN); + myMinimumPermissions &= allow; + myCombinedPermissions |= allow; } // rebuild myAllowed myAllowed.clear(); @@ -285,6 +300,11 @@ for (MSEdge* pred : myPredecessors) { pred->rebuildAllowedTargets(false); } + if (MSGlobals::gUseMesoSim) { + for (MESegment* s = MSGlobals::gMesoNet->getSegmentForEdge(*this); s != nullptr; s = s->getNextSegment()) { + s->updatePermissions(); + } + } } @@ -1066,7 +1086,7 @@ return mySuccessors; } #ifdef HAVE_FOX - FXConditionalLock lock(mySuccessorMutex, MSGlobals::gNumThreads > 1); + ScopedLocker<> lock(mySuccessorMutex, MSGlobals::gNumThreads > 1); #endif std::map::iterator i = myClassesSuccessorMap.find(vClass); if (i == myClassesSuccessorMap.end()) { @@ -1096,7 +1116,7 @@ return myViaSuccessors; } #ifdef HAVE_FOX - FXConditionalLock lock(mySuccessorMutex, MSGlobals::gNumThreads > 1); + ScopedLocker<> lock(mySuccessorMutex, MSGlobals::gNumThreads > 1); #endif auto i = myClassesViaSuccessorMap.find(vClass); if (i != myClassesViaSuccessorMap.end()) { @@ -1209,7 +1229,7 @@ void MSEdge::addWaiting(SUMOVehicle* vehicle) const { #ifdef HAVE_FOX - FXConditionalLock lock(myWaitingMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myWaitingMutex, MSGlobals::gNumSimThreads > 1); #endif myWaiting.push_back(vehicle); } @@ -1218,7 +1238,7 @@ void MSEdge::removeWaiting(const SUMOVehicle* vehicle) const { #ifdef HAVE_FOX - FXConditionalLock lock(myWaitingMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myWaitingMutex, MSGlobals::gNumSimThreads > 1); #endif std::vector::iterator it = std::find(myWaiting.begin(), myWaiting.end(), vehicle); if (it != myWaiting.end()) { @@ -1230,7 +1250,7 @@ SUMOVehicle* MSEdge::getWaitingVehicle(MSTransportable* transportable, const double position) const { #ifdef HAVE_FOX - FXConditionalLock lock(myWaitingMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myWaitingMutex, MSGlobals::gNumSimThreads > 1); #endif for (SUMOVehicle* const vehicle : myWaiting) { if (transportable->isWaitingFor(vehicle)) { diff -Nru sumo-1.11.0/src/microsim/MSEdge.h sumo-1.12.0/src/microsim/MSEdge.h --- sumo-1.11.0/src/microsim/MSEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -769,6 +769,11 @@ /** @brief Inserts IDs of all known edges into the given vector */ static void insertIDs(std::vector& into); + static SVCPermissions getMesoPermissions(SVCPermissions p, SVCPermissions ignoreIgnored = 0); + + static void setMesoIgnoredVClasses(SVCPermissions ignored) { + myMesoIgnoredVClasses = ignored; + } public: /// @name Static parser helper @@ -959,6 +964,8 @@ * @deprecated Move to MSEdgeControl, make non-static */ static MSEdgeVector myEdges; + + static SVCPermissions myMesoIgnoredVClasses; /// @} diff -Nru sumo-1.11.0/src/microsim/MSEdgeWeightsStorage.cpp sumo-1.12.0/src/microsim/MSEdgeWeightsStorage.cpp --- sumo-1.11.0/src/microsim/MSEdgeWeightsStorage.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSEdgeWeightsStorage.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSEdgeWeightsStorage.h sumo-1.12.0/src/microsim/MSEdgeWeightsStorage.h --- sumo-1.11.0/src/microsim/MSEdgeWeightsStorage.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSEdgeWeightsStorage.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSEventControl.cpp sumo-1.12.0/src/microsim/MSEventControl.cpp --- sumo-1.11.0/src/microsim/MSEventControl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSEventControl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSEventControl.h sumo-1.12.0/src/microsim/MSEventControl.h --- sumo-1.11.0/src/microsim/MSEventControl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSEventControl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSFrame.cpp sumo-1.12.0/src/microsim/MSFrame.cpp --- sumo-1.11.0/src/microsim/MSFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -436,7 +436,7 @@ oc.doRegister("default.carfollowmodel", new Option_String("Krauss")); oc.addDescription("default.carfollowmodel", "Processing", "Select default car following model (Krauss, IDM, ...)"); - oc.addSynonyme("default.carfollowmodel", "carfollow.model", false); + oc.addSynonyme("default.carfollowmodel", "carfollow.model"); oc.doRegister("default.speeddev", new Option_Float(-1)); oc.addDescription("default.speeddev", "Processing", "Select default speed deviation. A negative value implies vClass specific defaults (0.1 for the default passenger class"); @@ -592,6 +592,9 @@ oc.addDescription("meso-multi-queue", "Mesoscopic", "Enable multiple queues at edge ends"); oc.doRegister("meso-lane-queue", new Option_Bool(false)); oc.addDescription("meso-lane-queue", "Mesoscopic", "Enable separate queues for every lane"); + oc.doRegister("meso-ignore-lanes-by-vclass", new Option_StringVector(StringVector({ "pedestrian", "bicycle" }))); + oc.addDescription("meso-ignore-lanes-by-vclass", "Mesoscopic", "Do not build queues (or reduce capacity) for lanes allowing only the given vclasses"); + oc.addSynonyme("meso-ignore-lanes-by-vclass", "meso.ignore-lanes.by-vclass"); oc.doRegister("meso-junction-control", new Option_Bool(false)); oc.addDescription("meso-junction-control", "Mesoscopic", "Enable mesoscopic traffic light and priority junction handling"); oc.doRegister("meso-junction-control.limited", new Option_Bool(false)); @@ -792,7 +795,7 @@ try { const SUMOTime saveT = string2time(timeStr); if (end > 0 && saveT >= end) { - WRITE_WARNING("The save-state.time " + timeStr + " will not be used before simulation end at " + time2string(end)); + WRITE_WARNING("The save-state time=" + timeStr + " will not be used before simulation end at " + time2string(end) + "."); } else { checkStepLengthMultiple(saveT, " for save-state.times", deltaT); } diff -Nru sumo-1.11.0/src/microsim/MSFrame.h sumo-1.12.0/src/microsim/MSFrame.h --- sumo-1.11.0/src/microsim/MSFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSGlobals.cpp sumo-1.12.0/src/microsim/MSGlobals.cpp --- sumo-1.11.0/src/microsim/MSGlobals.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSGlobals.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2003-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2003-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSGlobals.h sumo-1.12.0/src/microsim/MSGlobals.h --- sumo-1.11.0/src/microsim/MSGlobals.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSGlobals.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2003-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2003-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSInsertionControl.cpp sumo-1.12.0/src/microsim/MSInsertionControl.cpp --- sumo-1.11.0/src/microsim/MSInsertionControl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSInsertionControl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSInsertionControl.h sumo-1.12.0/src/microsim/MSInsertionControl.h --- sumo-1.11.0/src/microsim/MSInsertionControl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSInsertionControl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSInternalJunction.cpp sumo-1.12.0/src/microsim/MSInternalJunction.cpp --- sumo-1.11.0/src/microsim/MSInternalJunction.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSInternalJunction.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSInternalJunction.h sumo-1.12.0/src/microsim/MSInternalJunction.h --- sumo-1.11.0/src/microsim/MSInternalJunction.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSInternalJunction.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSJunctionControl.cpp sumo-1.12.0/src/microsim/MSJunctionControl.cpp --- sumo-1.11.0/src/microsim/MSJunctionControl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSJunctionControl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSJunctionControl.h sumo-1.12.0/src/microsim/MSJunctionControl.h --- sumo-1.11.0/src/microsim/MSJunctionControl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSJunctionControl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSJunction.cpp sumo-1.12.0/src/microsim/MSJunction.cpp --- sumo-1.11.0/src/microsim/MSJunction.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSJunction.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSJunction.h sumo-1.12.0/src/microsim/MSJunction.h --- sumo-1.11.0/src/microsim/MSJunction.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSJunction.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSJunctionLogic.cpp sumo-1.12.0/src/microsim/MSJunctionLogic.cpp --- sumo-1.11.0/src/microsim/MSJunctionLogic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSJunctionLogic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSJunctionLogic.h sumo-1.12.0/src/microsim/MSJunctionLogic.h --- sumo-1.11.0/src/microsim/MSJunctionLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSJunctionLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSLaneChanger.cpp sumo-1.12.0/src/microsim/MSLaneChanger.cpp --- sumo-1.11.0/src/microsim/MSLaneChanger.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSLaneChanger.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -51,6 +51,7 @@ #define OPPOSITE_OVERTAKING_ONCOMING_LOOKAHEAD 1000.0 // just a guess // do not attempt overtaking maneuvers that would exceed this distance #define OPPOSITE_OVERTAKING_MAX_SPACE_TO_OVERTAKE 1000.0 // just a guess +#define OPPOSITE_OVERTAKING_HILLTOP_THRESHOHOLD 5 // (m) // =========================================================================== // debug defines @@ -1414,6 +1415,15 @@ #endif return false; } + if (!isOpposite && MSNet::getInstance()->hasElevation() && !overtaken.first->isStopped()) { + // do not overtake before the top of a hill + double searchDist = timeToOvertake * oncomingLane->getSpeedLimit() * 1.5 * vehicle->getLaneChangeModel().getOppositeSafetyFactor() + spaceToOvertake; + int view = vehicle->getLane()->isInternal() ? 1 : 0; + bool foundHill = vehicle->getSlope() > 0; + if (foundHilltop(vehicle, foundHill, searchDist, vehicle->getBestLanesContinuation(), view, vehicle->getPositionOnLane(), vehicle->getPosition().z(), OPPOSITE_OVERTAKING_HILLTOP_THRESHOHOLD)) { + return false; + } + } #ifdef DEBUG_CHANGE_OPPOSITE if (DEBUG_COND) { std::cout << " usableDist=" << usableDist << " spaceToOvertake=" << spaceToOvertake << " timeToOvertake=" << timeToOvertake << "\n"; @@ -1425,7 +1435,7 @@ // compute the remaining distance that can be driven on the opposite side // this value will put into oppositeLength of the opposite lanes // @note: length counts from the start of the current lane - // @note: see MSLCM_LC2013::_wantsChange @1092 (isOpposite() + // @note: see MSLaneChangeModel::LC2013::_wantsChange @1092 (isOpposite() // position on the target lane const double forwardPos = source->getOppositePos(vehicle->getPositionOnLane()); @@ -1583,6 +1593,60 @@ } bool +MSLaneChanger::foundHilltop(MSVehicle* vehicle, bool foundHill, double searchDist, const std::vector& bestLanes, int view, double pos, double lastMax, double hilltopThreshold) { + if (view >= (int)bestLanes.size()) { + return false; + } + MSLane* lane = bestLanes[view]; + double laneDist = 0; + const PositionVector& shape = lane->getShape(); + double lastZ = lastMax; + for (int i = 1; i < (int)shape.size(); i++) { + const double dist = lane->interpolateGeometryPosToLanePos(shape[i - 1].distanceTo(shape[i])); + laneDist += dist; + if (laneDist > pos) { + const double z = shape[i].z(); + if (z > lastMax) { + lastMax = z; + } + if (z > lastZ) { + foundHill = true; + } + lastZ = z; +#ifdef DEBUG_CHANGE_OPPOSITE + if (DEBUG_COND) { + std::cout << SIMTIME << " foundHill=" << foundHill << " searchDist=" << searchDist << " lastMax=" << lastMax << " lane=" << lane->getID() << " laneDist=" << laneDist << " z=" << z << "\n"; + } +#endif + if (foundHill && z < lastMax) { + const double drop = lastMax - z; + //std::cout << SIMTIME << " searchDist=" << searchDist << " hillDrop=" << drop << " lastMax=" << lastMax << " lane=" << lane->getID() << " laneDist=" << laneDist << " z=" << z << "\n"; + if (drop > hilltopThreshold) { +#ifdef DEBUG_CHANGE_OPPOSITE + if (DEBUG_COND) { + std::cout << " cannot changeOpposite before the top of a hill searchDist=" << searchDist << " hillDrop=" << drop + << " lastMax=" << lastMax << " lane=" << lane->getID() << " laneDist=" << laneDist << " z=" << z << "\n"; + } +#endif + return true; + } + } + if (pos == 0) { + searchDist -= dist; + } else { + searchDist -= laneDist - pos; + pos = 0; + } + if (searchDist <= 0) { + return false; + } + } + } + return foundHilltop(vehicle, foundHill, searchDist, bestLanes, view + 1, 0, lastMax, hilltopThreshold); +} + + +bool MSLaneChanger::checkChangeOpposite( MSVehicle* vehicle, int laneOffset, @@ -1810,7 +1874,8 @@ } else { // maybe the columnleader is stopped before a junction or takes a different turn. // try to find another columnleader on successive lanes - const MSLane* next = getLaneAfter(columnLeader.first->getLane(), conts); + const bool allowMinor = vehicle->getVehicleType().getVehicleClass() == SVC_EMERGENCY; + const MSLane* next = getLaneAfter(columnLeader.first->getLane(), conts, allowMinor); #ifdef DEBUG_CHANGE_OPPOSITE if (DEBUG_COND) { std::cout << " look for another leader on lane " << Named::getIDSecure(next) << "\n"; @@ -1825,6 +1890,7 @@ foundSpaceAhead = true; break; } + next = getLaneAfter(next, conts, allowMinor); } else { availableSpace += cand->getBackPositionOnLane(); if (availableSpace > requiredSpace) { @@ -1855,6 +1921,17 @@ if (leadLead.second > requiredSpace) { foundSpaceAhead = true; } else { + + if (leadLead.second < 0) { + // must be a junction leader or some other dangerous situation +#ifdef DEBUG_CHANGE_OPPOSITE + if (DEBUG_COND) { + std::cout << " leader's leader " << leadLead.first->getID() << " gap=" << leadLead.second << " is junction leader (aborting)\n"; + } +#endif + return std::make_pair(nullptr, -1); + } + #ifdef DEBUG_CHANGE_OPPOSITE if (DEBUG_COND) { std::cout << " not enough space after columnLeader=" << columnLeader.first->getID() << " required=" << requiredSpace << "\n"; @@ -1885,12 +1962,18 @@ } -MSLane* -MSLaneChanger::getLaneAfter(const MSLane* lane, const std::vector& conts) { +const MSLane* +MSLaneChanger::getLaneAfter(const MSLane* lane, const std::vector& conts, bool allowMinor) { for (auto it = conts.begin(); it != conts.end(); ++it) { if (*it == lane) { if (it + 1 != conts.end()) { - return *(it + 1); + // abort on minor link + const MSLane* next = *(it + 1); + const MSLink* link = lane->getLinkTo(next); + if (link == nullptr || (!allowMinor && !link->havePriority())) { + return nullptr; + } + return next; } else { return nullptr; } diff -Nru sumo-1.11.0/src/microsim/MSLaneChanger.h sumo-1.12.0/src/microsim/MSLaneChanger.h --- sumo-1.11.0/src/microsim/MSLaneChanger.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSLaneChanger.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -236,7 +236,7 @@ static std::pair getColumnleader(MSVehicle* vehicle, std::pair leader, double maxLookAhead = std::numeric_limits::max()); /// @brief return the next lane in conts beyond lane or nullptr - static MSLane* getLaneAfter(const MSLane* lane, const std::vector& conts); + static const MSLane* getLaneAfter(const MSLane* lane, const std::vector& conts, bool allowMinor); /// @brief whether vehicle has an opposite-direction stop within relevant range static bool hasOppositeStop(MSVehicle* vehicle); @@ -244,6 +244,9 @@ // @brief compute distance that can safely be driven on the opposite side static double computeSurplusGap(const MSVehicle* vehicle, const MSLane* opposite, std::pair oncoming, double timeToOvertake, double spaceToOvertake, double& oncomingSpeed); + // @brief find hilltop within searchDistance + static bool foundHilltop(MSVehicle* vehicle, bool foundHill, double searchDist, const std::vector& bestLanes, int view, double pos, double lastMax, double hilltopThreshold); + /// @brief add LaneQ for opposite lanes static std::vector getBestLanesOpposite(MSVehicle* vehicle, const MSLane* stopLane, double oppositeLength); diff -Nru sumo-1.11.0/src/microsim/MSLaneChangerSublane.cpp sumo-1.12.0/src/microsim/MSLaneChangerSublane.cpp --- sumo-1.11.0/src/microsim/MSLaneChangerSublane.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSLaneChangerSublane.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -40,6 +40,7 @@ // =========================================================================== #define DEBUG_COND (vehicle->getLaneChangeModel().debugVehicle()) //#define DEBUG_COND (vehicle->getID() == "disabled") +//#define DEBUG_COND true //#define DEBUG_DECISION //#define DEBUG_ACTIONSTEPS //#define DEBUG_STATE @@ -484,7 +485,7 @@ laneAngle += M_PI; } #ifdef DEBUG_MANEUVER - if (vehicle->getLaneChangeModel().debugVehicle()) { + if (DEBUG_COND) { std::cout << SIMTIME << " startChangeSublane" << " oldLane=" << from->lane->getID() << " newLane=" << to->lane->getID() @@ -506,10 +507,13 @@ vehicle->setAngle(laneAngle + changeAngle, completedManeuver); // check if a traci maneuver must continue - if ((vehicle->getLaneChangeModel().getOwnState() & LCA_TRACI) != 0) { - if (vehicle->getLaneChangeModel().debugVehicle()) { + // getOwnState is reset to 0 when changing lanes so we use the stored reason + if ((reason & LCA_TRACI) != 0) { +#ifdef DEBUG_MANEUVER + if (DEBUG_COND) { std::cout << SIMTIME << " continue TraCI-maneuver remainingLatDist=" << vehicle->getLaneChangeModel().getManeuverDist() << "\n"; } +#endif vehicle->getInfluencer().setSublaneChange(vehicle->getLaneChangeModel().getManeuverDist()); } from->lane->requireCollisionCheck(); diff -Nru sumo-1.11.0/src/microsim/MSLaneChangerSublane.h sumo-1.12.0/src/microsim/MSLaneChangerSublane.h --- sumo-1.11.0/src/microsim/MSLaneChangerSublane.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSLaneChangerSublane.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSLane.cpp sumo-1.12.0/src/microsim/MSLane.cpp --- sumo-1.11.0/src/microsim/MSLane.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSLane.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -42,7 +42,7 @@ #include #include #ifdef HAVE_FOX -#include +#include #endif #include #include @@ -284,7 +284,7 @@ #endif // XXX update occupancy here? #ifdef HAVE_FOX - FXConditionalLock lock(myPartialOccupatorMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myPartialOccupatorMutex, MSGlobals::gNumSimThreads > 1); #endif //assert(std::find(myPartialVehicles.begin(), myPartialVehicles.end(), v) == myPartialVehicles.end()); myPartialVehicles.push_back(v); @@ -295,7 +295,7 @@ void MSLane::resetPartialOccupation(MSVehicle* v) { #ifdef HAVE_FOX - FXConditionalLock lock(myPartialOccupatorMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myPartialOccupatorMutex, MSGlobals::gNumSimThreads > 1); #endif #ifdef DEBUG_CONTEXT if (DEBUG_COND2(v)) { @@ -310,7 +310,8 @@ return; } } - assert(false || MSGlobals::gClearState); + // bluelight eqipped vehicle can teleport onto the intersection without using a connection + assert(false || MSGlobals::gClearState || v->getLaneChangeModel().hasBlueLight()); } @@ -512,6 +513,20 @@ speed = getVehicleMaxSpeed(&veh) / veh.getChosenSpeedFactor(); patchSpeed = false; break; + case DepartSpeedDefinition::LAST: { + MSVehicle* last = getLastAnyVehicle(); + speed = getVehicleMaxSpeed(&veh); + if (last != nullptr) { + speed = MIN2(speed, last->getSpeed()); + } + patchSpeed = false; + break; + } + case DepartSpeedDefinition::AVG: { + speed = MIN2(getVehicleMaxSpeed(&veh), getMeanSpeed()); + patchSpeed = false; + break; + } case DepartSpeedDefinition::DEFAULT: default: // speed = 0 was set before @@ -1153,7 +1168,7 @@ } if (ego == nullptr && minPos == 0) { #ifdef HAVE_FOX - FXConditionalLock lock(myLeaderInfoMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myLeaderInfoMutex, MSGlobals::gNumSimThreads > 1); #endif // update cached value myLeaderInfo = leaderTmp; @@ -1182,7 +1197,7 @@ const MSLeaderInfo MSLane::getFirstVehicleInformation(const MSVehicle* ego, double latOffset, bool onlyFrontOnLane, double maxPos, bool allowCached) const { #ifdef HAVE_FOX - FXConditionalLock lock(myFollowerInfoMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myFollowerInfoMutex, MSGlobals::gNumSimThreads > 1); #endif if (myFollowerInfoTime < MSNet::getInstance()->getCurrentTimeStep() || ego != nullptr || maxPos < myLength || !allowCached || onlyFrontOnLane) { // XXX separate cache for onlyFrontOnLane = true @@ -1405,9 +1420,9 @@ // make a detailed check PositionVector boundingPoly = collider->getBoundingPoly(); if (collider->getBoundingPoly(myCheckJunctionCollisionMinGap).overlapsWith(victim->getBoundingPoly())) { - // junction leader is the victim + // junction leader is the victim (collider must still be on junction) assert(isInternal()); - if (victim->isLeader(myLinks.front(), collider)) { + if (victim->getLane()->isInternal() && victim->isLeader(myLinks.front(), collider)) { foeLane->handleCollisionBetween(timestep, stage, victim, collider, -1, 0, toRemove, toTeleport); } else { handleCollisionBetween(timestep, stage, collider, victim, -1, 0, toRemove, toTeleport); @@ -2677,7 +2692,7 @@ const auto bestLane = std::min_element(myIncomingLanes.begin(), myIncomingLanes.end(), incoming_lane_priority_sorter(this)); { #ifdef HAVE_FOX - FXConditionalLock lock(myLeaderInfoMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myLeaderInfoMutex, MSGlobals::gNumSimThreads > 1); #endif myCanonicalPredecessorLane = bestLane->lane; } @@ -3081,8 +3096,9 @@ break; } } - // if one link is subordinate, the other must be priorized - assert(priorized1 || priorized2); + // if one link is subordinate, the other must be priorized (except for + // traffic lights where mutual response is permitted to handle stuck-on-red + // situation) if (priorized1 != priorized2) { return priorized1; } @@ -3406,6 +3422,7 @@ agap = (*it).length - v->getPositionOnLane() + backOffset - v->getVehicleType().getMinGap(); if (!(*it).viaLink->havePriority() && !ego->onFurtherEdge(&(*it).lane->getEdge()) && ego->isOnRoad() // during insertion, this can lead to collisions because ego's further lanes are not set (see #3053) + && !ego->getLaneChangeModel().isOpposite() ) { // if v comes from a minor side road it should not block lane changing agap = MAX2(agap, 0.0); diff -Nru sumo-1.11.0/src/microsim/MSLane.h sumo-1.12.0/src/microsim/MSLane.h --- sumo-1.11.0/src/microsim/MSLane.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSLane.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSLeaderInfo.cpp sumo-1.12.0/src/microsim/MSLeaderInfo.cpp --- sumo-1.11.0/src/microsim/MSLeaderInfo.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSLeaderInfo.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSLeaderInfo.h sumo-1.12.0/src/microsim/MSLeaderInfo.h --- sumo-1.11.0/src/microsim/MSLeaderInfo.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSLeaderInfo.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSLink.cpp sumo-1.12.0/src/microsim/MSLink.cpp --- sumo-1.11.0/src/microsim/MSLink.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSLink.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -106,6 +106,7 @@ myParallelRight(nullptr), myParallelLeft(nullptr), myAmIndirect(indirect), + myRadius(std::numeric_limits::max()), myJunction(nullptr) { if (MSGlobals::gLateralResolution > 0) { @@ -324,6 +325,27 @@ } } } + if (myInternalLaneBefore != nullptr + && myDirection != LinkDirection::STRAIGHT + // for right turns, the curvature helps rather than restricts the linkLeader check + && ( + (!MSGlobals::gLefthand && myDirection != LinkDirection::RIGHT) + || (MSGlobals::gLefthand && myDirection != LinkDirection::LEFT))) { + const double angle = fabs(GeomHelper::angleDiff( + myLaneBefore->getNormalPredecessorLane()->getShape().angleAt2D(-2), + myLane->getShape().angleAt2D(0))); + if (angle > 0) { + double length = myInternalLaneBefore->getShape().length2D(); + if (myInternalLaneBefore->getIncomingLanes().size() == 1 && + myInternalLaneBefore->getIncomingLanes()[0].lane->isInternal()) { + length += myInternalLaneBefore->getIncomingLanes()[0].lane->getShape().length2D(); + } else if (myInternalLane != nullptr) { + length += myInternalLane->getShape().length2D(); + } + myRadius = length / angle; + //std::cout << getDescription() << " a=" << RAD2DEG(angle) << " l=" << length << " r=" << myRadius << "\n"; + } + } } @@ -1111,7 +1133,9 @@ MSVehicle* leader = (MSVehicle*)*it_veh; const double leaderBack = leader->getBackPositionOnLane(foeLane); const double leaderBackDist = foeDistToCrossing - leaderBack; - const bool pastTheCrossingPoint = leaderBackDist + foeCrossingWidth < 0; + const double l2 = ego != nullptr ? ego->getLength() + 2 : 0; // add some slack to account for further meeting-angle effects + const double sagitta = ego != nullptr && myRadius != std::numeric_limits::max() ? myRadius - sqrt(myRadius * myRadius - 0.25 * l2 * l2) : 0; + const bool pastTheCrossingPoint = leaderBackDist + foeCrossingWidth + sagitta < 0; const bool foeIsBicycleTurn = (leader->getVehicleType().getVehicleClass() == SVC_BICYCLE && foeLane->getIncomingLanes().front().viaLink->getDirection() == LinkDirection::LEFT); const bool ignoreIndirectBicycleTurn = pastTheCrossingPoint && foeIsBicycleTurn; @@ -1130,6 +1154,8 @@ << " lb=" << leaderBack << " lbd=" << leaderBackDist << " fcwidth=" << foeCrossingWidth + << " r=" << myRadius + << " sagitta=" << sagitta << " foePastCP=" << pastTheCrossingPoint << " inTheWay=" << inTheWay << " willPass=" << willPass @@ -1270,7 +1296,7 @@ //<< " stateRight=" << toString((LaneChangeAction)leader->getLaneChangeModel().getSavedState(-1).second) << "\n"; } - if (leaderBackDist + foeCrossingWidth < 0 && !sameTarget) { + if (pastTheCrossingPoint && !sameTarget) { // leader is completely past the crossing point // or there is no crossing point continue; // next vehicle @@ -1456,8 +1482,8 @@ MSLink* MSLink::computeParallelLink(int direction) { - const MSLane* const before = getLaneBefore()->getParallelLane(direction); - const MSLane* const after = getLane()->getParallelLane(direction); + const MSLane* const before = getLaneBefore()->getParallelLane(direction, false); + const MSLane* const after = getLane()->getParallelLane(direction, false); if (before != nullptr && after != nullptr) { for (MSLink* const link : before->getLinkCont()) { if (link->getLane() == after) { diff -Nru sumo-1.11.0/src/microsim/MSLink.h sumo-1.12.0/src/microsim/MSLink.h --- sumo-1.11.0/src/microsim/MSLink.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSLink.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -741,6 +741,9 @@ /// @brief whether this connection is an indirect turning movement const bool myAmIndirect; + /// @brief the turning radius for this link or doublemax for straight links + double myRadius; + /// @brief the junction to which this link belongs MSJunction* myJunction; diff -Nru sumo-1.11.0/src/microsim/MSLogicJunction.cpp sumo-1.12.0/src/microsim/MSLogicJunction.cpp --- sumo-1.11.0/src/microsim/MSLogicJunction.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSLogicJunction.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSLogicJunction.h sumo-1.12.0/src/microsim/MSLogicJunction.h --- sumo-1.11.0/src/microsim/MSLogicJunction.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSLogicJunction.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSMoveReminder.cpp sumo-1.12.0/src/microsim/MSMoveReminder.cpp --- sumo-1.11.0/src/microsim/MSMoveReminder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSMoveReminder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSMoveReminder.h sumo-1.12.0/src/microsim/MSMoveReminder.h --- sumo-1.11.0/src/microsim/MSMoveReminder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSMoveReminder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2003-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2003-2022 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/ @@ -234,14 +234,14 @@ const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane, const double meanLengthOnLane) { - UNUSED_PARAMETER(meanLengthOnLane); - UNUSED_PARAMETER(travelledDistanceFrontOnLane); - UNUSED_PARAMETER(travelledDistanceVehicleOnLane); - UNUSED_PARAMETER(meanSpeedVehicleOnLane); - UNUSED_PARAMETER(meanSpeedFrontOnLane); + UNUSED_PARAMETER(&veh); UNUSED_PARAMETER(frontOnLane); UNUSED_PARAMETER(timeOnLane); - UNUSED_PARAMETER(&veh); + UNUSED_PARAMETER(meanSpeedFrontOnLane); + UNUSED_PARAMETER(meanSpeedVehicleOnLane); + UNUSED_PARAMETER(travelledDistanceFrontOnLane); + UNUSED_PARAMETER(travelledDistanceVehicleOnLane); + UNUSED_PARAMETER(meanLengthOnLane); } void setDescription(const std::string& description) { diff -Nru sumo-1.11.0/src/microsim/MSNet.cpp sumo-1.12.0/src/microsim/MSNet.cpp --- sumo-1.11.0/src/microsim/MSNet.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSNet.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -40,10 +40,9 @@ #include #include -#include "trigger/MSTrigger.h" -#include "trigger/MSCalibrator.h" -#include "traffic_lights/MSTLLogicControl.h" -#include "MSVehicleControl.h" +#ifdef HAVE_FOX +#include +#endif #include #include #include @@ -89,14 +88,17 @@ #include #include #include +#include #include #include #include +#include +#include #include #include +#include #include -#include #include "MSEdgeControl.h" #include "MSJunctionControl.h" #include "MSInsertionControl.h" @@ -106,6 +108,7 @@ #include "MSJunction.h" #include "MSJunctionLogic.h" #include "MSLane.h" +#include "MSVehicleControl.h" #include "MSVehicleTransfer.h" #include "MSRoute.h" #include "MSGlobals.h" @@ -343,16 +346,16 @@ } void -MSNet::addMesoType(const std::string& typeID, const MesoEdgeType& edgeType) { +MSNet::addMesoType(const std::string& typeID, const MESegment::MesoEdgeType& edgeType) { myMesoEdgeTypes[typeID] = edgeType; } -const MSNet::MesoEdgeType& +const MESegment::MesoEdgeType& MSNet::getMesoType(const std::string& typeID) { if (myMesoEdgeTypes.count(typeID) == 0) { // init defaults const OptionsCont& oc = OptionsCont::getOptions(); - MesoEdgeType edgeType; + MESegment::MesoEdgeType edgeType; edgeType.tauff = string2time(oc.getString("meso-tauff")); edgeType.taufj = string2time(oc.getString("meso-taufj")); edgeType.taujf = string2time(oc.getString("meso-taujf")); @@ -838,7 +841,7 @@ } } myInserter->clearState(); - myVehicleControl->clearState(); + myVehicleControl->clearState(true); MSVehicleTransfer::getInstance()->clearState(); MSRoute::dict_clearState(); // delete all routes after vehicles are deleted myLogics->clearState(); @@ -1140,7 +1143,7 @@ void MSNet::informVehicleStateListener(const SUMOVehicle* const vehicle, VehicleState to, const std::string& info) { #ifdef HAVE_FOX - FXConditionalLock lock(myVehicleStateListenerMutex, MSGlobals::gNumThreads > 1); + ScopedLocker<> lock(myVehicleStateListenerMutex, MSGlobals::gNumThreads > 1); #endif for (VehicleStateListener* const listener : myVehicleStateListeners) { listener->vehicleStateChanged(vehicle, to, info); @@ -1168,7 +1171,7 @@ void MSNet::informTransportableStateListener(const MSTransportable* const transportable, TransportableState to, const std::string& info) { #ifdef HAVE_FOX - FXConditionalLock lock(myTransportableStateListenerMutex, MSGlobals::gNumThreads > 1); + ScopedLocker<> lock(myTransportableStateListenerMutex, MSGlobals::gNumThreads > 1); #endif for (TransportableStateListener* const listener : myTransportableStateListeners) { listener->transportableStateChanged(transportable, to, info); diff -Nru sumo-1.11.0/src/microsim/MSNet.h sumo-1.12.0/src/microsim/MSNet.h --- sumo-1.11.0/src/microsim/MSNet.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSNet.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -41,12 +41,9 @@ #include #include #include +#include #include "MSJunction.h" -#ifdef HAVE_FOX -#include -#endif - // =========================================================================== // class declarations @@ -115,20 +112,6 @@ typedef PedestrianRouter MSPedestrianRouter; typedef IntermodalRouter MSIntermodalRouter; - /// @brief edge type specific meso parameters - struct MesoEdgeType { - SUMOTime tauff; - SUMOTime taufj; - SUMOTime taujf; - SUMOTime taujj; - double jamThreshold; - bool junctionControl; - double tlsPenalty; - double tlsFlowPenalty; - SUMOTime minorPenalty; - bool overtaking; - }; - /// @brief collision tracking struct Collision { std::string victim; @@ -253,12 +236,12 @@ * @param[in] id The id of the type * @param[in] edgeType The parameter object */ - void addMesoType(const std::string& typeID, const MesoEdgeType& edgeType); + void addMesoType(const std::string& typeID, const MESegment::MesoEdgeType& edgeType); /** @brief Returns edge type specific meso parameters * if no type specific parameters have been loaded, default values are returned */ - const MesoEdgeType& getMesoType(const std::string& typeID); + const MESegment::MesoEdgeType& getMesoType(const std::string& typeID); /** @brief Clears all dictionaries * @todo Try to move all this to the destructor @@ -950,7 +933,7 @@ std::map > myRestrictions; /// @brief The edge type specific meso parameters - std::map myMesoEdgeTypes; + std::map myMesoEdgeTypes; /// @brief Whether the network contains internal links/lanes/edges bool myHasInternalLinks; diff -Nru sumo-1.11.0/src/microsim/MSNoLogicJunction.cpp sumo-1.12.0/src/microsim/MSNoLogicJunction.cpp --- sumo-1.11.0/src/microsim/MSNoLogicJunction.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSNoLogicJunction.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSNoLogicJunction.h sumo-1.12.0/src/microsim/MSNoLogicJunction.h --- sumo-1.11.0/src/microsim/MSNoLogicJunction.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSNoLogicJunction.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSParkingArea.cpp sumo-1.12.0/src/microsim/MSParkingArea.cpp --- sumo-1.11.0/src/microsim/MSParkingArea.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSParkingArea.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2015-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2015-2022 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/ @@ -34,6 +34,7 @@ #include "MSGlobals.h" //#define DEBUG_RESERVATIONS +//#define DEBUG_GET_LAST_FREE_POS //#define DEBUG_COND2(obj) (obj.getID() == "v.3") #define DEBUG_COND2(obj) (obj.isSelected()) @@ -179,14 +180,44 @@ double -MSParkingArea::getLastFreePos(const SUMOVehicle& forVehicle) const { +MSParkingArea::getLastFreePos(const SUMOVehicle& forVehicle, double brakePos) const { if (myCapacity == (int)myEndPositions.size()) { // keep enough space so that parking vehicles can leave +#ifdef DEBUG_GET_LAST_FREE_POS + if (DEBUG_COND2(forVehicle)) { + std::cout << SIMTIME << " getLastFreePos veh=" << forVehicle.getID() << " allOccupied\n"; + } +#endif return myLastFreePos - forVehicle.getVehicleType().getMinGap() - POSITION_EPS; } else { - // XXX if (forVehicle.getLane() == myLane && forVehicle.getPositionOnLane() > myLastFreePos) { - // find freePos beyond vehicle position } - return myLastFreePos; + const double minPos = MIN2(myEndPos, brakePos); + if (myLastFreePos >= minPos) { +#ifdef DEBUG_GET_LAST_FREE_POS + if (DEBUG_COND2(forVehicle)) { + std::cout << SIMTIME << " getLastFreePos veh=" << forVehicle.getID() << " brakePos=" << brakePos << " myEndPos=" << myEndPos << " using myLastFreePos=" << myLastFreePos << "\n"; + } +#endif + return myLastFreePos; + } else { + // find free pos after minPos + for (const auto& lsd : mySpaceOccupancies) { + if (lsd.vehicle == nullptr && lsd.endPos >= minPos) { +#ifdef DEBUG_GET_LAST_FREE_POS + if (DEBUG_COND2(forVehicle)) { + std::cout << SIMTIME << " getLastFreePos veh=" << forVehicle.getID() << " brakePos=" << brakePos << " myEndPos=" << myEndPos << " nextFreePos=" << lsd.endPos << "\n"; + } +#endif + return lsd.endPos; + } + } + // shouldn't happen. No good solution seems possible +#ifdef DEBUG_GET_LAST_FREE_POS + if (DEBUG_COND2(forVehicle)) { + std::cout << SIMTIME << " getLastFreePos veh=" << forVehicle.getID() << " brakePos=" << brakePos << " myEndPos=" << myEndPos << " noGoodFreePos blockedAt=" << brakePos << "\n"; + } +#endif + return brakePos; + } } } @@ -263,20 +294,53 @@ return 0; } +int +MSParkingArea::getLotIndex(const SUMOVehicle* veh) const { + if (veh->getPositionOnLane() > myLastFreePos) { + // vehicle has gone past myLastFreePos and we need to find the actual lot + int closestLot = 0; + for (int i = 0; i < (int)mySpaceOccupancies.size(); i++) { + const LotSpaceDefinition lsd = mySpaceOccupancies[i]; + if (lsd.vehicle == nullptr) { + closestLot = i; + if (lsd.endPos >= veh->getPositionOnLane()) { + return i; + } + } + } + // for on-road parking we need to be precise + return myOnRoad ? -1 : closestLot; + } + if (myOnRoad && myLastFreePos - veh->getPositionOnLane() > POSITION_EPS) { + // for on-road parking we need to be precise + return -1; + } + return myLastFreeLot; +} void MSParkingArea::enter(SUMOVehicle* veh) { double beg = veh->getPositionOnLane() + veh->getVehicleType().getMinGap(); double end = veh->getPositionOnLane() - veh->getVehicleType().getLength(); - assert(myLastFreePos >= 0); - assert(myLastFreeLot < (int)mySpaceOccupancies.size()); if (myUpdateEvent == nullptr) { myUpdateEvent = new WrappingCommand(this, &MSParkingArea::updateOccupancy); MSNet::getInstance()->getEndOfTimestepEvents()->addEvent(myUpdateEvent); } - mySpaceOccupancies[myLastFreeLot].vehicle = veh; + int lotIndex = getLotIndex(veh); + if (lotIndex < 0) { + WRITE_WARNING("Unsuitable parking position for vehicle '" + veh->getID() + "' at parkingArea '" + getID() + "' time=" + time2string(SIMSTEP)); + lotIndex = myLastFreeLot; + } +#ifdef DEBUG_GET_LAST_FREE_POS + ((SUMOVehicleParameter&)veh->getParameter()).setParameter("lotIndex", toString(lotIndex)); +#endif + assert(myLastFreePos >= 0); + assert(lotIndex < (int)mySpaceOccupancies.size()); + mySpaceOccupancies[lotIndex].vehicle = veh; myEndPositions[veh] = std::pair(beg, end); computeLastFreePos(); + // current search ends here + veh->setNumberParkingReroutes(0); } @@ -362,7 +426,7 @@ double -MSParkingArea::getLastFreePosWithReservation(SUMOTime t, const SUMOVehicle& forVehicle) { +MSParkingArea::getLastFreePosWithReservation(SUMOTime t, const SUMOVehicle& forVehicle, double brakePos) { if (forVehicle.getLane() != &myLane) { // for different lanes, do not consider reservations to avoid lane-order // dependency in parallel simulation @@ -375,7 +439,7 @@ // ensure that the vehicle reaches the rerouter lane return MAX2(myBegPos, MIN2(POSITION_EPS, myEndPos)); } else { - return getLastFreePos(forVehicle); + return getLastFreePos(forVehicle, brakePos); } } if (t > myReservationTime) { @@ -392,7 +456,7 @@ myReservationMaxLength = MAX2(myReservationMaxLength, lsd.vehicle->getVehicleType().getLength()); } } - return getLastFreePos(forVehicle); + return getLastFreePos(forVehicle, brakePos); } else { if (myCapacity > getOccupancy() + myReservations) { #ifdef DEBUG_RESERVATIONS @@ -402,14 +466,14 @@ #endif myReservations++; myReservationMaxLength = MAX2(myReservationMaxLength, forVehicle.getVehicleType().getLength()); - return getLastFreePos(forVehicle); + return getLastFreePos(forVehicle, brakePos); } else { if (myCapacity == 0) { - return getLastFreePos(forVehicle); + return getLastFreePos(forVehicle, brakePos); } else { #ifdef DEBUG_RESERVATIONS if (DEBUG_COND2(forVehicle)) std::cout << SIMTIME << " pa=" << getID() << " freePosRes veh=" << forVehicle.getID() - << " res=" << myReservations << " resTime=" << myReservationTime << " reserved full, maxLen=" << myReservationMaxLength << " endPos=" << mySpaceOccupancies[0].myEndPos << "\n"; + << " res=" << myReservations << " resTime=" << myReservationTime << " reserved full, maxLen=" << myReservationMaxLength << " endPos=" << mySpaceOccupancies[0].endPos << "\n"; #endif return (mySpaceOccupancies[0].endPos - myReservationMaxLength diff -Nru sumo-1.11.0/src/microsim/MSParkingArea.h sumo-1.12.0/src/microsim/MSParkingArea.h --- sumo-1.11.0/src/microsim/MSParkingArea.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSParkingArea.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2015-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2015-2022 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/ @@ -87,6 +87,9 @@ /// @brief whether vehicles park on the road bool parkOnRoad() const; + /// @brief compute lot for this vehicle + int getLotIndex(const SUMOVehicle* veh) const; + /** @brief Returns the area occupancy * * @return The occupancy computed as number of vehicles in myEndPositions @@ -133,14 +136,14 @@ SUMOTime updateOccupancy(SUMOTime currentTime); /// @brief Returns the last free position on this stop - double getLastFreePos(const SUMOVehicle& forVehicle) const; + double getLastFreePos(const SUMOVehicle& forVehicle, double brakePos = 0) const; /** @brief Returns the last free position on this stop including * reservatiosn from the current lane and time step * * @return The last free position of this bus stop */ - double getLastFreePosWithReservation(SUMOTime t, const SUMOVehicle& forVehicle); + double getLastFreePosWithReservation(SUMOTime t, const SUMOVehicle& forVehicle, double brakePos); /// @brief Returns the position of parked vehicle Position getVehiclePosition(const SUMOVehicle& forVehicle) const; diff -Nru sumo-1.11.0/src/microsim/MSRightOfWayJunction.cpp sumo-1.12.0/src/microsim/MSRightOfWayJunction.cpp --- sumo-1.11.0/src/microsim/MSRightOfWayJunction.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSRightOfWayJunction.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSRightOfWayJunction.h sumo-1.12.0/src/microsim/MSRightOfWayJunction.h --- sumo-1.11.0/src/microsim/MSRightOfWayJunction.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSRightOfWayJunction.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSRoute.cpp sumo-1.12.0/src/microsim/MSRoute.cpp --- sumo-1.11.0/src/microsim/MSRoute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSRoute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSRoute.h sumo-1.12.0/src/microsim/MSRoute.h --- sumo-1.11.0/src/microsim/MSRoute.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSRoute.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSRouteHandler.cpp sumo-1.12.0/src/microsim/MSRouteHandler.cpp --- sumo-1.11.0/src/microsim/MSRouteHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSRouteHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -844,6 +844,7 @@ void MSRouteHandler::closeVType() { MSVehicleType* vehType = MSVehicleType::build(*myCurrentVType); + vehType->check(); if (!MSNet::getInstance()->getVehicleControl().addVType(vehType)) { const std::string id = vehType->getID(); delete vehType; @@ -1167,7 +1168,8 @@ stop.startPos = attrs.getOpt(SUMO_ATTR_STARTPOS, nullptr, ok, MAX2(0., stop.endPos - MIN_STOP_LENGTH)); if (!myAmLoadingState) { const bool friendlyPos = attrs.getOpt(SUMO_ATTR_FRIENDLY_POS, nullptr, ok, !attrs.hasAttribute(SUMO_ATTR_STARTPOS) && !attrs.hasAttribute(SUMO_ATTR_ENDPOS)); - if (!ok || (checkStopPos(stop.startPos, stop.endPos, edge->getLength(), POSITION_EPS, friendlyPos) != StopPos::STOPPOS_VALID)) { + // @note stop startPos=endPos is interpreted as a collision in MSBaseVehicle::addStops so we cannot use minLength=0 + if (!ok || (checkStopPos(stop.startPos, stop.endPos, edge->getLength(), NUMERICAL_EPS, friendlyPos) != StopPos::STOPPOS_VALID)) { WRITE_ERROR("Invalid start or end position for stop on " + (stop.lane != "" ? ("lane '" + stop.lane) diff -Nru sumo-1.11.0/src/microsim/MSRouteHandler.h sumo-1.12.0/src/microsim/MSRouteHandler.h --- sumo-1.11.0/src/microsim/MSRouteHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSRouteHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSStateHandler.cpp sumo-1.12.0/src/microsim/MSStateHandler.cpp --- sumo-1.11.0/src/microsim/MSStateHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSStateHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSStateHandler.h sumo-1.12.0/src/microsim/MSStateHandler.h --- sumo-1.11.0/src/microsim/MSStateHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSStateHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSStop.cpp sumo-1.12.0/src/microsim/MSStop.cpp --- sumo-1.11.0/src/microsim/MSStop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSStop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ @@ -20,6 +20,7 @@ /****************************************************************************/ #include +#include #include "MSLane.h" #include "MSParkingArea.h" #include "MSStoppingPlace.h" @@ -31,12 +32,13 @@ // =========================================================================== double MSStop::getEndPos(const SUMOVehicle& veh) const { + const double brakePos = veh.getEdge() == getEdge() ? veh.getPositionOnLane() + veh.getBrakeGap() : 0; if (busstop != nullptr) { - return busstop->getLastFreePos(veh); + return busstop->getLastFreePos(veh, brakePos); } else if (containerstop != nullptr) { - return containerstop->getLastFreePos(veh); + return containerstop->getLastFreePos(veh, brakePos); } else if (parkingarea != nullptr) { - return parkingarea->getLastFreePos(veh); + return parkingarea->getLastFreePos(veh, brakePos); } else if (chargingStation != nullptr) { return chargingStation->getLastFreePos(veh); } else if (overheadWireSegment != nullptr) { @@ -45,6 +47,15 @@ return pars.endPos; } +const MSEdge* +MSStop::getEdge() const { + if (lane != nullptr) { + return &lane->getEdge(); + } else if (segment != nullptr) { + return &segment->getEdge(); + } + return nullptr; +} double MSStop::getReachedThreshold() const { diff -Nru sumo-1.11.0/src/microsim/MSStop.h sumo-1.12.0/src/microsim/MSStop.h --- sumo-1.11.0/src/microsim/MSStop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSStop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ @@ -103,6 +103,8 @@ /// @brief initialize attributes from the given stop parameters void initPars(const SUMOVehicleParameter::Stop& stopPar); + const MSEdge* getEdge() const; + private: /// @brief Invalidated assignment operator MSStop& operator=(const MSStop& src) = delete; diff -Nru sumo-1.11.0/src/microsim/MSStoppingPlace.cpp sumo-1.12.0/src/microsim/MSStoppingPlace.cpp --- sumo-1.11.0/src/microsim/MSStoppingPlace.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSStoppingPlace.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ @@ -98,7 +98,7 @@ double -MSStoppingPlace::getLastFreePos(const SUMOVehicle& forVehicle) const { +MSStoppingPlace::getLastFreePos(const SUMOVehicle& forVehicle, double /*brakePos*/) const { if (myLastFreePos != myEndPos) { const double vehGap = forVehicle.getVehicleType().getMinGap(); double pos = myLastFreePos - vehGap; diff -Nru sumo-1.11.0/src/microsim/MSStoppingPlace.h sumo-1.12.0/src/microsim/MSStoppingPlace.h --- sumo-1.11.0/src/microsim/MSStoppingPlace.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSStoppingPlace.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ @@ -133,9 +133,11 @@ /** @brief Returns the last free position on this stop * + * @param[in] forVehicle The vehicle that wants to stop here + * @param[in] brakePos the first position on the stop lane that the vehicle can stop at * @return The last free position of this bus stop */ - double getLastFreePos(const SUMOVehicle& forVehicle) const; + double getLastFreePos(const SUMOVehicle& forVehicle, double brakePos = 0) const; /// @brief return whether the given vehicle fits at the given position bool fits(double pos, const SUMOVehicle& veh) const; diff -Nru sumo-1.11.0/src/microsim/MSVehicleContainer.cpp sumo-1.12.0/src/microsim/MSVehicleContainer.cpp --- sumo-1.11.0/src/microsim/MSVehicleContainer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSVehicleContainer.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSVehicleContainer.h sumo-1.12.0/src/microsim/MSVehicleContainer.h --- sumo-1.11.0/src/microsim/MSVehicleContainer.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSVehicleContainer.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSVehicleControl.cpp sumo-1.12.0/src/microsim/MSVehicleControl.cpp --- sumo-1.11.0/src/microsim/MSVehicleControl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSVehicleControl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -36,9 +36,6 @@ #include #include #include -#ifdef HAVE_FOX -#include -#endif // =========================================================================== @@ -58,11 +55,6 @@ myStoppedVehicles(0), myTotalDepartureDelay(0), myTotalTravelTime(0), - myDefaultVTypeMayBeDeleted(true), - myDefaultPedTypeMayBeDeleted(true), - myDefaultContainerTypeMayBeDeleted(true), - myDefaultBikeTypeMayBeDeleted(true), - myDefaultTaxiTypeMayBeDeleted(true), myWaitingForTransportable(0), myMaxSpeedFactor(1), myMinDeceleration(SUMOVTypeParameter::getDefaultDecel(SVC_IGNORING)), @@ -74,7 +66,7 @@ MSVehicleControl::~MSVehicleControl() { - clearState(); + clearState(false); } @@ -102,6 +94,8 @@ defContainerType.height = 2.6; defContainerType.parametersSet |= VTYPEPARS_VEHICLECLASS_SET; myVTypeDict[DEFAULT_CONTAINERTYPE_ID] = MSVehicleType::build(defContainerType); + + myReplaceableDefaultVTypes = DEFAULT_VTYPES; } @@ -147,6 +141,7 @@ #endif } + void MSVehicleControl::removePending() { OutputDevice* const tripinfoOut = OptionsCont::getOptions().isSet("tripinfo-output") ? &OutputDevice::getDeviceByOption("tripinfo-output") : nullptr; @@ -214,59 +209,43 @@ out.writeAttr(SUMO_ATTR_DEPART, myTotalDepartureDelay); out.writeAttr(SUMO_ATTR_TIME, myTotalTravelTime).closeTag(); // save vehicle types - VTypeDictType vTypes = myVTypeDict; - if (myDefaultVTypeMayBeDeleted) { - vTypes.erase(DEFAULT_VTYPE_ID); - } - if (myDefaultPedTypeMayBeDeleted) { - vTypes.erase(DEFAULT_PEDTYPE_ID); - } - if (myDefaultContainerTypeMayBeDeleted) { - vTypes.erase(DEFAULT_CONTAINERTYPE_ID); - } - if (myDefaultBikeTypeMayBeDeleted) { - vTypes.erase(DEFAULT_BIKETYPE_ID); - } - if (myDefaultTaxiTypeMayBeDeleted) { - vTypes.erase(DEFAULT_TAXITYPE_ID); - } - for (const auto& item : vTypes) { - item.second->getParameter().write(out); + for (const auto& item : myVTypeDict) { + if (myReplaceableDefaultVTypes.count(item.first) == 0) { + item.second->getParameter().write(out); + } } - for (VTypeDistDictType::iterator it = myVTypeDistDict.begin(); it != myVTypeDistDict.end(); ++it) { - out.openTag(SUMO_TAG_VTYPE_DISTRIBUTION).writeAttr(SUMO_ATTR_ID, it->first); - out.writeAttr(SUMO_ATTR_VTYPES, (*it).second->getVals()); - out.writeAttr(SUMO_ATTR_PROBS, (*it).second->getProbs()); + for (const auto& item : myVTypeDistDict) { + out.openTag(SUMO_TAG_VTYPE_DISTRIBUTION).writeAttr(SUMO_ATTR_ID, item.first); + out.writeAttr(SUMO_ATTR_VTYPES, item.second->getVals()); + out.writeAttr(SUMO_ATTR_PROBS, item.second->getProbs()); out.closeTag(); } - for (VehicleDictType::iterator it = myVehicleDict.begin(); it != myVehicleDict.end(); ++it) { - (*it).second->saveState(out); + for (const auto& item : myVehicleDict) { + item.second->saveState(out); } } void -MSVehicleControl::clearState() { - for (VehicleDictType::iterator i = myVehicleDict.begin(); i != myVehicleDict.end(); ++i) { - delete (*i).second; +MSVehicleControl::clearState(const bool reinit) { + for (const auto& item : myVehicleDict) { + delete item.second; } myVehicleDict.clear(); // delete vehicle type distributions - for (VTypeDistDictType::iterator i = myVTypeDistDict.begin(); i != myVTypeDistDict.end(); ++i) { - delete (*i).second; + for (const auto& item : myVTypeDistDict) { + delete item.second; } myVTypeDistDict.clear(); // delete vehicle types - for (VTypeDictType::iterator i = myVTypeDict.begin(); i != myVTypeDict.end(); ++i) { - delete (*i).second; + for (const auto& item : myVTypeDict) { + delete item.second; } myVTypeDict.clear(); myPendingRemovals.clear(); // could be leftovers from MSVehicleTransfer::checkInsertions (teleport beyond arrival) - myDefaultVTypeMayBeDeleted = true; - myDefaultPedTypeMayBeDeleted = true; - myDefaultContainerTypeMayBeDeleted = true; - myDefaultBikeTypeMayBeDeleted = true; - myDefaultTaxiTypeMayBeDeleted = true; + if (reinit) { + initDefaultTypes(); + } } @@ -324,46 +303,9 @@ bool MSVehicleControl::checkVType(const std::string& id) { - if (id == DEFAULT_VTYPE_ID) { - if (myDefaultVTypeMayBeDeleted) { - delete myVTypeDict[id]; - myVTypeDict.erase(myVTypeDict.find(id)); - myDefaultVTypeMayBeDeleted = false; - } else { - return false; - } - } else if (id == DEFAULT_PEDTYPE_ID) { - if (myDefaultPedTypeMayBeDeleted) { - delete myVTypeDict[id]; - myVTypeDict.erase(myVTypeDict.find(id)); - myDefaultPedTypeMayBeDeleted = false; - } else { - return false; - } - } else if (id == DEFAULT_CONTAINERTYPE_ID) { - if (myDefaultContainerTypeMayBeDeleted) { - delete myVTypeDict[id]; - myVTypeDict.erase(myVTypeDict.find(id)); - myDefaultContainerTypeMayBeDeleted = false; - } else { - return false; - } - } else if (id == DEFAULT_BIKETYPE_ID) { - if (myDefaultBikeTypeMayBeDeleted) { - delete myVTypeDict[id]; - myVTypeDict.erase(myVTypeDict.find(id)); - myDefaultBikeTypeMayBeDeleted = false; - } else { - return false; - } - } else if (id == DEFAULT_TAXITYPE_ID) { - if (myDefaultTaxiTypeMayBeDeleted) { - delete myVTypeDict[id]; - myVTypeDict.erase(myVTypeDict.find(id)); - myDefaultTaxiTypeMayBeDeleted = false; - } else { - return false; - } + if (myReplaceableDefaultVTypes.erase(id) > 0) { + delete myVTypeDict[id]; + myVTypeDict.erase(myVTypeDict.find(id)); } else { if (myVTypeDict.find(id) != myVTypeDict.end() || myVTypeDistDict.find(id) != myVTypeDistDict.end()) { return false; @@ -372,6 +314,7 @@ return true; } + bool MSVehicleControl::addVType(MSVehicleType* vehType) { if (checkVType(vehType->getID())) { @@ -434,10 +377,8 @@ } return it2->second->get(rng); } - if (id == DEFAULT_VTYPE_ID && !readOnly) { - myDefaultVTypeMayBeDeleted = false; - } else if (id == DEFAULT_PEDTYPE_ID && !readOnly) { - myDefaultPedTypeMayBeDeleted = false; + if (!readOnly && myReplaceableDefaultVTypes.erase(id) > 0) { + it->second->check(); } return it->second; } @@ -464,6 +405,7 @@ return it->second; } + const RandomDistributor* MSVehicleControl::getVTypeDistribution(const std::string& typeDistID) const { auto it = myVTypeDistDict.find(typeDistID); @@ -474,6 +416,7 @@ } } + void MSVehicleControl::abortWaiting() { for (VehicleDictType::iterator i = myVehicleDict.begin(); i != myVehicleDict.end(); ++i) { @@ -496,7 +439,6 @@ } - std::pair MSVehicleControl::getVehicleMeanSpeeds() const { double speedSum = 0; @@ -529,6 +471,7 @@ return getScalingQuota(frac, origLoaded); } + int MSVehicleControl::getTeleportCount() const { return myTeleportsCollision + myTeleportsJam + myTeleportsYield + myTeleportsWrongLane; diff -Nru sumo-1.11.0/src/microsim/MSVehicleControl.h sumo-1.12.0/src/microsim/MSVehicleControl.h --- sumo-1.11.0/src/microsim/MSVehicleControl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSVehicleControl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -80,9 +80,6 @@ /// @brief Destructor virtual ~MSVehicleControl(); - /// @brief create default types - void initDefaultTypes(); - /// @name Vehicle creation /// @{ @@ -493,7 +490,7 @@ void saveState(OutputDevice& out); /** @brief Remove all vehicles before quick-loading state */ - void clearState(); + void clearState(const bool reinit); /// @} /// @brief discount vehicles that were removed during state loading @@ -531,6 +528,9 @@ } private: + /// @brief create default types + void initDefaultTypes(); + /** @brief Checks whether the vehicle type (distribution) may be added * * This method checks also whether the default type may still be replaced @@ -623,20 +623,8 @@ /// @brief Inverse lookup from vehicle type to distributions it is a member of std::map> myVTypeToDist; - /// @brief Whether the default vehicle type was already used or can still be replaced - bool myDefaultVTypeMayBeDeleted; - - /// @brief Whether the default pedestrian type was already used or can still be replaced - bool myDefaultPedTypeMayBeDeleted; - - /// @brief Whether the default container type was already used or can still be replaced - bool myDefaultContainerTypeMayBeDeleted; - - /// @brief Whether the default bicycle type was already used or can still be replaced - bool myDefaultBikeTypeMayBeDeleted; - - /// @brief Whether the default taxi type was already used or can still be replaced - bool myDefaultTaxiTypeMayBeDeleted; + /// @brief the default vehicle types which may still be replaced + std::set myReplaceableDefaultVTypes; /// the number of vehicles waiting for persons or containers contained in myWaiting which can only continue by being triggered int myWaitingForTransportable; @@ -662,10 +650,10 @@ private: /// @brief invalidated copy constructor - MSVehicleControl(const MSVehicleControl& s); + MSVehicleControl(const MSVehicleControl& s) = delete; /// @brief invalidated assignment operator - MSVehicleControl& operator=(const MSVehicleControl& s); + MSVehicleControl& operator=(const MSVehicleControl& s) = delete; }; diff -Nru sumo-1.11.0/src/microsim/MSVehicle.cpp sumo-1.12.0/src/microsim/MSVehicle.cpp --- sumo-1.11.0/src/microsim/MSVehicle.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSVehicle.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -1661,9 +1661,11 @@ } } else if (stop.parkingarea->getOccupancyIncludingBlocked() >= stop.parkingarea->getCapacity()) { fitsOnStoppingPlace = false; + } else if (stop.parkingarea->parkOnRoad() && stop.parkingarea->getLotIndex(this) < 0) { + fitsOnStoppingPlace = false; } } - const double targetPos = myState.myPos + myStopDist; + const double targetPos = myState.myPos + myStopDist + (stop.pars.speed > 0 ? (stop.pars.startPos - stop.pars.endPos) : 0); const double reachedThreshold = (useStoppingPlace ? targetPos - STOPPING_PLACE_OFFSET : stop.getReachedThreshold()) - NUMERICAL_EPS; #ifdef DEBUG_STOPS if (DEBUG_COND) { @@ -1895,8 +1897,8 @@ } double -MSVehicle::getBrakeGap() const { - return getCarFollowModel().brakeGap(getSpeed()); +MSVehicle::getBrakeGap(bool delayed) const { + return getCarFollowModel().brakeGap(getSpeed(), getCarFollowModel().getMaxDecel(), delayed ? getCarFollowModel().getHeadwayTime() : 0); } @@ -2224,7 +2226,8 @@ double endPos = stop.getEndPos(*this) + NUMERICAL_EPS; if (stop.parkingarea != nullptr) { // leave enough space so parking vehicles can exit - endPos = stop.parkingarea->getLastFreePosWithReservation(t, *this); + const double brakePos = getBrakeGap() + lane->getLength() - seen; + endPos = stop.parkingarea->getLastFreePosWithReservation(t, *this, brakePos); } else if (isWaypoint && !stop.reached) { endPos = stop.pars.startPos; } @@ -2357,7 +2360,8 @@ && (myLaneChangeModel->getShadowLane() == nullptr || myLaneChangeModel->getShadowLane()->getLinkCont().size() == 0 || myLaneChangeModel->getShadowLane()->getLinkCont().front()->getLane() != (*link)->getLane())) - || (opposite && (*link)->getViaLaneOrLane()->getParallelOpposite() == nullptr)) { + || (opposite && (*link)->getViaLaneOrLane()->getParallelOpposite() == nullptr + && !myLaneChangeModel->hasBlueLight())) { double va = cfModel.stopSpeed(this, getSpeed(), seen); if (lastLink != nullptr) { lastLink->adaptLeaveSpeed(va); @@ -2437,8 +2441,8 @@ } // signal that is passed in the current step does not count foundRailSignal |= ((*link)->getTLLogic() != nullptr - && (*link)->getTLLogic()->getLogicType() == TrafficLightType::RAIL_SIGNAL - && seen > SPEED2DIST(v)); + && (*link)->getTLLogic()->getLogicType() == TrafficLightType::RAIL_SIGNAL + && seen > SPEED2DIST(v)); } bool canReverseEventually = false; @@ -2504,16 +2508,12 @@ } #endif - // TODO: Consider option on the CFModel side to allow red/yellow light violation - if (yellowOrRed && canBrakeBeforeStopLine && !ignoreRed(*link, canBrakeBeforeStopLine) && seen >= mustSeeBeforeReversal) { if (lane->isInternal()) { checkLinkLeaderCurrentAndParallel(*link, lane, seen, lastLink, v, vLinkPass, vLinkWait, setRequest); } - SUMOTime arrivalTime = t + TIME2STEPS(seen / MAX2(v, NUMERICAL_EPS)); - if (isStopped()) { - arrivalTime += MAX2((SUMOTime)0, myStops.front().duration); - } + // arrivalSpeed / arrivalTime when braking for red light is only relevent for rail signal switching + const SUMOTime arrivalTime = getArrivalTime(t, seen, v, vLinkPass); // the vehicle is able to brake in front of a yellow/red traffic light lfLinks.push_back(DriveProcessItem(*link, v, vLinkWait, false, arrivalTime, vLinkWait, arrivalTime + TIME2STEPS(30), 0, seen)); //lfLinks.push_back(DriveProcessItem(0, vLinkWait, vLinkWait, false, 0, 0, stopDist)); @@ -2604,18 +2604,7 @@ #endif } - SUMOTime arrivalTime; - if (MSGlobals::gSemiImplicitEulerUpdate) { - // @note intuitively it would make sense to compare arrivalSpeed with getSpeed() instead of v - // however, due to the current position update rule (ticket #860) the vehicle moves with v in this step - // subtract DELTA_T because t is the time at the end of this step and the movement is not carried out yet - arrivalTime = t - DELTA_T + cfModel.getMinimalArrivalTime(seen, v, arrivalSpeed); - } else { - arrivalTime = t - DELTA_T + cfModel.getMinimalArrivalTime(seen, myState.mySpeed, arrivalSpeed); - } - if (isStopped()) { - arrivalTime += MAX2((SUMOTime)0, myStops.front().duration); - } + const SUMOTime arrivalTime = getArrivalTime(t, seen, v, arrivalSpeed); // compute arrival speed and arrival time if vehicle starts braking now // if stopping is possible, arrivalTime can be arbitrarily large. A small value keeps fractional times (impatience) meaningful @@ -2701,6 +2690,25 @@ } +SUMOTime +MSVehicle::getArrivalTime(SUMOTime t, double seen, double v, double arrivalSpeed) const { + const MSCFModel& cfModel = getCarFollowModel(); + SUMOTime arrivalTime; + if (MSGlobals::gSemiImplicitEulerUpdate) { + // @note intuitively it would make sense to compare arrivalSpeed with getSpeed() instead of v + // however, due to the current position update rule (ticket #860) the vehicle moves with v in this step + // subtract DELTA_T because t is the time at the end of this step and the movement is not carried out yet + arrivalTime = t - DELTA_T + cfModel.getMinimalArrivalTime(seen, v, arrivalSpeed); + } else { + arrivalTime = t - DELTA_T + cfModel.getMinimalArrivalTime(seen, myState.mySpeed, arrivalSpeed); + } + if (isStopped()) { + arrivalTime += MAX2((SUMOTime)0, myStops.front().duration); + } + return arrivalTime; +} + + void MSVehicle::adaptToLeaders(const MSLeaderInfo& ahead, double latOffset, const double seen, DriveProcessItem* const lastLink, @@ -4100,9 +4108,32 @@ newOpposite = newOppositeEdge->getLanes()[oldLaneIndex]; } if (newOpposite == nullptr) { - WRITE_WARNING("Unexpected end of opposite lane for vehicle '" + getID() + "' at lane '" + myLane->getID() + "', time=" + - time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); + if (!myLaneChangeModel->hasBlueLight()) { + // unusual overtaking at junctions is ok for emergency vehicles + WRITE_WARNING("Unexpected end of opposite lane for vehicle '" + getID() + "' at lane '" + myLane->getID() + "', time=" + + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); + } myLaneChangeModel->changedToOpposite(); + if (myState.myPos < getLength()) { + // further lanes is always cleared during opposite driving + MSLane* oldOpposite = oldLane->getOpposite(); + if (oldOpposite != nullptr) { + myFurtherLanes.push_back(oldOpposite); + myFurtherLanesPosLat.push_back(0); + // small value since the lane is going in the other direction + myState.myBackPos = getLength() - myState.myPos; + myAngle = computeAngle(); + } else { +#ifdef WIN32 +#pragma warning(push) +#pragma warning(disable: 4127) // do not warn about constant conditional expression +#endif + SOFT_ASSERT(false); +#ifdef WIN32 +#pragma warning(pop) +#endif + } + } } else { myState.myPos = myLane->getOppositePos(myState.myPos); myLane = newOpposite; @@ -4320,6 +4351,8 @@ std::cout << SIMTIME << " getBackPositionOnLane veh=" << getID() << " lane=" << Named::getIDSecure(lane) + << " pos=" << myState.myPos + << " backPos=" << myState.myBackPos << " myLane=" << myLane->getID() << " further=" << toString(myFurtherLanes) << " furtherPosLat=" << toString(myFurtherLanesPosLat) @@ -4968,8 +5001,11 @@ myAmOnNet = false; myWaitingTime = 0; } - if (reason != MSMoveReminder::NOTIFICATION_PARKING && resumeFromStopping() && myPastStops.back().speed <= 0) { - WRITE_WARNING("Vehicle '" + getID() + "' aborts stop."); + if (reason != MSMoveReminder::NOTIFICATION_PARKING && resumeFromStopping()) { + myStopDist = std::numeric_limits::max(); + if (myPastStops.back().speed <= 0) { + WRITE_WARNING("Vehicle '" + getID() + "' aborts stop."); + } } if (reason != MSMoveReminder::NOTIFICATION_PARKING && reason != MSMoveReminder::NOTIFICATION_LANE_CHANGE) { while (!myStops.empty() && myStops.front().edge == myCurrEdge && &myStops.front().lane->getEdge() == &myLane->getEdge()) { @@ -5161,7 +5197,7 @@ } if (nextStopEdge != myRoute->end()) { // make sure that the "wrong" lanes get a penalty. (penalty needs to be - // large enough to overcome a magic threshold in MSLCM_DK2004.cpp:383) + // large enough to overcome a magic threshold in MSLaneChangeModel::DK2004.cpp:383) nextStopPos = MAX2(POSITION_EPS, MIN2((double)nextStopPos, (double)(nextStopLane->getLength() - 2 * POSITION_EPS))); if (nextStopLane->isInternal()) { // switch to the correct lane before entering the intersection @@ -5982,17 +6018,19 @@ const double halfCurrentLaneWidth = 0.5 * myLane->getWidth(); const double halfVehWidth = 0.5 * (getWidth() + NUMERICAL_EPS); const double latPos = getLateralPositionOnLane(); - double leftLimit = halfCurrentLaneWidth - halfVehWidth - latPos; - double rightLimit = -halfCurrentLaneWidth + halfVehWidth - latPos; + const double oppositeSign = getLaneChangeModel().isOpposite() ? -1 : 1; + double leftLimit = halfCurrentLaneWidth - halfVehWidth - oppositeSign * latPos; + double rightLimit = -halfCurrentLaneWidth + halfVehWidth - oppositeSign * latPos; double latLaneDist = 0; // minimum distance to move the vehicle fully onto the new lane if (offset == 0) { if (latPos + halfVehWidth > halfCurrentLaneWidth) { // correct overlapping left latLaneDist = halfCurrentLaneWidth - latPos - halfVehWidth; - } else if (latPos - halfVehWidth < - halfCurrentLaneWidth) { - // correct overlapping left - latLaneDist = halfCurrentLaneWidth - latPos + halfVehWidth; + } else if (latPos - halfVehWidth < -halfCurrentLaneWidth) { + // correct overlapping right + latLaneDist = -halfCurrentLaneWidth - latPos + halfVehWidth; } + latLaneDist *= oppositeSign; } else if (offset == -1) { latLaneDist = rightLimit - (getWidth() + NUMERICAL_EPS); } else if (offset == 1) { @@ -6097,16 +6135,28 @@ MSVehicle::getBoundingBox(double offset) const { PositionVector centerLine; centerLine.push_back(getPosition()); - for (MSLane* lane : myFurtherLanes) { - centerLine.push_back(lane->getShape().back()); + switch (myType->getGuiShape()) { + case SUMOVehicleShape::BUS_FLEXIBLE: + case SUMOVehicleShape::RAIL: + case SUMOVehicleShape::RAIL_CAR: + case SUMOVehicleShape::RAIL_CARGO: + case SUMOVehicleShape::TRUCK_SEMITRAILER: + case SUMOVehicleShape::TRUCK_1TRAILER: { + for (MSLane* lane : myFurtherLanes) { + centerLine.push_back(lane->getShape().back()); + } + break; + } + default: + break; } centerLine.push_back(getBackPosition()); if (offset != 0) { centerLine.extrapolate2D(offset); } - centerLine.move2side(MAX2(0.0, 0.5 * myType->getWidth() + offset)); PositionVector result = centerLine; - centerLine.move2side(MIN2(0.0, -myType->getWidth() - 2 * offset)); + result.move2side(MAX2(0.0, 0.5 * myType->getWidth() + offset)); + centerLine.move2side(MIN2(0.0, -0.5 * myType->getWidth() - offset)); result.append(centerLine.reverse(), POSITION_EPS); return result; } @@ -6114,13 +6164,13 @@ PositionVector MSVehicle::getBoundingPoly(double offset) const { - // XXX implement more types switch (myType->getGuiShape()) { - case SVS_PASSENGER: - case SVS_PASSENGER_SEDAN: - case SVS_PASSENGER_HATCHBACK: - case SVS_PASSENGER_WAGON: - case SVS_PASSENGER_VAN: { + case SUMOVehicleShape::PASSENGER: + case SUMOVehicleShape::PASSENGER_SEDAN: + case SUMOVehicleShape::PASSENGER_HATCHBACK: + case SUMOVehicleShape::PASSENGER_WAGON: + case SUMOVehicleShape::PASSENGER_VAN: { + // box with corners cut off PositionVector result; PositionVector centerLine; centerLine.push_back(getPosition()); @@ -6146,7 +6196,7 @@ return result; } default: - return getBoundingBox(offset); + return getBoundingBox(); } } @@ -6226,7 +6276,8 @@ ConstMSEdgeVector prevEdges(myCurrEdge, myRoute->end()); const double savings = router.recomputeCosts(prevEdges, this, MSNet::getInstance()->getCurrentTimeStep()); if (replaceParkingArea(newParkingArea, errorMsg)) { - replaceRouteEdges(edges, routeCost, savings, "TraCI:" + toString(SUMO_TAG_PARKING_AREA_REROUTE), false, false, false); + const bool onInit = myLane == nullptr; + replaceRouteEdges(edges, routeCost, savings, "TraCI:" + toString(SUMO_TAG_PARKING_AREA_REROUTE), onInit, false, false); } else { WRITE_WARNING("Vehicle '" + getID() + "' could not reroute to new parkingArea '" + newParkingArea->getID() + "' reason=" + errorMsg + ", time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); @@ -6248,31 +6299,26 @@ bool -MSVehicle::handleCollisionStop(MSStop& stop, const bool collision, const double distToStop, const std::string& errorMsgStart, std::string& errorMsg) { +MSVehicle::handleCollisionStop(MSStop& stop, const double distToStop) { if (myCurrEdge == stop.edge && distToStop + POSITION_EPS < getCarFollowModel().brakeGap(myState.mySpeed, getCarFollowModel().getMaxDecel(), 0)) { - if (collision) { - if (distToStop < getCarFollowModel().brakeGap(myState.mySpeed, getCarFollowModel().getEmergencyDecel(), 0)) { - double vNew = getCarFollowModel().maximumSafeStopSpeed(distToStop, getCarFollowModel().getMaxDecel(), getSpeed(), false, 0); - //std::cout << SIMTIME << " veh=" << getID() << " v=" << myState.mySpeed << " distToStop=" << distToStop - // << " vMinNex=" << getCarFollowModel().minNextSpeed(getSpeed(), this) - // << " bg1=" << getCarFollowModel().brakeGap(myState.mySpeed) - // << " bg2=" << getCarFollowModel().brakeGap(myState.mySpeed, getCarFollowModel().getEmergencyDecel(), 0) - // << " vNew=" << vNew - // << "\n"; - myState.mySpeed = MIN2(myState.mySpeed, vNew + ACCEL2SPEED(getCarFollowModel().getEmergencyDecel())); - myState.myPos = MIN2(myState.myPos, stop.pars.endPos); - myCachedPosition = Position::INVALID; - if (myState.myPos < myType->getLength()) { - computeFurtherLanes(myLane, myState.myPos, true); - myAngle = computeAngle(); - if (myLaneChangeModel->isOpposite()) { - myAngle += M_PI; - } + if (distToStop < getCarFollowModel().brakeGap(myState.mySpeed, getCarFollowModel().getEmergencyDecel(), 0)) { + double vNew = getCarFollowModel().maximumSafeStopSpeed(distToStop, getCarFollowModel().getMaxDecel(), getSpeed(), false, 0); + //std::cout << SIMTIME << " veh=" << getID() << " v=" << myState.mySpeed << " distToStop=" << distToStop + // << " vMinNex=" << getCarFollowModel().minNextSpeed(getSpeed(), this) + // << " bg1=" << getCarFollowModel().brakeGap(myState.mySpeed) + // << " bg2=" << getCarFollowModel().brakeGap(myState.mySpeed, getCarFollowModel().getEmergencyDecel(), 0) + // << " vNew=" << vNew + // << "\n"; + myState.mySpeed = MIN2(myState.mySpeed, vNew + ACCEL2SPEED(getCarFollowModel().getEmergencyDecel())); + myState.myPos = MIN2(myState.myPos, stop.pars.endPos); + myCachedPosition = Position::INVALID; + if (myState.myPos < myType->getLength()) { + computeFurtherLanes(myLane, myState.myPos, true); + myAngle = computeAngle(); + if (myLaneChangeModel->isOpposite()) { + myAngle += M_PI; } } - } else { - errorMsg = errorMsgStart + " for vehicle '" + myParameter->id + "' on lane '" + stop.pars.lane + "' is too close to brake."; - return false; } } return true; @@ -6487,6 +6533,10 @@ // if this vehicle is not yet on the junction, every vehicle is a leader return true; } + if (veh->getLaneChangeModel().hasBlueLight()) { + // blue light device automatically gets right of way + return true; + } const MSLane* foeLane = veh->getLane(); if (foeLane->isInternal()) { if (foeLane->getEdge().getFromJunction() == link->getJunction()) { @@ -6907,11 +6957,16 @@ double MSVehicle::estimateTimeToNextStop() const { if (hasStops()) { + MSLane* lane = myLane; + if (lane == nullptr) { + // not in network + lane = getEdge()->getLanes()[0]; + } const MSStop& stop = myStops.front(); auto it = myCurrEdge + 1; // drive to end of current edge - double dist = (myLane->getLength() - getPositionOnLane()); - double travelTime = myLane->getEdge().getMinimumTravelTime(this) * dist / myLane->getLength(); + double dist = (lane->getLength() - getPositionOnLane()); + double travelTime = lane->getEdge().getMinimumTravelTime(this) * dist / lane->getLength(); // drive until stop edge while (it != myRoute->end() && it < stop.edge) { travelTime += (*it)->getMinimumTravelTime(this); @@ -6919,7 +6974,7 @@ it++; } // drive up to the stop position - const double stopEdgeDist = stop.pars.endPos - (myLane == stop.lane ? myLane->getLength() : 0); + const double stopEdgeDist = stop.pars.endPos - (lane == stop.lane ? lane->getLength() : 0); dist += stopEdgeDist; travelTime += stop.lane->getEdge().getMinimumTravelTime(this) * (stopEdgeDist / stop.lane->getLength()); // estimate time loss due to acceleration and deceleration diff -Nru sumo-1.11.0/src/microsim/MSVehicle.h sumo-1.12.0/src/microsim/MSVehicle.h --- sumo-1.11.0/src/microsim/MSVehicle.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSVehicle.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -654,17 +654,6 @@ return myWaitingTimeCollector.cumulatedWaitingTime(MSGlobals::gWaitingTimeMemory); } - /** @brief Returns the number of seconds waited (speed was lesser than 0.1m/s) - * - * The value is reset if the vehicle moves faster than 0.1m/s - * Intentional stopping does not count towards this time. - * @return The time the vehicle is standing - */ - double getWaitingSeconds() const { - return STEPS2TIME(myWaitingTime); - } - - /** @brief Returns the number of seconds waited (speed was lesser than 0.1m/s) within the last millisecs * * @return The time the vehicle was standing within the last t millisecs @@ -1191,7 +1180,7 @@ */ bool addTraciStop(SUMOVehicleParameter::Stop stop, std::string& errorMsg); - bool handleCollisionStop(MSStop& stop, const bool collision, const double distToStop, const std::string& errorMsgStart, std::string& errorMsg); + bool handleCollisionStop(MSStop& stop, const double distToStop); /** * resumes a vehicle from stopping @@ -1790,7 +1779,7 @@ void updateOccupancyAndCurrentBestLane(const MSLane* startLane); /// @brief get distance for coming to a stop (used for rerouting checks) - double getBrakeGap() const; + double getBrakeGap(bool delayed = false) const; /// @brief ensure that a vehicle-relative position is not invalid Position validatePosition(Position result, double offset = 0) const; @@ -2057,6 +2046,9 @@ */ bool hasArrivedInternal(bool oppositeTransformed = true) const; + + SUMOTime getArrivalTime(SUMOTime t, double seen, double v, double arrivalSpeed) const; + private: /// @brief The per vehicle variables of the car following model MSCFModel::VehicleVariables* myCFVariables; diff -Nru sumo-1.11.0/src/microsim/MSVehicleTransfer.cpp sumo-1.12.0/src/microsim/MSVehicleTransfer.cpp --- sumo-1.11.0/src/microsim/MSVehicleTransfer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSVehicleTransfer.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -61,7 +61,7 @@ veh->getLaneChangeModel().endLaneChangeManeuver(MSMoveReminder::NOTIFICATION_TELEPORT); MSNet::getInstance()->informVehicleStateListener(veh, MSNet::VehicleState::STARTING_TELEPORT); if (veh->succEdge(1) == nullptr) { - WRITE_WARNINGF("Vehicle '%' teleports beyond arrival edge '%', time %.", veh->getID(), veh->getEdge()->getID(), time2string(t)); + WRITE_WARNINGF("Vehicle '%' teleports beyond arrival edge '%', time=%.", veh->getID(), veh->getEdge()->getID(), time2string(t)); veh->onRemovalFromNet(MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED); MSNet::getInstance()->getVehicleControl().scheduleVehicleRemoval(veh); return; @@ -153,7 +153,7 @@ e->getFreeLane(nullptr, vclass, departPos)); // handle teleporting vehicles, lane may be 0 because permissions were modified by a closing rerouter or TraCI if (l != nullptr && l->freeInsertion(*(desc.myVeh), MIN2(l->getSpeedLimit(), desc.myVeh->getMaxSpeed()), 0, MSMoveReminder::NOTIFICATION_TELEPORT)) { - WRITE_WARNINGF("Vehicle '%' ends teleporting on edge '%', time %.", desc.myVeh->getID(), e->getID(), time2string(time)); + WRITE_WARNINGF("Vehicle '%' ends teleporting on edge '%', time=%.", desc.myVeh->getID(), e->getID(), time2string(time)); MSNet::getInstance()->informVehicleStateListener(desc.myVeh, MSNet::VehicleState::ENDING_TELEPORT); i = vehInfos.erase(i); } else { @@ -167,7 +167,7 @@ desc.myProceedTime = time + TIME2STEPS(e->getCurrentTravelTime(TeleportMinSpeed)); } else if (desc.myProceedTime < time) { if (desc.myVeh->succEdge(1) == nullptr) { - WRITE_WARNINGF("Vehicle '%' teleports beyond arrival edge '%', time %.", desc.myVeh->getID(), e->getID(), time2string(time)); + WRITE_WARNINGF("Vehicle '%' teleports beyond arrival edge '%', time=%.", desc.myVeh->getID(), e->getID(), time2string(time)); desc.myVeh->leaveLane(MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED); MSNet::getInstance()->getVehicleControl().scheduleVehicleRemoval(desc.myVeh); i = vehInfos.erase(i); diff -Nru sumo-1.11.0/src/microsim/MSVehicleTransfer.h sumo-1.12.0/src/microsim/MSVehicleTransfer.h --- sumo-1.11.0/src/microsim/MSVehicleTransfer.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSVehicleTransfer.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2003-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2003-2022 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/ diff -Nru sumo-1.11.0/src/microsim/MSVehicleType.cpp sumo-1.12.0/src/microsim/MSVehicleType.cpp --- sumo-1.11.0/src/microsim/MSVehicleType.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSVehicleType.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -63,6 +63,7 @@ myParameter(parameter), myWarnedActionStepLengthTauOnce(false), myWarnedActionStepLengthBallisticOnce(false), + myWarnedStepLengthTauOnce(false), myIndex(myNextIndex++), myCarFollowModel(nullptr), myOriginalType(nullptr) { @@ -354,7 +355,6 @@ } // init Rail visualization parameters vtype->myParameter.initRailVisualizationParameters(); - vtype->check(); return vtype; } @@ -415,6 +415,19 @@ WRITE_WARNINGF("Action step length '%' is used for vehicle type '%' but step-method.ballistic was not set." + warning2 , STEPS2TIME(myParameter.actionStepLength), getID()) } + if (!myWarnedStepLengthTauOnce && TS > getCarFollowModel().getHeadwayTime() + && !MSGlobals::gUseMesoSim) { + myWarnedStepLengthTauOnce = true; + WRITE_WARNINGF("Value of tau=% in vehicle type '%' lower than simulation step size may cause collisions.", + getCarFollowModel().getHeadwayTime(), getID()); + } + if (MSGlobals::gUseMesoSim && getVehicleClass() != SVC_PEDESTRIAN && !OptionsCont::getOptions().getBool("meso-lane-queue")) { + SVCPermissions ignoreVClasses = parseVehicleClasses(OptionsCont::getOptions().getStringVector("meso-ignore-lanes-by-vclass")); + if ((ignoreVClasses & getVehicleClass()) != 0) { + WRITE_WARNINGF("Vehicle class '%' of vType '%' is set as ignored by option --meso-ignore-lanes-by-vclass to ensure default vehicle capacity. Set option --meso-lane-queue for multi-modal meso simulation", + toString(getVehicleClass()), getID()); + } + } } void diff -Nru sumo-1.11.0/src/microsim/MSVehicleType.h sumo-1.12.0/src/microsim/MSVehicleType.h --- sumo-1.11.0/src/microsim/MSVehicleType.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/MSVehicleType.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -587,6 +587,7 @@ /// larger than the desired time headway. bool myWarnedActionStepLengthTauOnce; bool myWarnedActionStepLengthBallisticOnce; + bool myWarnedStepLengthTauOnce; /// @brief the running index const int myIndex; diff -Nru sumo-1.11.0/src/microsim/output/MSAmitranTrajectories.cpp sumo-1.12.0/src/microsim/output/MSAmitranTrajectories.cpp --- sumo-1.11.0/src/microsim/output/MSAmitranTrajectories.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSAmitranTrajectories.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSAmitranTrajectories.h sumo-1.12.0/src/microsim/output/MSAmitranTrajectories.h --- sumo-1.11.0/src/microsim/output/MSAmitranTrajectories.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSAmitranTrajectories.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSBatteryExport.cpp sumo-1.12.0/src/microsim/output/MSBatteryExport.cpp --- sumo-1.11.0/src/microsim/output/MSBatteryExport.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSBatteryExport.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSBatteryExport.h sumo-1.12.0/src/microsim/output/MSBatteryExport.h --- sumo-1.11.0/src/microsim/output/MSBatteryExport.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSBatteryExport.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSCrossSection.h sumo-1.12.0/src/microsim/output/MSCrossSection.h --- sumo-1.11.0/src/microsim/output/MSCrossSection.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSCrossSection.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSDetectorControl.cpp sumo-1.12.0/src/microsim/output/MSDetectorControl.cpp --- sumo-1.11.0/src/microsim/output/MSDetectorControl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSDetectorControl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSDetectorControl.h sumo-1.12.0/src/microsim/output/MSDetectorControl.h --- sumo-1.11.0/src/microsim/output/MSDetectorControl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSDetectorControl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSDetectorFileOutput.cpp sumo-1.12.0/src/microsim/output/MSDetectorFileOutput.cpp --- sumo-1.11.0/src/microsim/output/MSDetectorFileOutput.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSDetectorFileOutput.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSDetectorFileOutput.h sumo-1.12.0/src/microsim/output/MSDetectorFileOutput.h --- sumo-1.11.0/src/microsim/output/MSDetectorFileOutput.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSDetectorFileOutput.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -58,7 +59,7 @@ * Pure virtual base class for classes (e.g. MSInductLoop) that should produce * XML-output. */ -class MSDetectorFileOutput : public Named { +class MSDetectorFileOutput : public Named, public Parameterised { public: /// @brief Constructor MSDetectorFileOutput(const std::string& id, const std::string& vTypes, const int detectPersons = false); diff -Nru sumo-1.11.0/src/microsim/output/MSE2Collector.cpp sumo-1.12.0/src/microsim/output/MSE2Collector.cpp --- sumo-1.11.0/src/microsim/output/MSE2Collector.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSE2Collector.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -39,7 +39,7 @@ #include #include #ifdef HAVE_FOX -#include +#include #endif #include #include @@ -82,6 +82,7 @@ myCurrentMeanSpeed(0), myCurrentMeanLength(0), myCurrentJamNo(0), + myCurrentMaxJamLengthInMeters(0), myCurrentJamLengthInMeters(0), myCurrentJamLengthInVehicles(0), myCurrentHaltingsNumber(0) { @@ -621,7 +622,7 @@ return keep; } #ifdef HAVE_FOX - FXConditionalLock lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); #endif VehicleInfoMap::iterator vi = myVehicleInfos.find(veh.getID()); assert(vi != myVehicleInfos.end()); // all vehicles calling notifyMove() should have called notifyEnter() before @@ -703,7 +704,7 @@ #endif #ifdef HAVE_FOX - FXConditionalLock lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); #endif if (reason == MSMoveReminder::NOTIFICATION_JUNCTION && !veh.isPerson()) { // vehicle left lane via junction, unsubscription and registering in myLeftVehicles when @@ -805,7 +806,7 @@ #endif #ifdef HAVE_FOX - FXConditionalLock lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); #endif const std::string& vehID = veh.getID(); VehicleInfoMap::iterator vi = myVehicleInfos.find(vehID); @@ -896,7 +897,7 @@ for (MSLane* lane : getLanes()) { if (lane->hasPedestrians()) { for (MSTransportable* p : myLane->getEdge().getPersons()) { - if (p->getLane() == lane) { + if (p->getLane() == lane && vehicleApplies(*p)) { notifyMovePerson(p, p->getDirection(), p->getPositionOnLane()); } } @@ -1342,6 +1343,10 @@ void MSE2Collector::writeXMLOutput(OutputDevice& dev, SUMOTime startTime, SUMOTime stopTime) { + if (dev.isNull()) { + reset(); + return; + } dev << " \n"; reset(); - } void diff -Nru sumo-1.11.0/src/microsim/output/MSE2Collector.h sumo-1.12.0/src/microsim/output/MSE2Collector.h --- sumo-1.11.0/src/microsim/output/MSE2Collector.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSE2Collector.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -76,7 +76,7 @@ */ -class MSE2Collector : public MSMoveReminder, public MSDetectorFileOutput, public Parameterised { +class MSE2Collector : public MSMoveReminder, public MSDetectorFileOutput { public: /** @brief A VehicleInfo stores values that are tracked for the individual vehicles on the detector, * e.g., accumulated timeloss. These infos are stored in myVehicles. If a vehicle leaves the detector diff -Nru sumo-1.11.0/src/microsim/output/MSE3Collector.cpp sumo-1.12.0/src/microsim/output/MSE3Collector.cpp --- sumo-1.11.0/src/microsim/output/MSE3Collector.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSE3Collector.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -24,7 +24,9 @@ #include #include - +#ifdef HAVE_FOX +#include +#endif #include #include #include @@ -74,7 +76,7 @@ const double posOnLane = veh.getBackPositionOnLane(enteredLane) + veh.getVehicleType().getLength(); if (myLane == enteredLane && posOnLane > myPosition) { #ifdef HAVE_FOX - FXConditionalLock lock(myCollector.myContainerMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myCollector.myContainerMutex, MSGlobals::gNumSimThreads > 1); #endif const auto& itVeh = myCollector.myEnteredContainer.find(&veh); if (itVeh == myCollector.myEnteredContainer.end() || @@ -107,7 +109,7 @@ } #endif #ifdef HAVE_FOX - FXConditionalLock lock(myCollector.myContainerMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myCollector.myContainerMutex, MSGlobals::gNumSimThreads > 1); #endif if ((myCollector.myEnteredContainer.find(&veh) == myCollector.myEnteredContainer.end() || (veh.isPerson() && dynamic_cast(veh).getDirection() != MSPModel::FORWARD)) @@ -152,7 +154,7 @@ #endif if (reason >= MSMoveReminder::NOTIFICATION_ARRIVED) { #ifdef HAVE_FOX - FXConditionalLock lock(myCollector.myContainerMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myCollector.myContainerMutex, MSGlobals::gNumSimThreads > 1); #endif if (myCollector.myEnteredContainer.erase(&veh) > 0) { WRITE_WARNING("Vehicle '" + veh.getID() + "' arrived inside " + toString(SUMO_TAG_E3DETECTOR) + " '" + myCollector.getID() + "'."); @@ -220,7 +222,7 @@ return true; } #ifdef HAVE_FOX - FXConditionalLock lock(myCollector.myContainerMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myCollector.myContainerMutex, MSGlobals::gNumSimThreads > 1); #endif const double oldSpeed = veh.getPreviousSpeed(); if (oldPos < myPosition) { @@ -276,7 +278,7 @@ return false; } #ifdef HAVE_FOX - FXConditionalLock lock(myCollector.myContainerMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myCollector.myContainerMutex, MSGlobals::gNumSimThreads > 1); #endif if (reason == MSMoveReminder::NOTIFICATION_TELEPORT) { WRITE_WARNING("Vehicle '" + veh.getID() + "' teleported from " + toString(SUMO_TAG_E3DETECTOR) + " '" + myCollector.getID() + "'."); @@ -574,7 +576,7 @@ const MSLane* lane = rem->getLane(); if (lane->hasPedestrians()) { for (MSTransportable* p : lane->getEdge().getPersons()) { - if (p->getLane() == lane) { + if (p->getLane() == lane && vehicleApplies(*p)) { notifyMovePerson(p, rem, rem->getPosition(), p->getDirection(), p->getPositionOnLane()); } } @@ -584,7 +586,7 @@ const MSLane* lane = rem->getLane(); if (lane->hasPedestrians()) { for (MSTransportable* p : lane->getEdge().getPersons()) { - if (p->getLane() == lane) { + if (p->getLane() == lane && vehicleApplies(*p)) { notifyMovePerson(p, rem, rem->getPosition(), p->getDirection(), p->getPositionOnLane()); } } diff -Nru sumo-1.11.0/src/microsim/output/MSE3Collector.h sumo-1.12.0/src/microsim/output/MSE3Collector.h --- sumo-1.11.0/src/microsim/output/MSE3Collector.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSE3Collector.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2003-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2003-2022 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/ @@ -56,7 +56,7 @@ * out-cross-section. Vehicles passing the out-cross-section without having * passed the in-cross-section are not detected. */ -class MSE3Collector : public MSDetectorFileOutput, public Parameterised { +class MSE3Collector : public MSDetectorFileOutput { public: /** * @class MSE3EntryReminder diff -Nru sumo-1.11.0/src/microsim/output/MSElecHybridExport.cpp sumo-1.12.0/src/microsim/output/MSElecHybridExport.cpp --- sumo-1.11.0/src/microsim/output/MSElecHybridExport.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSElecHybridExport.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSElecHybridExport.h sumo-1.12.0/src/microsim/output/MSElecHybridExport.h --- sumo-1.11.0/src/microsim/output/MSElecHybridExport.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSElecHybridExport.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSEmissionExport.cpp sumo-1.12.0/src/microsim/output/MSEmissionExport.cpp --- sumo-1.11.0/src/microsim/output/MSEmissionExport.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSEmissionExport.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSEmissionExport.h sumo-1.12.0/src/microsim/output/MSEmissionExport.h --- sumo-1.11.0/src/microsim/output/MSEmissionExport.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSEmissionExport.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSFCDExport.cpp sumo-1.12.0/src/microsim/output/MSFCDExport.cpp --- sumo-1.11.0/src/microsim/output/MSFCDExport.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSFCDExport.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ @@ -47,20 +47,23 @@ // =========================================================================== void MSFCDExport::write(OutputDevice& of, SUMOTime timestep, bool elevation) { - const bool useGeo = OptionsCont::getOptions().getBool("fcd-output.geo"); - const bool signals = OptionsCont::getOptions().getBool("fcd-output.signals"); - const bool writeAccel = OptionsCont::getOptions().getBool("fcd-output.acceleration"); - const bool writeDistance = OptionsCont::getOptions().getBool("fcd-output.distance"); - const double maxLeaderDistance = OptionsCont::getOptions().getFloat("fcd-output.max-leader-distance"); - std::vector params = OptionsCont::getOptions().getStringVector("fcd-output.params"); - const SUMOTime period = string2time(OptionsCont::getOptions().getString("device.fcd.period")); - const SUMOTime begin = string2time(OptionsCont::getOptions().getString("begin")); + const OptionsCont& oc = OptionsCont::getOptions(); + const SUMOTime period = string2time(oc.getString("device.fcd.period")); + const SUMOTime begin = string2time(oc.getString("begin")); if (period > 0 && (timestep - begin) % period != 0) { return; } const long long int mask = MSDevice_FCD::getWrittenAttributes(); - MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl(); - const double radius = OptionsCont::getOptions().getFloat("device.fcd.radius"); + const bool maskSet = oc.isSet("fcd-output.attributes"); + const bool useGeo = oc.getBool("fcd-output.geo"); + const bool signals = oc.getBool("fcd-output.signals") || (maskSet && of.useAttribute(SUMO_ATTR_SIGNALS, mask)); + const bool writeAccel = oc.getBool("fcd-output.acceleration") || (maskSet && of.useAttribute(SUMO_ATTR_ACCELERATION, mask)); + const bool writeDistance = oc.getBool("fcd-output.distance") || (maskSet && of.useAttribute(SUMO_ATTR_DISTANCE, mask)); + const double maxLeaderDistance = oc.getFloat("fcd-output.max-leader-distance"); + std::vector params = oc.getStringVector("fcd-output.params"); + MSNet* net = MSNet::getInstance(); + MSVehicleControl& vc = net->getVehicleControl(); + const double radius = oc.getFloat("device.fcd.radius"); const bool filter = MSDevice_FCD::getEdgeFilter().size() > 0; std::set inRadius; if (radius > 0) { @@ -169,9 +172,9 @@ } } } - if (MSNet::getInstance()->getPersonControl().hasTransportables()) { + if (net->hasPersons() && net->getPersonControl().hasTransportables()) { // write persons - MSEdgeControl& ec = MSNet::getInstance()->getEdgeControl(); + MSEdgeControl& ec = net->getEdgeControl(); const MSEdgeVector& edges = ec.getEdges(); for (MSEdgeVector::const_iterator e = edges.begin(); e != edges.end(); ++e) { if (filter && MSDevice_FCD::getEdgeFilter().count(*e) == 0) { @@ -183,9 +186,9 @@ } } } - if (MSNet::getInstance()->getContainerControl().hasTransportables()) { + if (net->hasContainers() && net->getContainerControl().hasTransportables()) { // write containers - MSEdgeControl& ec = MSNet::getInstance()->getEdgeControl(); + MSEdgeControl& ec = net->getEdgeControl(); const std::vector& edges = ec.getEdges(); for (std::vector::const_iterator e = edges.begin(); e != edges.end(); ++e) { if (filter && MSDevice_FCD::getEdgeFilter().count(*e) == 0) { diff -Nru sumo-1.11.0/src/microsim/output/MSFCDExport.h sumo-1.12.0/src/microsim/output/MSFCDExport.h --- sumo-1.11.0/src/microsim/output/MSFCDExport.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSFCDExport.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSFullExport.cpp sumo-1.12.0/src/microsim/output/MSFullExport.cpp --- sumo-1.11.0/src/microsim/output/MSFullExport.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSFullExport.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSFullExport.h sumo-1.12.0/src/microsim/output/MSFullExport.h --- sumo-1.11.0/src/microsim/output/MSFullExport.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSFullExport.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSInductLoop.cpp sumo-1.12.0/src/microsim/output/MSInductLoop.cpp --- sumo-1.11.0/src/microsim/output/MSInductLoop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSInductLoop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -28,6 +28,9 @@ #include #include #include +#ifdef HAVE_FOX +#include +#endif #include #include #include @@ -71,7 +74,7 @@ void MSInductLoop::reset() { #ifdef HAVE_FOX - FXConditionalLock lock(myNotificationMutex, myNeedLock); + ScopedLocker<> lock(myNotificationMutex, myNeedLock); #endif myEnteredVehicleNumber = 0; myLastVehicleDataCont = myVehicleDataCont; @@ -91,7 +94,7 @@ } if (veh.getPositionOnLane() >= myPosition) { #ifdef HAVE_FOX - FXConditionalLock lock(myNotificationMutex, myNeedLock); + ScopedLocker<> lock(myNotificationMutex, myNeedLock); #endif myVehiclesOnDet[&veh] = SIMTIME; myEnteredVehicleNumber++; @@ -117,7 +120,7 @@ return keep; } #ifdef HAVE_FOX - FXConditionalLock lock(myNotificationMutex, myNeedLock); + ScopedLocker<> lock(myNotificationMutex, myNeedLock); #endif const double oldSpeed = veh.getPreviousSpeed(); if (newPos >= myPosition && oldPos < myPosition) { @@ -162,7 +165,7 @@ } if (reason != MSMoveReminder::NOTIFICATION_JUNCTION || (veh.isPerson() && myDetectPersons != (int)PersonMode::NONE)) { #ifdef HAVE_FOX - FXConditionalLock lock(myNotificationMutex, myNeedLock); + ScopedLocker<> lock(myNotificationMutex, myNeedLock); #endif const std::map::iterator it = myVehiclesOnDet.find(&veh); if (it != myVehiclesOnDet.end()) { @@ -249,6 +252,10 @@ void MSInductLoop::writeXMLOutput(OutputDevice& dev, SUMOTime startTime, SUMOTime stopTime) { + if (dev.isNull()) { + reset(); + return; + } const double t(STEPS2TIME(stopTime - startTime)); double occupancy = 0.; double speedSum = 0.; @@ -290,7 +297,7 @@ } if (myLane->hasPedestrians()) { for (MSTransportable* p : myLane->getEdge().getPersons()) { - if (p->getLane() != myLane) { + if (p->getLane() != myLane || !vehicleApplies(*p)) { continue; } notifyMovePerson(p, p->getDirection(), p->getPositionOnLane()); @@ -318,7 +325,7 @@ std::vector MSInductLoop::collectVehiclesOnDet(SUMOTime tMS, bool includeEarly, bool leaveTime, bool forOccupancy) const { #ifdef HAVE_FOX - FXConditionalLock lock(myNotificationMutex, myNeedLock); + ScopedLocker<> lock(myNotificationMutex, myNeedLock); #endif const double t = STEPS2TIME(tMS); std::vector ret; diff -Nru sumo-1.11.0/src/microsim/output/MSInductLoop.h sumo-1.12.0/src/microsim/output/MSInductLoop.h --- sumo-1.11.0/src/microsim/output/MSInductLoop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSInductLoop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ @@ -59,7 +59,7 @@ * @see MSDetectorFileOutput */ class MSInductLoop - : public MSMoveReminder, public MSDetectorFileOutput, public Parameterised { + : public MSMoveReminder, public MSDetectorFileOutput { public: /** * @brief Constructor. @@ -184,7 +184,6 @@ */ double getOccupancy() const; - /** @brief Returns the number of vehicles that have passed the detector * * If a vehicle is on the detector, 1 is returned. If a vehicle has passed the detector diff -Nru sumo-1.11.0/src/microsim/output/MSInstantInductLoop.cpp sumo-1.12.0/src/microsim/output/MSInstantInductLoop.cpp --- sumo-1.11.0/src/microsim/output/MSInstantInductLoop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSInstantInductLoop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2011-2022 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/ @@ -25,6 +25,9 @@ #include #include #include +#ifdef HAVE_FOX +#include +#endif #include #include #include @@ -67,7 +70,7 @@ return true; } #ifdef HAVE_FOX - FXConditionalLock lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); #endif const double oldSpeed = veh.getPreviousSpeed(); @@ -106,15 +109,17 @@ void MSInstantInductLoop::write(const char* state, double t, SUMOTrafficObject& veh, double speed, const char* add, double addValue) { - myOutputDevice.openTag("instantOut").writeAttr( - "id", getID()).writeAttr("time", toString(t)).writeAttr("state", state).writeAttr( - "vehID", veh.getID()).writeAttr("speed", toString(speed)).writeAttr( - "length", toString(veh.getVehicleType().getLength())).writeAttr( - "type", veh.getVehicleType().getID()); - if (add != nullptr) { - myOutputDevice.writeAttr(add, toString(addValue)); + if (!myOutputDevice.isNull()) { + myOutputDevice.openTag("instantOut").writeAttr( + "id", getID()).writeAttr("time", toString(t)).writeAttr("state", state).writeAttr( + "vehID", veh.getID()).writeAttr("speed", toString(speed)).writeAttr( + "length", toString(veh.getVehicleType().getLength())).writeAttr( + "type", veh.getVehicleType().getID()); + if (add != nullptr) { + myOutputDevice.writeAttr(add, toString(addValue)); + } + myOutputDevice.closeTag(); } - myOutputDevice.closeTag(); } diff -Nru sumo-1.11.0/src/microsim/output/MSInstantInductLoop.h sumo-1.12.0/src/microsim/output/MSInstantInductLoop.h --- sumo-1.11.0/src/microsim/output/MSInstantInductLoop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSInstantInductLoop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2011-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSMeanData_Amitran.cpp sumo-1.12.0/src/microsim/output/MSMeanData_Amitran.cpp --- sumo-1.11.0/src/microsim/output/MSMeanData_Amitran.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSMeanData_Amitran.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -107,7 +107,7 @@ void MSMeanData_Amitran::MSLaneMeanDataValues::write(OutputDevice& dev, long long int attributeMask, const SUMOTime /* period */, - const double /* numLanes */, const double defaultTravelTime, const int /* numVehicles */) const { + const double /* numLanes */, const double /*speedLimit*/, const double defaultTravelTime, const int /* numVehicles */) const { int averageSpeed; if (sampleSeconds > 0) { averageSpeed = int(100 * travelledDistance / sampleSeconds); diff -Nru sumo-1.11.0/src/microsim/output/MSMeanData_Amitran.h sumo-1.12.0/src/microsim/output/MSMeanData_Amitran.h --- sumo-1.11.0/src/microsim/output/MSMeanData_Amitran.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSMeanData_Amitran.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -110,7 +110,7 @@ * @exception IOError If an error on writing occurs (!!! not yet implemented) */ void write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, - const double numLanes, const double defaultTravelTime, + const double numLanes, const double speedLimit, const double defaultTravelTime, const int numVehicles = -1) const; protected: diff -Nru sumo-1.11.0/src/microsim/output/MSMeanData.cpp sumo-1.12.0/src/microsim/output/MSMeanData.cpp --- sumo-1.11.0/src/microsim/output/MSMeanData.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSMeanData.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -24,6 +24,9 @@ #include #include +#ifdef HAVE_FOX +#include +#endif #include #include #include @@ -246,7 +249,7 @@ // const double travelledDistanceVehicleOnLane = timeOnLane*newSpeed; #ifdef HAVE_FOX - FXConditionalLock lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); #endif notifyMoveInternal(veh, frontOnLane, timeOnLane, (enterSpeed + leaveSpeedFront) / 2., (enterSpeed + leaveSpeed) / 2., travelledDistanceFrontOnLane, travelledDistanceVehicleOnLane, meanLengthOnLane); return ret; @@ -374,9 +377,10 @@ long long int attributeMask, const SUMOTime period, const double numLanes, + const double speedLimit, const double defaultTravelTime, const int /*numVehicles*/) const { - myCurrentData.front()->myValues->write(dev, attributeMask, period, numLanes, + myCurrentData.front()->myValues->write(dev, attributeMask, period, numLanes, speedLimit, defaultTravelTime, myCurrentData.front()->myNumVehicleEntered); } @@ -530,6 +534,7 @@ if (writePrefix(dev, *data, SUMO_TAG_EDGE, getEdgeID(edge))) { data->write(dev, myWrittenAttributes, stopTime - startTime, (double)edge->getLanes().size(), + edge->getSpeedLimit(), myPrintDefaults ? edge->getLength() / edge->getSpeedLimit() : -1.); } data->reset(true); @@ -552,7 +557,8 @@ for (lane = edgeValues.begin(); lane != edgeValues.end(); ++lane) { MeanDataValues& meanData = **lane; if (writePrefix(dev, meanData, SUMO_TAG_LANE, meanData.getLane()->getID())) { - meanData.write(dev, myWrittenAttributes, stopTime - startTime, 1.f, myPrintDefaults ? meanData.getLane()->getLength() / meanData.getLane()->getSpeedLimit() : -1.); + meanData.write(dev, myWrittenAttributes, stopTime - startTime, 1.f, meanData.getLane()->getSpeedLimit(), + myPrintDefaults ? meanData.getLane()->getLength() / meanData.getLane()->getSpeedLimit() : -1.); } meanData.reset(true); } @@ -563,7 +569,8 @@ if (myTrackVehicles) { MeanDataValues& meanData = **edgeValues.begin(); if (writePrefix(dev, meanData, SUMO_TAG_EDGE, edge->getID())) { - meanData.write(dev, myWrittenAttributes, stopTime - startTime, (double)edge->getLanes().size(), myPrintDefaults ? edge->getLength() / edge->getSpeedLimit() : -1.); + meanData.write(dev, myWrittenAttributes, stopTime - startTime, (double)edge->getLanes().size(), edge->getSpeedLimit(), + myPrintDefaults ? edge->getLength() / edge->getSpeedLimit() : -1.); } meanData.reset(true); } else { @@ -574,7 +581,8 @@ meanData.reset(); } if (writePrefix(dev, *sumData, SUMO_TAG_EDGE, getEdgeID(edge))) { - sumData->write(dev, myWrittenAttributes, stopTime - startTime, (double)edge->getLanes().size(), myPrintDefaults ? edge->getLength() / edge->getSpeedLimit() : -1.); + sumData->write(dev, myWrittenAttributes, stopTime - startTime, (double)edge->getLanes().size(), edge->getSpeedLimit(), + myPrintDefaults ? edge->getLength() / edge->getSpeedLimit() : -1.); } delete sumData; } diff -Nru sumo-1.11.0/src/microsim/output/MSMeanData_Emissions.cpp sumo-1.12.0/src/microsim/output/MSMeanData_Emissions.cpp --- sumo-1.11.0/src/microsim/output/MSMeanData_Emissions.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSMeanData_Emissions.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -95,7 +95,7 @@ void MSMeanData_Emissions::MSLaneMeanDataValues::write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, - const double /*numLanes*/, const double defaultTravelTime, const int /*numVehicles*/) const { + const double /*numLanes*/, const double /*speedLimit*/, const double defaultTravelTime, const int /*numVehicles*/) const { const double normFactor = double(3600. / STEPS2TIME(period) / myLaneLength); dev.writeOptionalAttr(SUMO_ATTR_CO_ABS, OutputDevice::realString(myEmissions.CO, 6), attributeMask); dev.writeOptionalAttr(SUMO_ATTR_CO2_ABS, OutputDevice::realString(myEmissions.CO2, 6), attributeMask); diff -Nru sumo-1.11.0/src/microsim/output/MSMeanData_Emissions.h sumo-1.12.0/src/microsim/output/MSMeanData_Emissions.h --- sumo-1.11.0/src/microsim/output/MSMeanData_Emissions.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSMeanData_Emissions.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -90,7 +90,7 @@ * @exception IOError If an error on writing occurs (!!! not yet implemented) */ void write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, - const double numLanes, const double defaultTravelTime, + const double numLanes, const double speedLimit, const double defaultTravelTime, const int numVehicles = -1) const; diff -Nru sumo-1.11.0/src/microsim/output/MSMeanData.h sumo-1.12.0/src/microsim/output/MSMeanData.h --- sumo-1.11.0/src/microsim/output/MSMeanData.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSMeanData.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -142,7 +142,7 @@ * @exception IOError If an error on writing occurs (!!! not yet implemented) */ virtual void write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, - const double numLanes, const double defaultTravelTime, + const double numLanes, const double speedLimit, const double defaultTravelTime, const int numVehicles = -1) const = 0; /** @brief Returns the number of collected sample seconds. @@ -244,7 +244,7 @@ * @exception IOError If an error on writing occurs (!!! not yet implemented) */ void write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, - const double numLanes, const double defaultTravelTime, + const double numLanes, const double speedLimit, const double defaultTravelTime, const int numVehicles = -1) const; int getNumReady() const; diff -Nru sumo-1.11.0/src/microsim/output/MSMeanData_Harmonoise.cpp sumo-1.12.0/src/microsim/output/MSMeanData_Harmonoise.cpp --- sumo-1.11.0/src/microsim/output/MSMeanData_Harmonoise.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSMeanData_Harmonoise.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -85,7 +85,7 @@ void MSMeanData_Harmonoise::MSLaneMeanDataValues::write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, - const double /*numLanes*/, const double defaultTravelTime, const int /*numVehicles*/) const { + const double /*numLanes*/, const double /*speedLimit*/, const double defaultTravelTime, const int /*numVehicles*/) const { const double noise = meanNTemp != 0 ? (double)(10. * log10(meanNTemp * TS / STEPS2TIME(period))) : (double) 0.; dev.writeOptionalAttr(SUMO_ATTR_NOISE, noise, attributeMask); if (sampleSeconds > myParent->myMinSamples) { diff -Nru sumo-1.11.0/src/microsim/output/MSMeanData_Harmonoise.h sumo-1.12.0/src/microsim/output/MSMeanData_Harmonoise.h --- sumo-1.11.0/src/microsim/output/MSMeanData_Harmonoise.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSMeanData_Harmonoise.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -91,7 +91,7 @@ * @exception IOError If an error on writing occurs (!!! not yet implemented) */ void write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, - const double numLanes, const double defaultTravelTime, + const double numLanes, const double speedLimit, const double defaultTravelTime, const int numVehicles = -1) const; diff -Nru sumo-1.11.0/src/microsim/output/MSMeanData_Net.cpp sumo-1.12.0/src/microsim/output/MSMeanData_Net.cpp --- sumo-1.11.0/src/microsim/output/MSMeanData_Net.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSMeanData_Net.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ @@ -21,18 +21,21 @@ /****************************************************************************/ #include +#ifdef HAVE_FOX +#include +#endif +#include +#include +#include #include #include #include #include -#include -#include -#include -#include "MSMeanData_Net.h" - #include #include #include +#include "MSMeanData_Net.h" + // =========================================================================== // debug constants @@ -181,7 +184,7 @@ if ((myParent == nullptr || myParent->vehicleApplies(veh)) && ( getLane() == nullptr || !veh.isVehicle() || getLane() == static_cast(veh).getLane())) { #ifdef HAVE_FOX - FXConditionalLock lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); #endif if (MSGlobals::gUseMesoSim) { removeFromVehicleUpdateValues(veh); @@ -216,7 +219,7 @@ if (myParent == nullptr || myParent->vehicleApplies(veh)) { if (getLane() == nullptr || !veh.isVehicle() || getLane() == static_cast(veh).getLane()) { #ifdef HAVE_FOX - FXConditionalLock lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); #endif if (reason == MSMoveReminder::NOTIFICATION_DEPARTED) { ++nVehDeparted; @@ -241,7 +244,7 @@ void MSMeanData_Net::MSLaneMeanDataValues::write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, - const double numLanes, const double defaultTravelTime, const int numVehicles) const { + const double numLanes, const double speedLimit, const double defaultTravelTime, const int numVehicles) const { const double density = MIN2(sampleSeconds / STEPS2TIME(period) * (double) 1000 / myLaneLength, 1000. * numLanes / MAX2(minimalVehicleLength, NUMERICAL_EPS)); @@ -267,6 +270,7 @@ dev.writeOptionalAttr(SUMO_ATTR_WAITINGTIME, waitSeconds, attributeMask); dev.writeOptionalAttr(SUMO_ATTR_TIMELOSS, timeLoss, attributeMask); dev.writeOptionalAttr(SUMO_ATTR_SPEED, travelledDistance / sampleSeconds, attributeMask); + dev.writeOptionalAttr(SUMO_ATTR_SPEEDREL, speedLimit == 0. ? 0. : travelledDistance / sampleSeconds / speedLimit, attributeMask); } dev.writeOptionalAttr(SUMO_ATTR_DEPARTED, nVehDeparted, attributeMask); dev.writeOptionalAttr(SUMO_ATTR_ARRIVED, nVehArrived, attributeMask); @@ -293,6 +297,7 @@ dev.writeOptionalAttr(SUMO_ATTR_WAITINGTIME, waitSeconds, attributeMask); dev.writeOptionalAttr(SUMO_ATTR_TIMELOSS, timeLoss, attributeMask); dev.writeOptionalAttr(SUMO_ATTR_SPEED, travelledDistance / sampleSeconds, attributeMask); + dev.writeOptionalAttr(SUMO_ATTR_SPEEDREL, speedLimit == 0. ? 0. : travelledDistance / sampleSeconds / speedLimit, attributeMask); } else { double traveltime = myParent->myMaxTravelTime; if (frontTravelledDistance > NUMERICAL_EPS) { @@ -308,10 +313,12 @@ dev.writeOptionalAttr(SUMO_ATTR_WAITINGTIME, waitSeconds, attributeMask); dev.writeOptionalAttr(SUMO_ATTR_TIMELOSS, timeLoss, attributeMask); dev.writeOptionalAttr(SUMO_ATTR_SPEED, travelledDistance / sampleSeconds, attributeMask); + dev.writeOptionalAttr(SUMO_ATTR_SPEEDREL, speedLimit == 0. ? 0. : travelledDistance / sampleSeconds / speedLimit, attributeMask); } } else if (defaultTravelTime >= 0.) { dev.writeOptionalAttr(SUMO_ATTR_TRAVELTIME, defaultTravelTime, attributeMask); dev.writeOptionalAttr(SUMO_ATTR_SPEED, myLaneLength / defaultTravelTime, attributeMask); + dev.writeOptionalAttr(SUMO_ATTR_SPEEDREL, speedLimit == 0. ? 0. : myLaneLength / defaultTravelTime / speedLimit, attributeMask); } dev.writeOptionalAttr(SUMO_ATTR_DEPARTED, nVehDeparted, attributeMask); dev.writeOptionalAttr(SUMO_ATTR_ARRIVED, nVehArrived, attributeMask); diff -Nru sumo-1.11.0/src/microsim/output/MSMeanData_Net.h sumo-1.12.0/src/microsim/output/MSMeanData_Net.h --- sumo-1.11.0/src/microsim/output/MSMeanData_Net.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSMeanData_Net.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ @@ -123,7 +123,7 @@ * @exception IOError If an error on writing occurs (!!! not yet implemented) */ void write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, - const double numLanes, const double defaultTravelTime, + const double numLanes, const double speedLimit, const double defaultTravelTime, const int numVehicles = -1) const; protected: diff -Nru sumo-1.11.0/src/microsim/output/MSQueueExport.cpp sumo-1.12.0/src/microsim/output/MSQueueExport.cpp --- sumo-1.11.0/src/microsim/output/MSQueueExport.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSQueueExport.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSQueueExport.h sumo-1.12.0/src/microsim/output/MSQueueExport.h --- sumo-1.11.0/src/microsim/output/MSQueueExport.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSQueueExport.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSRouteProbe.cpp sumo-1.12.0/src/microsim/output/MSRouteProbe.cpp --- sumo-1.11.0/src/microsim/output/MSRouteProbe.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSRouteProbe.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSRouteProbe.h sumo-1.12.0/src/microsim/output/MSRouteProbe.h --- sumo-1.11.0/src/microsim/output/MSRouteProbe.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSRouteProbe.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSStopOut.cpp sumo-1.12.0/src/microsim/output/MSStopOut.cpp --- sumo-1.11.0/src/microsim/output/MSStopOut.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSStopOut.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -66,8 +66,8 @@ MSStopOut::stopStarted(const SUMOVehicle* veh, int numPersons, int numContainers, SUMOTime time) { assert(veh != nullptr); if (myStopped.count(veh) != 0) { - WRITE_WARNING("Vehicle '" + veh->getID() + "' stops on edge '" + veh->getEdge()->getID() - + "', time " + time2string(time) + " without ending the previous stop."); + WRITE_WARNINGF("Vehicle '%' stops on edge '%', time=% without ending the previous stop.", + veh->getID(), veh->getEdge()->getID(), time2string(time)); } myStopped.emplace(veh, StopInfo(numPersons, numContainers)); } @@ -102,15 +102,15 @@ MSStopOut::stopEnded(const SUMOVehicle* veh, const SUMOVehicleParameter::Stop& stop, const std::string& laneOrEdgeID, bool simEnd) { assert(veh != nullptr); if (myStopped.count(veh) == 0) { - WRITE_WARNING("Vehicle '" + veh->getID() + "' ends stop on edge '" + veh->getEdge()->getID() - + "', time " + time2string(MSNet::getInstance()->getCurrentTimeStep()) + " without entering the stop"); + WRITE_WARNINGF("Vehicle '%' ends stop on edge '%', time=% without entering the stop.", + veh->getID(), veh->getEdge()->getID(), time2string(SIMSTEP)); return; } const StopInfo& si = myStopped.find(veh)->second; double delay = -1; double arrivalDelay = -1; if (stop.until >= 0 && !simEnd) { - delay = STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep() - stop.until); + delay = STEPS2TIME(SIMSTEP - stop.until); } if (stop.arrival >= 0) { arrivalDelay = STEPS2TIME(stop.started - stop.arrival); @@ -126,7 +126,7 @@ myDevice.writeAttr(SUMO_ATTR_POSITION, veh->getPositionOnLane()); myDevice.writeAttr(SUMO_ATTR_PARKING, stop.parking); myDevice.writeAttr("started", time2string(stop.started)); - myDevice.writeAttr("ended", simEnd ? "-1" : time2string(MSNet::getInstance()->getCurrentTimeStep())); + myDevice.writeAttr("ended", simEnd ? "-1" : time2string(SIMSTEP)); myDevice.writeAttr("delay", delay); if (stop.arrival >= 0) { myDevice.writeAttr("arrivalDelay", arrivalDelay); diff -Nru sumo-1.11.0/src/microsim/output/MSStopOut.h sumo-1.12.0/src/microsim/output/MSStopOut.h --- sumo-1.11.0/src/microsim/output/MSStopOut.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSStopOut.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSVTKExport.cpp sumo-1.12.0/src/microsim/output/MSVTKExport.cpp --- sumo-1.11.0/src/microsim/output/MSVTKExport.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSVTKExport.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSVTKExport.h sumo-1.12.0/src/microsim/output/MSVTKExport.h --- sumo-1.11.0/src/microsim/output/MSVTKExport.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSVTKExport.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSVTypeProbe.cpp sumo-1.12.0/src/microsim/output/MSVTypeProbe.cpp --- sumo-1.11.0/src/microsim/output/MSVTypeProbe.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSVTypeProbe.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSVTypeProbe.h sumo-1.12.0/src/microsim/output/MSVTypeProbe.h --- sumo-1.11.0/src/microsim/output/MSVTypeProbe.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSVTypeProbe.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSXMLRawOut.cpp sumo-1.12.0/src/microsim/output/MSXMLRawOut.cpp --- sumo-1.11.0/src/microsim/output/MSXMLRawOut.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSXMLRawOut.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/output/MSXMLRawOut.h sumo-1.12.0/src/microsim/output/MSXMLRawOut.h --- sumo-1.11.0/src/microsim/output/MSXMLRawOut.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/output/MSXMLRawOut.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp sumo-1.12.0/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -27,8 +27,6 @@ #include #include #include -#include -#include #include #include #include @@ -38,12 +36,22 @@ #include #include #include +#include //#define DEBUG_DETECTORS //#define DEBUG_PHASE_SELECTION #define DEBUG_COND (getID()=="C") // =========================================================================== +// static members +// =========================================================================== +const std::vector MSActuatedTrafficLightLogic::OPERATOR_PRECEDENCE({ + "**", "^", "*", "/", "+", "-", "%", + "=", "==", "!=", "<", ">", "<=", ">=", + "and", "&&", "or", "||", +}); + +// =========================================================================== // parameter defaults definitions // =========================================================================== #define DEFAULT_MAX_GAP "3.0" @@ -61,13 +69,17 @@ // =========================================================================== MSActuatedTrafficLightLogic::MSActuatedTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, + const SUMOTime offset, const Phases& phases, int step, SUMOTime delay, const std::map& parameter, - const std::string& basePath) : - MSSimpleTrafficLightLogic(tlcontrol, id, programID, TrafficLightType::ACTUATED, phases, step, delay, parameter), + const std::string& basePath, + const std::map& conditions) : + MSSimpleTrafficLightLogic(tlcontrol, id, programID, offset, TrafficLightType::ACTUATED, phases, step, delay, parameter), myLastTrySwitchTime(0), - myTraCISwitch(false) { + myConditions(conditions), + myTraCISwitch(false), + myDetectorPrefix(id + "_" + programID + "_") { myMaxGap = StringUtils::toDouble(getParameter("max-gap", DEFAULT_MAX_GAP)); myPassingTime = StringUtils::toDouble(getParameter("passing-time", DEFAULT_PASSING_TIME)); myDetectorGap = StringUtils::toDouble(getParameter("detector-gap", DEFAULT_DETECTOR_GAP)); @@ -78,6 +90,7 @@ myVehicleTypes = getParameter("vTypes", ""); } + MSActuatedTrafficLightLogic::~MSActuatedTrafficLightLogic() { } void @@ -113,6 +126,9 @@ // build the induct loops std::map laneInductLoopMap; std::map inductLoopLaneMap; // in case loops are placed further upstream + int detEdgeIndex = -1; + int detLaneIndex = 0; + MSEdge* prevDetEdge = nullptr; for (LaneVector& lanes : myLanes) { for (MSLane* lane : lanes) { if (noVehicles(lane->getPermissions())) { @@ -133,6 +149,13 @@ double ilpos; double inductLoopPosition; MSInductLoop* loop = nullptr; + if (&lane->getEdge() != prevDetEdge) { + detEdgeIndex++; + detLaneIndex = 0; + prevDetEdge = &lane->getEdge(); + } else { + detLaneIndex++; + } if (customID == "") { double speed = lane->getSpeedLimit(); inductLoopPosition = MIN2( @@ -150,7 +173,7 @@ ilpos = 0; } // Build the induct loop and set it into the container - std::string id = "TLS" + myID + "_" + myProgramID + "_InductLoopOn_" + lane->getID(); + std::string id = myDetectorPrefix + "D" + toString(detEdgeIndex) + "." + toString(detLaneIndex); loop = static_cast(nb.createInductLoop(id, placementLane, ilpos, myVehicleTypes, (int)PersonMode::NONE, myShowDetectors)); MSNet::getInstance()->getDetectorControl().add(SUMO_TAG_INDUCTION_LOOP, loop, myFile, myFreq); } else if (customID == NO_DETECTOR) { @@ -232,8 +255,7 @@ for (const MSPhaseDefinition* phase : myPhases) { const int phaseIndex = (int)myInductLoopsForPhase.size(); std::set loops; - if (phase->minDuration != phase->maxDuration) { - // actuated phase + if (phase->isActuted()) { const std::string& state = phase->getState(); // collect indices of all green links for the phase std::set greenLinks; @@ -387,13 +409,39 @@ myLinkMinGreenTimes[link] = string2time(kv.second); } } - if (myLinkMaxGreenTimes.size() > 0 || myLinkMinGreenTimes.size() > 0) { + initSwitchingRules(); + if (myLinkMaxGreenTimes.size() > 0 || myLinkMinGreenTimes.size() > 0 || mySwitchingRules.size() > 0) { myLinkGreenTimes = std::vector(myNumLinks, 0); + myLinkRedTimes = std::vector(myNumLinks, 0); } //std::cout << SIMTIME << " linkMaxGreenTimes=" << toString(myLinkMaxGreenTimes) << "\n"; } +void +MSActuatedTrafficLightLogic::initSwitchingRules() { + for (int i = 0; i < (int)myPhases.size(); i++) { + SwitchingRules sr; + MSPhaseDefinition* phase = myPhases[i]; + std::vector nextPhases = phase->nextPhases; + if (nextPhases.size() == 0) { + nextPhases.push_back((i + 1) % (int)myPhases.size()); + } + for (int next : nextPhases) { + if (next >= 0 && next < (int)myPhases.size()) { + const MSPhaseDefinition* nextPhase = myPhases[next]; + if (nextPhase->earlyTarget != "" || nextPhase->finalTarget != "") { + sr.enabled = true; + // simplifies later code + phase->nextPhases = nextPhases; + } + } + } + mySwitchingRules.push_back(sr); + } +} + + SUMOTime MSActuatedTrafficLightLogic::getMinimumMinDuration(MSLane* lane) const { SUMOTime result = std::numeric_limits::max(); @@ -403,7 +451,7 @@ if (state[i] == LINKSTATE_TL_GREEN_MAJOR || state[i] == LINKSTATE_TL_GREEN_MINOR) { for (MSLane* cand : getLanesAt(i)) { if (lane == cand) { - if (phase->minDuration != phase->maxDuration) { + if (phase->isActuted()) { result = MIN2(result, phase->minDuration); } } @@ -436,7 +484,7 @@ MSActuatedTrafficLightLogic::activateProgram() { MSTrafficLightLogic::activateProgram(); for (InductLoopInfo& loopInfo : myInductLoops) { - loopInfo.loop->setVisible(true); + loopInfo.loop->setVisible(myShowDetectors); } } @@ -477,44 +525,53 @@ if (myLinkGreenTimes.size() > 0) { // constraints exist, record green time durations for each link const std::string& state = getCurrentPhaseDef().getState(); - SUMOTime lastDuration = now - myLastTrySwitchTime; + SUMOTime lastDuration = SIMSTEP - myLastTrySwitchTime; for (int i = 0; i < myNumLinks; i++) { if (state[i] == 'G' || state[i] == 'g') { myLinkGreenTimes[i] += lastDuration; } else { myLinkGreenTimes[i] = 0; } + if (state[i] == 'r' || state[i] == 'u') { + myLinkRedTimes[i] += lastDuration; + } else { + myLinkRedTimes[i] = 0; + } } - //std::cout << SIMTIME << " greenTimes=" << toString(myLinkGreenTimes) << "\n"; } myLastTrySwitchTime = now; - const double detectionGap = gapControl(); - const bool multiTarget = myPhases[myStep]->nextPhases.size() > 1 && myPhases[myStep]->nextPhases.front() >= 0; -#ifdef DEBUG_PHASE_SELECTION - if (DEBUG_COND) { - std::cout << SIMTIME << " p=" << myStep << " trySwitch dGap=" << detectionGap << " multi=" << multiTarget << "\n"; - } -#endif - if (detectionGap < std::numeric_limits::max() && !multiTarget && !myTraCISwitch) { - return duration(detectionGap); - } - myTraCISwitch = false; // decide the next phase + const bool multiTarget = myPhases[myStep]->nextPhases.size() > 1 && myPhases[myStep]->nextPhases.front() >= 0; const int origStep = myStep; int nextStep = myStep; SUMOTime actDuration = now - myPhases[myStep]->myLastSwitch; - if (multiTarget) { - nextStep = decideNextPhase(); + + if (mySwitchingRules[myStep].enabled) { + const bool mustSwitch = MIN2(getCurrentPhaseDef().maxDuration - actDuration, getLatest()) <= 0; + nextStep = decideNextPhaseCustom(mustSwitch); } else { - if (myPhases[myStep]->nextPhases.size() == 1 && myPhases[myStep]->nextPhases.front() >= 0) { - nextStep = myPhases[myStep]->nextPhases.front(); + // default algorithm + const double detectionGap = gapControl(); +#ifdef DEBUG_PHASE_SELECTION + if (DEBUG_COND) { + std::cout << SIMTIME << " p=" << myStep << " trySwitch dGap=" << detectionGap << " multi=" << multiTarget << "\n"; + } +#endif + if (detectionGap < std::numeric_limits::max() && !multiTarget && !myTraCISwitch) { + return duration(detectionGap); + } + if (multiTarget) { + nextStep = decideNextPhase(); } else { - nextStep++; + if (myPhases[myStep]->nextPhases.size() == 1 && myPhases[myStep]->nextPhases.front() >= 0) { + nextStep = myPhases[myStep]->nextPhases.front(); + } else { + nextStep = (myStep + 1) % (int)myPhases.size(); + } } } - if (nextStep == (int)myPhases.size()) { - nextStep = 0; - } + + myTraCISwitch = false; SUMOTime linkMinDur = getLinkMinDuration(getTarget(nextStep)); if (linkMinDur > 0) { // for multiTarget, the current phase must be extended but if another @@ -525,7 +582,9 @@ assert(myStep <= (int)myPhases.size()); assert(myStep >= 0); //stores the time the phase started + const SUMOTime prevStart = myPhases[myStep]->myLastSwitch; if (myStep != origStep) { + myPhases[origStep]->myLastEnd = now; myPhases[myStep]->myLastSwitch = now; actDuration = 0; } @@ -538,7 +597,7 @@ } } // set the next event - return MAX2(TIME2STEPS(1), getCurrentPhaseDef().minDuration - actDuration); + return MAX3(TIME2STEPS(1), getCurrentPhaseDef().minDuration - actDuration, getEarliest(prevStart)); } @@ -558,7 +617,7 @@ newDuration = (totalDur / 1000 + 1) * 1000 - actDuration; } // ensure that the maximum duration is not exceeded - newDuration = MIN2(newDuration, getCurrentPhaseDef().maxDuration - actDuration); + newDuration = MIN3(newDuration, getCurrentPhaseDef().maxDuration - actDuration, getLatest()); return newDuration; } @@ -587,7 +646,13 @@ // Checks, if the maxDuration is kept. No phase should last longer than maxDuration. SUMOTime actDuration = MSNet::getInstance()->getCurrentTimeStep() - myPhases[myStep]->myLastSwitch; - if (actDuration >= getCurrentPhaseDef().maxDuration || maxLinkDurationReached()) { + if (actDuration >= getCurrentPhaseDef().maxDuration || maxLinkDurationReached() || getLatest() == 0) { +#ifdef DEBUG_PHASE_SELECTION + if (DEBUG_COND) { + std::cout << SIMTIME << " actDuration=" << STEPS2TIME(actDuration) << " maxDur=" << STEPS2TIME(getCurrentPhaseDef().maxDuration) + << " maxLinkDurationReached=" << maxLinkDurationReached() << " latest=" << STEPS2TIME(getLatest()) << "\n"; + } +#endif return result; // end current phase } @@ -603,7 +668,6 @@ return result; } - int MSActuatedTrafficLightLogic::decideNextPhase() { const auto& cands = myPhases[myStep]->nextPhases; @@ -613,7 +677,7 @@ int result = cands.front(); int maxPrio = 0; SUMOTime actDuration = MSNet::getInstance()->getCurrentTimeStep() - myPhases[myStep]->myLastSwitch; - const bool canExtend = actDuration < getCurrentPhaseDef().maxDuration && !maxLinkDurationReached(); + const bool canExtend = actDuration < getCurrentPhaseDef().maxDuration && !maxLinkDurationReached() && getLatest() > 0; if (canExtend) { // consider keeping the current phase until maxDur is reached // (only when there is still traffic in that phase) @@ -673,7 +737,7 @@ } step = myPhases[step]->nextPhases.front(); } else { - step = (step + 1) % myPhases.size(); + step = (step + 1) % (int)myPhases.size(); } if (step == origStep) { WRITE_WARNING("At actuated tlLogic '" + getID() + "', infinite transition loop from phase " + toString(origStep)); @@ -702,7 +766,7 @@ // give bonus to detectors that are currently served (if that phase can stil be extended) if (loopInfo.servedPhase[myStep]) { SUMOTime actDuration = MSNet::getInstance()->getCurrentTimeStep() - myPhases[myStep]->myLastSwitch; - const bool canExtend = actDuration < getCurrentPhaseDef().maxDuration; + const bool canExtend = actDuration < getCurrentPhaseDef().maxDuration || getLatest() > 0; if (canExtend) { return DEFAULT_CURRENT_PRIORITY; } else { @@ -783,6 +847,204 @@ return result; } +int +MSActuatedTrafficLightLogic::decideNextPhaseCustom(bool mustSwitch) { + for (int next : getCurrentPhaseDef().nextPhases) { + const MSPhaseDefinition* phase = myPhases[next]; + const std::string& condition = mustSwitch ? phase->finalTarget : phase->earlyTarget; + //std::cout << SIMTIME << " mustSwitch=" << mustSwitch << " condition=" << condition << "\n"; + if (condition != "" && evalExpression(condition)) { + return next; + } + } + return mustSwitch ? getCurrentPhaseDef().nextPhases.back() : myStep; +} + + +double +MSActuatedTrafficLightLogic::evalExpression(const std::string& condition) const { + const size_t bracketOpen = condition.find('('); + if (bracketOpen != std::string::npos) { + // find matching closing bracket + size_t bracketClose = std::string::npos; + int open = 1; + for (size_t i = bracketOpen + 1; i < condition.size(); i++) { + if (condition[i] == '(') { + open++; + } else if (condition[i] == ')') { + open--; + if (open == 0) { + bracketClose = i; + break; + } + } + } + if (bracketOpen == std::string::npos) { + throw ProcessError("Unmatched parentheses in condition " + condition + "'"); + } + std::string cond2 = condition; + const std::string inBracket = condition.substr(bracketOpen + 1, bracketClose - bracketOpen - 1); + double bracketVal = evalExpression(inBracket); + cond2.replace(bracketOpen, bracketClose - bracketOpen + 1, toString(bracketVal)); + return evalExpression(cond2); + } + std::vector tokens = StringTokenizer(condition).getVector(); + //std::cout << SIMTIME << " tokens(" << tokens.size() << ")=" << toString(tokens) << "\n"; + if (tokens.size() == 0) { + throw ProcessError("Invalid empty condition '" + condition + "'"); + } else if (tokens.size() == 1) { + return evalAtomicExpression(tokens[0]); + } else if (tokens.size() == 2) { + if (tokens[0] == "not") { + return !(bool)(evalAtomicExpression(tokens[1])); + } else { + throw ProcessError("Unsupported condition '" + condition + "'"); + } + } else if (tokens.size() == 3) { + // infix expression + const double a = evalAtomicExpression(tokens[0]); + const double b = evalAtomicExpression(tokens[2]); + const std::string& o = tokens[1]; + //std::cout << SIMTIME << " o=" << o << " a=" << a << " b=" << b << "\n"; + return evalTernaryExpression(a, o, b, condition); + } else { + const int iEnd = (int)tokens.size() - 1; + for (const std::string& o : OPERATOR_PRECEDENCE) { + for (int i = 1; i < iEnd; i++) { + if (tokens[i] == o) { + const double val = evalTernaryExpression( + evalAtomicExpression(tokens[i - 1]), o, + evalAtomicExpression(tokens[i + 1]), condition); + std::vector newTokens(tokens.begin(), tokens.begin() + (i - 1)); + newTokens.push_back(toString(val)); + newTokens.insert(newTokens.end(), tokens.begin() + (i + 2), tokens.end()); + return evalExpression(toString(newTokens)); + } + } + } + throw ProcessError("Parsing expressions with " + toString(tokens.size()) + " elements ('" + condition + "') is not supported"); + } + return true; +} + +double +MSActuatedTrafficLightLogic::evalTernaryExpression(double a, const std::string& o, double b, const std::string& condition) const { + if (o == "=" || o == "==") { + return (double)(a == b); + } else if (o == "<") { + return (double)(a < b); + } else if (o == ">") { + return (double)(a > b); + } else if (o == "<=") { + return (double)(a <= b); + } else if (o == ">=") { + return (double)(a >= b); + } else if (o == "!=") { + return (double)(a != b); + } else if (o == "or" || o == "||") { + return (double)(a || b); + } else if (o == "and" || o == "&&") { + return (double)(a && b); + } else if (o == "+") { + return a + b; + } else if (o == "-") { + return a + b; + } else if (o == "*") { + return a * b; + } else if (o == "/") { + if (b == 0) { + WRITE_ERROR("Division by 0 in condition '" + condition + "'"); + return 0; + } + return a / b; + } else if (o == "%") { + return fmod(a, b); + } else if (o == "**" || o == "^") { + return pow(a, b); + } else { + throw ProcessError("Unsupported operator '" + o + "' in condition '" + condition + "'"); + } +} + +double +MSActuatedTrafficLightLogic::evalAtomicExpression(const std::string& expr) const { + if (expr.size() == 0) { + throw ProcessError("Invalid empty expression"); + } else if (expr[0] == '!') { + return !(bool)evalAtomicExpression(expr.substr(1)); + } else if (expr[0] == '-') { + return -evalAtomicExpression(expr.substr(1)); + } else { + // check for 'operator:' + const size_t pos = expr.find(':'); + if (pos == std::string::npos) { + auto it = myConditions.find(expr); + if (it != myConditions.end()) { + // symbol lookup + return evalExpression(it->second); + } else { + return StringUtils::toDouble(expr); + } + } else { + const std::string fun = expr.substr(0, pos); + const std::string arg = expr.substr(pos + 1); + if (fun == "z") { + return retrieveDetExpression(arg, expr, true)->getTimeSinceLastDetection(); + } else if (fun == "a") { + try { + return retrieveDetExpression(arg, expr, true)->getTimeSinceLastDetection() == 0; + } catch (ProcessError&) { + return retrieveDetExpression(arg, expr, true)->getCurrentVehicleNumber() > 0; + } + } else if (fun == "g" || fun == "r") { + try { + int linkIndex = StringUtils::toInt(arg); + if (linkIndex >= 0 && linkIndex < myNumLinks) { + const std::vector& times = fun == "g" ? myLinkGreenTimes : myLinkRedTimes; + if (myLastTrySwitchTime < SIMSTEP) { + // times are only updated at the start of a phase where + // switching is possible (i.e. not during minDur). + // If somebody is looking at those values in the tracker + // this would be confusing + const LinkState ls = getCurrentPhaseDef().getSignalState(linkIndex); + if ((fun == "g" && (ls == LINKSTATE_TL_GREEN_MAJOR || ls == LINKSTATE_TL_GREEN_MINOR)) + || (fun == "r" && (ls == LINKSTATE_TL_RED || ls == LINKSTATE_TL_REDYELLOW))) { + const SUMOTime currentGreen = SIMSTEP - myLastTrySwitchTime; + return STEPS2TIME(times[linkIndex] + currentGreen); + } else { + return 0; + } + } else { + return STEPS2TIME(times[linkIndex]); + } + } + } catch (NumberFormatException&) { } + throw ProcessError("Invalid link index '" + arg + "' in expression '" + expr + "'"); + } else { + throw ProcessError("Unsupported function '" + fun + "' in expression '" + expr + "'"); + } + } + } +} + + +std::map +MSActuatedTrafficLightLogic::getDetectorStates() const { + std::map result; + for (auto li : myInductLoops) { + result[li.loop->getID()] = li.loop->getOccupancy() > 0 ? 1 : 0; + } + return result; +} + +std::map +MSActuatedTrafficLightLogic::getConditions() const { + std::map result; + for (auto item : myConditions) { + result[item.first] = evalExpression(item.second); + } + return result; +} void MSActuatedTrafficLightLogic::setParameter(const std::string& key, const std::string& value) { diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h sumo-1.12.0/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h --- sumo-1.11.0/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -28,8 +28,9 @@ #include #include #include -#include "MSSimpleTrafficLightLogic.h" +#include #include +#include "MSSimpleTrafficLightLogic.h" // =========================================================================== @@ -37,7 +38,6 @@ // =========================================================================== class NLDetectorBuilder; - // =========================================================================== // class definitions // =========================================================================== @@ -58,10 +58,12 @@ */ MSActuatedTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, + const SUMOTime offset, const MSSimpleTrafficLightLogic::Phases& phases, int step, SUMOTime delay, const std::map& parameter, - const std::string& basePath); + const std::string& basePath, + const std::map& conditions = std::map()); /** @brief Initialises the tls with information about incoming lanes @@ -112,7 +114,16 @@ /**@brief Sets a parameter and updates internal constants */ void setParameter(const std::string& key, const std::string& value); + /// @brief retrieve all detectors used by this program + std::map getDetectorStates() const; + + /// @brief return all named conditions defined for this traffic light + std::map getConditions() const; + protected: + /// @brief initialize custom switching rules + void initSwitchingRules(); + struct InductLoopInfo { InductLoopInfo(MSInductLoop* _loop, int numPhases, double _maxGap): loop(_loop), @@ -149,9 +160,21 @@ bool hasMajor(const std::string& state, const LaneVector& lanes) const; /// @} - /// @brief select am candidate phases based on detector states + /// @brief select among candidate phases based on detector states int decideNextPhase(); + /// @brief select among candidate phases based on detector states and custom switching rules + int decideNextPhaseCustom(bool mustSwitch); + + /// @brief evaluate custom switching condition + double evalExpression(const std::string& condition) const; + + /// @brief evaluate atomic expression + double evalTernaryExpression(double a, const std::string& o, double b, const std::string& condition) const; + + /// @brief evaluate atomic expression + double evalAtomicExpression(const std::string& expr) const; + int getDetectorPriority(const InductLoopInfo& loopInfo) const; /// @brief count the number of active detectors for the given step @@ -169,13 +192,30 @@ /// @brief the minimum duratin for keeping the current phase due to linkMinDur constraints SUMOTime getLinkMinDuration(int target) const; + template + const T* retrieveDetExpression(const std::string& arg, const std::string& expr, bool tryPrefix) const { + const T* det = dynamic_cast( + MSNet::getInstance()->getDetectorControl().getTypedDetectors(Tag).get( + (tryPrefix ? myDetectorPrefix : "") + arg)); + if (det == nullptr) { + if (tryPrefix) { + // try again without prefix + return retrieveDetExpression(arg, expr, false); + } else { + throw ProcessError("Unknown detector '" + arg + "' in expression '" + expr + "'"); + } + } else { + return det; + } + } + + protected: /// @brief A map from phase to induction loops to be used for gap control InductLoopMap myInductLoopsForPhase; std::vector myInductLoops; - /// The maximum gap to check in seconds double myMaxGap; @@ -202,13 +242,28 @@ /// @brief last time trySwitch was called SUMOTime myLastTrySwitchTime; + /// @brief consecutive time that the given link index has been green std::vector myLinkGreenTimes; + std::vector myLinkRedTimes; /// @brief maximum consecutive time that the given link may remain green std::vector myLinkMaxGreenTimes; /// @brief minimum consecutive time that the given link must remain green std::vector myLinkMinGreenTimes; + /// @brief The custom switching conditions + std::map myConditions; + /// @brief whether the next switch time was requested via TraCI bool myTraCISwitch; + + struct SwitchingRules { + bool enabled = false; + }; + + std::vector mySwitchingRules; + + const std::string myDetectorPrefix; + + static const std::vector OPERATOR_PRECEDENCE; }; diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.cpp sumo-1.12.0/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -43,11 +43,12 @@ // =========================================================================== MSDelayBasedTrafficLightLogic::MSDelayBasedTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, + const SUMOTime offset, const Phases& phases, int step, SUMOTime delay, const std::map& parameter, const std::string& basePath) : - MSSimpleTrafficLightLogic(tlcontrol, id, programID, TrafficLightType::DELAYBASED, phases, step, delay, parameter) { + MSSimpleTrafficLightLogic(tlcontrol, id, programID, offset, TrafficLightType::DELAYBASED, phases, step, delay, parameter) { #ifdef DEBUG_TIMELOSS_CONTROL std::cout << "Building delay based tls logic '" << id << "'" << std::endl; #endif @@ -142,7 +143,7 @@ for (const MSE2Collector::VehicleInfo* const iv : vehInfos) { if (iv->accumulatedTimeLoss > myTimeLossThreshold && iv->distToDetectorEnd > 0) { const SUMOTime estimatedTimeToJunction = TIME2STEPS((iv->distToDetectorEnd) / lane->getSpeedLimit()); - if (actDuration + estimatedTimeToJunction <= maxDuration) { + if (actDuration + estimatedTimeToJunction <= maxDuration && getLatest() > 0) { // only prolong if vehicle has a chance to pass until max duration is reached prolongation = MAX2(prolongation, estimatedTimeToJunction); } @@ -234,16 +235,14 @@ } } // Don't prolong... switch to the next phase - myStep++; - assert(myStep <= (int)myPhases.size()); - if (myStep == (int)myPhases.size()) { - myStep = 0; - } + const SUMOTime prevStart = myPhases[myStep]->myLastSwitch; + myStep = (myStep + 1) % (int)myPhases.size(); + myPhases[myStep]->myLastSwitch = SIMSTEP; MSPhaseDefinition* newPhase = myPhases[myStep]; //stores the time the phase started newPhase->myLastSwitch = MSNet::getInstance()->getCurrentTimeStep(); // set the next event - return newPhase->minDuration; + return MAX2(newPhase->minDuration, getEarliest(prevStart)); } void diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.h sumo-1.12.0/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.h --- sumo-1.11.0/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -55,6 +55,7 @@ */ MSDelayBasedTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, + const SUMOTime offset, const MSSimpleTrafficLightLogic::Phases& phases, int step, SUMOTime delay, const std::map& parameter, diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.cpp sumo-1.12.0/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ @@ -163,12 +163,12 @@ SUMOTime step = MSNet::getInstance()->getCurrentTimeStep(); std::ostringstream phero_str; phero_str << " (mean_vSpeed_in= " << mean_vSpeed_in << " ,mean_vSpeed_out= " << mean_vSpeed_out << " )"; - WRITE_MESSAGE("TL " + getID() + " time " + time2string(step) + " Policy: " + newPolicy->getName() + phero_str.str() + " OldPolicy: " + oldPolicy->getName() + " id " + getID() + " ."); + WRITE_MESSAGE("TL " + getID() + " time=" + time2string(step) + " Policy: " + newPolicy->getName() + phero_str.str() + " OldPolicy: " + oldPolicy->getName() + " id " + getID() + " ."); } else { //debug purpose only std::ostringstream phero_str; phero_str << " (mean_vSpeed_in= " << mean_vSpeed_in << " ,mean_vSpeed_out= " << mean_vSpeed_out << " )"; SUMOTime step = MSNet::getInstance()->getCurrentTimeStep(); - WRITE_MESSAGE("TL " + getID() + " time " + time2string(step) + " Policy: Nochanges" + phero_str.str() + " OldPolicy: " + oldPolicy->getName() + " id " + getID() + " ."); + WRITE_MESSAGE("TL " + getID() + " time=" + time2string(step) + " Policy: Nochanges" + phero_str.str() + " OldPolicy: " + oldPolicy->getName() + " id " + getID() + " ."); } #endif } diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.h sumo-1.12.0/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.h --- sumo-1.11.0/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp sumo-1.12.0/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -35,7 +35,7 @@ // =========================================================================== MSOffTrafficLightLogic::MSOffTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id) : - MSTrafficLightLogic(tlcontrol, id, "off", TrafficLightType::OFF, 0, std::map()) { + MSTrafficLightLogic(tlcontrol, id, "off", 0, TrafficLightType::OFF, 0, std::map()) { myDefaultCycleTime = TIME2STEPS(120); } @@ -87,7 +87,7 @@ delete *i; } myPhaseDefinition.clear(); - myPhaseDefinition.push_back(new MSPhaseDefinition(TIME2STEPS(120), state, -1)); + myPhaseDefinition.push_back(new MSPhaseDefinition(TIME2STEPS(120), state)); } diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSOffTrafficLightLogic.h sumo-1.12.0/src/microsim/traffic_lights/MSOffTrafficLightLogic.h --- sumo-1.11.0/src/microsim/traffic_lights/MSOffTrafficLightLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSOffTrafficLightLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSPhaseDefinition.h sumo-1.12.0/src/microsim/traffic_lights/MSPhaseDefinition.h --- sumo-1.11.0/src/microsim/traffic_lights/MSPhaseDefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSPhaseDefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -46,8 +46,13 @@ * @class MSPhaseDefinition * @brief The definition of a single phase of a tls logic */ + + class MSPhaseDefinition { public: + + static const SUMOTime UNSPECIFIED_DURATION = -1; + /// @brief The duration of the phase SUMOTime duration; @@ -60,9 +65,24 @@ /// @brief The maximum duration of the phase SUMOTime maxDuration; + /// @brief The minimum time within the cycle for switching (for coordinated actuation) + SUMOTime earliestEnd; + + /// @brief The maximum time within the cycle for switching (for coordinated actuation) + SUMOTime latestEnd; + + /// @brief The condition expression for an early switch into this phase + std::string earlyTarget; + + /// @brief The condition expression for switching into this phase when the active phase must end + std::string finalTarget; + /// @brief Stores the timestep of the last on-switched of the phase SUMOTime myLastSwitch; + /// @brief Stores the timestep when the previous instance of this phase was switched off + SUMOTime myLastEnd; + /// @brief The index of the phase that suceeds this one (or -1) std::vector nextPhases; @@ -78,18 +98,14 @@ /// @brief for NEMA phase SUMOTime vehext; -private: - /// @brief The phase definition - std::string myState; - /// @brief the phase is a transient one or a decisional one, compulsory directive for SOTL policies - bool myTransientNotDecisional = false; + bool myTransientNotDecisional; /// @brief the phase is a commit, compulsory directive for SOTL policies - bool myCommit = false; + bool myCommit; /// @brief Leaving the phase type as "undefined" lets SOTL policies malfunction - bool myUndefined = true; + bool myUndefined; /* * @brief The lanes-set @@ -101,90 +117,32 @@ */ std::vector myTargetLaneSet; - void init(SUMOTime durationArg, const std::string& stateArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, - const std::vector nextPhasesArg, const std::string& nameArg) { - this->duration = durationArg; - this->myState = stateArg; - this->minDuration = minDurationArg < 0 ? durationArg : minDurationArg; - this->maxDuration = (maxDurationArg < 0 || maxDurationArg < minDurationArg) ? durationArg : maxDurationArg; - // assert(this->minDuration <= this->maxDuration); // not ensured by the previous lines - this->myLastSwitch = string2time(OptionsCont::getOptions().getString("begin")); // SUMOTime-option - this->nextPhases = nextPhasesArg; - this->name = nameArg; - } - - void init(SUMOTime durationArg, const std::string& stateArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, - SUMOTime vehextArg, SUMOTime yellowArg, SUMOTime redArg, const std::vector nextPhasesArg, const std::string& nameArg) { - init(durationArg, stateArg, minDurationArg, maxDurationArg, nextPhasesArg, nameArg); - this->vehext = vehextArg; - this->yellow = yellowArg; - this->red = redArg; - } - - void init(SUMOTime durationArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, const std::string& stateArg, - const std::vector& nextPhasesArg, const std::string& nameArg, std::vector* targetLaneSetArg) { - init(durationArg, stateArg, minDurationArg, maxDurationArg, nextPhasesArg, nameArg); - //For SOTL target phases - if (targetLaneSetArg != nullptr) { - this->myTargetLaneSet = *targetLaneSetArg; - } - } +private: + /// @brief The phase definition + std::string myState; public: - /** @brief Constructor - * - * minDuration and maxDuration are set to duration. - * - * @param[in] durationArg The duration of the phase - * @param[in] stateArg The state in the phase - */ - MSPhaseDefinition(SUMOTime durationArg, const std::string& stateArg, const std::vector& nextPhases, const std::string& name = "") { - init(durationArg, stateArg, durationArg, durationArg, nextPhases, name); - } - + /** @brief Constructor **/ + MSPhaseDefinition(SUMOTime _duration, const std::string& state, const std::string& _name = ""): + duration(_duration), + lastDuration(UNSPECIFIED_DURATION), + minDuration(duration), + maxDuration(duration), + earliestEnd(UNSPECIFIED_DURATION), + latestEnd(UNSPECIFIED_DURATION), + myLastSwitch(UNSPECIFIED_DURATION), + myLastEnd(UNSPECIFIED_DURATION), + name(_name), + yellow(UNSPECIFIED_DURATION), + red(UNSPECIFIED_DURATION), + vehext(UNSPECIFIED_DURATION), + myTransientNotDecisional(false), + myCommit(false), + myUndefined(false), + myState(state) + {} - /** @brief Constructor - * In this phase the duration is constrained between min and max duration - * @param[in] durationArg The duration of the phase - * @param[in] stateArg The state in the phase - * @param[in] minDurationArg The minimum duration of the phase - * @param[in] maxDurationArg The maximum duration of the phase - */ - MSPhaseDefinition(SUMOTime durationArg, const std::string& stateArg, SUMOTime minDurationArg = -1, SUMOTime maxDurationArg = -1, - const std::vector& nextPhases = std::vector(), const std::string& name = "") { - init(durationArg, stateArg, minDurationArg, maxDurationArg, nextPhases, name); - } - - /** @brief Constructor - * In this phase the duration is constrained between min and max duration - * @param[in] durationArg The duration of the phase - * @param[in] stateArg The state in the phase - * @param[in] minDurationArg The minimum duration of the phase - * @param[in] maxDurationArg The maximum duration of the phase - */ - MSPhaseDefinition(SUMOTime durationArg, const std::string& stateArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, - SUMOTime vehextTime, SUMOTime redTime, SUMOTime yellowTime, - const std::vector& nextPhases = std::vector(), const std::string& name = "") { - init(durationArg, stateArg, minDurationArg, maxDurationArg, vehextTime, yellowTime, redTime, nextPhases, name); - } - - /* - * @brief Constructor for definitions for SOTL target step - * In this phase the duration is constrained between min and max duration - * @param[in] phaseType Indicates the type of the step - * @param[in] targetLaneSet If not null, specifies this MSPhaseDefinition is a target step - * @see MSPhaseDefinition::PhaseType - */ - MSPhaseDefinition(SUMOTime durationArg, const std::string& stateArg, SUMOTime minDurationArg, SUMOTime maxDurationArg, - const std::vector& nextPhases, const std::string& name, bool transient_notdecisional, bool commit, - std::vector* targetLaneSetArg = nullptr) : - myTransientNotDecisional(transient_notdecisional), myCommit(commit), myUndefined(false) { - if (targetLaneSetArg != nullptr && targetLaneSetArg->size() == 0) { - MsgHandler::getErrorInstance()->inform("MSPhaseDefinition::MSPhaseDefinition -> targetLaneSetArg cannot be empty for a target phase"); - } - init(durationArg, minDurationArg, maxDurationArg, stateArg, nextPhases, name, targetLaneSetArg); - } /// @brief Destructor virtual ~MSPhaseDefinition() { } @@ -243,6 +201,9 @@ return (LinkState) myState[pos]; } + inline bool isActuted() const { + return minDuration != maxDuration; + } /** @brief Comparison operator * @@ -251,7 +212,7 @@ * @return Whether the given phase definition differs */ bool operator!=(const MSPhaseDefinition& pd) { - return myState != pd.myState; + return myState != pd.myState || name != pd.name; } diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.cpp sumo-1.12.0/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ @@ -34,10 +34,10 @@ // member method definitions // =========================================================================== MSPhasedTrafficLightLogic::MSPhasedTrafficLightLogic(MSTLLogicControl& tlcontrol, - const std::string& id, const std::string& programID, const TrafficLightType logicType, const Phases& phases, + const std::string& id, const std::string& programID, const SUMOTime offset, const TrafficLightType logicType, const Phases& phases, int step, SUMOTime delay, const std::map& parameters) - : MSTrafficLightLogic(tlcontrol, id, programID, logicType, delay, parameters), myPhases(phases), + : MSTrafficLightLogic(tlcontrol, id, programID, offset, logicType, delay, parameters), myPhases(phases), myStep(step) { for (int i = 0; i < (int)myPhases.size(); i++) { myDefaultCycleTime += myPhases[i]->duration; diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.h sumo-1.12.0/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.h --- sumo-1.11.0/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ @@ -54,6 +54,7 @@ */ MSPhasedTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, + const SUMOTime offset, const TrafficLightType logicType, const Phases& phases, int step, SUMOTime delay, const std::map& parameters); diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSPushButton.cpp sumo-1.12.0/src/microsim/traffic_lights/MSPushButton.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSPushButton.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSPushButton.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSPushButton.h sumo-1.12.0/src/microsim/traffic_lights/MSPushButton.h --- sumo-1.11.0/src/microsim/traffic_lights/MSPushButton.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSPushButton.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSRailCrossing.cpp sumo-1.12.0/src/microsim/traffic_lights/MSRailCrossing.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSRailCrossing.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSRailCrossing.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -41,7 +41,7 @@ MSRailCrossing::MSRailCrossing(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, SUMOTime delay, const std::map& parameters) : - MSSimpleTrafficLightLogic(tlcontrol, id, programID, TrafficLightType::RAIL_CROSSING, Phases(), 0, delay, parameters) { + MSSimpleTrafficLightLogic(tlcontrol, id, programID, 0, TrafficLightType::RAIL_CROSSING, Phases(), 0, delay, parameters) { // dummy phase, used to avoid crashing in MSTrafficLightLogic::setTrafficLightSignals() myPhases.push_back(new MSPhaseDefinition(1, std::string(SUMO_MAX_CONNECTIONS, 'X'))); myDefaultCycleTime = 1; diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSRailCrossing.h sumo-1.12.0/src/microsim/traffic_lights/MSRailCrossing.h --- sumo-1.11.0/src/microsim/traffic_lights/MSRailCrossing.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSRailCrossing.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSRailSignalConstraint.cpp sumo-1.12.0/src/microsim/traffic_lights/MSRailSignalConstraint.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSRailSignalConstraint.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSRailSignalConstraint.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSRailSignalConstraint.h sumo-1.12.0/src/microsim/traffic_lights/MSRailSignalConstraint.h --- sumo-1.11.0/src/microsim/traffic_lights/MSRailSignalConstraint.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSRailSignalConstraint.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSRailSignalControl.cpp sumo-1.12.0/src/microsim/traffic_lights/MSRailSignalControl.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSRailSignalControl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSRailSignalControl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSRailSignalControl.h sumo-1.12.0/src/microsim/traffic_lights/MSRailSignalControl.h --- sumo-1.11.0/src/microsim/traffic_lights/MSRailSignalControl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSRailSignalControl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSRailSignal.cpp sumo-1.12.0/src/microsim/traffic_lights/MSRailSignal.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSRailSignal.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSRailSignal.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -94,8 +94,8 @@ MSRailSignal::MSRailSignal(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, SUMOTime delay, const std::map& parameters) : - MSTrafficLightLogic(tlcontrol, id, programID, TrafficLightType::RAIL_SIGNAL, delay, parameters), - myCurrentPhase(DELTA_T, std::string(SUMO_MAX_CONNECTIONS, 'X'), -1), // dummy phase + MSTrafficLightLogic(tlcontrol, id, programID, 0, TrafficLightType::RAIL_SIGNAL, delay, parameters), + myCurrentPhase(DELTA_T, std::string(SUMO_MAX_CONNECTIONS, 'X')), // dummy phase myPhaseIndex(0) { myDefaultCycleTime = DELTA_T; myMovingBlock = OptionsCont::getOptions().getBool("railsignal-moving-block"); diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSRailSignal.h sumo-1.12.0/src/microsim/traffic_lights/MSRailSignal.h --- sumo-1.11.0/src/microsim/traffic_lights/MSRailSignal.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSRailSignal.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -28,8 +28,10 @@ #include #include #include +#include #include #include +#include #include "MSTLLogicControl.h" #include "MSTrafficLightLogic.h" #include "MSSimpleTrafficLightLogic.h" @@ -39,14 +41,30 @@ // member method definitions // =========================================================================== MSSimpleTrafficLightLogic::MSSimpleTrafficLightLogic(MSTLLogicControl& tlcontrol, - const std::string& id, const std::string& programID, const TrafficLightType logicType, const Phases& phases, + const std::string& id, const std::string& programID, const SUMOTime offset, const TrafficLightType logicType, const Phases& phases, int step, SUMOTime delay, const std::map& parameters) : - MSTrafficLightLogic(tlcontrol, id, programID, logicType, delay, parameters), + MSTrafficLightLogic(tlcontrol, id, programID, offset, logicType, delay, parameters), myPhases(phases), myStep(step) { - for (int i = 0; i < (int)myPhases.size(); i++) { - myDefaultCycleTime += myPhases[i]->duration; + for (const MSPhaseDefinition* phase : myPhases) { + myDefaultCycleTime += phase->duration; + } + if (myStep < (int)myPhases.size()) { + myPhases[myStep]->myLastSwitch = SIMSTEP; + } + // the following initializations are only used by 'actuated' and 'delay_based' but do not affect 'static' + if (knowsParameter(toString(SUMO_ATTR_CYCLETIME))) { + myDefaultCycleTime = TIME2STEPS(StringUtils::toDouble(getParameter(toString(SUMO_ATTR_CYCLETIME), ""))); + } + myCoordinated = StringUtils::toBool(getParameter("coordinated", "false")); + if (myPhases.size() > 0) { + SUMOTime earliest = SIMSTEP + getEarliest(-1); + if (earliest > getNextSwitchTime()) { + mySwitchCommand->deschedule(this); + mySwitchCommand = new SwitchCommand(tlcontrol, this, earliest); + MSNet::getInstance()->getBeginOfTimestepEvents()->addEvent(mySwitchCommand, earliest); + } } } @@ -181,6 +199,66 @@ } +SUMOTime +MSSimpleTrafficLightLogic::mapTimeInCycle(SUMOTime t) const { + return (myCoordinated + ? (t - myOffset) % myDefaultCycleTime + : (t - myPhases[0]->myLastSwitch) % myDefaultCycleTime); +} + + + + +SUMOTime +MSSimpleTrafficLightLogic::getEarliest(SUMOTime prevStart) const { + SUMOTime earliest = getCurrentPhaseDef().earliestEnd; + if (earliest == MSPhaseDefinition::UNSPECIFIED_DURATION) { + return 0; + } else { + if (prevStart >= SIMSTEP - getTimeInCycle()) { + // phase was started and ended once already in the current cycle + // it should not end a second time in the same cycle + earliest += myDefaultCycleTime; + //std::cout << SIMTIME << " tl=" << getID() << " getEarliest phase=" << myStep << " started Twice - move into next cycle\n"; + } else { + SUMOTime latest = getCurrentPhaseDef().latestEnd; + if (latest != MSPhaseDefinition::UNSPECIFIED_DURATION) { + const SUMOTime minEnd = getTimeInCycle() + getCurrentPhaseDef().minDuration; + if (latest > earliest && latest < minEnd) { + // cannot terminate phase between earliest and latest -> move end into next cycle + earliest += myDefaultCycleTime; + } else if (latest < earliest && latest >= minEnd) { + // can ignore earliest since it counts from the previous cycle + earliest -= myDefaultCycleTime; + } + //std::cout << SIMTIME << " tl=" << getID() << " getEarliest phase=" << myStep << " latest=" << STEPS2TIME(latest) << " minEnd=" << STEPS2TIME(minEnd) << " earliest=" << STEPS2TIME(earliest) << "\n"; + } + } + const SUMOTime maxRemaining = getCurrentPhaseDef().maxDuration - (SIMSTEP - getCurrentPhaseDef().myLastSwitch); + return MIN2(earliest - getTimeInCycle(), maxRemaining); + } +} + + +SUMOTime +MSSimpleTrafficLightLogic::getLatest() const { + const SUMOTime latest = getCurrentPhaseDef().latestEnd; + if (latest == MSPhaseDefinition::UNSPECIFIED_DURATION) { + return SUMOTime_MAX; // no restriction + } else { + if (latest < myPhases[myStep]->earliestEnd) { + const SUMOTime running = SIMSTEP - getCurrentPhaseDef().myLastSwitch; + if (running < getTimeInCycle()) { + // phase was started in the current cycle so the restriction does not apply yet + return SUMOTime_MAX; + } + } + return MAX2(SUMOTime(0), latest - getTimeInCycle()); + } +} + + + // ------------ Changing phases and phase durations void MSSimpleTrafficLightLogic::changeStepAndDuration(MSTLLogicControl& tlcontrol, diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.h sumo-1.12.0/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -55,6 +55,7 @@ * @param[in] tlcontrol The tls control responsible for this tls * @param[in] id This tls' id * @param[in] programID This tls' sub-id (program id) + * @param[in] offset the time offset of the program * @param[in] logicType This tls' type (static, actuated etc.) * @param[in] delay The time to wait before the first switch * @param[in] phases Definitions of the phases @@ -64,6 +65,7 @@ */ MSSimpleTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, + const SUMOTime offset, const TrafficLightType logicType, const Phases& phases, int step, SUMOTime delay, const std::map& parameters); @@ -194,6 +196,17 @@ */ virtual void saveState(OutputDevice& /*out*/) const; + virtual SUMOTime mapTimeInCycle(SUMOTime t) const; + +protected: + + /// @brief the minimum duration for keeping the current phase when considering 'earliestEnd' + SUMOTime getEarliest(SUMOTime prevStart) const; + + /// @brief the maximum duratin for keeping the current phase when considering 'latestEnd' + SUMOTime getLatest() const; + + protected: /// @brief The list of phases this logic uses Phases myPhases; @@ -201,6 +214,9 @@ /// @brief The current step int myStep; + /// @brief whether coordination parameters earliestEnd, latestEnd are + //compared to absolute simulation time or timeInCycle + bool myCoordinated; private: /// @brief frees memory responsibilities diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLCongestionPolicy.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLCongestionPolicy.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLCongestionPolicy.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLCongestionPolicy.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLCongestionPolicy.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLCongestionPolicy.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLCongestionPolicy.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLCongestionPolicy.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLDefinitions.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLDefinitions.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLDefinitions.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLDefinitions.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLE2Sensors.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLE2Sensors.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLE2Sensors.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLE2Sensors.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLE2Sensors.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLE2Sensors.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLE2Sensors.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLE2Sensors.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLHiLevelTrafficLightLogic.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLHiLevelTrafficLightLogic.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLHiLevelTrafficLightLogic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLHiLevelTrafficLightLogic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLHiLevelTrafficLightLogic.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLHiLevelTrafficLightLogic.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLHiLevelTrafficLightLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLHiLevelTrafficLightLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLMarchingPolicy.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLMarchingPolicy.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLMarchingPolicy.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLMarchingPolicy.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLMarchingPolicy.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLMarchingPolicy.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLMarchingPolicy.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLMarchingPolicy.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPhasePolicy.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPhasePolicy.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPhasePolicy.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPhasePolicy.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPhasePolicy.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPhasePolicy.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPhasePolicy.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPhasePolicy.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPlatoonPolicy.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPlatoonPolicy.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPlatoonPolicy.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPlatoonPolicy.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPlatoonPolicy.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPlatoonPolicy.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPlatoonPolicy.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPlatoonPolicy.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy3DStimulus.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy3DStimulus.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy3DStimulus.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy3DStimulus.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy3DStimulus.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy3DStimulus.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy3DStimulus.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy3DStimulus.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy5DStimulus.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy5DStimulus.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy5DStimulus.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy5DStimulus.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy5DStimulus.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy5DStimulus.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy5DStimulus.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy5DStimulus.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicyBasedTrafficLightLogic.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicyBasedTrafficLightLogic.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicyBasedTrafficLightLogic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicyBasedTrafficLightLogic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicyBasedTrafficLightLogic.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicyBasedTrafficLightLogic.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicyBasedTrafficLightLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicyBasedTrafficLightLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicyDesirability.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicyDesirability.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicyDesirability.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicyDesirability.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicyDesirability.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicyDesirability.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicyDesirability.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicyDesirability.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLPolicy.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLPolicy.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLRequestPolicy.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLRequestPolicy.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLRequestPolicy.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLRequestPolicy.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLRequestPolicy.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLRequestPolicy.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLRequestPolicy.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLRequestPolicy.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLSensors.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLSensors.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLSensors.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLSensors.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLSensors.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLSensors.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLSensors.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLSensors.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLTrafficLightLogic.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLTrafficLightLogic.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLTrafficLightLogic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLTrafficLightLogic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ @@ -39,7 +39,7 @@ int step, SUMOTime delay, const std::map& parameters) - : MSPhasedTrafficLightLogic(tlcontrol, id, programID, logicType, phases, step, delay, parameters) { + : MSPhasedTrafficLightLogic(tlcontrol, id, programID, 0, logicType, phases, step, delay, parameters) { this->mySensors = nullptr; this->myCountSensors = nullptr; sensorsSelfBuilt = true; @@ -58,7 +58,7 @@ SUMOTime delay, const std::map& parameters, MSSOTLSensors* sensors) - : MSPhasedTrafficLightLogic(tlcontrol, id, programID, logicType, phases, step, delay, parameters) { + : MSPhasedTrafficLightLogic(tlcontrol, id, programID, 0, logicType, phases, step, delay, parameters) { this->mySensors = sensors; sensorsSelfBuilt = false; checkPhases(); @@ -327,7 +327,7 @@ #ifdef SWARM_DEBUG SUMOTime step = MSNet::getInstance()->getCurrentTimeStep(); std::ostringstream threshold_str; - // threshold_str <<"\tTL " +getID()<<" time " +time2string(step)<< "(getThreshold()= " << getThreshold() + // threshold_str <<"\tTL " +getID()<<" time=" +time2string(step)<< "(getThreshold()= " << getThreshold() // << ", targetPhaseCTS= " << iterator->second << " )" << " phase="<first).getState(); threshold_str << getCurrentPhaseDef().getState() << ";" << time2string(step) << ";" << getThreshold() << ";" << iterator->second << ";" << getPhase(iterator->first).getState() << ";" diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLTrafficLightLogic.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLTrafficLightLogic.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLTrafficLightLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLTrafficLightLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.h sumo-1.12.0/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.cpp sumo-1.12.0/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ @@ -717,7 +717,7 @@ SUMOTime step = MSNet::getInstance()->getCurrentTimeStep(); std::ostringstream phero_str; phero_str << " (pheroIn= " << pheroIn << " ,pheroOut= " << pheroOut << " )"; - WRITE_MESSAGE("TL " + getID() + " time " + time2string(step) + " Policy: " + newPolicy->getName() + phero_str.str() + " OldPolicy: " + oldPolicy->getName() + " id " + getID() + " ."); + WRITE_MESSAGE("TL " + getID() + " time=" + time2string(step) + " Policy: " + newPolicy->getName() + phero_str.str() + " OldPolicy: " + oldPolicy->getName() + " id " + getID() + " ."); #endif if (oldPolicy->getName().compare("Congestion") == 0) { congestion_steps = 0; @@ -727,7 +727,7 @@ std::ostringstream phero_str; phero_str << " (pheroIn= " << pheroIn << " ,pheroOut= " << pheroOut << " )"; SUMOTime step = MSNet::getInstance()->getCurrentTimeStep(); - WRITE_MESSAGE("TL " + getID() + " time " + time2string(step) + " Policy: Nochanges" + phero_str.str() + " OldPolicy: " + oldPolicy->getName() + " id " + getID() + " ."); + WRITE_MESSAGE("TL " + getID() + " time=" + time2string(step) + " Policy: Nochanges" + phero_str.str() + " OldPolicy: " + oldPolicy->getName() + " id " + getID() + " ."); #endif } diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.h sumo-1.12.0/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.h --- sumo-1.11.0/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSTLLogicControl.cpp sumo-1.12.0/src/microsim/traffic_lights/MSTLLogicControl.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSTLLogicControl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSTLLogicControl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -172,16 +172,16 @@ // build only once... MSTrafficLightLogic* logic = getLogic(TRACI_PROGRAM); if (logic == nullptr) { - MSPhaseDefinition* phase = new MSPhaseDefinition(DELTA_T, state, -1); + MSPhaseDefinition* phase = new MSPhaseDefinition(DELTA_T, state); std::vector phases; phases.push_back(phase); - logic = new MSSimpleTrafficLightLogic(tlc, myCurrentProgram->getID(), TRACI_PROGRAM, TrafficLightType::STATIC, phases, 0, + logic = new MSSimpleTrafficLightLogic(tlc, myCurrentProgram->getID(), TRACI_PROGRAM, 0, TrafficLightType::STATIC, phases, 0, MSNet::getInstance()->getCurrentTimeStep() + DELTA_T, std::map()); addLogic(TRACI_PROGRAM, logic, true, true); MSNet::getInstance()->createTLWrapper(logic); } else { - MSPhaseDefinition nphase(DELTA_T, state, -1); + MSPhaseDefinition nphase(DELTA_T, state); *(dynamic_cast(logic)->getPhases()[0]) = nphase; switchTo(tlc, TRACI_PROGRAM); } diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSTLLogicControl.h sumo-1.12.0/src/microsim/traffic_lights/MSTLLogicControl.h --- sumo-1.11.0/src/microsim/traffic_lights/MSTLLogicControl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSTLLogicControl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSTrafficLightLogic.cpp sumo-1.12.0/src/microsim/traffic_lights/MSTrafficLightLogic.cpp --- sumo-1.11.0/src/microsim/traffic_lights/MSTrafficLightLogic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSTrafficLightLogic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,6 +32,7 @@ #include #include #include +#include #include "MSTLLogicControl.h" #include "MSTrafficLightLogic.h" @@ -107,10 +108,11 @@ * member method definitions * ----------------------------------------------------------------------- */ MSTrafficLightLogic::MSTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id, - const std::string& programID, const TrafficLightType logicType, const SUMOTime delay, + const std::string& programID, const SUMOTime offset, const TrafficLightType logicType, const SUMOTime delay, const std::map& parameters) : Named(id), Parameterised(parameters), myProgramID(programID), + myOffset(offset), myLogicType(logicType), myCurrentDurationIncrement(-1), myDefaultCycleTime(0), @@ -234,7 +236,7 @@ const int logicSize = logic->getLogicSize(); std::vector tlIndex; for (int u = 0; u < logicSize; u++) { - const MSLogicJunction::LinkBits& response = logic->getResponseFor(u); + const MSLogicJunction::LinkBits& response = logic->getResponseFor(u); for (int v = 0; v < logicSize; v++) { if (response.test(v)) { if (logic->getResponseFor(v).test(u)) { @@ -442,7 +444,7 @@ for (int k = 0; k < (int)myLinks[j].size(); ++k) { MSLink* link = myLinks[j][k]; MSEdge& edge = link->getLaneBefore()->getEdge(); - const MSNet::MesoEdgeType& edgeType = MSNet::getInstance()->getMesoType(edge.getEdgeType()); + const MESegment::MesoEdgeType& edgeType = MSNet::getInstance()->getMesoType(edge.getEdgeType()); double greenFraction = (durationSeconds - totalRedDuration[j]) / durationSeconds; if (edgeType.tlsFlowPenalty == 0) { greenFraction = 1; @@ -475,6 +477,17 @@ myIgnoredIndices.insert(pos); } +SUMOTime +MSTrafficLightLogic::getTimeInCycle() const { + return mapTimeInCycle(SIMSTEP); +} + + +SUMOTime +MSTrafficLightLogic::mapTimeInCycle(SUMOTime t) const { + return (t - myOffset) % myDefaultCycleTime; +} + bool MSTrafficLightLogic::isSelected() const { diff -Nru sumo-1.11.0/src/microsim/traffic_lights/MSTrafficLightLogic.h sumo-1.12.0/src/microsim/traffic_lights/MSTrafficLightLogic.h --- sumo-1.11.0/src/microsim/traffic_lights/MSTrafficLightLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/MSTrafficLightLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -40,6 +40,7 @@ class MSNet; class MSLink; class MSTLLogicControl; +class MSDetectorFileOutput; class NLDetectorBuilder; @@ -80,6 +81,7 @@ * @param[in] tlcontrol The tls control responsible for this tls * @param[in] id This tls' id * @param[in] programID This tls' sub-id (program id) + * @param[in] offset the time offset of the program * @param[in] logicType This tls' type (static, actuated etc.) * @param[in] delay The time to wait before the first switch * @param[in] parameters Additional parameters (especially for actuated logics) @@ -87,6 +89,7 @@ MSTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, + const SUMOTime offset, const TrafficLightType logicType, const SUMOTime delay, const std::map& parameters); @@ -272,6 +275,12 @@ return myDefaultCycleTime; } + /// @brief return time within the current cycle + SUMOTime getTimeInCycle() const; + + /// @brief map the given time into the current cycle + virtual SUMOTime mapTimeInCycle(SUMOTime t) const; + /// @brief return the number of controlled link indices int getNumLinks() const { return myNumLinks; @@ -318,6 +327,9 @@ /// @} + SUMOTime getOffset() const { + return myOffset; + } /// @name Changing phases and phase durations /// @{ @@ -356,6 +368,17 @@ /// @brief whether the given link index ever turns 'G' virtual bool getsMajorGreen(int linkIndex) const; + + /// @brief return activation state of all detectors that affect this traffic light + virtual std::map getDetectorStates() const { + return std::map(); + } + + /// @brief return all named conditions defined for this traffic light + virtual std::map getConditions() const { + return std::map(); + } + /// @brief return vehicles that block the intersection/rail signal for vehicles that wish to pass the given linkIndex virtual VehicleVector getBlockingVehicles(int linkIndex) { UNUSED_PARAMETER(linkIndex); @@ -458,6 +481,9 @@ /// @brief The id of the logic const std::string myProgramID; + /// @brief the offset parameter of the current program + SUMOTime myOffset; + /// @brief The type of the logic const TrafficLightType myLogicType; diff -Nru sumo-1.11.0/src/microsim/traffic_lights/NEMAController.cpp sumo-1.12.0/src/microsim/traffic_lights/NEMAController.cpp --- sumo-1.11.0/src/microsim/traffic_lights/NEMAController.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/NEMAController.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -46,35 +46,72 @@ #define INVALID_POSITION std::numeric_limits::max() // tl added -//#define DEBUG_NEMA +// #define DEBUG_NEMA // =========================================================================== // method definitions // =========================================================================== NEMALogic::NEMALogic(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, + const SUMOTime _offset, const Phases& phases, - int step, SUMOTime delay, + int /*step*/, SUMOTime /*delay*/, const std::map& parameter, const std::string& basePath) : - MSSimpleTrafficLightLogic(tlcontrol, id, programID, TrafficLightType::NEMA, phases, step, delay, parameter), + MSSimpleTrafficLightLogic(tlcontrol, id, programID, _offset, TrafficLightType::NEMA, phases, 0, phases.front()->minDuration + SIMSTEP, parameter), myPhase(phases[0]->duration, phases[0]->getState()) { myDetectorLength = StringUtils::toDouble(getParameter("detector-length", "20")); myDetectorLengthLeftTurnLane = StringUtils::toDouble(getParameter("detector-length-leftTurnLane", "20")); - myCycleLength = (StringUtils::toDouble(getParameter("total-cycle-length", "60"))); + myCycleLength = (StringUtils::toDouble(getParameter("total-cycle-length", getParameter("cycle-length", getParameter(toString(SUMO_ATTR_CYCLETIME), "60"))))); myNextCycleLength = myCycleLength; + myDefaultCycleTime = TIME2STEPS(myCycleLength); myShowDetectors = StringUtils::toBool(getParameter("show-detectors", toString(OptionsCont::getOptions().getBool("tls.actuated.show-detectors")))); myFile = FileHelpers::checkForRelativity(getParameter("file", "NUL"), basePath); myFreq = TIME2STEPS(StringUtils::toDouble(getParameter("freq", "300"))); myVehicleTypes = getParameter("vTypes", ""); ring1 = getParameter("ring1", ""); ring2 = getParameter("ring2", ""); + + std::vector VecMinRecall = readParaFromString(getParameter("minRecall", "1,2,3,4,5,6,7,8")); + for (int i = 0; i < (int)VecMinRecall.size(); i++) { + minRecalls[VecMinRecall[i] - 1] = true; + recall[VecMinRecall[i] - 1] = true; + } + + std::vector VecMaxRecall = readParaFromString(getParameter("maxRecall", "")); + for (int i = 0; i < (int)VecMaxRecall.size(); i++) { + maxRecalls[VecMaxRecall[i] - 1] = true; + recall[VecMaxRecall[i] - 1] = true; + } + +#ifdef DEBUG_NEMA + std::cout << "minRecall: "; + for (int i = 0; i < 8; i++) { + std::cout << minRecalls[i] << '\t'; + } + std::cout << std::endl; + + std::cout << "maxRecall: "; + for (int i = 0; i < 8; i++) { + std::cout << maxRecalls[i] << '\t'; + } + std::cout << std::endl; +#endif barriers = getParameter("barrierPhases", ""); - coordinates = getParameter("coordinatePhases", ""); - offset = (StringUtils::toDouble(getParameter("offset", "0"))); + coordinates = getParameter("coordinatePhases", getParameter("barrier2Phases", "")); + fixForceOff = StringUtils::toBool(getParameter("fixForceOff", "false")); + offset = STEPS2TIME(_offset); myNextOffset = offset; whetherOutputState = StringUtils::toBool(getParameter("whetherOutputState", "false")); coordinateMode = StringUtils::toBool(getParameter("coordinate-mode", "false")); + greenTransfer = StringUtils::toBool(getParameter("greenTransfer", "true")); + + //missing parameter error + error_handle_not_set(ring1, "ring1"); + error_handle_not_set(ring2, "ring2"); + error_handle_not_set(barriers, "barrierPhases"); + error_handle_not_set(coordinates, "barrier2Phases or coordinatePhases"); + //print to check #ifdef DEBUG_NEMA std::cout << "JunctionID = " << myID << std::endl; @@ -87,10 +124,33 @@ std::cout << "coordinates = " << coordinates << std::endl; std::cout << "offset = " << offset << std::endl; std::cout << "whetherOutputState = " << whetherOutputState << std::endl; + std::cout << "myShowDetectors = " << myShowDetectors << std::endl; std::cout << "coordinateMode = " << coordinateMode << std::endl; + std::cout << "fixForceOff = " << fixForceOff << std::endl; + std::cout << "greenTransfer = " << greenTransfer << std::endl; std::cout << "You reach the end of constructor" << std::endl; std::cout << "****************************************\n"; #endif + + // construct the phaseDetectorMapping. In the future this could hold more parameters, such as lock in time or delay + for (auto p : readParaFromString(ring1)) { + // #TODO clean up this string mess + std::string cps = "crossPhaseSwitching:"; + int crossPhase = StringUtils::toInt(getParameter(cps.append(std::to_string(p)), "0")); + phase2DetectorMap[p] = phaseDetectorInfo(crossPhase); + } + for (auto p : readParaFromString(ring2)) { + std::string cps = "crossPhaseSwitching:"; + int crossPhase = StringUtils::toInt(getParameter(cps.append(std::to_string(p)), "0")); + phase2DetectorMap[p] = phaseDetectorInfo(crossPhase); + } + // Construct the Cross Mapping + for (auto const& phaseDetectInfo : phase2DetectorMap) { + if (phaseDetectInfo.second.cpdSource > 0) { + phase2DetectorMap.find(phaseDetectInfo.second.cpdSource) -> second.cpdTarget = phaseDetectInfo.first; + } + } + } NEMALogic::~NEMALogic() { } @@ -147,6 +207,7 @@ #endif } + #ifdef DEBUG_NEMA //print to check the phase2ControllerLanesMap for (auto item : phase2ControllerLanesMap) { @@ -164,6 +225,7 @@ rings.push_back(readParaFromString(ring2)); + #ifdef DEBUG_NEMA //print to check for (int i = 0; i < (int)rings.size(); i++) { @@ -192,8 +254,9 @@ for (int i = 0; (int)rings[0].size(); i++) { if (rings[0][i] != 0) { - // std::cout << i << std::endl; - // std::cout << "rings[0][i] = " << rings[0][i] << std::endl; +#ifdef DEBUG_NEMA + std::cout << "rings[0][" << i << "] = " << rings[0][i] << std::endl; +#endif activeRing1Index = i; activeRing1Phase = rings[0][activeRing1Index]; break; @@ -201,13 +264,95 @@ } for (int i = 0; (int)rings[1].size(); i++) { if (rings[1][i] != 0) { - // std::cout << i << std::endl; - // std::cout << "rings[0][i] = " << rings[1][i] << std::endl; +#ifdef DEBUG_NEMA + std::cout << "rings[1][" << i << "] = " << rings[1][i] << std::endl; +#endif activeRing2Index = i; activeRing2Phase = rings[1][activeRing2Index]; break; } } + int initialIndexRing [2] = { activeRing1Index, activeRing2Index}; + // calculate force offs + for (int ringNumber = 0; ringNumber < 2; ringNumber++) { + int length = (int)rings[ringNumber].size(); + int aPhaseNumber = rings[ringNumber][initialIndexRing[ringNumber]]; + int aPhaseIndex = aPhaseNumber - 1; + int nPhaseIndex = aPhaseIndex; //next phase + int nPhaseNumber = aPhaseNumber; + forceOffs[aPhaseNumber - 1] = maxGreen[aPhaseNumber - 1]; + +#ifdef DEBUG_NEMA + std::cout << "Phase " << aPhaseNumber << ": force off " << forceOffs[aPhaseNumber - 1] << std::endl; +#endif + for (int i = initialIndexRing[ringNumber] + 1; i < length; i++) { + nPhaseNumber = rings[ringNumber][i]; + nPhaseIndex = nPhaseNumber - 1; + // std::cout <<" ring "<getCurrentTimeStep(); + double currentTimeInSecond = STEPS2TIME(now); + double currentInCycleTime = ModeCycle(currentTimeInSecond - cycleRefPoint - offset, myCycleLength); + + // find the initial phases + for (int ringNumber = 0; ringNumber < 2; ringNumber++) { + int length = (int)rings[ringNumber].size(); + int aPhaseIndex = -1; + bool found = false; + for (int i = initialIndexRing[ringNumber]; i < length; i++) { + aPhaseIndex = rings[ringNumber][i] - 1; + if (aPhaseIndex != -1) { + if (currentInCycleTime < phaseCutOffs[aPhaseIndex]) { +#ifdef DEBUG_NEMA + std::cout << "current in cycle time=" << currentInCycleTime << " phase: " << aPhaseIndex << std::endl; +#endif + found = true; + break; + } + } + } + if (!found) { + aPhaseIndex = rings[ringNumber][initialIndexRing[ringNumber]] - 1; // if the break didn't get triggered, go back to the beginning. + } +#ifdef DEBUG_NEMA + std::cout << "current in cycle time=" << currentInCycleTime << " ring " << ringNumber << " aphase: " << aPhaseIndex + 1 << std::endl; +#endif + if (ringNumber == 0) { + activeRing1Index = aPhaseIndex; + activeRing1Phase = activeRing1Index + 1; + } else { + activeRing2Index = aPhaseIndex; + activeRing2Phase = activeRing2Index + 1; + } + } + + #ifdef DEBUG_NEMA //print to check the rings and barriers active phase @@ -307,14 +452,14 @@ detector = myLaneDetectorMap[lane]; detectors.push_back(detector); } - phase2DetectorMap[NEMAPhaseIndex] = detectors; + phase2DetectorMap.find(NEMAPhaseIndex) -> second.detectors = detectors; } #ifdef DEBUG_NEMA // print to check phase2DetectorMap std::cout << "Print to check phase2DetectorMap" << std::endl; for (auto item : phase2DetectorMap) { std::cout << "The NEMA phase index = " << item.first << " has detectors: \n"; - for (auto det : item.second) { + for (auto det : item.second.detectors) { std::cout << '\t' << det->getID() << std::endl; } } @@ -322,11 +467,16 @@ R1State = activeRing1Phase; R2State = activeRing2Phase; + + // set the next phase to current for initialization + myNextPhaseR1 = R1State; + myNextPhaseR2 = R2State; + // std::cout << "After init, R1State = " << R1State << std::endl; // std::cout << "After init, R2State = " << R2State << std::endl; - R1RYG = 1; - R2RYG = 1; + R1RYG = GREEN; + R2RYG = GREEN; wait4R1Green = false; wait4R2Green = false; @@ -337,11 +487,17 @@ r1coordinatePhase = coordinatePhaseIndecies[0]; r2coordinatePhase = coordinatePhaseIndecies[1]; + // Create the barrier to phase mapping; + constructBarrierMap(0, myRingBarrierMapping[0]); + constructBarrierMap(1, myRingBarrierMapping[1]); + + #ifdef DEBUG_NEMA std::cout << "After init, r1/r2 barrier phase = " << r1barrier << " and " << r2barrier << std::endl; std::cout << "After init, r1/r2 coordinate phase = " << r1coordinatePhase << " and " << r2coordinatePhase << std::endl; #endif + currentState = ""; // currentR1State = myPhases[R1State - 1]->getState(); // currentR2State = myPhases[R2State - 1]->getState(); @@ -393,8 +549,7 @@ for (const MSPhaseDefinition* phase : myPhases) { const int phaseIndex = (int)myDetectorForPhase.size(); std::set detectors; - if (phase->minDuration != phase->maxDuration) { - //actuated phase + if (phase->isActuted()) { const std::string& state = phase->getState(); std::set greenLinks; std::map> detectorLinks; @@ -472,15 +627,72 @@ WRITE_WARNINGF("At NEMA tlLogic '%, linkIndex % has no controlling detector", getID(), toString(i)); } } + + std::string state1 = transitionState(currentR1State, GREEN); + std::string state2 = transitionState(currentR2State, GREEN); + myPhase.setState(combineStates(state1, state2)); myPhase.setName(toString(activeRing1Phase) + "+" + toString(activeRing2Phase)); + + //validating timing + validate_timing(); #ifdef DEBUG_NEMA //std::cout << "reach the end of init()\n"; #endif } +void +NEMALogic::validate_timing() { + const bool ignoreErrors = StringUtils::toBool(getParameter("ignore-errors", "false")); + //check cycle length + for (int ringIndex = 0; ringIndex <= 1; ringIndex++) { + int lastPhasePositionIndex = (int)rings[ringIndex].size() - 1; + int lastPhase = rings[ringIndex][lastPhasePositionIndex]; + if (lastPhase == 0) { //should be enough + lastPhase = rings[ringIndex][lastPhasePositionIndex - 1]; + } + int lastPhaseIndex = lastPhase - 1; + double cycleLengthCalculated = forceOffs[lastPhaseIndex] + yellowTime[lastPhaseIndex] + redTime[lastPhaseIndex]; + if (coordinateMode && cycleLengthCalculated != myCycleLength) { + int ringNumber = ringIndex + 1; + const std::string error = "At NEMA tlLogic '" + getID() + "', Ring " + toString(ringNumber) + " does not add to cycle length."; + if (ignoreErrors) { + WRITE_WARNING(error); + } else { + throw ProcessError(error); + } + } + } + // check barriers + double ring1barrier1_length = forceOffs[r1barrier - 1] + yellowTime[r1barrier - 1] + redTime[r1barrier - 1]; + double ring2barrier1_length = forceOffs[r2barrier - 1] + yellowTime[r2barrier - 1] + redTime[r2barrier - 1]; + if (ring1barrier1_length != ring2barrier1_length) { + const std::string error = "At NEMA tlLogic '" + getID() + "', the phases before barrier 1 from both rings do not add up. (ring1=" + + toString(ring1barrier1_length) + ", ring2=" + toString(ring2barrier1_length) + ")"; + if (coordinateMode && !ignoreErrors) { + throw ProcessError(error); + } else { + WRITE_WARNING(error); + } + } + double ring1barrier2_length = forceOffs[r2coordinatePhase - 1] + yellowTime[r2coordinatePhase - 1] + redTime[r2coordinatePhase - 1]; + double ring2barrier2_length = forceOffs[r1coordinatePhase - 1] + yellowTime[r1coordinatePhase - 1] + redTime[r1coordinatePhase - 1]; + if (ring1barrier2_length != ring2barrier2_length) { + const std::string error = "At NEMA tlLogic '" + getID() + "', the phases before barrier 2 from both rings do not add up. (ring1=" + + toString(ring1barrier2_length) + ", ring2=" + toString(ring2barrier2_length) + ")"; + if (coordinateMode && !ignoreErrors) { + throw ProcessError(error); + } else { + WRITE_WARNING(error); + } + } + // no offset for non coordinated + if (!coordinateMode && offset != 0) { + WRITE_WARNINGF("NEMA tlLogic '%' is not coordinated but an offset was set.", getID()); + } +} -void +void NEMALogic::setNewSplits(std::vector newSplits) { assert(newSplits.size() == 8); for (int i = 0; i < 8; i++) { @@ -489,7 +701,7 @@ } -void +void NEMALogic::setNewMaxGreens(std::vector newMaxGreens) { for (int i = 0; i < 8; i++) { nextMaxGreen[i] = newMaxGreens[i]; @@ -497,7 +709,7 @@ } -void +void NEMALogic::setNewCycleLength(double newCycleLength) { myNextCycleLength = newCycleLength; } @@ -541,18 +753,27 @@ std::string NEMALogic::combineStates(std::string state1, std::string state2) { std::string output = ""; if (state1.size() != state2.size()) { - throw ProcessError("Different sizes of NEMA phase states. Please check the NEMA XML"); + throw ProcessError("At NEMA tlLogic '" + getID() + "', different sizes of NEMA phase states. Please check the NEMA XML"); } for (int i = 0; i < (int)state1.size(); i++) { char ch1 = state1[i]; char ch2 = state2[i]; + // check through this order. 'G' overwrite 'g'. if (ch1 == 'G' || ch2 == 'G') { output += 'G'; } else if (ch1 == 'g' || ch2 == 'g') { output += 'g'; + } else if (ch1 == 's' || ch2 == 's') { + output += 's'; } else if (ch1 == 'y' || ch2 == 'y') { output += 'y'; + } else if (ch1 == 'u' || ch2 == 'u') { + output += 'u'; + } else if (ch1 == 'O' || ch2 == 'O') { + output += 'O'; + } else if (ch1 == 'o' || ch2 == 'o') { + output += 'o'; } else { output += 'r'; } @@ -560,17 +781,40 @@ return output; } -bool NEMALogic::isDetectorActivated(int phaseIndex) { - - for (auto det : phase2DetectorMap.find(phaseIndex)->second) { - if (det->getCurrentVehicleNumber() > 0) { - return true; +bool NEMALogic::isDetectorActivated(int phaseNumber, int depth = 0) const { + if (phase2DetectorMap.find(phaseNumber) == phase2DetectorMap.end()) { + return false; + } else { + auto const& detectInfo = phase2DetectorMap.find(phaseNumber)->second; + if ((phaseNumber != R1State) && (phaseNumber != R2State) && depth < 1) { + // If I am not the active phase & my target is an active phase, don't report when I am called for my own phase + if ((detectInfo.cpdTarget == R1State && R1RYG >= GREEN) || (detectInfo.cpdTarget == R2State && R2RYG >= GREEN)) { + return false; + } + } + for (auto det : detectInfo.detectors) { + if (det->getCurrentVehicleNumber() > 0) { + return true; + } + } + if (detectInfo.cpdSource > 0 && depth < 1) { + return isDetectorActivated(detectInfo.cpdSource, depth + 1); } + return false; } +} - return false; + +std::map +NEMALogic::getDetectorStates() const { + std::map result; + for (auto item : myDetectorLaneMap) { + result[item.first->getID()] = item.first->getCurrentVehicleNumber(); + } + return result; } + const MSPhaseDefinition& NEMALogic::getCurrentPhaseDef() const { return myPhase; @@ -585,7 +829,7 @@ myStep = 1 - myStep; } //std::cout << SIMTIME << " " << myPhase.getState() << "\n"; - return TIME2STEPS(1); + return TIME2STEPS(TS); } @@ -595,28 +839,60 @@ //controller starts SUMOTime now = MSNet::getInstance()->getCurrentTimeStep(); double currentTimeInSecond = STEPS2TIME(now); + +#ifdef DEBUG_NEMA + //print to check + //I didn't use getTimeInCycle(). This is because the cycle reference point may change in the future. + double currentInCycleTime = ModeCycle(currentTimeInSecond - cycleRefPoint - offset, myCycleLength); + std::cout << "current time in cycle:\t" << currentInCycleTime << "\t" << "phases: " << R1State << '\t' << R2State << std::endl; +#endif //int R1Phase = activeRing1Phase; int R1Phase = R1State; int R1Index = R1Phase - 1; double durationR1 = currentTimeInSecond - phaseStartTime[R1Index]; + double phaseStartTimeInCycleR1 = ModeCycle(phaseStartTime[R1Index] - cycleRefPoint - offset, myCycleLength); //ensure minGreen for each phase - phaseExpectedDuration[R1Index] = MAX2(phaseExpectedDuration[R1Index], minGreen[R1Index]); - if (R1Phase != r1coordinatePhase) { + if (maxRecalls[R1Index]) { + phaseExpectedDuration[R1Index] = maxGreen[R1Index]; + } else { + phaseExpectedDuration[R1Index] = MAX2(phaseExpectedDuration[R1Index], minGreen[R1Index]); + } + if (((R1Phase != r1coordinatePhase) || (vehExt[R1Index] > 0 && !coordinateMode)) && (R1RYG == GREEN || R1RYG == GREENREST)) { if (isDetectorActivated(R1Phase)) { phaseExpectedDuration[R1Index] = MAX2(phaseExpectedDuration[R1Index], durationR1 + vehExt[R1Index]); - phaseExpectedDuration[R1Index] = MIN2(phaseExpectedDuration[R1Index], maxGreen[R1Index]); + if (fixForceOff) { + phaseExpectedDuration[R1Index] = MIN2(phaseExpectedDuration[R1Index], ModeCycle(forceOffs[R1Index] - phaseStartTimeInCycleR1, myCycleLength)); +#ifdef DEBUG_NEMA + std::cout << "R1 phase " << R1State << " forceOff " << forceOffs[R1Index] << "\tphase start " << phaseStartTimeInCycleR1 << std::endl; +#endif + } else { + phaseExpectedDuration[R1Index] = MIN2(phaseExpectedDuration[R1Index], maxGreen[R1Index]); + } } } int R2Phase = R2State; int R2Index = R2Phase - 1; double durationR2 = currentTimeInSecond - phaseStartTime[R2Index]; - phaseExpectedDuration[R2Index] = MAX2(phaseExpectedDuration[R2Index], minGreen[R2Index]); - if (R2Phase != r2coordinatePhase && R2Phase >= 5) { + double phaseStartTimeInCycleR2 = ModeCycle(phaseStartTime[R2Index] - cycleRefPoint - offset, myCycleLength); + + if (maxRecalls[R2Index]) { + phaseExpectedDuration[R2Index] = maxGreen[R2Index]; + } else { + phaseExpectedDuration[R2Index] = MAX2(phaseExpectedDuration[R2Index], minGreen[R2Index]); + } + if ((((R2Phase != r2coordinatePhase && R2Phase >= 5) || ((R2Phase >= 5 && vehExt[R2Index] > 0) && !coordinateMode)) && (R2RYG == GREEN || R2RYG == GREENREST))) { if (isDetectorActivated(R2Phase)) { phaseExpectedDuration[R2Index] = MAX2(phaseExpectedDuration[R2Index], durationR2 + vehExt[R2Index]); - phaseExpectedDuration[R2Index] = MIN2(phaseExpectedDuration[R2Index], maxGreen[R2Index]); + if (fixForceOff) { + phaseExpectedDuration[R2Index] = MIN2(phaseExpectedDuration[R2Index], ModeCycle(forceOffs[R2Index] - phaseStartTimeInCycleR2, myCycleLength)); +#ifdef DEBUG_NEMA + std::cout << "R2 phase " << R1State << " forceOff " << forceOffs[R2Index] << "\tphase start " << phaseStartTimeInCycleR2 << std::endl; +#endif + } else { + phaseExpectedDuration[R2Index] = MIN2(phaseExpectedDuration[R2Index], maxGreen[R2Index]); + } } } @@ -628,38 +904,128 @@ if (durationR2 >= phaseExpectedDuration[R2Index]) { EndCurrentPhaseR2 = true; } + // Green rest can always transition, even if it is at the barrier if (EndCurrentPhaseR1 && (R1Phase == r1barrier)) { - if (!(EndCurrentPhaseR2 && R2Phase == r2barrier)) { - //update expectedDuration + if ((!EndCurrentPhaseR2 || R2RYG < GREEN) && R1RYG != GREENREST) { EndCurrentPhaseR1 = false; } } if (EndCurrentPhaseR1 && (R1Phase == r1coordinatePhase)) { - if (!EndCurrentPhaseR2 || R2Phase != r2coordinatePhase) { + if ((!EndCurrentPhaseR2 || R2RYG < GREEN) && R1RYG != GREENREST) { EndCurrentPhaseR1 = false; } } if (EndCurrentPhaseR2 && (R2Phase == r2barrier)) { - if (!EndCurrentPhaseR1 || R1Phase != r1barrier) { + if ((!EndCurrentPhaseR1 || R1RYG < GREEN) && R2RYG != GREENREST) { EndCurrentPhaseR2 = false; } } if (EndCurrentPhaseR2 && (R2Phase == r2coordinatePhase)) { - if (!EndCurrentPhaseR1 || R1Phase != r1coordinatePhase) { + if ((!EndCurrentPhaseR1 || R1RYG < GREEN) && R2RYG != GREENREST) { EndCurrentPhaseR2 = false; } } + + // Falling Edge of Green if (EndCurrentPhaseR1 && (!wait4R1Green)) { phaseEndTimeR1 = currentTimeInSecond; phaseExpectedDuration[R1Index] = 0; wait4R1Green = true; } + if (EndCurrentPhaseR2 && (!wait4R2Green)) { + phaseEndTimeR2 = currentTimeInSecond; + phaseExpectedDuration[R2Index] = 0; + wait4R2Green = true; + } + + // Logic for Green Rest & Green Transfer + // This requires a detector check. It should only be entered when the lights are green + // This logic doesn't need to enter at all if in coordinated mode and greenTransfer is disabled + if (((EndCurrentPhaseR1 && R1RYG >= GREEN) || (EndCurrentPhaseR2 && R2RYG >= GREEN)) && (!coordinateMode || greenTransfer)) { + // Calculate the potential next phases. + // Have to do it here and below because the "final" traffic light check is at the end of yellow + int tempR1Phase; + int tempR2Phase; + // Get the next phases, with the first option being staying in the current phase + std::tie(tempR1Phase, tempR2Phase) = getNextPhases(R1Phase, R2Phase, wait4R1Green, wait4R2Green, true); + // entry point to green rest. First check detector status, then determine if this should be up next. + // Green rest is effectively the same as being perpetually past the minimum green timer but not changing + if ((tempR1Phase == R1Phase && EndCurrentPhaseR1) && (tempR2Phase == R2Phase && EndCurrentPhaseR2) && !coordinateMode) { + // mark that the phases are not desired to end + EndCurrentPhaseR1 = false; + EndCurrentPhaseR2 = false; + wait4R1Green = false; + wait4R2Green = false; + // Timing update. This logic should be checked the next step, so only add the simulation timestep. + // Potential that this needs to be extended in the future. + phaseEndTimeR1 += TS; + phaseEndTimeR2 += TS; + // setting the phase start time to current time - the minimum timer + // will still allow the phase to be extended with vehicle detection + phaseStartTime[R1Index] = currentTimeInSecond - minGreen[R1Index]; + phaseStartTime[R2Index] = currentTimeInSecond - minGreen[R2Index]; + + // Set my state to Green Rest + R1RYG = GREENREST; + R2RYG = GREENREST; + + } else if (tempR1Phase == R1Phase && EndCurrentPhaseR1 && greenTransfer) { + // This is the logic for green transfer on Ring 1 + // Green transfer occurs when current phase should end but there isn't a better one to go to, + // even though the other phase might be transitioning + if (!EndCurrentPhaseR2 || (tempR2Phase != R2Phase)) { + EndCurrentPhaseR1 = false; + wait4R1Green = false; + phaseEndTimeR1 += TS; + if ((R1Phase == r1barrier || R1Phase == r1coordinatePhase) && R1RYG != GREENREST) { + // If the "green transfer" is at the barrier, it can't actually move until the other phase is done + phaseEndTimeR1 = currentTimeInSecond + phaseExpectedDuration[tempR2Phase - 1]; + phaseExpectedDuration[R1Index] = phaseExpectedDuration[tempR2Phase - 1]; + } + R1RYG = R1RYG == GREENREST ? GREENREST : GREENTRANSFER; + } + } else if (tempR2Phase == R2Phase && EndCurrentPhaseR2 && greenTransfer) { + if (!EndCurrentPhaseR1 || (tempR1Phase != R1Phase)) { + // This is the logic for green transfer on Ring 2 + EndCurrentPhaseR2 = false; + wait4R2Green = false; + phaseEndTimeR2 += TS; + if ((R2Phase == r2barrier || R2Phase == r2coordinatePhase) && R2RYG != GREENREST) { + // If the "green transfer" is at the barrier, it can't actually move until the other phase is done + phaseEndTimeR2 = currentTimeInSecond + phaseExpectedDuration[tempR1Phase - 1]; + phaseExpectedDuration[R2Index] = phaseExpectedDuration[tempR1Phase - 1]; + } + R2RYG = R2RYG == GREENREST ? GREENREST : GREENTRANSFER; + } + } + } + + + // Calculate the next phase with knowledge of both rings + // Next Phase should be calculated on the falling edge of yellow + bool calculate = false; + if (wait4R1Green || wait4R2Green) { + if ((currentTimeInSecond - phaseEndTimeR1 >= yellowTime[R1Index]) && (R1RYG == YELLOW)) { + R1RYG = RED; //red + calculate = true; + } + if ((currentTimeInSecond - phaseEndTimeR2 >= yellowTime[R2Index]) && (R2RYG == YELLOW)) { + R2RYG = RED; //red + calculate = true; + } + if (calculate) { + std::tie(myNextPhaseR1, myNextPhaseR2) = getNextPhases(R1Phase, R2Phase, wait4R1Green, wait4R2Green); + } + } + //enter transtion phase for Ring1 if (wait4R1Green) { if (currentTimeInSecond - phaseEndTimeR1 < yellowTime[R1Index]) { - R1RYG = 0; //yellow + // Not removing this if statement for clarity on the transition timing + R1RYG = YELLOW; //yellow } else if (currentTimeInSecond - phaseEndTimeR1 < (yellowTime[R1Index] + redTime[R1Index])) { - R1RYG = -1; //red + R1RYG = RED; //red + // TODO: remove the 0.5 (it has timing issues with <1 timesteps) bool toUpdate = (currentTimeInSecond - phaseEndTimeR1) < yellowTime[R1Index] + 0.5; if (R1Phase == r1coordinatePhase && toUpdate) { for (int i = 0; i < 8; i++) { @@ -671,9 +1037,10 @@ } else { //next phase //time 10 R1Phase = 4. Checked - R1Phase = nextPhase(rings[0], R1Phase); + // R1Phase = nextPhase(rings[0], R1Phase); + R1Phase = myNextPhaseR1; //offset control not included for now - R1RYG = 1; //green + R1RYG = GREEN; //green //update phaseStartTime phaseStartTime[R1Phase - 1] = currentTimeInSecond; @@ -686,26 +1053,25 @@ wait4R1Green = false; } } - //Enter transition phase in Ring2 - if (EndCurrentPhaseR2 && (!wait4R2Green)) { - phaseEndTimeR2 = currentTimeInSecond; - phaseExpectedDuration[R2Index] = 0; - wait4R2Green = true; - } + if (wait4R2Green) { if ((currentTimeInSecond - phaseEndTimeR2) < yellowTime[R2Index]) { - R2RYG = 0; + R2RYG = YELLOW; } else if ((currentTimeInSecond - phaseEndTimeR2) < (yellowTime[R2Index] + redTime[R2Index])) { - R2RYG = -1; + R2RYG = RED; } else { - R2Phase = nextPhase(rings[1], R2Phase); - R2RYG = 1; + R2Phase = myNextPhaseR2; + // R2Phase = nextPhase(rings[1], R2Phase); + R2RYG = GREEN; //update phaseStartTime phaseStartTime[R2Phase - 1] = currentTimeInSecond; R2State = R2Phase; if (R2Phase == r2coordinatePhase) { if (coordinateMode) { phaseExpectedDuration[R2Phase - 1] = ModeCycle(myCycleLength - (currentTimeInSecond - cycleRefPoint - offset) - yellowTime[R2Phase - 1] - redTime[R2Phase - 1], myCycleLength); +#ifdef DEBUG_NEMA + std::cout << "R2 phase " << R1Phase << " is coordinated and has an expected duration of " << phaseExpectedDuration[R1Phase - 1] << std::endl; +#endif } } @@ -747,30 +1113,114 @@ return outputState; } -int NEMALogic::nextPhase(std::vector ring, int currentPhase) { - +int NEMALogic::nextPhase(std::vector ring, int currentPhase, int& distance, bool sameAllowed) { int length = (int)ring.size(); int flag = 0; int nphase = 0; // next phase - for (int i = 0; i < length * 2; i++) { + int i = 0; // i represents the distance + int matching_i = 0; + for (i = 0; i < length * 2; i++) { if (flag == 1) { if (ring[i % length] != 0) { - nphase = ring[i % length]; - break; + int tempPhase = ring[i % length]; + if (recall[tempPhase - 1] || isDetectorActivated(tempPhase)) { + nphase = tempPhase; + break; + } + +#ifdef DEBUG_NEMA + else { + std::cout << "phase " << tempPhase << " was skipped" << std::endl; + } +#endif } } if (ring[i % length] == currentPhase) { flag = 1; + matching_i = i; + } + } + if (nphase != 0) { + distance = i; + return nphase; + } else { + // this should only occur in the subset + if (sameAllowed) { + distance = i; + return ring[matching_i % length]; + } else { + distance = i + 1; + return ring[(matching_i + 1) % length]; + } + } +} + + +void NEMALogic::constructBarrierMap(int ring, std::vector>& barrierMap) { + int flag = 0; + std::vector barrierOne; + std::vector barrierTwo; + for (int localPhase : rings[ring]) { + if (!flag) { + barrierOne.push_back(localPhase); + if (((localPhase == r1coordinatePhase || localPhase == r1barrier) && ring == 0) || ((localPhase == r2coordinatePhase || localPhase == r2barrier) && ring == 1)) { + flag = 1; + }; + } else { + barrierTwo.push_back(localPhase); + } + }; + barrierMap.push_back(barrierOne); + barrierMap.push_back(barrierTwo); +} + +int NEMALogic::findBarrier(int phase, int ring) { + int barrier = 0; + for (int localPhase : myRingBarrierMapping[ring][1]) { + if (phase == localPhase) { + barrier = 1; + break; } } - return nphase; + return barrier; +} + +std::tuple NEMALogic::getNextPhases(int R1Phase, int R2Phase, bool toUpdateR1, bool toUpdateR2, bool stayOk) { + // Only 1 or both can be !toUpdate (otherwise we wouldn't be in this situation) + int nextR1Phase = R1Phase; + int nextR2Phase = R2Phase; + if (!toUpdateR1) { + int r1BarrierNum = findBarrier(R1Phase, 0); + int d = 0; + nextR2Phase = nextPhase(myRingBarrierMapping[1][r1BarrierNum], R2Phase, d, stayOk); + // If we aren't updating both, the search range is only the subset of values on the same side of the barrier; + } else if (!toUpdateR2) { + int r2BarrierNum = findBarrier(R2Phase, 1); + int d = 0; + nextR1Phase = nextPhase(myRingBarrierMapping[0][r2BarrierNum], R1Phase, d, stayOk); + } else { + // Both can be updated. We should take the change requiring the least distance travelled around the loop, + // and then recalculate the other ring if it is not in the same barrier + int r1Distance = 0; + int r2Distance = 0; + nextR1Phase = nextPhase(rings[0], R1Phase, r1Distance, stayOk); + nextR2Phase = nextPhase(rings[1], R2Phase, r2Distance, stayOk); + int r1Barrier = findBarrier(nextR1Phase, 0); + int r2Barrier = findBarrier(nextR2Phase, 1); + if ((r1Distance <= r2Distance) && (r1Barrier != r2Barrier)) { + nextR2Phase = nextPhase(myRingBarrierMapping[1][r1Barrier], R2Phase, r2Distance, stayOk); + } else if ((r1Distance > r2Distance) && (r1Barrier != r2Barrier)) { + nextR1Phase = nextPhase(myRingBarrierMapping[0][r2Barrier], R1Phase, r1Distance, stayOk); + }; + }; + return std::make_tuple(nextR1Phase, nextR2Phase); } //b should be the base of mode double NEMALogic::ModeCycle(double a, double b) { double c = a - b; - while (c > b) { + while (c >= b) { c = c - b; } while (c < 0) { //should be minimum green (or may be not) @@ -781,11 +1231,11 @@ std::string NEMALogic::transitionState(std::string curState, int RYG) { std::string newState = ""; - if (RYG == 1) { + if (RYG >= GREEN) { //Green newState = curState; - } else if (RYG == -1) { + } else if (RYG == RED) { // red for (char ch : curState) { UNUSED_PARAMETER(ch); @@ -876,6 +1326,26 @@ return ret; } + +const std::string +NEMALogic::getParameter(const std::string& key, const std::string defaultValue) const { + if (StringUtils::startsWith(key, "NEMA.")) { + if (key == "NEMA.phaseCall") { + std::string out_str = std::to_string(isDetectorActivated(1)); + for (int i = 2; i <= 8; i++) { + out_str += ","; + out_str += std::to_string(isDetectorActivated(i)); + } + return out_str; + } else { + throw InvalidArgument("Unsupported parameter '" + key + "' for NEMA controller '" + getID() + "'"); + } + } else { + return Parameterised::getParameter(key, defaultValue); + } +} + + void NEMALogic::setParameter(const std::string& key, const std::string& value) { if (StringUtils::startsWith(key, "NEMA.")) { @@ -904,3 +1374,10 @@ } Parameterised::setParameter(key, value); } + +void +NEMALogic::error_handle_not_set(std::string param_variable, std::string param_name) { + if (param_variable == "") { + throw InvalidArgument("Please set " + param_name + " for NEMA tlLogic '" + getID() + "'"); + } +} diff -Nru sumo-1.11.0/src/microsim/traffic_lights/NEMAController.h sumo-1.12.0/src/microsim/traffic_lights/NEMAController.h --- sumo-1.11.0/src/microsim/traffic_lights/NEMAController.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/traffic_lights/NEMAController.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -52,7 +52,7 @@ typedef std::map LaneDetectorMap; /// @brief Definition of a map from detectors to corresponding lanes - typedef std::map DetectorLaneMap; + typedef std::map DetectorLaneMap; /** @brief Constructor * @param[in] tlcontrol The tls control responsible for this tls @@ -65,6 +65,7 @@ */ NEMALogic(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, + const SUMOTime offset, const MSSimpleTrafficLightLogic::Phases& phases, int step, SUMOTime delay, const std::map& parameter, @@ -75,13 +76,13 @@ * @param[in] nb The detector builder * @exception ProcessError If something fails on initialisation */ - void init(NLDetectorBuilder& nb); + void init(NLDetectorBuilder& nb) override; /// @brief Destructor ~NEMALogic(); - SUMOTime trySwitch(); + SUMOTime trySwitch() override; /// @name Dynamic Information Retrieval /// @{ @@ -89,12 +90,12 @@ /** @brief Returns the definition of the current phase * @return The current phase */ - const MSPhaseDefinition& getCurrentPhaseDef() const; + const MSPhaseDefinition& getCurrentPhaseDef() const override; /// @} /// @brief called when switching programs - void activateProgram(); - void deactivateProgram(); + void activateProgram() override; + void deactivateProgram() override; bool showDetectors() const { return myShowDetectors; @@ -102,18 +103,27 @@ void setShowDetectors(bool show); - std::map>* getPhase2DetectorMap() { - return &phase2DetectorMap; + std::map> getPhase2DetectorMap() { + std::map> temp; + for (auto const& detectInfo : phase2DetectorMap) { + temp[detectInfo.first] = detectInfo.second.detectors; + } + return temp; } + /// @brief retrieve all detectors used by this program + std::map getDetectorStates() const override; + // control logic std::string NEMA_control(); std::string combineStates(std::string state1, std::string state2); - bool isDetectorActivated(int phaseIndex); + bool isDetectorActivated(int phaseNumber, int depth) const; + + int nextPhase(std::vector ring, int phaseNum, int& distance, bool sameAllowed); - int nextPhase(std::vector ring, int currentPhase); + std::tuple getNextPhases(int currentR1Index, int currentR2Index, bool toUpdateR1, bool toUpdateR2, bool stayOk = false); double ModeCycle(double a, double b); @@ -145,7 +155,10 @@ } /// @brief try to set the given parameter. Parameters prefixed with 'NEMA.' control functionality - void setParameter(const std::string& key, const std::string& value) override; + void setParameter(const std::string& key, const std::string& value) override; + + /// @brief try to get the value of the given parameter. Parameters prefixed with 'NEMA.' control functionality + const std::string getParameter(const std::string& key, const std::string defaultValue = "") const override; protected: // create a small datatype for mapping detector to phase index @@ -164,6 +177,15 @@ typedef std::vector> detectorMap; + // Light Head State + enum lightState { + YELLOW = 0, + RED = 1, + GREEN = 2, + GREENTRANSFER = 3, + GREENREST = 4, + }; + /// @brief return whether there is a major link from the given lane in the given phase bool hasMajor(const std::string& state, const LaneVector& lanes) const; /// @} @@ -179,7 +201,7 @@ //convert "1" to int 1 int string2int(std::string s); -// protected: + // protected: detectorMap myDetectorForPhase; std::vector myDetectorInfoVector; @@ -234,6 +256,41 @@ std::vector barrierPhaseIndecies; std::vector coordinatePhaseIndecies; + /* + This serves as a mapping to speed up phaseSelection + { + {{3, 4}, {1, 2}}, + {{7, 8}, {5, 6}} + } + */ + std::vector> myRingBarrierMapping[2]; + + // Creating a small extensible datatype for including information about the phase's detectors + // this is different than DetectorInfo, as it is per-phase not per-detector. + // Purpose is that when we check detectors, we may need to have per-detector settings handy + struct phaseDetectorInfo { + phaseDetectorInfo(): + detectors(), + cpdTarget(), + cpdSource() + {} + phaseDetectorInfo(int _cross_phase_source): + cpdSource(_cross_phase_source) + {} + std::vector detectors = {nullptr}; + int cpdTarget = 0; + int cpdSource = 0; + }; + + // myNextPhase needs to be presevered in memory because the phase is calculated at start of yellow + // but not implementend until the end of red + int myNextPhaseR1; + int myNextPhaseR2; + + bool minRecalls[8] {}; + bool maxRecalls[8] {}; + bool recall[8] {}; + // std::vector> barriers; //init 0 and then 1,2,3,0 //redundant need to remove @@ -249,13 +306,15 @@ /* { - {1 : {det1, det2 ...}}, - {2 : {det3}}, - ... - {8 : {...}} + {1 : phaseDetectorInfo{ + detectors: {det1, det2, ...}, + crossPhaseDetector: 6 + }, + }, + {2 : ... } */ - std::map> phase2DetectorMap; + std::map phase2DetectorMap; double minGreen[8] {}; double maxGreen[8] {}; @@ -264,11 +323,15 @@ double yellowTime[8] {}; double redTime[8] {}; double phaseStartTime[8] {}; + double forceOffs[8] {}; + double phaseCutOffs[8] {}; double phaseExpectedDuration[8] {}; + bool fixForceOff; + double phaseEndTimeR1, phaseEndTimeR2; bool wait4R1Green, wait4R2Green; - int R1RYG, R2RYG; + lightState R1RYG, R2RYG; double cycleRefPoint;// missing update //activeR1phase int R1State, R2State; @@ -292,4 +355,14 @@ /// @brief virtual phase that holds the current state MSPhaseDefinition myPhase; + /// helps to construct myRingBarrierMapping + void constructBarrierMap(int ring, std::vector>& barrierMap); + int findBarrier(int desiredPhase, int ring); + + // Green Transfer Option + bool greenTransfer; + + // handle error + void error_handle_not_set(std::string param_variable, std::string param_name); + void validate_timing(); }; diff -Nru sumo-1.11.0/src/microsim/transportables/MSPerson.cpp sumo-1.12.0/src/microsim/transportables/MSPerson.cpp --- sumo-1.11.0/src/microsim/transportables/MSPerson.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSPerson.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -223,13 +223,13 @@ } MSDevice_Tripinfo::addPedestrianData(distance, duration, timeLoss); os.openTag("walk"); - os.writeAttr("depart", time2string(myDeparted)); + os.writeAttr("depart", myDeparted >= 0 ? time2string(myDeparted) : "-1"); os.writeAttr("departPos", myDepartPos); os.writeAttr("arrival", myArrived >= 0 ? time2string(myArrived) : "-1"); - os.writeAttr("arrivalPos", myArrivalPos); + os.writeAttr("arrivalPos", myArrived >= 0 ? toString(myArrivalPos) : "-1"); os.writeAttr("duration", myDeparted < 0 ? "-1" : time2string(myArrived >= 0 ? duration : MSNet::getInstance()->getCurrentTimeStep() - myDeparted)); - os.writeAttr("routeLength", distance); + os.writeAttr("routeLength", myArrived >= 0 ? toString(distance) : "-1"); os.writeAttr("timeLoss", time2string(timeLoss)); os.writeAttr("maxSpeed", maxSpeed); os.closeTag(); @@ -452,7 +452,10 @@ bool MSPerson::checkAccess(const MSStage* const prior, const bool waitAtStop) { - MSStoppingPlace* const prevStop = prior->getDestinationStop(); + MSStoppingPlace* prevStop = prior->getDestinationStop(); + if (!waitAtStop && prior->getStageType() == MSStageType::TRIP) { + prevStop = dynamic_cast(prior)->getOriginStop(); + } if (prevStop != nullptr) { if (waitAtStop) { const double accessDist = prevStop->getAccessDistance(prior->getDestination()); @@ -462,12 +465,10 @@ return true; } } else { - if (prior->getStageType() != MSStageType::TRIP) { - const double accessDist = prevStop->getAccessDistance((*myStep)->getFromEdge()); - if (accessDist > 0.) { - myStep = myPlan->insert(myStep, new MSPersonStage_Access((*myStep)->getFromEdge(), prevStop, prevStop->getAccessPos((*myStep)->getFromEdge()), accessDist, true)); - return true; - } + const double accessDist = prevStop->getAccessDistance((*myStep)->getFromEdge()); + if (accessDist > 0.) { + myStep = myPlan->insert(myStep, new MSPersonStage_Access((*myStep)->getFromEdge(), prevStop, prevStop->getAccessPos((*myStep)->getFromEdge()), accessDist, true)); + return true; } } } diff -Nru sumo-1.11.0/src/microsim/transportables/MSPerson.h sumo-1.12.0/src/microsim/transportables/MSPerson.h --- sumo-1.11.0/src/microsim/transportables/MSPerson.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSPerson.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/transportables/MSPModel.cpp sumo-1.12.0/src/microsim/transportables/MSPModel.cpp --- sumo-1.11.0/src/microsim/transportables/MSPModel.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSPModel.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/microsim/transportables/MSPModel.h sumo-1.12.0/src/microsim/transportables/MSPModel.h --- sumo-1.11.0/src/microsim/transportables/MSPModel.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSPModel.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/microsim/transportables/MSPModel_NonInteracting.cpp sumo-1.12.0/src/microsim/transportables/MSPModel_NonInteracting.cpp --- sumo-1.11.0/src/microsim/transportables/MSPModel_NonInteracting.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSPModel_NonInteracting.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/microsim/transportables/MSPModel_NonInteracting.h sumo-1.12.0/src/microsim/transportables/MSPModel_NonInteracting.h --- sumo-1.11.0/src/microsim/transportables/MSPModel_NonInteracting.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSPModel_NonInteracting.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/microsim/transportables/MSPModel_Remote.cpp sumo-1.12.0/src/microsim/transportables/MSPModel_Remote.cpp --- sumo-1.11.0/src/microsim/transportables/MSPModel_Remote.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSPModel_Remote.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/microsim/transportables/MSPModel_Remote.h sumo-1.12.0/src/microsim/transportables/MSPModel_Remote.h --- sumo-1.11.0/src/microsim/transportables/MSPModel_Remote.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSPModel_Remote.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/microsim/transportables/MSPModel_Striping.cpp sumo-1.12.0/src/microsim/transportables/MSPModel_Striping.cpp --- sumo-1.11.0/src/microsim/transportables/MSPModel_Striping.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSPModel_Striping.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ @@ -200,6 +200,21 @@ } +MSTransportableStateAdapter* +MSPModel_Striping::loadState(MSTransportable* transportable, MSStageMoving* stage, std::istringstream& in) { + MSPerson* person = static_cast(transportable); + MSNet* net = MSNet::getInstance(); + if (!myAmActive) { + net->getBeginOfTimestepEvents()->addEvent(new MovePedestrians(this), net->getCurrentTimeStep() + DELTA_T); + myAmActive = true; + } + PState* ped = new PState(person, stage, &in); + myActiveLanes[ped->getLane()].push_back(ped); + myNumActivePedestrians++; + return ped; +} + + void MSPModel_Striping::remove(MSTransportableStateAdapter* state) { const MSLane* lane = dynamic_cast(state)->myLane; @@ -373,11 +388,17 @@ for (const MSEdge* in : edge->getPredecessors()) { if (!in->isTazConnector()) { lanes.push_back(getSidewalk(in)); + if (lanes.back() == nullptr) { + throw ProcessError("Invalid connection from edge '" + in->getID() + "' to walkingarea edge '" + edge->getID() + "'"); + } } } for (const MSEdge* out : edge->getSuccessors()) { if (!out->isTazConnector()) { lanes.push_back(getSidewalk(out)); + if (lanes.back() == nullptr) { + throw ProcessError("Invalid connection from walkingarea edge '" + edge->getID() + "' to edge '" + out->getID() + "'"); + } } } // build all combinations @@ -1502,6 +1523,7 @@ myNLI = getNextLane(*this, lane, nullptr); } + MSPModel_Striping::PState::PState(): myPerson(nullptr), myStage(nullptr), @@ -1520,6 +1542,112 @@ } +MSPModel_Striping::PState::PState(MSPerson* person, MSStageMoving* stage, std::istringstream* in): + myPerson(person), + myStage(stage), + myLane(nullptr), + myWalkingAreaPath(nullptr), + myRemoteXYPos(Position::INVALID), + myAngle(std::numeric_limits::max()) { + if (in != nullptr) { + std::string laneID; + std::string wapLaneFrom; + std::string wapLaneTo; + std::string nextLaneID; + std::string nextLinkFrom; + std::string nextLinkTo; + int nextDir; + + (*in) >> laneID + >> myRelX >> myRelY >> myDir >> mySpeed >> mySpeedLat >> myWaitingToEnter >> myWaitingTime + >> wapLaneFrom >> wapLaneTo + >> myAmJammed + >> nextLaneID + >> nextLinkFrom + >> nextLinkTo + >> nextDir; + + + myLane = MSLane::dictionary(laneID); + if (myLane == nullptr) { + throw ProcessError("Unknown lane '" + laneID + "' when loading walk for person '" + myPerson->getID() + "' from state."); + } + + MSLane* nextLane = nullptr; + if (nextLaneID != "null") { + nextLane = MSLane::dictionary(nextLaneID); + if (nextLane == nullptr) { + throw ProcessError("Unknown next lane '" + nextLaneID + "' when loading walk for person '" + myPerson->getID() + "' from state."); + } + } + const MSLink* link = nullptr; + if (nextLinkFrom != "null") { + MSLane* from = MSLane::dictionary(nextLinkFrom); + MSLane* to = MSLane::dictionary(nextLinkTo); + if (from == nullptr) { + throw ProcessError("Unknown link origin lane '" + nextLinkFrom + "' when loading walk for person '" + myPerson->getID() + "' from state."); + } + if (to == nullptr) { + throw ProcessError("Unknown link destination lane '" + nextLinkTo + "' when loading walk for person '" + myPerson->getID() + "' from state."); + } + link = from->getLinkTo(to); + } + myNLI = NextLaneInfo(nextLane, link, nextDir); + + if (wapLaneFrom != "null") { + MSLane* from = MSLane::dictionary(wapLaneFrom); + MSLane* to = MSLane::dictionary(wapLaneFrom); + if (from == nullptr) { + throw ProcessError("Unknown walkingAreaPath origin lane '" + wapLaneFrom + "' when loading walk for person '" + myPerson->getID() + "' from state."); + } + if (to == nullptr) { + throw ProcessError("Unknown walkingAreaPath destination lane '" + wapLaneTo + "' when loading walk for person '" + myPerson->getID() + "' from state."); + } + const auto pathIt = myWalkingAreaPaths.find(std::make_pair(from, to)); + if (pathIt != myWalkingAreaPaths.end()) { + myWalkingAreaPath = &pathIt->second; + } else { + throw ProcessError("Unknown walkingAreaPath from lane '" + wapLaneFrom + "' to lane '" + wapLaneFrom + "' wawhen loading walk for person '" + myPerson->getID() + "' from state."); + } + } + } +} + +void +MSPModel_Striping::PState::saveState(std::ostringstream& out) { + std::string wapLaneFrom = "null"; + std::string wapLaneTo = "null"; + if (myWalkingAreaPath != nullptr) { + wapLaneFrom = myWalkingAreaPath->from->getID(); + wapLaneTo = myWalkingAreaPath->to->getID(); + } + std::string nextLaneID = "null"; + std::string nextLinkFrom = "null"; + std::string nextLinkTo = "null"; + if (myNLI.lane != nullptr) { + nextLaneID = myNLI.lane->getID(); + } + if (myNLI.link != nullptr) { + nextLinkFrom = myNLI.link->getLaneBefore()->getID(); + nextLinkTo = myNLI.link->getViaLaneOrLane()->getID(); + } + out << " " << myLane->getID() + << " " << myRelX + << " " << myRelY + << " " << myDir + << " " << mySpeed + << " " << mySpeedLat + << " " << myWaitingToEnter + << " " << myWaitingTime + << " " << wapLaneFrom + << " " << wapLaneTo + << " " << myAmJammed + << " " << nextLaneID + << " " << nextLinkFrom + << " " << nextLinkTo + << " " << myNLI.dir; +} + double MSPModel_Striping::PState::getMinX(const bool includeMinGap) const { // @todo speed should have an influence here because faster persons need more space @@ -1895,7 +2023,7 @@ // still on the road && stripe() == stripe(myRelY) // only when the vehicle is moving on the same lane - && !myLane->getEdge().isCrossing()) { + && !(myLane->getEdge().isCrossing() || myLane->getEdge().isWalkingArea())) { // step aside to let the vehicle pass int stepAsideDir = myDir; if (myLane->getEdge().getLanes().size() > 1 || current > sMax / 2) { diff -Nru sumo-1.11.0/src/microsim/transportables/MSPModel_Striping.h sumo-1.12.0/src/microsim/transportables/MSPModel_Striping.h --- sumo-1.11.0/src/microsim/transportables/MSPModel_Striping.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSPModel_Striping.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ @@ -63,6 +63,9 @@ /// @brief register the given person as a pedestrian MSTransportableStateAdapter* add(MSTransportable* transportable, MSStageMoving* stage, SUMOTime now); + /// @brief load the state of the given transportable + MSTransportableStateAdapter* loadState(MSTransportable* transportable, MSStageMoving* stage, std::istringstream& in); + /// @brief remove the specified person from the pedestrian simulation void remove(MSTransportableStateAdapter* state); @@ -287,6 +290,8 @@ PState(MSPerson* person, MSStageMoving* stage, const MSLane* lane); + /// @brief constructor for loading state + PState(MSPerson* person, MSStageMoving* stage, std::istringstream* in = nullptr); ~PState() {}; MSPerson* myPerson; @@ -374,6 +379,10 @@ /// @brief whether the person is currently being controlled via TraCI bool isRemoteControlled() const; + /** @brief Saves the current state into the given stream + */ + void saveState(std::ostringstream& out); + protected: /// @brief constructor for PStateVehicle PState(); diff -Nru sumo-1.11.0/src/microsim/transportables/MSStage.cpp sumo-1.12.0/src/microsim/transportables/MSStage.cpp --- sumo-1.11.0/src/microsim/transportables/MSStage.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSStage.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -303,7 +303,9 @@ if (MSGlobals::gUseMesoSim && prevStop != nullptr) { departPos = (prevStop->getBeginLanePosition() + prevStop->getEndLanePosition()) / 2.; } - if (net->getIntermodalRouter(0).compute(myOrigin, myDestination, departPos, myArrivalPos, myDestinationStop == nullptr ? "" : myDestinationStop->getID(), + if (net->getIntermodalRouter(0).compute(myOrigin, myDestination, + departPos, myOriginStop == nullptr ? "" : myOriginStop->getID(), + myArrivalPos, myDestinationStop == nullptr ? "" : myDestinationStop->getID(), transportable->getMaxSpeed() * myWalkFactor, vehicle, myModeSet, time, result)) { for (std::vector::iterator it = result.begin(); it != result.end(); ++it) { if (!it->edges.empty()) { @@ -423,7 +425,8 @@ myWaitingDuration(duration), myWaitingUntil(until), myStopWaitPos(Position::INVALID), - myActType(actType) { + myActType(actType), + myStopEndTime(-1) { } @@ -464,17 +467,17 @@ void MSStageWaiting::proceed(MSNet* net, MSTransportable* transportable, SUMOTime now, MSStage* previous) { myDeparted = now; - const SUMOTime until = MAX3(now, now + myWaitingDuration, myWaitingUntil); + myStopEndTime = MAX3(now, now + myWaitingDuration, myWaitingUntil); if (myDestinationStop != nullptr) { myDestinationStop->addTransportable(transportable); myStopWaitPos = myDestinationStop->getWaitPosition(transportable); } if (dynamic_cast(transportable) != nullptr) { previous->getEdge()->addPerson(transportable); - net->getPersonControl().setWaitEnd(until, transportable); + net->getPersonControl().setWaitEnd(myStopEndTime, transportable); } else { previous->getEdge()->addContainer(transportable); - net->getContainerControl().setWaitEnd(until, transportable); + net->getContainerControl().setWaitEnd(myStopEndTime, transportable); } } @@ -562,6 +565,28 @@ return "stopping at edge '" + getDestination()->getID() + "' " + timeInfo + " (" + myActType + ")"; } +void +MSStageWaiting::saveState(std::ostringstream& out) { + out << " " << myDeparted; +} + +void +MSStageWaiting::loadState(MSTransportable* transportable, std::istringstream& state) { + state >> myDeparted; + const SUMOTime until = MAX3(myDeparted, myDeparted + myWaitingDuration, myWaitingUntil); + if (myDestinationStop != nullptr) { + myDestinationStop->addTransportable(transportable); + myStopWaitPos = myDestinationStop->getWaitPosition(transportable); + } + MSNet* net = MSNet::getInstance(); + if (dynamic_cast(transportable) != nullptr) { + myDestination->addPerson(transportable); + net->getPersonControl().setWaitEnd(until, transportable); + } else { + myDestination->addContainer(transportable); + net->getContainerControl().setWaitEnd(until, transportable); + } +} /* ------------------------------------------------------------------------- * MSStageMoving - methods @@ -575,7 +600,7 @@ if (myCurrentInternalEdge != nullptr) { return myCurrentInternalEdge; } else { - return *myRouteStep; + return myRouteStep == myRoute.end() ? nullptr : *myRouteStep;; } } diff -Nru sumo-1.11.0/src/microsim/transportables/MSStageDriving.cpp sumo-1.12.0/src/microsim/transportables/MSStageDriving.cpp --- sumo-1.11.0/src/microsim/transportables/MSStageDriving.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSStageDriving.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -182,7 +182,7 @@ " stop '" + getDestinationStop()->getID() + "'" + ( getDestinationStop()->getMyName() != "" ? " (" + getDestinationStop()->getMyName() + ")" : "")); const std::string intended = myIntendedVehicleID != "" ? - " (vehicle " + myIntendedVehicleID + " at time " + time2string(myIntendedDepart) + ")" : + " (vehicle " + myIntendedVehicleID + " at time=" + time2string(myIntendedDepart) + ")" : ""; const std::string modeName = isPerson ? "driving" : "transported"; return isWaiting4Vehicle() ? @@ -298,10 +298,10 @@ os.writeAttr("vehicle", myVehicleID); os.writeAttr("depart", myDeparted >= 0 ? time2string(myDeparted) : "-1"); os.writeAttr("arrival", myArrived >= 0 ? time2string(myArrived) : "-1"); - os.writeAttr("arrivalPos", toString(getArrivalPos())); + os.writeAttr("arrivalPos", myArrived >= 0 ? toString(getArrivalPos()) : "-1"); os.writeAttr("duration", myArrived >= 0 ? time2string(duration) : (myDeparted >= 0 ? time2string(now - myDeparted) : "-1")); - os.writeAttr("routeLength", myVehicleDistance); + os.writeAttr("routeLength", myArrived >= 0 || myVehicle != nullptr ? toString(getDistance()) : "-1"); os.writeAttr("timeLoss", myArrived >= 0 ? time2string(myTimeLoss) : "-1"); os.closeTag(); } diff -Nru sumo-1.11.0/src/microsim/transportables/MSStageDriving.h sumo-1.12.0/src/microsim/transportables/MSStageDriving.h --- sumo-1.11.0/src/microsim/transportables/MSStageDriving.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSStageDriving.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/transportables/MSStage.h sumo-1.12.0/src/microsim/transportables/MSStage.h --- sumo-1.11.0/src/microsim/transportables/MSStage.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSStage.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -158,7 +158,7 @@ return false; } - /// @brief Whether the transportable waits for a vehicle + /// @brief Current vehicle in which the transportable is driving (or nullptr) virtual SUMOVehicle* getVehicle() const { return nullptr; } @@ -390,6 +390,10 @@ SUMOTime getUntil() const; SUMOTime getDuration() const; + + SUMOTime getStopEnd() const { + return myStopEndTime; + } /// Position getPosition(SUMOTime now) const; @@ -423,6 +427,10 @@ */ void routeOutput(const bool isPerson, OutputDevice& os, const bool withRouteLength, const MSStage* const previous) const; + void saveState(std::ostringstream& out); + + void loadState(MSTransportable* transportable, std::istringstream& state); + private: /// the time the person is waiting SUMOTime myWaitingDuration; @@ -436,6 +444,9 @@ /// @brief The type of activity std::string myActType; + /// @brief stores the actual end time of the stop (combination of duration and until) + SUMOTime myStopEndTime; + private: /// @brief Invalidated copy constructor. MSStageWaiting(const MSStageWaiting&); @@ -455,7 +466,8 @@ MSStageMoving(const std::vector& route, MSStoppingPlace* toStop, const double speed, const double departPos, const double arrivalPos, const double departPosLat, const int departLane, MSStageType type) : MSStage(route.back(), toStop, arrivalPos, type), - myState(nullptr), myRoute(route), mySpeed(speed), myDepartPos(departPos), + myState(nullptr), myRoute(route), myRouteStep(myRoute.begin()), + mySpeed(speed), myDepartPos(departPos), myDepartPosLat(departPosLat), myDepartLane(departLane) {} /// destructor diff -Nru sumo-1.11.0/src/microsim/transportables/MSStageTranship.cpp sumo-1.12.0/src/microsim/transportables/MSStageTranship.cpp --- sumo-1.11.0/src/microsim/transportables/MSStageTranship.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSStageTranship.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/transportables/MSStageTranship.h sumo-1.12.0/src/microsim/transportables/MSStageTranship.h --- sumo-1.11.0/src/microsim/transportables/MSStageTranship.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSStageTranship.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/transportables/MSTransportableControl.cpp sumo-1.12.0/src/microsim/transportables/MSTransportableControl.cpp --- sumo-1.11.0/src/microsim/transportables/MSTransportableControl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSTransportableControl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -27,15 +27,16 @@ #include #include #include -#include -#include #include #include -#include -#include #include #include #include +#include +#include +#include +#include +#include // =========================================================================== @@ -106,15 +107,23 @@ void MSTransportableControl::erase(MSTransportable* transportable) { - if (OptionsCont::getOptions().isSet("tripinfo-output")) { + const OptionsCont& oc = OptionsCont::getOptions(); + if (oc.isSet("tripinfo-output")) { transportable->tripInfoOutput(OutputDevice::getDeviceByOption("tripinfo-output")); - } else if (OptionsCont::getOptions().getBool("duration-log.statistics")) { + } else if (oc.getBool("duration-log.statistics")) { // collecting statistics is a sideffect OutputDevice_String dev; transportable->tripInfoOutput(dev); } - if (OptionsCont::getOptions().isSet("vehroute-output")) { - transportable->routeOutput(OutputDevice::getDeviceByOption("vehroute-output"), OptionsCont::getOptions().getBool("vehroute-output.route-length")); + if (oc.isSet("vehroute-output")) { + if (oc.getBool("vehroute-output.sorted")) { + OutputDevice_String od(1); + transportable->routeOutput(od, oc.getBool("vehroute-output.route-length")); + MSDevice_Vehroutes::writeSortedOutput(OutputDevice::getDeviceByOption("vehroute-output"), + transportable->getDeparture(), transportable->getID(), od.getString()); + } else { + transportable->routeOutput(OutputDevice::getDeviceByOption("vehroute-output"), oc.getBool("vehroute-output.route-length")); + } } const std::map::iterator i = myTransportables.find(transportable->getID()); if (i != myTransportables.end()) { @@ -155,6 +164,9 @@ myRunningNumber++; MSNet::getInstance()->informTransportableStateListener(t, isPerson ? MSNet::TransportableState::PERSON_DEPARTED : MSNet::TransportableState::CONTAINER_DEPARTED); + if (OptionsCont::getOptions().getBool("vehroute-output.sorted")) { + MSDevice_Vehroutes::registerTransportableDepart(time); + } } else { erase(t); } diff -Nru sumo-1.11.0/src/microsim/transportables/MSTransportableControl.h sumo-1.12.0/src/microsim/transportables/MSTransportableControl.h --- sumo-1.11.0/src/microsim/transportables/MSTransportableControl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSTransportableControl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/transportables/MSTransportable.cpp sumo-1.12.0/src/microsim/transportables/MSTransportable.cpp --- sumo-1.11.0/src/microsim/transportables/MSTransportable.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSTransportable.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -136,6 +136,15 @@ (*myStep)->setDeparted(now); } +SUMOTime +MSTransportable::getDeparture() const { + if (myPlan->size() > 1 && (*myPlan)[1]->getDeparted() >= 0) { + return (*myPlan)[1]->getDeparted(); + } + return -1; +} + + double MSTransportable::getEdgePos() const { return (*myStep)->getEdgePos(MSNet::getInstance()->getCurrentTimeStep()); diff -Nru sumo-1.11.0/src/microsim/transportables/MSTransportable.h sumo-1.12.0/src/microsim/transportables/MSTransportable.h --- sumo-1.11.0/src/microsim/transportables/MSTransportable.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/transportables/MSTransportable.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -141,6 +141,9 @@ /// logs depart time of the current stage void setDeparted(SUMOTime now); + /// logs depart time of the current stage + SUMOTime getDeparture() const; + /// Returns the current destination. const MSEdge* getDestination() const { return (*myStep)->getDestination(); diff -Nru sumo-1.11.0/src/microsim/trigger/MSCalibrator.cpp sumo-1.12.0/src/microsim/trigger/MSCalibrator.cpp --- sumo-1.11.0/src/microsim/trigger/MSCalibrator.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/trigger/MSCalibrator.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ @@ -561,8 +561,7 @@ << " vaporizing " << vehicle->getID() << " to clear jam\n"; #endif if (!myParent->myHaveWarnedAboutClearingJam) { - WRITE_WARNING("Clearing jam at calibrator '" + myParent->getID() + "' at time " - + time2string(MSNet::getInstance()->getCurrentTimeStep())); + WRITE_WARNINGF("Clearing jam at calibrator '%' at time=%.", myParent->getID(), time2string(SIMSTEP)); myParent->myHaveWarnedAboutClearingJam = true; } if (myParent->scheduleRemoval(&veh)) { @@ -644,7 +643,7 @@ auto it = myCurrentStateInterval; while (it != myIntervals.end()) { if (it->begin > begin) { - throw ProcessError("Cannot set flow for calibrator '" + getID() + "' with begin time " + time2string(begin) + " in the past."); + throw ProcessError("Cannot set flow for calibrator '" + getID() + "' with begin time=" + time2string(begin) + " in the past."); } else if (it->begin == begin && it->end == end) { // update current interval AspiredState& state = const_cast(*it); diff -Nru sumo-1.11.0/src/microsim/trigger/MSCalibrator.h sumo-1.12.0/src/microsim/trigger/MSCalibrator.h --- sumo-1.11.0/src/microsim/trigger/MSCalibrator.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/trigger/MSCalibrator.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ @@ -45,7 +45,7 @@ * @class MSCalibrator * @brief Calibrates the flow on a segment to a specified one */ -class MSCalibrator : public MSTrigger, public MSRouteHandler, public Command, public MSDetectorFileOutput, public Parameterised { +class MSCalibrator : public MSTrigger, public MSRouteHandler, public Command, public MSDetectorFileOutput { public: /** constructor */ MSCalibrator(const std::string& id, diff -Nru sumo-1.11.0/src/microsim/trigger/MSChargingStation.cpp sumo-1.12.0/src/microsim/trigger/MSChargingStation.cpp --- sumo-1.11.0/src/microsim/trigger/MSChargingStation.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/trigger/MSChargingStation.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/trigger/MSChargingStation.h sumo-1.12.0/src/microsim/trigger/MSChargingStation.h --- sumo-1.11.0/src/microsim/trigger/MSChargingStation.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/trigger/MSChargingStation.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/trigger/MSLaneSpeedTrigger.cpp sumo-1.12.0/src/microsim/trigger/MSLaneSpeedTrigger.cpp --- sumo-1.11.0/src/microsim/trigger/MSLaneSpeedTrigger.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/trigger/MSLaneSpeedTrigger.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/trigger/MSLaneSpeedTrigger.h sumo-1.12.0/src/microsim/trigger/MSLaneSpeedTrigger.h --- sumo-1.11.0/src/microsim/trigger/MSLaneSpeedTrigger.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/trigger/MSLaneSpeedTrigger.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/microsim/trigger/MSOverheadWire.cpp sumo-1.12.0/src/microsim/trigger/MSOverheadWire.cpp --- sumo-1.11.0/src/microsim/trigger/MSOverheadWire.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/trigger/MSOverheadWire.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/microsim/trigger/MSOverheadWire.h sumo-1.12.0/src/microsim/trigger/MSOverheadWire.h --- sumo-1.11.0/src/microsim/trigger/MSOverheadWire.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/trigger/MSOverheadWire.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/microsim/trigger/MSTrigger.cpp sumo-1.12.0/src/microsim/trigger/MSTrigger.cpp --- sumo-1.11.0/src/microsim/trigger/MSTrigger.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/trigger/MSTrigger.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/microsim/trigger/MSTriggeredRerouter.cpp sumo-1.12.0/src/microsim/trigger/MSTriggeredRerouter.cpp --- sumo-1.11.0/src/microsim/trigger/MSTriggeredRerouter.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/trigger/MSTriggeredRerouter.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -24,6 +24,9 @@ #include #include +#ifdef HAVE_FOX +#include +#endif #include #include #include @@ -57,6 +60,7 @@ //#define DEBUG_REROUTER //#define DEBUG_PARKING #define DEBUGCOND (veh.isSelected()) +//#define DEBUGCOND (true) //#define DEBUGCOND (veh.getID() == "") // =========================================================================== @@ -414,13 +418,13 @@ const MSEdge* lastEdge = route.getLastEdge(); #ifdef DEBUG_REROUTER if (DEBUGCOND) { - std::cout << SIMTIME << " veh=" << veh.getID() << " check rerouter " << getID() << " lane=" << veh.getLane()->getID() << " edge=" << veh.getEdge()->getID() << " finalEdge=" << lastEdge->getID() << " arrivalPos=" << veh.getArrivalPos() << "\n"; + std::cout << SIMTIME << " veh=" << veh.getID() << " check rerouter " << getID() << " lane=" << Named::getIDSecure(veh.getLane()) << " edge=" << veh.getEdge()->getID() << " finalEdge=" << lastEdge->getID() << " arrivalPos=" << veh.getArrivalPos() << "\n"; } #endif if (rerouteDef->parkProbs.getOverallProb() > 0) { #ifdef HAVE_FOX - FXConditionalLock lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); + ScopedLocker<> lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); #endif bool newDestination = false; ConstMSEdgeVector newRoute; @@ -616,9 +620,13 @@ MSParkingArea* MSTriggeredRerouter::rerouteParkingArea(const MSTriggeredRerouter::RerouteInterval* rerouteDef, SUMOVehicle& veh, bool& newDestination, ConstMSEdgeVector& newRoute) const { - // reroute destination from initial parking area to the near parking area - // if the next stop is a parking area, it is included in the current - // alternative set and if it can be observed to be full + // Reroute destination from initial parking area to an alternative parking area + // if the following conditions are met: + // - next stop target is a parking area + // - target is included in the current alternative set + // - target is visibly full + // Any parking areas that are visibly full at the current location are + // committed to parking memory MSParkingArea* nearParkArea = nullptr; std::vector parks = rerouteDef->parkProbs.getVals(); @@ -642,12 +650,63 @@ break; } } - if (!destVisible) { - // cannot determine destination occupancy + + MSParkingArea* onTheWay = nullptr; + const int parkAnywhere = (int)getWeight(veh, "parking.anywhere", -1); + + // check whether we are ready to accept any free parkingArea along the + // way to our destination + if (parkAnywhere < 0 || parkAnywhere > veh.getNumberParkingReroutes()) { + if (!destVisible) { + // cannot determine destination occupancy, only register visibly full + for (const ParkingAreaVisible& pav : parks) { + if (pav.second && pav.first->getLastStepOccupancy() == pav.first->getCapacity()) { + veh.rememberBlockedParkingArea(pav.first, &pav.first->getLane().getEdge() == veh.getEdge()); + } + } +#ifdef DEBUG_PARKING + if (DEBUGCOND) { + //std::cout << SIMTIME << " rerouter=" << getID() << " veh=" << veh.getID() + // << " dest=" << destParkArea->getID() << " parkAnywhere=" << parkAnywhere << " parkingReroutes=" << veh.getNumberParkingReroutes() << " stay on original route\n"; + } +#endif + } + + } else { + double bestDist = std::numeric_limits::max(); + const double brakeGap = veh.getBrakeGap(true); + for (ParkingAreaVisible& item : parks) { + if (item.second) { + MSParkingArea* pa = item.first; + if (&pa->getLane().getEdge() == veh.getEdge() + && pa->getLastStepOccupancy() < pa->getCapacity()) { + const double distToStart = pa->getBeginLanePosition() - veh.getPositionOnLane(); + const double distToEnd = pa->getEndLanePosition() - veh.getPositionOnLane(); + if (distToEnd > brakeGap) { + veh.rememberParkingAreaScore(pa, "dist=" + toString(distToStart)); + if (distToStart < bestDist) { + bestDist = distToStart; + onTheWay = pa; + } + } else { + veh.rememberParkingAreaScore(pa, "tooClose"); + } + } + } + } +#ifdef DEBUG_PARKING + if (DEBUGCOND) { + std::cout << SIMTIME << " rerouter=" << getID() << " veh=" << veh.getID() + << " dest=" << destParkArea->getID() << " parkAnywhere=" << parkAnywhere << " parkingReroutes=" << veh.getNumberParkingReroutes() << " alongTheWay=" << Named::getIDSecure(onTheWay) << "\n"; + } +#endif + } + if (!destVisible && onTheWay == nullptr) { return nullptr; } - if (destParkArea->getLastStepOccupancy() == destParkArea->getCapacity()) { - veh.rememberBlockedParkingArea(destParkArea); + + if (destParkArea->getLastStepOccupancy() == destParkArea->getCapacity() || onTheWay != nullptr) { + // if the current route ends at the parking area, the new route will // also and at the new area newDestination = (&destParkArea->getLane().getEdge() == route.getLastEdge() @@ -711,21 +770,45 @@ const std::vector& probs = rerouteDef->parkProbs.getProbs(); - const double brakeGap = veh.getBrakeGap(); + const double brakeGap = veh.getBrakeGap(true); + + if (onTheWay != nullptr) { + // compute new route + if (newDestination) { + newRoute.push_back(veh.getEdge()); + } else { + bool valid = addParkValues(veh, brakeGap, newDestination, onTheWay, onTheWay->getLastStepOccupancy(), 1, router, parkAreas, newRoutes, parkApproaches, maxValues); + if (!valid) { + WRITE_WARNING("Parkingarea '" + onTheWay->getID() + "' along the way cannot be used by vehicle '" + veh.getID() + "' for unknown reason"); + return nullptr; + } + newRoute = newRoutes[onTheWay]; + } + return onTheWay; + } int numAlternatives = 0; std::vector > blockedTimes; + veh.resetParkingAreaScores(); + veh.rememberParkingAreaScore(destParkArea, "occupied"); + veh.rememberBlockedParkingArea(destParkArea, &destParkArea->getLane().getEdge() == veh.getEdge()); + + const SUMOTime parkingMemory = TIME2STEPS(getWeight(veh, "parking.memory", 600)); + const double parkingFrustration = getWeight(veh, "parking.frustration", 100); + const double parkingKnowledge = getWeight(veh, "parking.knowledge", 0); for (int i = 0; i < (int)parks.size(); ++i) { MSParkingArea* pa = parks[i].first; // alternative occupancy is randomized (but never full) if invisible // current destination must be visible at this point - const bool visible = parks[i].second || pa == destParkArea; - int paOccupancy = visible ? pa->getOccupancy() : RandHelper::rand(pa->getCapacity()); - if (!visible) { + const bool visible = parks[i].second || (pa == destParkArea && destVisible); + double paOccupancy = pa->getOccupancy(); + if (!visible && (parkingKnowledge == 0 || parkingKnowledge < RandHelper::rand(veh.getRNG()))) { + const double minOccupancy = MIN2((double)pa->getCapacity() - NUMERICAL_EPS, (veh.getNumberParkingReroutes() * pa->getCapacity() / parkingFrustration)); + paOccupancy = RandHelper::rand(minOccupancy, (double)pa->getCapacity()); // previously visited? - SUMOTime blockedTime = veh.sawBlockedParkingArea(pa); - if (blockedTime >= 0 && SIMSTEP - blockedTime < TIME2STEPS(getWeight(veh, "parking.memory", 600))) { + SUMOTime blockedTime = veh.sawBlockedParkingArea(pa, false); + if (blockedTime >= 0 && SIMSTEP - blockedTime < parkingMemory) { // assume it's still occupied paOccupancy = pa->getCapacity(); blockedTimes.push_back(std::make_tuple(blockedTime, pa, i)); @@ -739,25 +822,70 @@ if (paOccupancy < pa->getCapacity()) { if (addParkValues(veh, brakeGap, newDestination, pa, paOccupancy, probs[i], router, parkAreas, newRoutes, parkApproaches, maxValues)) { numAlternatives++; - }; + } } else if (visible) { // might only be visible now (i.e. because it's on the other // side of the street), so we should remember this for later. - veh.rememberBlockedParkingArea(pa); + veh.rememberBlockedParkingArea(pa, &pa->getLane().getEdge() == veh.getEdge()); } } if (numAlternatives == 0) { // use parkingArea with lowest blockedTime - std::sort(blockedTimes.begin(), blockedTimes.end()); + std::sort(blockedTimes.begin(), blockedTimes.end(), + [](std::tuple const & t1, std::tuple const & t2) { + if (std::get<0>(t1) < std::get<0>(t2)) { + return true; + } + if (std::get<0>(t1) == std::get<0>(t2)) { + if (std::get<1>(t1)->getID() < std::get<1>(t2)->getID()) { + return true; + } + if (std::get<1>(t1)->getID() == std::get<1>(t2)->getID()) { + return std::get<2>(t1) < std::get<2>(t2); + } + } + return false; + } + ); for (auto item : blockedTimes) { MSParkingArea* pa = std::get<1>(item); double prob = probs[std::get<2>(item)]; - int paOccupancy = RandHelper::rand(pa->getCapacity()); + // all parking areas are occupied. We have no good basis for + // prefering one or the other based on estimated occupancy + double paOccupancy = RandHelper::rand((double)pa->getCapacity()); if (addParkValues(veh, brakeGap, newDestination, pa, paOccupancy, prob, router, parkAreas, newRoutes, parkApproaches, maxValues)) { + numAlternatives = 1; break; } //std::cout << " candidate=" << item.second->getID() << " observed=" << time2string(item.first) << "\n"; } + if (numAlternatives == 0) { + // take any random target but prefer that that haven't been visited yet + std::vector > candidates; + for (const ParkingAreaVisible& pav : parks) { + if (pav.first == destParkArea) { + continue; + } + SUMOTime dummy = veh.sawBlockedParkingArea(pav.first, true); + if (dummy < 0) { + // randomize among the unvisited + dummy = -RandHelper::rand(1000000); + } + candidates.push_back(std::make_pair(dummy, pav.first)); + } + std::sort(candidates.begin(), candidates.end(), + [](std::tuple const & t1, std::tuple const & t2) { + return std::get<0>(t1) < std::get<0>(t2) || (std::get<0>(t1) == std::get<0>(t2) && std::get<1>(t1)->getID() < std::get<1>(t2)->getID()); + } + ); + for (auto item : candidates) { + MSParkingArea* pa = item.second; + if (addParkValues(veh, brakeGap, newDestination, pa, 0, 1, router, parkAreas, newRoutes, parkApproaches, maxValues)) { + numAlternatives = 1; + break; + } + } + } } MSNet::getInstance()->getRouterTT(veh.getRNGIndex()); // reset closed edges @@ -804,9 +932,13 @@ double prob = 0; if (!dominated) { prob = RandHelper::rand(parkValues["probability"], veh.getRNG()); + parkValues["probability"] = 1.0 - prob / maxValues["probability"]; + } else { + // worst probability score + parkValues["probability"] = 1.0; } - parkValues["probability"] = 1.0 - prob / maxValues["probability"]; } else { + // value takes no effect due to weight=0 parkValues["probability"] = 0; } // normalizing with maximum values (we want to maximize some parameters then we reverse the value) @@ -827,6 +959,11 @@ for (ParkingParamMap_t::iterator pc = parkValues.begin(); pc != parkValues.end(); ++pc) { parkingCost += weights[pc->first] * pc->second; } + veh.rememberParkingAreaScore(it->first, toString(parkingCost) + //+ " rfs=" + toString(parkValues["relfreespace"]) + //+ " dt=" + toString(parkValues["distanceto"]) + //+ " p=" + toString(parkValues["probability"]) + ); // get the parking area with minimum cost if (nearParkArea == nullptr || parkingCost < minParkingCost) { @@ -837,10 +974,11 @@ #ifdef DEBUG_PARKING if (DEBUGCOND) { - std::cout << " altPA=" << it->first->getID() << " score=" << parkingCost << "\n"; + std::cout << " altPA=" << it->first->getID() << " score=" << parkingCost << " vals=" << joinToString(parkValues, " ", ":") << "\n"; } #endif } + veh.setNumberParkingReroutes(veh.getNumberParkingReroutes() + 1); } else { #ifdef DEBUG_PARKING if (DEBUGCOND) { @@ -860,14 +998,13 @@ bool -MSTriggeredRerouter::addParkValues(const SUMOVehicle& veh, double brakeGap, bool newDestination, - MSParkingArea* pa, int paOccupancy, double prob, - SUMOAbstractRouter& router, - MSParkingAreaMap_t& parkAreas, - std::map& newRoutes, - std::map& parkApproaches, - ParkingParamMap_t& maxValues) const -{ +MSTriggeredRerouter::addParkValues(SUMOVehicle& veh, double brakeGap, bool newDestination, + MSParkingArea* pa, double paOccupancy, double prob, + SUMOAbstractRouter& router, + MSParkingAreaMap_t& parkAreas, + std::map& newRoutes, + std::map& parkApproaches, + ParkingParamMap_t& maxValues) const { // a map stores the parking values ParkingParamMap_t parkValues; @@ -879,14 +1016,21 @@ // Compute the route from the current edge to the parking area edge ConstMSEdgeVector edgesToPark; - if (veh.getEdge() == parkEdge && pa->getLastFreePos(veh) < veh.getPositionOnLane()) { - router.computeLooped(veh.getEdge(), parkEdge, &veh, MSNet::getInstance()->getCurrentTimeStep(), edgesToPark, true); - } else { - router.compute(veh.getEdge(), parkEdge, &veh, MSNet::getInstance()->getCurrentTimeStep(), edgesToPark, true); + const double parkPos = pa->getLastFreePos(veh); + const MSEdge* rerouteOrigin = veh.getRerouteOrigin(); + router.compute(rerouteOrigin, veh.getPositionOnLane(), parkEdge, parkPos, &veh, MSNet::getInstance()->getCurrentTimeStep(), edgesToPark, true); + +#ifdef DEBUG_PARKING + if (DEBUGCOND) { + std::cout << " altPA=" << pa->getID() << " vehEdge=" << veh.getEdge()->getID() << " parkEdge " << parkEdge->getID() << " edgesToPark=" << edgesToPark.size() << "\n"; } +#endif if (edgesToPark.size() > 0) { // Compute the route from the parking area edge to the end of the route + if (rerouteOrigin != veh.getEdge()) { + edgesToPark.insert(edgesToPark.begin(), veh.getEdge()); + } ConstMSEdgeVector edgesFromPark; parkApproaches[pa] = edgesToPark; @@ -901,12 +1045,13 @@ nextPos = stopIndices[1].second; } - if (parkEdge == nextDestination && nextPos < pa->getLastFreePos(veh)) { - router.computeLooped(parkEdge, nextDestination, &veh, MSNet::getInstance()->getCurrentTimeStep(), edgesFromPark, true); - } else { - router.compute(parkEdge, nextDestination, &veh, MSNet::getInstance()->getCurrentTimeStep(), edgesFromPark, true); - } + router.compute(parkEdge, parkPos, nextDestination, nextPos, &veh, MSNet::getInstance()->getCurrentTimeStep(), edgesFromPark, true); } +#ifdef DEBUG_PARKING + if (DEBUGCOND) { + //std::cout << " altPA=" << pa->getID() << " parkEdge=" << parkEdge->getID() << " nextDest=" << nextDestination->getID() << " edgesFromPark=" << edgesFromPark.size() << "\n"; + } +#endif if (edgesFromPark.size() > 0 || newDestination) { @@ -918,7 +1063,8 @@ parkValues["capacity"] = (double)(pa->getCapacity()); parkValues["absfreespace"] = (double)(pa->getCapacity() - paOccupancy); - parkValues["relfreespace"] = parkValues["absfreespace"] / parkValues["capacity"]; + // if capacity = 0 then absfreespace and relfreespace are also 0 + parkValues["relfreespace"] = parkValues["absfreespace"] / MAX2(1.0, parkValues["capacity"]); if (parkValues["capacity"] > maxValues["capacity"]) { maxValues["capacity"] = parkValues["capacity"]; @@ -932,22 +1078,42 @@ maxValues["relfreespace"] = parkValues["relfreespace"]; } - MSRoute routeToPark(route.getID() + "!topark#1", edgesToPark, false, &c == &RGBColor::DEFAULT_COLOR ? nullptr : new RGBColor(c), route.getStops()); + MSRoute routeToPark(route.getID() + "!topark#1", edgesToPark, false, + &c == &RGBColor::DEFAULT_COLOR ? nullptr : new RGBColor(c), route.getStops()); // The distance from the current edge to the new parking area - parkValues["distanceto"] = routeToPark.getDistanceBetween(veh.getPositionOnLane(), pa->getBeginLanePosition(), - routeToPark.begin(), routeToPark.end() - 1, includeInternalLengths); + double toPos = pa->getBeginLanePosition(); + if (&pa->getLane().getEdge() == veh.getEdge()) { + toPos = MAX2(veh.getPositionOnLane(), toPos); + } + parkValues["distanceto"] = routeToPark.getDistanceBetween(veh.getPositionOnLane(), toPos, + routeToPark.begin(), routeToPark.end() - 1, includeInternalLengths); + + if (parkValues["distanceto"] == std::numeric_limits::max()) { + WRITE_WARNINGF("Invalid distance computation for vehicle '%' to parkingArea '%' at time=%.", + veh.getID(), pa->getID(), time2string(SIMSTEP)); + } + +#ifdef DEBUG_PARKING + if (DEBUGCOND) { + std::cout << " " << veh.getID() << " candidate=" << pa->getID() + << " distanceTo=" << parkValues["distanceto"] + << " brakeGap=" << brakeGap + << " routeToPark=" << toString(edgesToPark) + << " fromPos=" << veh.getPositionOnLane() + << " tPos=" << pa->getBeginLanePosition() + << "\n"; + } +#endif - //std::cout << SIMTIME << " veh=" << veh.getID() << " candidate=" << pa->getID() - // << " distanceTo=" << parkValues["distanceto"] - // << " brakeGap=" << brakeGap - // << " routeToPark=" << toString(edgesToPark) - // << " fromPos=" << veh.getPositionOnLane() - // << " tPos=" << pa->getBeginLanePosition() - // << "\n"; - if (parkValues["distanceto"] < brakeGap) { - //std::cout << " removed: pa too close\n"; - // to close to stop for this parkingArea + const double distToEnd = parkValues["distanceto"] - toPos + pa->getEndLanePosition(); + if (distToEnd < brakeGap) { + veh.rememberParkingAreaScore(pa, "tooClose"); +#ifdef DEBUG_PARKING + if (DEBUGCOND) { + std::cout << " altPA=" << pa->getID() << " too close to brake (dist=" << distToEnd << " brakeGap=" << brakeGap << "\n"; + } +#endif return false; } @@ -969,12 +1135,16 @@ parkValues["timefrom"] = 0; } else { MSRoute routeFromPark(route.getID() + "!frompark#1", edgesFromPark, false, - &c == &RGBColor::DEFAULT_COLOR ? nullptr : new RGBColor(c), route.getStops()); + &c == &RGBColor::DEFAULT_COLOR ? nullptr : new RGBColor(c), route.getStops()); // The distance from the new parking area to the end of the route parkValues["distancefrom"] = routeFromPark.getDistanceBetween(pa->getBeginLanePosition(), routeFromPark.getLastEdge()->getLength(), - routeFromPark.begin(), routeFromPark.end() - 1, includeInternalLengths); + routeFromPark.begin(), routeFromPark.end() - 1, includeInternalLengths); + if (parkValues["distancefrom"] == std::numeric_limits::max()) { + WRITE_WARNINGF("Invalid distance computation for vehicle '%' from parkingArea '%' at time=%.", + veh.getID(), pa->getID(), time2string(SIMSTEP)); + } // The time to reach this area - parkValues["timefrom"] = router.recomputeCosts(edgesFromPark, &veh, MSNet::getInstance()->getCurrentTimeStep()); + parkValues["timefrom"] = router.recomputeCosts(edgesFromPark, &veh, SIMSTEP); newEdges.insert(newEdges.end(), edgesFromPark.begin() + 1, edgesFromPark.end()); newEdges.insert(newEdges.end(), route.begin() + nextDestinationIndex + 1, route.end()); } @@ -990,19 +1160,20 @@ parkAreas[pa] = parkValues; newRoutes[pa] = newEdges; -#ifdef DEBUG_PARKING - if (DEBUGCOND) { - std::cout << " altPA=" << pa->getID() - << " vals=" << joinToString(parkValues, " ", ":") - << "\n"; - } -#endif + return true; + } else { + veh.rememberParkingAreaScore(pa, "destUnreachable"); } - return true; } else { - // unreachable - return false; + veh.rememberParkingAreaScore(pa, "unreachable"); } +#ifdef DEBUG_PARKING + if (DEBUGCOND) { + std::cout << " altPA=" << pa->getID() << " disconnected\n"; + } +#endif + // unreachable + return false; } diff -Nru sumo-1.11.0/src/microsim/trigger/MSTriggeredRerouter.h sumo-1.12.0/src/microsim/trigger/MSTriggeredRerouter.h --- sumo-1.11.0/src/microsim/trigger/MSTriggeredRerouter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/trigger/MSTriggeredRerouter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -220,13 +220,13 @@ typedef std::map MSParkingAreaMap_t; /// determine attributes of candiate parking area for scoring - bool addParkValues(const SUMOVehicle& veh, double brakeGap, bool newDestination, - MSParkingArea* pa, int paOccupancy, double prob, - SUMOAbstractRouter& router, - MSParkingAreaMap_t& parkAreas, - std::map& newRoutes, - std::map& parkApproaches, - ParkingParamMap_t& maxValues) const; + bool addParkValues(SUMOVehicle& veh, double brakeGap, bool newDestination, + MSParkingArea* pa, double paOccupancy, double prob, + SUMOAbstractRouter& router, + MSParkingAreaMap_t& parkAreas, + std::map& newRoutes, + std::map& parkApproaches, + ParkingParamMap_t& maxValues) const; protected: /// @brief edges where vehicles are notified diff -Nru sumo-1.11.0/src/microsim/trigger/MSTrigger.h sumo-1.12.0/src/microsim/trigger/MSTrigger.h --- sumo-1.11.0/src/microsim/trigger/MSTrigger.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/microsim/trigger/MSTrigger.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBAlgorithms.cpp sumo-1.12.0/src/netbuild/NBAlgorithms.cpp --- sumo-1.11.0/src/netbuild/NBAlgorithms.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBAlgorithms.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBAlgorithms.h sumo-1.12.0/src/netbuild/NBAlgorithms.h --- sumo-1.11.0/src/netbuild/NBAlgorithms.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBAlgorithms.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBAlgorithms_Railway.cpp sumo-1.12.0/src/netbuild/NBAlgorithms_Railway.cpp --- sumo-1.11.0/src/netbuild/NBAlgorithms_Railway.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBAlgorithms_Railway.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ @@ -1098,29 +1098,46 @@ void -NBRailwayTopologyAnalyzer::assignDirectionPriority(NBNetBuilder& nb) { - // assign priority value for each railway edge: +NBRailwayTopologyAnalyzer::extendDirectionPriority(NBNetBuilder& nb, bool fromUniDir) { + // if fromUniDir=true, assign priority value for each railway edge: // 4: edge is unidirectional // 3: edge is in main direction of bidirectional track // 2: edge is part of bidirectional track, main direction unknown - both edges are extensions of unidirectional edges // 1: edge is part of bidirectional track, main direction unknown - neither edge is an extension of a unidirectional edge // 0: edge is part of bidirectional track in reverse of main direction + // + // otherwise: + // assign priority value for each railway edge with priority -1 (undefined): + // x: edges with priority >= 0 keep their priority + // x-1 : edge is in direct (no switch) sequence of an edge with initial priority x + // x-2 : edge and its opposite-direction are in direct (no switch) sequence of an edge with initial priority x + // x-3 : edge is part of bidirectional track, both directions are indirect extensions of x-1 edges + // x-4 : edge is reverse direction of an x-1 edge EdgeSet bidi; EdgeSet uni; for (NBEdge* edge : nb.getEdgeCont().getAllEdges()) { if (isRailway(edge->getPermissions())) { - if (!edge->isBidiRail()) { - edge->setPriority(4); - uni.insert(edge); + if (fromUniDir) { + if (!edge->isBidiRail()) { + edge->setPriority(4); + uni.insert(edge); + } else { + bidi.insert(edge); + } } else { - bidi.insert(edge); + if (edge->getPriority() >= 0) { + uni.insert(edge); + } else { + bidi.insert(edge); + } } } } + if (uni.size() == 0) { if (bidi.size() != 0) { - WRITE_WARNING("Cannot assign track direction priority because there are no unidirectional tracks."); + WRITE_WARNING("Cannot extend track direction priority because there are no track edges with positive priority"); } return; } @@ -1154,31 +1171,49 @@ for (NBEdge* edge : bidi) { NBEdge* bidiEdge = const_cast(edge->getBidiEdge()); + int prio; + int bidiPrio; if (forward.count(edge) != 0) { if (forward.count(bidiEdge) == 0) { - edge->setPriority(3); - bidiEdge->setPriority(0); + prio = 3; + bidiPrio = 0; } else { // both forward - edge->setPriority(2); - bidiEdge->setPriority(2); + prio = 2; + bidiPrio = 2; } } else { if (forward.count(bidiEdge) != 0) { - edge->setPriority(0); - bidiEdge->setPriority(3); + prio = 0; + bidiPrio = 3; } else { // neither forward - edge->setPriority(1); - bidiEdge->setPriority(1); + prio = 1; + bidiPrio = 1; } } + if (edge->getPriority() >= 0) { + bidiPrio = 0; + } + if (bidiEdge->getPriority() >= 0) { + prio = 0; + } + if (edge->getPriority() < 0) { + edge->setPriority(prio); + } + if (bidiEdge->getPriority() < 0) { + bidiEdge->setPriority(bidiPrio); + } } std::map numPrios; for (NBEdge* edge : bidi) { numPrios[edge->getPriority()]++; } - WRITE_MESSAGE("Assigned edge priority based on main direction: " + joinToString(numPrios, " ", ":") + ".") + if (fromUniDir) { + WRITE_MESSAGE("Assigned edge priority based on main direction: " + joinToString(numPrios, " ", ":") + ".") + } else { + WRITE_MESSAGE("Extended edge priority based on main direction: " + joinToString(numPrios, " ", ":") + ".") + } } diff -Nru sumo-1.11.0/src/netbuild/NBAlgorithms_Railway.h sumo-1.12.0/src/netbuild/NBAlgorithms_Railway.h --- sumo-1.11.0/src/netbuild/NBAlgorithms_Railway.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBAlgorithms_Railway.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ @@ -51,7 +51,7 @@ static void analyzeTopology(NBNetBuilder& nb); static int repairTopology(NBNetBuilder& nb); static int makeAllBidi(NBNetBuilder& nb); - static void assignDirectionPriority(NBNetBuilder& nb); + static void extendDirectionPriority(NBNetBuilder& nb, bool fromUniDir); /// routing edge class Track { diff -Nru sumo-1.11.0/src/netbuild/NBAlgorithms_Ramps.cpp sumo-1.12.0/src/netbuild/NBAlgorithms_Ramps.cpp --- sumo-1.11.0/src/netbuild/NBAlgorithms_Ramps.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBAlgorithms_Ramps.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBAlgorithms_Ramps.h sumo-1.12.0/src/netbuild/NBAlgorithms_Ramps.h --- sumo-1.11.0/src/netbuild/NBAlgorithms_Ramps.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBAlgorithms_Ramps.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBCapacity2Lanes.h sumo-1.12.0/src/netbuild/NBCapacity2Lanes.h --- sumo-1.11.0/src/netbuild/NBCapacity2Lanes.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBCapacity2Lanes.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBConnection.cpp sumo-1.12.0/src/netbuild/NBConnection.cpp --- sumo-1.11.0/src/netbuild/NBConnection.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBConnection.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBConnectionDefs.h sumo-1.12.0/src/netbuild/NBConnectionDefs.h --- sumo-1.11.0/src/netbuild/NBConnectionDefs.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBConnectionDefs.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBConnection.h sumo-1.12.0/src/netbuild/NBConnection.h --- sumo-1.11.0/src/netbuild/NBConnection.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBConnection.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBCont.h sumo-1.12.0/src/netbuild/NBCont.h --- sumo-1.11.0/src/netbuild/NBCont.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBCont.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBContHelper.cpp sumo-1.12.0/src/netbuild/NBContHelper.cpp --- sumo-1.11.0/src/netbuild/NBContHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBContHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBContHelper.h sumo-1.12.0/src/netbuild/NBContHelper.h --- sumo-1.11.0/src/netbuild/NBContHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBContHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBDistrictCont.cpp sumo-1.12.0/src/netbuild/NBDistrictCont.cpp --- sumo-1.11.0/src/netbuild/NBDistrictCont.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBDistrictCont.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBDistrictCont.h sumo-1.12.0/src/netbuild/NBDistrictCont.h --- sumo-1.11.0/src/netbuild/NBDistrictCont.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBDistrictCont.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBDistrict.cpp sumo-1.12.0/src/netbuild/NBDistrict.cpp --- sumo-1.11.0/src/netbuild/NBDistrict.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBDistrict.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBDistrict.h sumo-1.12.0/src/netbuild/NBDistrict.h --- sumo-1.11.0/src/netbuild/NBDistrict.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBDistrict.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBEdgeCont.cpp sumo-1.12.0/src/netbuild/NBEdgeCont.cpp --- sumo-1.11.0/src/netbuild/NBEdgeCont.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBEdgeCont.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -55,7 +55,7 @@ //#define DEBUG_GUESS_ROUNDABOUT //#define DEBUG_JOIN_TRAM -#define DEBUG_EDGE_ID "301241681#2" +#define DEBUG_EDGE_ID "" // =========================================================================== // method definitions @@ -1216,7 +1216,6 @@ NBNode* const to = e->getToNode(); if (e->getTurnDestination() == nullptr && to->getConnectionTo(e->getFromNode()) == nullptr - && loadedRoundaboutEdges.count(e) == 0 && (e->getPermissions() & valid) != 0) { candidates.insert(e); } @@ -1238,11 +1237,11 @@ loopEdges.push_back(e); bool doLoop = true; #ifdef DEBUG_GUESS_ROUNDABOUT - gDebugFlag1 = false; + gDebugFlag1 = e->getID() == DEBUG_EDGE_ID; #endif do { #ifdef DEBUG_GUESS_ROUNDABOUT - if (e->getID() == DEBUG_EDGE_ID || gDebugFlag1) { + if (gDebugFlag1) { std::cout << " e=" << e->getID() << " loopEdges=" << toString(loopEdges) << "\n"; gDebugFlag1 = true; } @@ -1274,7 +1273,7 @@ doLoop = false; #ifdef DEBUG_GUESS_ROUNDABOUT if (gDebugFlag1) { - std::cout << " turn\n"; + std::cout << " invalid turnAround e=" << e->getID() << " dest=" << Named::getIDSecure(e->getTurnDestination()) << "\n"; } gDebugFlag1 = false; #endif @@ -1304,7 +1303,7 @@ double nextAngle = nextLeft == e ? 180 : fabs(NBHelpers::relAngle(e->getAngleAtNode(e->getToNode()), nextLeft->getAngleAtNode(e->getToNode()))); #ifdef DEBUG_GUESS_ROUNDABOUT if (gDebugFlag1) { - std::cout << " angle=" << angle << " nextAngle=" << nextAngle << "\n"; + std::cout << " e=" << e->getID() << " left=" << left->getID() << " nextLeft=" << nextLeft->getID() << " angle=" << angle << " nextAngle=" << nextAngle << " eLength=" << e->getLength() << " lLength=" << left->getLength() << " dist=" << e->getLaneShape(0).back().distanceTo2D(left->getLaneShape(0).front()) << "\n"; } #endif if (angle >= 120 @@ -1320,7 +1319,7 @@ doLoop = false; #ifdef DEBUG_GUESS_ROUNDABOUT if (gDebugFlag1) { - std::cout << " angle=" << angle << "\n"; + std::cout << " failed angle=" << angle << "\n"; } gDebugFlag1 = false; #endif @@ -1362,16 +1361,40 @@ e = left; } } while (doLoop); -#ifdef DEBUG_GUESS_ROUNDABOUT - gDebugFlag1 = false; -#endif if (doLoop) { // check form factor to avoid elongated shapes (circle: 1, square: ~0.79) +#ifdef DEBUG_GUESS_ROUNDABOUT + if (gDebugFlag1) { + std::cout << " formFactor=" << formFactor(loopEdges) << "\n"; + } +#endif if (formFactor(loopEdges) > 0.6) { // collected edges are marked in markRoundabouts - myGuessedRoundabouts.insert(EdgeSet(loopEdges.begin(), loopEdges.end())); + EdgeSet guessed(loopEdges.begin(), loopEdges.end()); + if (loadedRoundaboutEdges.count(loopEdges.front()) != 0) { + if (find(myRoundabouts.begin(), myRoundabouts.end(), guessed) == myRoundabouts.end()) { + for (auto it = myRoundabouts.begin(); it != myRoundabouts.end(); it++) { + if ((*it).count(loopEdges.front()) != 0) { + WRITE_WARNINGF("Replacing loaded roundabout '%s' with '%s'", toString(*it), toString(guessed)); + myRoundabouts.erase(it); + break; + } + } + myGuessedRoundabouts.insert(guessed); + } + } else { + myGuessedRoundabouts.insert(guessed); +#ifdef DEBUG_GUESS_ROUNDABOUT + if (gDebugFlag1) { + std::cout << " foundRoundabout=" << toString(loopEdges) << "\n"; + } +#endif + } } } +#ifdef DEBUG_GUESS_ROUNDABOUT + gDebugFlag1 = false; +#endif } return (int)myGuessedRoundabouts.size(); } diff -Nru sumo-1.11.0/src/netbuild/NBEdgeCont.h sumo-1.12.0/src/netbuild/NBEdgeCont.h --- sumo-1.11.0/src/netbuild/NBEdgeCont.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBEdgeCont.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBEdge.cpp sumo-1.12.0/src/netbuild/NBEdge.cpp --- sumo-1.11.0/src/netbuild/NBEdge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBEdge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -381,7 +381,24 @@ NBEdge::NBEdge() : - Named("DUMMY") { + Named("DUMMY"), + myStep(EdgeBuildingStep::INIT), + myFrom(nullptr), myTo(nullptr), + myStartAngle(0), myEndAngle(0), myTotalAngle(0), + myPriority(0), mySpeed(0), + myDistance(0), + myTurnDestination(nullptr), + myPossibleTurnDestination(nullptr), + myFromJunctionPriority(-1), myToJunctionPriority(-1), + myLaneSpreadFunction(LaneSpreadFunction::RIGHT), + myEndOffset(0), + myEdgeStopOffset(StopOffset()), + myLaneWidth(0), + myLoadedLength(UNSPECIFIED_LOADED_LENGTH), + myAmInTLS(false), + myAmMacroscopicConnector(false), + mySignalPosition(Position::INVALID), + mySignalNode(nullptr) { } @@ -473,7 +490,7 @@ // revisit geometry // should have at least two points at the end... // and in dome cases, the node positions must be added - myGeom.removeDoublePoints(myGeom.size() > 2 ? POSITION_EPS : NUMERICAL_EPS); + myGeom.removeDoublePoints(POSITION_EPS, true); if (!tryIgnoreNodePositions || myGeom.size() < 2) { if (myGeom.size() == 0) { myGeom.push_back(myFrom->getPosition()); @@ -943,17 +960,17 @@ // (very important for bidiRail) if (myFrom->getID() < myTo->getID()) { PositionVector reverse = myGeom.reverse(); - reverse.removeDoublePoints(minDist, true); + reverse.removeDoublePoints(minDist, true, 0, 0, true); myGeom = reverse.reverse(); for (Lane& lane : myLanes) { reverse = lane.customShape.reverse(); - reverse.removeDoublePoints(minDist, true); + reverse.removeDoublePoints(minDist, true, 0, 0, true); lane.customShape = reverse.reverse(); } } else { - myGeom.removeDoublePoints(minDist, true); + myGeom.removeDoublePoints(minDist, true, 0, 0, true); for (Lane& lane : myLanes) { - lane.customShape.removeDoublePoints(minDist, true); + lane.customShape.removeDoublePoints(minDist, true, 0, 0, true); } } } @@ -1602,6 +1619,7 @@ const double limitTurnSpeedWarnStraight = oc.getFloat("junctions.limit-turn-speed.warn.straight"); const double limitTurnSpeedWarnTurn = oc.getFloat("junctions.limit-turn-speed.warn.turn"); const bool higherSpeed = oc.getBool("junctions.higher-speed"); + const double interalJunctionVehicleWidth = oc.getFloat("internal-junctions.vehicle-width"); const bool fromRail = isRailway(getPermissions()); std::string innerID = ":" + n.getID(); NBEdge* toEdge = nullptr; @@ -1625,7 +1643,7 @@ // skip indices to keep some correspondence between edge ids and link indices: // internalEdgeIndex + internalLaneIndex = linkIndex edgeIndex = linkIndex; - toEdge = (*i).toEdge; + toEdge = con.toEdge; internalLaneIndex = 0; assignInternalLaneLength(i, numLanes, lengthSum, averageLength); numLanes = 0; @@ -1652,6 +1670,8 @@ case LinkDirection::TURN: { int index = 0; std::vector otherShapes; + const double width1 = MIN2(interalJunctionVehicleWidth / 2, getLaneWidth(con.fromLane) / 2); + const double width1OppositeLeft = 0; // using width1 changes a lot of curves even though they are rarely responsible for collisions for (const NBEdge* i2 : n.getIncomingEdges()) { for (const Connection& k2 : i2->getConnections()) { if (k2.toEdge == nullptr) { @@ -1667,10 +1687,10 @@ LinkDirection dir2 = n.getDirection(i2, k2.toEdge); bool needsCont = !isRailway(conPermissions) && n.needsCont(this, i2, con, k2); const bool avoidIntersectCandidate = !foes && bothLeftTurns(dir, i2, dir2); - bool oppositeLeftIntersect = avoidIntersectCandidate && haveIntersection(n, shape, i2, k2, numPoints, width2); + bool oppositeLeftIntersect = avoidIntersectCandidate && haveIntersection(n, shape, i2, k2, numPoints, width1OppositeLeft, width2); int shapeFlag = 0; SVCPermissions warn = SVCAll & ~(SVC_PEDESTRIAN | SVC_BICYCLE | SVC_DELIVERY | SVC_RAIL_CLASSES); - // do not warn if only bicycles pedestrians or delivery vehicles are involved as this is a typical occurence + // do not warn if only bicycles, pedestrians or delivery vehicles are involved as this is a typical occurence if (con.customShape.size() == 0 && k2.customShape.size() == 0 && (oppositeLeftIntersect || (avoidedIntersectingLeftOriginLane < con.fromLane && avoidIntersectCandidate)) @@ -1681,7 +1701,7 @@ shapeFlag = NBNode::AVOID_INTERSECTING_LEFT_TURNS; PositionVector origShape = shape; shape = n.computeInternalLaneShape(this, con, numPoints, myTo, shapeFlag); - oppositeLeftIntersect = haveIntersection(n, shape, i2, k2, numPoints, width2, shapeFlag); + oppositeLeftIntersect = haveIntersection(n, shape, i2, k2, numPoints, width1OppositeLeft, width2, shapeFlag); if (oppositeLeftIntersect && (conPermissions & (SVCAll & ~(SVC_BICYCLE | SVC_PEDESTRIAN))) == 0) { shape = origShape; @@ -1691,7 +1711,7 @@ || avoidedIntersectingLeftOriginLane < con.fromLane) { for (const PositionVector& otherShape : otherShapes) { const bool secondIntersection = con.indirectLeft && this == i2 && con.fromLane == k2.fromLane; - const double minDV = firstIntersection(shape, otherShape, width2, + const double minDV = firstIntersection(shape, otherShape, width1OppositeLeft, width2, "Could not compute intersection of conflicting internal lanes at node '" + myTo->getID() + "'", secondIntersection); if (minDV < shape.length() - POSITION_EPS && minDV > POSITION_EPS) { // !!!? assert(minDV >= 0); @@ -1707,13 +1727,15 @@ } const bool bothPrio = getJunctionPriority(&n) > 0 && i2->getJunctionPriority(&n) > 0; //std::cout << "n=" << n.getID() << " e1=" << getID() << " prio=" << getJunctionPriority(&n) << " e2=" << i2->getID() << " prio2=" << i2->getJunctionPriority(&n) << " both=" << bothPrio << " bothLeftIntersect=" << bothLeftIntersect(n, shape, dir, i2, k2, numPoints, width2) << " needsCont=" << needsCont << "\n"; + // the following special case might get obsolete once we have solved #9745 + const bool isBicycleLeftTurn = k2.indirectLeft || (dir2 == LinkDirection::LEFT && (i2->getPermissions(k2.fromLane) & k2.toEdge->getPermissions(k2.toLane)) == SVC_BICYCLE); // compute the crossing point - if ((needsCont || (bothPrio && oppositeLeftIntersect)) && (!con.indirectLeft || dir2 == LinkDirection::STRAIGHT)) { + if ((needsCont || (bothPrio && oppositeLeftIntersect)) && (!con.indirectLeft || dir2 == LinkDirection::STRAIGHT) && !isBicycleLeftTurn) { crossingPositions.second.push_back(index); const PositionVector otherShape = n.computeInternalLaneShape(i2, k2, numPoints, 0, shapeFlag); otherShapes.push_back(otherShape); const bool secondIntersection = con.indirectLeft && this == i2 && con.fromLane == k2.fromLane; - const double minDV = firstIntersection(shape, otherShape, width2, + const double minDV = firstIntersection(shape, otherShape, width1, width2, "Could not compute intersection of conflicting internal lanes at node '" + myTo->getID() + "'", secondIntersection); if (minDV < shape.length() - POSITION_EPS && minDV > POSITION_EPS) { // !!!? assert(minDV >= 0); @@ -1770,7 +1792,7 @@ // build internal junctions (not for left turns at uncontrolled intersections) PositionVector crossingShape = crossing.shape; crossingShape.extrapolate(5.0); // sometimes shapes miss each other by a small margin - const double minDV = firstIntersection(shape, crossingShape, crossing.width / 2); + const double minDV = firstIntersection(shape, crossingShape, 0, crossing.width / 2); if (minDV < shape.length() - POSITION_EPS && minDV > POSITION_EPS) { assert(minDV >= 0); if (crossingPositions.first < 0 || crossingPositions.first > minDV) { @@ -1919,21 +1941,43 @@ } double -NBEdge::firstIntersection(const PositionVector& v1, const PositionVector& v2, double width2, const std::string& error, bool secondIntersection) { +NBEdge::firstIntersection(const PositionVector& v1, const PositionVector& v2, double width1, double width2, const std::string& error, bool secondIntersection) { double intersect = std::numeric_limits::max(); if (v2.length() < POSITION_EPS) { return intersect; } try { + PositionVector v1Right = v1; + v1Right.move2side(width1); + + PositionVector v1Left = v1; + v1Left.move2side(-width1); + PositionVector v2Right = v2; v2Right.move2side(width2); PositionVector v2Left = v2; v2Left.move2side(-width2); - // intersect center line of v1 with left and right border of v2 + // intersect all border combinations bool skip = secondIntersection; - for (double cand : v1.intersectsAtLengths2D(v2Right)) { + for (double cand : v1Left.intersectsAtLengths2D(v2Right)) { + if (skip) { + skip = false; + continue; + } + intersect = MIN2(intersect, cand); + } + skip = secondIntersection; + for (double cand : v1Left.intersectsAtLengths2D(v2Left)) { + if (skip) { + skip = false; + continue; + } + intersect = MIN2(intersect, cand); + } + skip = secondIntersection; + for (double cand : v1Right.intersectsAtLengths2D(v2Right)) { if (skip) { skip = false; continue; @@ -1941,7 +1985,7 @@ intersect = MIN2(intersect, cand); } skip = secondIntersection; - for (double cand : v1.intersectsAtLengths2D(v2Left)) { + for (double cand : v1Right.intersectsAtLengths2D(v2Left)) { if (skip) { skip = false; continue; @@ -1970,9 +2014,10 @@ } bool -NBEdge::haveIntersection(const NBNode& n, const PositionVector& shape, const NBEdge* otherFrom, const NBEdge::Connection& otherCon, int numPoints, double width2, int shapeFlag) const { +NBEdge::haveIntersection(const NBNode& n, const PositionVector& shape, const NBEdge* otherFrom, const NBEdge::Connection& otherCon, int numPoints, + double width1, double width2, int shapeFlag) const { const PositionVector otherShape = n.computeInternalLaneShape(otherFrom, otherCon, numPoints, 0, shapeFlag); - const double minDV = firstIntersection(shape, otherShape, width2); + const double minDV = firstIntersection(shape, otherShape, width1, width2); return minDV < shape.length() - POSITION_EPS && minDV > POSITION_EPS; } @@ -2467,6 +2512,175 @@ } +std::vector +NBEdge::decodeTurnSigns(int turnSigns) { + std::vector result; + for (int i = 0; i < 8; i++) { + // see LinkDirection in SUMOXMLDefinitions.h + if ((turnSigns & (1 << i)) != 0) { + result.push_back((LinkDirection)(1 << i)); + } + } + return result; +} + +bool +NBEdge::applyTurnSigns() { + // build a map of target edges and lanes + std::vector targets; + std::map > toLaneMap; + for (const Connection& c : myConnections) { + if (myLanes[c.fromLane].turnSigns != 0) { + if (std::find(targets.begin(), targets.end(), c.toEdge) == targets.end()) { + targets.push_back(c.toEdge); + } + toLaneMap[c.toEdge].push_back(c.toLane); + } + } + // might be unsorted due to bike lane connections + for (auto& item : toLaneMap) { + std::sort(item.second.begin(), item.second.end()); + } + + // check number of distinct signed directions and count the number of signs for each direction + std::map signCons; + int allDirs = 0; + for (const Lane& lane : myLanes) { + allDirs |= lane.turnSigns; + for (LinkDirection dir : decodeTurnSigns(lane.turnSigns)) { + signCons[dir]++; + } + } + if ((allDirs & (int)LinkDirection::NODIR) != 0) { + targets.push_back(nullptr); // dead end + } + + // build a mapping from sign directions to targets + std::vector signedDirs = decodeTurnSigns(allDirs); + std::map dirMap; + if (signedDirs.size() > targets.size()) { + WRITE_WARNINGF("Cannot apply turn sign information for edge '%' because there are % signed directions but only % targets", getID(), signedDirs.size(), targets.size()); + return false; + } else if (signedDirs.size() < targets.size()) { + // we need to drop some targets (i.e. turn-around) + // use sumo-directions as a guide + std::vector sumoDirs; + for (const NBEdge* to : targets) { + sumoDirs.push_back(myTo->getDirection(this, to)); + } + // remove targets to the left + bool checkMore = true; + while (signedDirs.size() < targets.size() && checkMore) { + checkMore = false; + //std::cout << getID() << " sumoDirs=" << joinToString(sumoDirs, ",") << " signedDirs=" << joinToString(signedDirs, ",") << "\n"; + if (sumoDirs.back() != signedDirs.back()) { + targets.pop_back(); + sumoDirs.pop_back(); + checkMore = true; + } + } + // remove targets to the right + checkMore = true; + while (signedDirs.size() < targets.size() && checkMore) { + checkMore = false; + if (sumoDirs.front() != signedDirs.front()) { + targets.erase(targets.begin()); + sumoDirs.erase(sumoDirs.begin()); + checkMore = true; + } + } + // remove targets by permissions + int i = 0; + while (signedDirs.size() < targets.size() && i < (int)targets.size()) { + if (targets[i] != nullptr && (targets[i]->getPermissions() & SVC_PASSENGER) == 0) { + targets.erase(targets.begin() + i); + sumoDirs.erase(sumoDirs.begin() + i); + } else { + i++; + } + } + if (signedDirs.size() != targets.size()) { + WRITE_WARNINGF("Cannot apply turn sign information for edge '%' because there are % signed directions and % targets (after target pruning)", getID(), signedDirs.size(), targets.size()); + return false; + } + } + // directions and connections are both sorted from right to left + for (int i = 0; i < (int)signedDirs.size(); i++) { + dirMap[signedDirs[i]] = targets[i]; + } + // check whether we have enough target lanes for a each signed direction + for (auto item : signCons) { + const LinkDirection dir = item.first; + if (dir == LinkDirection::NODIR) { + continue; + } + const NBEdge* to = dirMap[dir]; + std::vector& knownTargets = toLaneMap[to]; + if ((int)knownTargets.size() < item.second) { + int candidates = to->getNumLanesThatAllow(SVC_PASSENGER); + if (candidates < item.second) { + WRITE_WARNINGF("Cannot apply turn sign information for edge '%' because there are % signed connections with directions '%' but target edge '%' has only % suitable lanes", + getID(), item.second, toString(dir), to->getID(), candidates); + return false; + } + int i; + int iInc; + int iEnd; + if (dir > LinkDirection::STRAIGHT) { + // set more targets on the left + i = to->getNumLanes() - 1; + iInc = -1; + iEnd = -1; + } else { + // set more targets on the right + i = 0; + iInc = 1; + iEnd = to->getNumLanes(); + } + while ((int)knownTargets.size() < item.second && i != iEnd) { + if ((to->getPermissions(i) & SVC_PASSENGER) != 0) { + if (std::find(knownTargets.begin(), knownTargets.end(), i) == knownTargets.end()) { + knownTargets.push_back(i); + } + } + i += iInc; + } + if ((int)knownTargets.size() != item.second) { + WRITE_WARNINGF("Cannot apply turn sign information for edge '%' because not enough target lanes could be determined for direction '%'", getID(), toString(dir)); + return false; + } + std::sort(knownTargets.begin(), knownTargets.end()); + } + } + + std::map toLaneIndex; // implicitly starting at 0 + for (int i = 0; i < getNumLanes(); i++) { + const int turnSigns = myLanes[i].turnSigns; + // no turnSigns are given for bicycle lanes and sidewalks + if (turnSigns != 0) { + // clear existing connections + for (auto it = myConnections.begin(); it != myConnections.end();) { + if (it->fromLane == i) { + it = myConnections.erase(it); + } else { + it++; + } + } + // add new connections + for (LinkDirection dir : decodeTurnSigns(turnSigns)) { + NBEdge* to = const_cast(dirMap[dir]); + if (to != nullptr) { + setConnection(i, to, toLaneMap[to][toLaneIndex[to]++], Lane2LaneInfoType::VALIDATED, true); + } + } + } + } + sortOutgoingConnectionsByAngle(); + sortOutgoingConnectionsByIndex(); + return true; +} + + bool NBEdge::recheckLanes() { #ifdef DEBUG_CONNECTION_GUESSING @@ -2496,96 +2710,101 @@ } } if (myStep != EdgeBuildingStep::LANES2LANES_DONE && myStep != EdgeBuildingStep::LANES2LANES_USER) { - // check #1: - // If there is a lane with no connections and any neighbour lane has - // more than one connections, try to move one of them. - // This check is only done for edges which connections were assigned - // using the standard algorithm. - for (int i = 0; i < (int)myLanes.size(); i++) { - if (connNumbersPerLane[i] == 0 && !isForbidden(getPermissions((int)i))) { - // dead-end lane found - bool hasDeadEnd = true; - // find lane with two connections or more to the right of the current lane - for (int i2 = i - 1; hasDeadEnd && i2 >= 0; i2--) { - if (getPermissions(i) != getPermissions(i2)) { - break; - } - if (connNumbersPerLane[i2] > 1) { - connNumbersPerLane[i2]--; - for (int i3 = i2; i3 != i; i3++) { - moveConnectionToLeft(i3); - sortOutgoingConnectionsByAngle(); - sortOutgoingConnectionsByIndex(); - } - hasDeadEnd = false; - } - } - if (hasDeadEnd) { - // find lane with two connections or more to the left of the current lane - for (int i2 = i + 1; hasDeadEnd && i2 < getNumLanes(); i2++) { + //if (myLanes.back().turnSigns != 0 && myTurnSignTarget != myTo->getID()) { + // std::cout << getID() << " tst=" << myTurnSignTarget << " to=" << myTo->getID() << "\n"; + //} + if (myLanes.back().turnSigns == 0 || myTurnSignTarget != myTo->getID() || !applyTurnSigns()) { + // check #1: + // If there is a lane with no connections and any neighbour lane has + // more than one connections, try to move one of them. + // This check is only done for edges which connections were assigned + // using the standard algorithm. + for (int i = 0; i < (int)myLanes.size(); i++) { + if (connNumbersPerLane[i] == 0 && !isForbidden(getPermissions((int)i))) { + // dead-end lane found + bool hasDeadEnd = true; + // find lane with two connections or more to the right of the current lane + for (int i2 = i - 1; hasDeadEnd && i2 >= 0; i2--) { if (getPermissions(i) != getPermissions(i2)) { break; } if (connNumbersPerLane[i2] > 1) { connNumbersPerLane[i2]--; - for (int i3 = i2; i3 != i; i3--) { - moveConnectionToRight(i3); + for (int i3 = i2; i3 != i; i3++) { + moveConnectionToLeft(i3); sortOutgoingConnectionsByAngle(); sortOutgoingConnectionsByIndex(); } hasDeadEnd = false; } } + if (hasDeadEnd) { + // find lane with two connections or more to the left of the current lane + for (int i2 = i + 1; hasDeadEnd && i2 < getNumLanes(); i2++) { + if (getPermissions(i) != getPermissions(i2)) { + break; + } + if (connNumbersPerLane[i2] > 1) { + connNumbersPerLane[i2]--; + for (int i3 = i2; i3 != i; i3--) { + moveConnectionToRight(i3); + sortOutgoingConnectionsByAngle(); + sortOutgoingConnectionsByIndex(); + } + hasDeadEnd = false; + } + } + } } } - } - // check restrictions - for (std::vector::iterator i = myConnections.begin(); i != myConnections.end();) { - Connection& c = *i; - const SVCPermissions common = getPermissions(c.fromLane) & c.toEdge->getPermissions(c.toLane); - if (common == SVC_PEDESTRIAN || getPermissions(c.fromLane) == SVC_PEDESTRIAN) { - // these are computed in NBNode::buildWalkingAreas - i = myConnections.erase(i); - } else if (common == 0) { - // no common permissions. - // try to find a suitable target lane to the right - const int origToLane = c.toLane; - c.toLane = -1; // ignore this connection when calling hasConnectionTo - int toLane = origToLane; - while (toLane > 0 - && (getPermissions(c.fromLane) & c.toEdge->getPermissions(toLane)) == 0 - && !hasConnectionTo(c.toEdge, toLane) - ) { - toLane--; - } - if ((getPermissions(c.fromLane) & c.toEdge->getPermissions(toLane)) != 0 - && !hasConnectionTo(c.toEdge, toLane)) { - c.toLane = toLane; - ++i; - } else { - // try to find a suitable target lane to the left - toLane = origToLane; - while (toLane < (int)c.toEdge->getNumLanes() - 1 + // check restrictions + for (std::vector::iterator i = myConnections.begin(); i != myConnections.end();) { + Connection& c = *i; + const SVCPermissions common = getPermissions(c.fromLane) & c.toEdge->getPermissions(c.toLane); + if (common == SVC_PEDESTRIAN || getPermissions(c.fromLane) == SVC_PEDESTRIAN) { + // these are computed in NBNode::buildWalkingAreas + i = myConnections.erase(i); + } else if (common == 0) { + // no common permissions. + // try to find a suitable target lane to the right + const int origToLane = c.toLane; + c.toLane = -1; // ignore this connection when calling hasConnectionTo + int toLane = origToLane; + while (toLane > 0 && (getPermissions(c.fromLane) & c.toEdge->getPermissions(toLane)) == 0 && !hasConnectionTo(c.toEdge, toLane) ) { - toLane++; + toLane--; } if ((getPermissions(c.fromLane) & c.toEdge->getPermissions(toLane)) != 0 && !hasConnectionTo(c.toEdge, toLane)) { c.toLane = toLane; ++i; } else { - // no alternative target found - i = myConnections.erase(i); + // try to find a suitable target lane to the left + toLane = origToLane; + while (toLane < (int)c.toEdge->getNumLanes() - 1 + && (getPermissions(c.fromLane) & c.toEdge->getPermissions(toLane)) == 0 + && !hasConnectionTo(c.toEdge, toLane) + ) { + toLane++; + } + if ((getPermissions(c.fromLane) & c.toEdge->getPermissions(toLane)) != 0 + && !hasConnectionTo(c.toEdge, toLane)) { + c.toLane = toLane; + ++i; + } else { + // no alternative target found + i = myConnections.erase(i); + } } + } else if (isRailway(getPermissions(c.fromLane)) && isRailway(c.toEdge->getPermissions(c.toLane)) + && isTurningDirectionAt(c.toEdge)) { + // do not allow sharp rail turns + i = myConnections.erase(i); + } else { + ++i; } - } else if (isRailway(getPermissions(c.fromLane)) && isRailway(c.toEdge->getPermissions(c.toLane)) - && isTurningDirectionAt(c.toEdge)) { - // do not allow sharp rail turns - i = myConnections.erase(i); - } else { - ++i; } } } @@ -2615,14 +2834,16 @@ // avoid deadend due to change prohibitions if (getNumLanes() > 1 && myConnections.size() > 0) { for (int i = 0; i < (int)myLanes.size(); i++) { - if (connNumbersPerLane[i] == 0 && getPermissions(i) != SVC_PEDESTRIAN && !isForbidden(getPermissions(i))) { - Lane& lane = myLanes[i]; + Lane& lane = myLanes[i]; + if ((connNumbersPerLane[i] == 0 || ((lane.accelRamp || (i > 0 && myLanes[i - 1].accelRamp && connNumbersPerLane[i - 1] > 0)) + && getSuccessors(SVC_PASSENGER).size() > 1)) + && getPermissions(i) != SVC_PEDESTRIAN && !isForbidden(getPermissions(i))) { const bool forbiddenLeft = lane.changeLeft != SVCAll && lane.changeLeft != SVC_IGNORING && lane.changeLeft != SVC_UNSPECIFIED; const bool forbiddenRight = lane.changeRight != SVCAll && lane.changeRight != SVC_IGNORING && lane.changeRight != SVC_UNSPECIFIED; if (forbiddenLeft && (i == 0 || forbiddenRight)) { lane.changeLeft = SVC_UNSPECIFIED; WRITE_WARNING("Ignoring changeLeft prohibition for '" + getLaneID(i) + "' to avoid dead-end"); - } else if (forbiddenRight && i == getNumLanes() - 1) { + } else if (forbiddenRight && (i == getNumLanes() - 1 || (i > 0 && myLanes[i - 1].accelRamp))) { lane.changeRight = SVC_UNSPECIFIED; WRITE_WARNING("Ignoring changeRight prohibition for '" + getLaneID(i) + "' to avoid dead-end"); } @@ -3269,7 +3490,6 @@ PositionVector NBEdge::getCWBoundaryLine(const NBNode& n) const { PositionVector ret; - double width; int lane; if (myFrom == (&n)) { // outgoing @@ -3280,8 +3500,7 @@ lane = getFirstAllowedLaneIndex(NBNode::BACKWARD); ret = myLanes[lane].shape.reverse(); } - width = getLaneWidth(lane); - ret.move2side(width * 0.5); + ret.move2side(getLaneWidth(lane) / 2.); return ret; } @@ -3289,7 +3508,6 @@ PositionVector NBEdge::getCCWBoundaryLine(const NBNode& n) const { PositionVector ret; - double width; int lane; if (myFrom == (&n)) { // outgoing @@ -3300,8 +3518,7 @@ lane = getFirstAllowedLaneIndex(NBNode::FORWARD); ret = myLanes[lane].shape.reverse(); } - width = getLaneWidth(lane); - ret.move2side(-width * 0.5); + ret.move2side(-getLaneWidth(lane) / 2.); return ret; } @@ -3418,6 +3635,7 @@ } } myLanes[i].connectionsDone = e->myLanes[i].connectionsDone; + myLanes[i].turnSigns = e->myLanes[i].turnSigns; } if (e->getLength() > myLength) { // possibly some lane attributes differ (when using option geometry.remove.min-length) @@ -3439,6 +3657,7 @@ myConnectionsToDelete = e->myConnectionsToDelete; // set the node myTo = e->myTo; + myTurnSignTarget = e->myTurnSignTarget; myToBorder = e->myToBorder; if (e->knowsParameter("origTo")) { setParameter("origTo", e->getParameter("origTo")); @@ -3939,6 +4158,18 @@ return result; } +bool +NBEdge::allowsChangingLeft(int lane, SUMOVehicleClass vclass) const { + assert(lane >= 0 && lane < getNumLanes()); + return myLanes[lane].changeLeft == SVC_UNSPECIFIED ? true : (myLanes[lane].changeLeft & vclass) == vclass; +} + +bool +NBEdge::allowsChangingRight(int lane, SUMOVehicleClass vclass) const { + assert(lane >= 0 && lane < getNumLanes()); + return myLanes[lane].changeRight == SVC_UNSPECIFIED ? true : (myLanes[lane].changeRight & vclass) == vclass; +} + double NBEdge::getCrossingAngle(NBNode* node) { double angle = getAngleAtNode(node) + (getFromNode() == node ? 180.0 : 0.0); diff -Nru sumo-1.11.0/src/netbuild/NBEdge.h sumo-1.12.0/src/netbuild/NBEdge.h --- sumo-1.11.0/src/netbuild/NBEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -186,6 +186,9 @@ /// @brief the type of this lane std::string type; + + /// @brief turning signs printed on the road, bitset of LinkDirection (imported from OSM) + int turnSigns = 0; }; /** @struct Connection @@ -729,6 +732,12 @@ /// @brief get lane indices that allow the given permissions int getNumLanesThatAllow(SVCPermissions permissions) const; + /** @brief Returns whether the given vehicle class may change left from this lane */ + bool allowsChangingLeft(int lane, SUMOVehicleClass vclass) const; + + /** @brief Returns whether the given vehicle class may change left from this lane */ + bool allowsChangingRight(int lane, SUMOVehicleClass vclass) const; + /// @brief return the angle for computing pedestrian crossings at the given node double getCrossingAngle(NBNode* node); @@ -1410,7 +1419,7 @@ void debugPrintConnections(bool outgoing = true, bool incoming = false) const; /// @brief compute the first intersection point between the given lane geometries considering their rspective widths - static double firstIntersection(const PositionVector& v1, const PositionVector& v2, double width2, const std::string& error = "", bool secondIntersection = false); + static double firstIntersection(const PositionVector& v1, const PositionVector& v2, double width1, double width2, const std::string& error = "", bool secondIntersection = false); /** returns a modified version of laneShape which starts at the outside of startNode. laneShape may be shorted or extended * @note see [wiki:Developer/Network_Building_Process] @@ -1477,6 +1486,15 @@ /// @brief set oppositeID and return opposite edge if found NBEdge* guessOpposite(bool reguess = false); + + const std::string& getTurnSignTarget() const { + return myTurnSignTarget; + } + + void setTurnSignTarget(const std::string& target) { + myTurnSignTarget = target; + } + /// @brief return only those edges that permit at least one of the give permissions static EdgeVector filterByPermissions(const EdgeVector& edges, SVCPermissions permissions); @@ -1624,7 +1642,7 @@ /// @brief determine conflict between opposite left turns bool bothLeftTurns(LinkDirection dir, const NBEdge* otherFrom, LinkDirection dir2) const; bool haveIntersection(const NBNode& n, const PositionVector& shape, const NBEdge* otherFrom, const NBEdge::Connection& otherCon, - int numPoints, double width2, int shapeFlag = 0) const; + int numPoints, double width1, double width2, int shapeFlag = 0) const; /// @brief returns whether any lane already allows the given vclass exclusively bool hasRestrictedLane(SUMOVehicleClass vclass) const; @@ -1635,6 +1653,12 @@ /// @brief assign length to all lanes of an internal edge void assignInternalLaneLength(std::vector::iterator i, int numLanes, double lengthSum, bool averageLength); + /// @brief decode bitset + std::vector decodeTurnSigns(int turnSigns); + + /// @brief apply loaded turn sign information + bool applyTurnSigns(); + private: /** @brief The building step * @see EdgeBuildingStep @@ -1647,6 +1671,9 @@ /// @brief The source and the destination node NBNode* myFrom, *myTo; + /// @brief node for which turnSign information applies + std::string myTurnSignTarget; + /// @brief The length of the edge double myLength; diff -Nru sumo-1.11.0/src/netbuild/NBFrame.cpp sumo-1.12.0/src/netbuild/NBFrame.cpp --- sumo-1.11.0/src/netbuild/NBFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -228,6 +228,9 @@ oc.doRegister("railway.topology.direction-priority", new Option_Bool(false)); oc.addDescription("railway.topology.direction-priority", "Railway", "Set edge priority values based on estimated main direction"); + oc.doRegister("railway.topology.extend-priority", new Option_Bool(false)); + oc.addDescription("railway.topology.extend-priority", "Railway", "Extend loaded edge priority values based on estimated main direction"); + oc.doRegister("railway.access-distance", new Option_Float(150.f)); oc.addDescription("railway.access-distance", "Railway", "The search radius for finding suitable road accesses for rail stops"); oc.addSynonyme("railway.access-distance", "osm.stop-output.footway-access-distance", true); @@ -364,6 +367,10 @@ oc.addDescription("junctions.higher-speed", "Junctions", "Use maximum value of incoming and outgoing edge speed on junction instead of average"); + oc.doRegister("internal-junctions.vehicle-width", new Option_Float(1.8)); + oc.addDescription("internal-junctions.vehicle-width", "Junctions", + "Assumed vehicle width for computing internal junction positions"); + oc.doRegister("rectangular-lane-cut", new Option_Bool(false)); oc.addDescription("rectangular-lane-cut", "Junctions", "Forces rectangular cuts between lanes and intersections"); @@ -709,8 +716,7 @@ } if (oc.getFloat("junctions.small-radius") > oc.getFloat("default.junctions.radius") && oc.getFloat("default.junctions.radius") >= 0) { if (!oc.isDefault("junctions.small-radius")) { - WRITE_ERROR("option 'default.junctions.radius' cannot be smaller than option 'junctions.small-radius'"); - ok = false; + WRITE_WARNING("option 'default.junctions.radius' is smaller than option 'junctions.small-radius'"); } else { oc.set("junctions.small-radius", oc.getValueString("default.junctions.radius")); } diff -Nru sumo-1.11.0/src/netbuild/NBFrame.h sumo-1.12.0/src/netbuild/NBFrame.h --- sumo-1.11.0/src/netbuild/NBFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBHeightMapper.cpp sumo-1.12.0/src/netbuild/NBHeightMapper.cpp --- sumo-1.11.0/src/netbuild/NBHeightMapper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBHeightMapper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2011-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBHeightMapper.h sumo-1.12.0/src/netbuild/NBHeightMapper.h --- sumo-1.11.0/src/netbuild/NBHeightMapper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBHeightMapper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2011-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBHelpers.cpp sumo-1.12.0/src/netbuild/NBHelpers.cpp --- sumo-1.11.0/src/netbuild/NBHelpers.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBHelpers.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBHelpers.h sumo-1.12.0/src/netbuild/NBHelpers.h --- sumo-1.11.0/src/netbuild/NBHelpers.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBHelpers.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBLinkPossibilityMatrix.h sumo-1.12.0/src/netbuild/NBLinkPossibilityMatrix.h --- sumo-1.11.0/src/netbuild/NBLinkPossibilityMatrix.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBLinkPossibilityMatrix.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBLoadedSUMOTLDef.cpp sumo-1.12.0/src/netbuild/NBLoadedSUMOTLDef.cpp --- sumo-1.11.0/src/netbuild/NBLoadedSUMOTLDef.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBLoadedSUMOTLDef.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2011-2022 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/ @@ -689,13 +689,25 @@ cleanupStates(); //std::cout << "oldMaxIndex=" << maxIndex << " newMaxIndex=" << getMaxIndex() << " unused=" << toString(unusedIndices) << "\n"; setTLControllingInformation(); + // patch crossing indices + for (NBNode* n : myControlledNodes) { + for (NBNode::Crossing* c : n->getCrossings()) { + for (int i = (int)unusedIndices.size() - 1; i >= 0; i--) { + if (c->customTLIndex > i) { + c->customTLIndex--; + } + if (c->customTLIndex2 > i) { + c->customTLIndex2--; + } + } + } + } } void NBLoadedSUMOTLDef::ungroupSignals() { NBConnectionVector defaultOrdering; collectAllLinks(defaultOrdering); - myTLLogic->setStateLength((int)myControlledLinks.size()); std::vector states; // organized per link rather than phase int index = 0; for (NBConnection& c : defaultOrdering) { @@ -706,13 +718,14 @@ for (NBNode* n : myControlledNodes) { for (NBNode::Crossing* c : n->getCrossings()) { states.push_back(getStates(c->tlLinkIndex)); - c->tlLinkIndex = index++; + c->customTLIndex = index++; if (c->tlLinkIndex2 != NBConnection::InvalidTlIndex) { states.push_back(getStates(c->tlLinkIndex2)); - c->tlLinkIndex2 = index++; + c->customTLIndex2 = index++; } } } + myTLLogic->setStateLength(index); for (int i = 0; i < (int)states.size(); i++) { for (int p = 0; p < (int)states[i].size(); p++) { myTLLogic->setPhaseState(p, i, (LinkState)states[i][p]); diff -Nru sumo-1.11.0/src/netbuild/NBLoadedSUMOTLDef.h sumo-1.12.0/src/netbuild/NBLoadedSUMOTLDef.h --- sumo-1.11.0/src/netbuild/NBLoadedSUMOTLDef.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBLoadedSUMOTLDef.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2011-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBLoadedTLDef.cpp sumo-1.12.0/src/netbuild/NBLoadedTLDef.cpp --- sumo-1.11.0/src/netbuild/NBLoadedTLDef.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBLoadedTLDef.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBLoadedTLDef.h sumo-1.12.0/src/netbuild/NBLoadedTLDef.h --- sumo-1.11.0/src/netbuild/NBLoadedTLDef.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBLoadedTLDef.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBNetBuilder.cpp sumo-1.12.0/src/netbuild/NBNetBuilder.cpp --- sumo-1.11.0/src/netbuild/NBNetBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBNetBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -165,7 +165,10 @@ } if (oc.exists("railway.topology.direction-priority") && oc.getBool("railway.topology.direction-priority")) { NBTurningDirectionsComputer::computeTurnDirections(myNodeCont, false); // recompute after new edges were added - NBRailwayTopologyAnalyzer::assignDirectionPriority(*this); + NBRailwayTopologyAnalyzer::extendDirectionPriority(*this, true); + } else if (oc.exists("railway.topology.extend-priority") && oc.getBool("railway.topology.extend-priority")) { + NBTurningDirectionsComputer::computeTurnDirections(myNodeCont, false); // recompute after new edges were added + NBRailwayTopologyAnalyzer::extendDirectionPriority(*this, false); } if (oc.exists("railway.topology.output") && oc.isSet("railway.topology.output")) { NBTurningDirectionsComputer::computeTurnDirections(myNodeCont, false); // recompute after new edges were added diff -Nru sumo-1.11.0/src/netbuild/NBNetBuilder.h sumo-1.12.0/src/netbuild/NBNetBuilder.h --- sumo-1.11.0/src/netbuild/NBNetBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBNetBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBNodeCont.cpp sumo-1.12.0/src/netbuild/NBNodeCont.cpp --- sumo-1.11.0/src/netbuild/NBNodeCont.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBNodeCont.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -1734,6 +1734,14 @@ e->setParameter("origTo", e->getToNode()->getID()); } } + if (e->getTurnSignTarget() != "") { + for (NBNode* n : cluster) { + if (e->getTurnSignTarget() == n->getID()) { + e->setTurnSignTarget(to->getID()); + break; + } + } + } e->reinitNodes(from, to); // re-add connections which previously existed and may still valid. // connections to removed edges will be ignored diff -Nru sumo-1.11.0/src/netbuild/NBNodeCont.h sumo-1.12.0/src/netbuild/NBNodeCont.h --- sumo-1.11.0/src/netbuild/NBNodeCont.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBNodeCont.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBNode.cpp sumo-1.12.0/src/netbuild/NBNode.cpp --- sumo-1.11.0/src/netbuild/NBNode.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBNode.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -1907,6 +1907,19 @@ return NBRequest::mustBrakeForCrossing(this, from, to, crossing); } +bool +NBNode::brakeForCrossingOnExit(const NBEdge* to) const { + // code is called for connections exiting after an internal junction. + // Therefore we can assume that the connection is turning and do not check + // for direction or crossing priority anymore. + for (auto& c : myCrossings) { + if (std::find(c->edges.begin(), c->edges.end(), to) != c->edges.end()) { + return true; + } + } + return false; +} + bool NBNode::rightTurnConflict(const NBEdge* from, const NBEdge* to, int fromLane, @@ -2235,6 +2248,9 @@ return angle > 0 ? LinkDirection::PARTRIGHT : LinkDirection::PARTLEFT; } } + if (angle > 0 && incoming->getJunctionPriority(this) == NBEdge::JunctionPriority::ROUNDABOUT) { + return angle > 15 ? LinkDirection::RIGHT : LinkDirection::PARTRIGHT; + } return LinkDirection::STRAIGHT; } @@ -2251,7 +2267,9 @@ } } else { // check whether any other edge goes further to the left - if (angle < -90) { + if (angle < -170 && incoming->getGeometry().reverse() == outgoing->getGeometry()) { + return leftHand ? LinkDirection::TURN_LEFTHAND : LinkDirection::TURN; + } else if (angle < -90) { return LinkDirection::LEFT; } NBEdge* outCCW = getNextCompatibleOutgoing(incoming, vehPerm, itOut, leftHand); diff -Nru sumo-1.11.0/src/netbuild/NBNode.h sumo-1.12.0/src/netbuild/NBNode.h --- sumo-1.11.0/src/netbuild/NBNode.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBNode.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -462,6 +462,9 @@ */ bool mustBrakeForCrossing(const NBEdge* const from, const NBEdge* const to, const Crossing& crossing) const; + /// @brief whether a connection to the given edge must brake for a crossing when leaving the intersection + bool brakeForCrossingOnExit(const NBEdge* to) const; + /// @brief return whether the given laneToLane connection is a right turn which must yield to a bicycle crossings static bool rightTurnConflict(const NBEdge* from, const NBEdge* to, int fromLane, const NBEdge* prohibitorFrom, const NBEdge* prohibitorTo, int prohibitorFromLane); diff -Nru sumo-1.11.0/src/netbuild/NBNodeShapeComputer.cpp sumo-1.12.0/src/netbuild/NBNodeShapeComputer.cpp --- sumo-1.11.0/src/netbuild/NBNodeShapeComputer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBNodeShapeComputer.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -43,7 +43,7 @@ #define EXT 100.0 #define EXT2 10.0 -// foot- and bicycle paths as well as pure service roads should not get larget junctions +// foot and bicycle paths as well as pure service roads should not get large junctions // railways also do have have junctions with sharp turns so can be excluded const SVCPermissions NBNodeShapeComputer::SVC_LARGE_TURN( SVCAll & ~(SVC_BICYCLE | SVC_PEDESTRIAN | SVC_DELIVERY | SVC_RAIL_CLASSES)); @@ -60,20 +60,8 @@ NBNodeShapeComputer::~NBNodeShapeComputer() {} -PositionVector +const PositionVector NBNodeShapeComputer::compute() { - PositionVector ret; - // check whether the node is a dead end node or a node where only turning is possible - // in this case, we will use "computeNodeShapeSmall" - bool singleDirection = false; - if (myNode.getEdges().size() == 1) { - singleDirection = true; - } - if (myNode.getEdges().size() == 2 && myNode.getIncomingEdges().size() == 1) { - if (myNode.getIncomingEdges()[0]->isTurningDirectionAt(myNode.getOutgoingEdges()[0])) { - singleDirection = true; - } - } #ifdef DEBUG_NODE_SHAPE if (DEBUGCOND) { // annotate edges edges to make their ordering visible @@ -84,39 +72,21 @@ } } #endif - if (singleDirection) { + // check whether the node is a dead end node or a node where only turning is possible + // in this case, we will use "computeNodeShapeSmall" + if (myNode.getEdges().size() == 1) { return computeNodeShapeSmall(); } - // check whether the node is a just something like a geometry - // node (one in and one out or two in and two out, pair-wise continuations) - // also in this case "computeNodeShapeSmall" is used - bool geometryLike = myNode.isSimpleContinuation(true, true); - if (geometryLike && myNode.getCrossings().size() == 0) { - // additionally, the angle between the edges must not be larger than 45 degrees - // (otherwise, we will try to compute the shape in a different way) - const EdgeVector& incoming = myNode.getIncomingEdges(); - const EdgeVector& outgoing = myNode.getOutgoingEdges(); - double maxAngle = 0.; - for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); ++i) { - double ia = (*i)->getAngleAtNode(&myNode); - for (EdgeVector::const_iterator j = outgoing.begin(); j != outgoing.end(); ++j) { - double oa = (*j)->getAngleAtNode(&myNode); - double ad = GeomHelper::getMinAngleDiff(ia, oa); - if (22.5 >= ad) { - maxAngle = MAX2(ad, maxAngle); - } - } - } - if (maxAngle > 22.5) { + if (myNode.getEdges().size() == 2 && myNode.getIncomingEdges().size() == 1) { + if (myNode.getIncomingEdges()[0]->isTurningDirectionAt(myNode.getOutgoingEdges()[0])) { return computeNodeShapeSmall(); } } - - // - ret = computeNodeShapeDefault(geometryLike); + const bool geometryLike = myNode.isSimpleContinuation(true, true); + const PositionVector& ret = computeNodeShapeDefault(geometryLike); // fail fall-back: use "computeNodeShapeSmall" if (ret.size() < 3) { - ret = computeNodeShapeSmall(); + return computeNodeShapeSmall(); } return ret; } @@ -145,7 +115,7 @@ } -PositionVector +const PositionVector NBNodeShapeComputer::computeNodeShapeDefault(bool simpleContinuation) { // if we have less than two edges, we can not compute the node's shape this way if (myNode.getEdges().size() < 2) { @@ -196,7 +166,7 @@ return PositionVector(); } - // All geoms are outoing from myNode. + // All geoms are outgoing from myNode. // for every direction in newAll we compute the offset at which the // intersection ends and the edge starts. This value is saved in 'distances' // If the geometries need to be extended to get an intersection, this is @@ -303,7 +273,7 @@ } else { // the angles are different enough to compute the intersection of - // the outer boundaries directly (or there are more than 2 directions). The "nearer" neighbar causes the furthest distance + // the outer boundaries directly (or there are more than 2 directions). The "nearer" neighbor causes the furthest distance const bool ccwCloser = ccad < cad; const bool cwLargeTurn = needsLargeTurn(*i, *cwi, same); const bool ccwLargeTurn = needsLargeTurn(*i, *ccwi, same); @@ -409,30 +379,32 @@ } } - for (i = newAll.begin(); i != newAll.end(); ++i) { - if (distances.find(*i) == distances.end()) { + for (NBEdge* const edge : newAll) { + if (distances.find(edge) == distances.end()) { assert(false); - distances[*i] = EXT; + distances[edge] = EXT; } } + // because of lane spread right the crossing point may be identical to the junction center and thus the distance is exactly EXT + const double off = EXT - NUMERICAL_EPS; // prevent inverted node shapes // (may happen with near-parallel edges) const double minDistSum = 2 * (EXT + myRadius); - for (i = newAll.begin(); i != newAll.end(); ++i) { - if (distances[*i] < EXT && (*i)->hasDefaultGeometryEndpointAtNode(&myNode)) { + for (NBEdge* const edge : newAll) { + if (distances[edge] < off && edge->hasDefaultGeometryEndpointAtNode(&myNode)) { for (EdgeVector::const_iterator j = newAll.begin(); j != newAll.end(); ++j) { - if (distances[*j] > EXT && (*j)->hasDefaultGeometryEndpointAtNode(&myNode) && distances[*i] + distances[*j] < minDistSum) { - const double angleDiff = fabs(NBHelpers::relAngle((*i)->getAngleAtNode(&myNode), (*j)->getAngleAtNode(&myNode))); + if (distances[*j] > off && (*j)->hasDefaultGeometryEndpointAtNode(&myNode) && distances[edge] + distances[*j] < minDistSum) { + const double angleDiff = fabs(NBHelpers::relAngle(edge->getAngleAtNode(&myNode), (*j)->getAngleAtNode(&myNode))); if (angleDiff > 160 || angleDiff < 20) { #ifdef DEBUG_NODE_SHAPE if (DEBUGCOND) { - std::cout << " increasing dist for i=" << (*i)->getID() << " because of j=" << (*j)->getID() << " jDist=" << distances[*j] - << " oldI=" << distances[*i] << " newI=" << minDistSum - distances[*j] + std::cout << " increasing dist for i=" << edge->getID() << " because of j=" << (*j)->getID() << " jDist=" << distances[*j] + << " oldI=" << distances[edge] << " newI=" << minDistSum - distances[*j] << " angleDiff=" << angleDiff - << " geomI=" << (*i)->getGeometry() << " geomJ=" << (*j)->getGeometry() << "\n"; + << " geomI=" << edge->getGeometry() << " geomJ=" << (*j)->getGeometry() << "\n"; } #endif - distances[*i] = minDistSum - distances[*j]; + distances[edge] = minDistSum - distances[*j]; } } } @@ -622,7 +594,7 @@ GeomsMap& geomsCCW, GeomsMap& geomsCW) { // compute boundary lines and extend it by EXT m - for (NBEdge* edge : edges) { + for (NBEdge* const edge : edges) { // store current edge's boundary as current ccw/cw boundary try { geomsCCW[edge] = edge->getCCWBoundaryLine(myNode); @@ -643,7 +615,7 @@ if (geomsCW[edge].length2D() < NUMERICAL_EPS) { geomsCW[edge] = edge->getGeometry(); } - // extend the boundary by extroplating it by EXT m + // extend the boundary by extrapolating it by EXT m geomsCCW[edge].extrapolate2D(EXT, true); geomsCW[edge].extrapolate2D(EXT, true); geomsCCW[edge].extrapolate(EXT2, false, true); @@ -654,9 +626,8 @@ void NBNodeShapeComputer::joinSameDirectionEdges(const EdgeVector& edges, std::map >& same) { // compute same (edges where an intersection doesn't work well - // (always check an edge and its cw neightbor) - // distance to look ahead for a misleading angle - const double angleChangeLookahead = 35; + // (always check an edge and its cw neighbor) + const double angleChangeLookahead = 35; // distance to look ahead for a misleading angle EdgeSet foundOpposite; for (EdgeVector::const_iterator i = edges.begin(); i != edges.end(); i++) { EdgeVector::const_iterator j; @@ -667,8 +638,8 @@ } const bool incoming = (*i)->getToNode() == &myNode; const bool incoming2 = (*j)->getToNode() == &myNode; - const Position positionAtNode = (*i)->getGeometry()[incoming ? -1 : 0]; - const Position positionAtNode2 = (*j)->getGeometry()[incoming2 ? -1 : 0]; + const bool differentDirs = (incoming != incoming2); + const bool sameGeom = (*i)->getGeometry() == (differentDirs ? (*j)->getGeometry().reverse() : (*j)->getGeometry()); const PositionVector g1 = incoming ? (*i)->getCCWBoundaryLine(myNode) : (*i)->getCWBoundaryLine(myNode); const PositionVector g2 = incoming ? (*j)->getCCWBoundaryLine(myNode) : (*j)->getCWBoundaryLine(myNode); const double angle1further = (g1.size() > 2 && g1[0].distanceTo2D(g1[1]) < angleChangeLookahead ? @@ -678,7 +649,6 @@ const double angleDiff = GeomHelper::angleDiff(g1.angleAt2D(0), g2.angleAt2D(0)); const double angleDiffFurther = GeomHelper::angleDiff(angle1further, angle2further); const bool ambiguousGeometry = ((angleDiff > 0 && angleDiffFurther < 0) || (angleDiff < 0 && angleDiffFurther > 0)); - const bool differentDirs = (incoming != incoming2); //if (ambiguousGeometry) { // @todo: this warning would be helpful in many cases. However, if angle and angleFurther jump between 179 and -179 it is misleading // WRITE_WARNING("Ambiguous angles at junction '" + myNode.getID() + "' for edges '" + (*i)->getID() + "' and '" + (*j)->getID() + "'."); @@ -690,12 +660,12 @@ << " isOpposite=" << (differentDirs && foundOpposite.count(*i) == 0) << " angleDiff=" << angleDiff << " ambiguousGeometry=" << ambiguousGeometry - << " badIntersect=" << badIntersection(*i, *j, EXT) + << badIntersection(*i, *j, EXT) << "\n"; } #endif - if (fabs(angleDiff) < DEG2RAD(20)) { + if (sameGeom || fabs(angleDiff) < DEG2RAD(20)) { const bool isOpposite = differentDirs && foundOpposite.count(*i) == 0; if (isOpposite) { foundOpposite.insert(*i); @@ -897,7 +867,7 @@ -PositionVector +const PositionVector NBNodeShapeComputer::computeNodeShapeSmall() { #ifdef DEBUG_NODE_SHAPE if (DEBUGCOND) { @@ -1023,14 +993,19 @@ maxTurnAngle = maxLeftAngle; extraWidth = extraWidthLeft; } + const double minRadius = maxTurnAngle >= DEG2RAD(30) ? MIN2(smallRadius, radius) : smallRadius; if (laneDelta == 0 || maxTurnAngle >= DEG2RAD(30) || myNode.isConstantWidthTransition()) { // subtract radius gained from extra lanes // do not increase radius for turns that are sharper than a right angle - result = MAX2(smallRadius, radius * tan(0.5 * MIN2(0.5 * M_PI, maxTurnAngle)) - extraWidth); + result = radius * tan(0.5 * MIN2(0.5 * M_PI, maxTurnAngle)) - extraWidth; } + result = MAX2(minRadius, result); #ifdef DEBUG_RADIUS if (DEBUGCOND) { - std::cout << "getDefaultRadius n=" << myNode.getID() << " laneDelta=" << laneDelta + std::cout << "getDefaultRadius n=" << myNode.getID() + << " r=" << radius << " sr=" << smallRadius + << " mr=" << minRadius + << " laneDelta=" << laneDelta << " rightA=" << RAD2DEG(maxRightAngle) << " leftA=" << RAD2DEG(maxLeftAngle) << " maxA=" << RAD2DEG(maxTurnAngle) diff -Nru sumo-1.11.0/src/netbuild/NBNodeShapeComputer.h sumo-1.12.0/src/netbuild/NBNodeShapeComputer.h --- sumo-1.11.0/src/netbuild/NBNodeShapeComputer.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBNodeShapeComputer.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -48,7 +48,7 @@ ~NBNodeShapeComputer(); /// Computes the shape of the assigned junction - PositionVector compute(); + const PositionVector compute(); /// @brief get computed radius for node double getRadius() const { @@ -63,7 +63,7 @@ * Then the node geometry is built from intersection between the borders * of adjacent edge groups */ - PositionVector computeNodeShapeDefault(bool simpleContinuation); + const PositionVector computeNodeShapeDefault(bool simpleContinuation); /** @brief Computes the node geometry using normals * @@ -76,7 +76,7 @@ * @note This usually gives a very small node shape, appropriate for * dead-ends or turn-around-only situations */ - PositionVector computeNodeShapeSmall(); + const PositionVector computeNodeShapeSmall(); /// @brief compute clockwise/counter-clockwise edge boundaries void computeEdgeBoundaries(const EdgeVector& edges, diff -Nru sumo-1.11.0/src/netbuild/NBOwnTLDef.cpp sumo-1.12.0/src/netbuild/NBOwnTLDef.cpp --- sumo-1.11.0/src/netbuild/NBOwnTLDef.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBOwnTLDef.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBOwnTLDef.h sumo-1.12.0/src/netbuild/NBOwnTLDef.h --- sumo-1.11.0/src/netbuild/NBOwnTLDef.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBOwnTLDef.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBParking.cpp sumo-1.12.0/src/netbuild/NBParking.cpp --- sumo-1.11.0/src/netbuild/NBParking.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBParking.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBParking.h sumo-1.12.0/src/netbuild/NBParking.h --- sumo-1.11.0/src/netbuild/NBParking.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBParking.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBPTLineCont.cpp sumo-1.12.0/src/netbuild/NBPTLineCont.cpp --- sumo-1.11.0/src/netbuild/NBPTLineCont.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBPTLineCont.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -610,7 +610,7 @@ } if (!ok) { int lane = cons[0].fromLane; - e1->setPermissions(e1->getPermissions(lane) | svc); + e1->setPermissions(e1->getPermissions(lane) | svc, lane); } } } diff -Nru sumo-1.11.0/src/netbuild/NBPTLineCont.h sumo-1.12.0/src/netbuild/NBPTLineCont.h --- sumo-1.11.0/src/netbuild/NBPTLineCont.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBPTLineCont.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBPTLine.cpp sumo-1.12.0/src/netbuild/NBPTLine.cpp --- sumo-1.11.0/src/netbuild/NBPTLine.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBPTLine.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBPTLine.h sumo-1.12.0/src/netbuild/NBPTLine.h --- sumo-1.11.0/src/netbuild/NBPTLine.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBPTLine.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBPTPlatform.cpp sumo-1.12.0/src/netbuild/NBPTPlatform.cpp --- sumo-1.11.0/src/netbuild/NBPTPlatform.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBPTPlatform.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBPTPlatform.h sumo-1.12.0/src/netbuild/NBPTPlatform.h --- sumo-1.11.0/src/netbuild/NBPTPlatform.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBPTPlatform.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBPTStopCont.cpp sumo-1.12.0/src/netbuild/NBPTStopCont.cpp --- sumo-1.11.0/src/netbuild/NBPTStopCont.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBPTStopCont.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -332,7 +332,9 @@ myPTStopLookup[item.second->getEdgeId()].push_back(item.second); } } - for (NBPTStop* stop : myPTStopLookup[edgeID]) { + // make a copy because the vector gets modified + const std::vector stops = myPTStopLookup[edgeID]; + for (NBPTStop* stop : stops) { if (!stop->replaceEdge(edgeID, replacement)) { WRITE_WARNINGF("Could not re-assign pt stop '%' after replacing edge '%'.", stop->getID(), edgeID); } else { diff -Nru sumo-1.11.0/src/netbuild/NBPTStopCont.h sumo-1.12.0/src/netbuild/NBPTStopCont.h --- sumo-1.11.0/src/netbuild/NBPTStopCont.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBPTStopCont.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBPTStop.cpp sumo-1.12.0/src/netbuild/NBPTStop.cpp --- sumo-1.11.0/src/netbuild/NBPTStop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBPTStop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBPTStop.h sumo-1.12.0/src/netbuild/NBPTStop.h --- sumo-1.11.0/src/netbuild/NBPTStop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBPTStop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBRequest.cpp sumo-1.12.0/src/netbuild/NBRequest.cpp --- sumo-1.11.0/src/netbuild/NBRequest.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBRequest.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -827,7 +827,8 @@ return false; }; - double width2 = prohibitorCon.toEdge->getLaneWidth(prohibitorCon.toLane) / 2; + const double width1 = MIN2(from->getLaneWidth(con.fromLane) / 2, OptionsCont::getOptions().getFloat("internal-junctions.vehicle-width") / 2); + const double width2 = prohibitorCon.toEdge->getLaneWidth(prohibitorCon.toLane) / 2; PositionVector shape = con.shape; shape.append(con.viaShape); PositionVector otherShape = prohibitorCon.shape; @@ -836,7 +837,7 @@ // no internal lanes built return false; } - const double minDV = NBEdge::firstIntersection(shape, otherShape, width2); + const double minDV = NBEdge::firstIntersection(shape, otherShape, width1, width2); if (minDV < shape.length() - POSITION_EPS && minDV > POSITION_EPS) { // break symmetry using edge id return foes || from->getID() < prohibitorFrom->getID(); diff -Nru sumo-1.11.0/src/netbuild/NBRequest.h sumo-1.12.0/src/netbuild/NBRequest.h --- sumo-1.11.0/src/netbuild/NBRequest.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBRequest.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBSign.cpp sumo-1.12.0/src/netbuild/NBSign.cpp --- sumo-1.11.0/src/netbuild/NBSign.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBSign.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBSign.h sumo-1.12.0/src/netbuild/NBSign.h --- sumo-1.11.0/src/netbuild/NBSign.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBSign.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBTrafficLightDefinition.cpp sumo-1.12.0/src/netbuild/NBTrafficLightDefinition.cpp --- sumo-1.11.0/src/netbuild/NBTrafficLightDefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBTrafficLightDefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBTrafficLightDefinition.h sumo-1.12.0/src/netbuild/NBTrafficLightDefinition.h --- sumo-1.11.0/src/netbuild/NBTrafficLightDefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBTrafficLightDefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBTrafficLightLogicCont.cpp sumo-1.12.0/src/netbuild/NBTrafficLightLogicCont.cpp --- sumo-1.11.0/src/netbuild/NBTrafficLightLogicCont.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBTrafficLightLogicCont.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBTrafficLightLogicCont.h sumo-1.12.0/src/netbuild/NBTrafficLightLogicCont.h --- sumo-1.11.0/src/netbuild/NBTrafficLightLogicCont.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBTrafficLightLogicCont.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBTrafficLightLogic.cpp sumo-1.12.0/src/netbuild/NBTrafficLightLogic.cpp --- sumo-1.11.0/src/netbuild/NBTrafficLightLogic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBTrafficLightLogic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBTrafficLightLogic.h sumo-1.12.0/src/netbuild/NBTrafficLightLogic.h --- sumo-1.11.0/src/netbuild/NBTrafficLightLogic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBTrafficLightLogic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netbuild/NBTypeCont.cpp sumo-1.12.0/src/netbuild/NBTypeCont.cpp --- sumo-1.11.0/src/netbuild/NBTypeCont.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBTypeCont.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -47,10 +47,27 @@ } -NBTypeCont::LaneTypeDefinition::LaneTypeDefinition(double _speed, double _width, SVCPermissions _permissions) : +NBTypeCont::LaneTypeDefinition::LaneTypeDefinition(const EdgeTypeDefinition* edgeTypeDefinition) : + speed(edgeTypeDefinition->speed), + permissions(edgeTypeDefinition->permissions), + width(edgeTypeDefinition->width) { +} + + +NBTypeCont::LaneTypeDefinition::LaneTypeDefinition(const double _speed, const double _width, SVCPermissions _permissions, const std::set& _attrs) : speed(_speed), permissions(_permissions), - width(_width) { + width(_width), + attrs(_attrs) { +} + + +NBTypeCont::LaneTypeDefinition::LaneTypeDefinition(const LaneTypeDefinition* laneTypeDefinition) : + speed(laneTypeDefinition->speed), + permissions(laneTypeDefinition->permissions), + width(laneTypeDefinition->width), + restrictions(laneTypeDefinition->restrictions), + attrs(laneTypeDefinition->attrs) { } // --------------------------------------------------------------------------- @@ -74,9 +91,12 @@ NBTypeCont::EdgeTypeDefinition::EdgeTypeDefinition(const EdgeTypeDefinition* edgeType) : - speed(edgeType->speed), priority(edgeType->priority), + speed(edgeType->speed), + priority(edgeType->priority), permissions(edgeType->permissions), - oneWay(edgeType->oneWay), discard(edgeType->discard), + spreadType(edgeType->spreadType), + oneWay(edgeType->oneWay), + discard(edgeType->discard), width(edgeType->width), widthResolution(edgeType->widthResolution), maxWidth(edgeType->maxWidth), @@ -212,11 +232,10 @@ double width, const std::set& attrs) { EdgeTypeDefinition* et = myEdgeTypes.at(edgeTypeID); while ((int)et->laneTypeDefinitions.size() <= index) { - et->laneTypeDefinitions.push_back(LaneTypeDefinition(et->speed, et->width, et->permissions)); + et->laneTypeDefinitions.push_back(et); } - et->laneTypeDefinitions[index] = LaneTypeDefinition(maxSpeed, width, permissions); - // update attributes - et->laneTypeDefinitions[index].attrs = attrs; + // add LaneTypeDefinition with the given attributes + et->laneTypeDefinitions[index] = LaneTypeDefinition(maxSpeed, width, permissions, attrs); } diff -Nru sumo-1.11.0/src/netbuild/NBTypeCont.h sumo-1.12.0/src/netbuild/NBTypeCont.h --- sumo-1.11.0/src/netbuild/NBTypeCont.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBTypeCont.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -52,13 +52,23 @@ class NBTypeCont { public: + /// @name struct declaration + struct EdgeTypeDefinition; + /// @brief laneType definition struct LaneTypeDefinition { - /// @brief Constructor + + /// @brief default Constructor LaneTypeDefinition(); - /// @brief parameter Constructor - LaneTypeDefinition(double speed, double width, SVCPermissions permissions); + /// @brief constructor (using parameters of EdgeTypeDefinition) + LaneTypeDefinition(const EdgeTypeDefinition* edgeTypeDefinition); + + /// @brief parameter constructor + LaneTypeDefinition(const double speed, const double width, SVCPermissions permissions, const std::set& attrs); + + /// @brief copy constructor + LaneTypeDefinition(const LaneTypeDefinition* laneTypeDefinition); /// @brief The maximal velocity on a lane in m/s double speed; diff -Nru sumo-1.11.0/src/netbuild/NBVehicle.h sumo-1.12.0/src/netbuild/NBVehicle.h --- sumo-1.11.0/src/netbuild/NBVehicle.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netbuild/NBVehicle.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/netconvert_main.cpp sumo-1.12.0/src/netconvert_main.cpp --- sumo-1.11.0/src/netconvert_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netconvert_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/CMakeLists.txt sumo-1.12.0/src/netedit/changes/CMakeLists.txt --- sumo-1.11.0/src/netedit/changes/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -9,8 +9,6 @@ GNEChange_Edge.cpp GNEChange_EdgeType.h GNEChange_EdgeType.cpp - GNEChange_LaneType.h - GNEChange_LaneType.cpp GNEChange_Crossing.h GNEChange_Crossing.cpp GNEChange_Lane.h diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Additional.cpp sumo-1.12.0/src/netedit/changes/GNEChange_Additional.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_Additional.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Additional.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Additional.h sumo-1.12.0/src/netedit/changes/GNEChange_Additional.h --- sumo-1.11.0/src/netedit/changes/GNEChange_Additional.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Additional.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Attribute.cpp sumo-1.12.0/src/netedit/changes/GNEChange_Attribute.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_Attribute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Attribute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Attribute.h sumo-1.12.0/src/netedit/changes/GNEChange_Attribute.h --- sumo-1.11.0/src/netedit/changes/GNEChange_Attribute.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Attribute.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Children.cpp sumo-1.12.0/src/netedit/changes/GNEChange_Children.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_Children.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Children.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Children.h sumo-1.12.0/src/netedit/changes/GNEChange_Children.h --- sumo-1.11.0/src/netedit/changes/GNEChange_Children.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Children.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Connection.cpp sumo-1.12.0/src/netedit/changes/GNEChange_Connection.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_Connection.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Connection.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Connection.h sumo-1.12.0/src/netedit/changes/GNEChange_Connection.h --- sumo-1.11.0/src/netedit/changes/GNEChange_Connection.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Connection.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange.cpp sumo-1.12.0/src/netedit/changes/GNEChange.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Crossing.cpp sumo-1.12.0/src/netedit/changes/GNEChange_Crossing.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_Crossing.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Crossing.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Crossing.h sumo-1.12.0/src/netedit/changes/GNEChange_Crossing.h --- sumo-1.11.0/src/netedit/changes/GNEChange_Crossing.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Crossing.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_DataInterval.cpp sumo-1.12.0/src/netedit/changes/GNEChange_DataInterval.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_DataInterval.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_DataInterval.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_DataInterval.h sumo-1.12.0/src/netedit/changes/GNEChange_DataInterval.h --- sumo-1.11.0/src/netedit/changes/GNEChange_DataInterval.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_DataInterval.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_DataSet.cpp sumo-1.12.0/src/netedit/changes/GNEChange_DataSet.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_DataSet.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_DataSet.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_DataSet.h sumo-1.12.0/src/netedit/changes/GNEChange_DataSet.h --- sumo-1.11.0/src/netedit/changes/GNEChange_DataSet.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_DataSet.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_DemandElement.cpp sumo-1.12.0/src/netedit/changes/GNEChange_DemandElement.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_DemandElement.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_DemandElement.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include @@ -83,8 +83,8 @@ restoreHierarchicalContainers(); } // update vehicle type selector if demand element is a VType and vehicle type Frame is shown - if ((myDemandElement->getTagProperty().getTag() == SUMO_TAG_VTYPE) && myDemandElement->getNet()->getViewNet()->getViewParent()->getVehicleTypeFrame()->shown()) { - myDemandElement->getNet()->getViewNet()->getViewParent()->getVehicleTypeFrame()->getVehicleTypeSelector()->refreshVehicleTypeSelector(); + if ((myDemandElement->getTagProperty().getTag() == SUMO_TAG_VTYPE) && myDemandElement->getNet()->getViewNet()->getViewParent()->getTypeFrame()->shown()) { + myDemandElement->getNet()->getViewNet()->getViewParent()->getTypeFrame()->getTypeSelector()->refreshTypeSelector(); } // update stack labels if (myOriginalHierarchicalContainer.getParents >().size() > 0) { @@ -121,8 +121,8 @@ removeElementFromParentsAndChildren(myDemandElement); } // update vehicle type selector if demand element is a VType and vehicle type Frame is shown - if ((myDemandElement->getTagProperty().getTag() == SUMO_TAG_VTYPE) && myDemandElement->getNet()->getViewNet()->getViewParent()->getVehicleTypeFrame()->shown()) { - myDemandElement->getNet()->getViewNet()->getViewParent()->getVehicleTypeFrame()->getVehicleTypeSelector()->refreshVehicleTypeSelector(); + if ((myDemandElement->getTagProperty().getTag() == SUMO_TAG_VTYPE) && myDemandElement->getNet()->getViewNet()->getViewParent()->getTypeFrame()->shown()) { + myDemandElement->getNet()->getViewNet()->getViewParent()->getTypeFrame()->getTypeSelector()->refreshTypeSelector(); } // update stack labels if (myOriginalHierarchicalContainer.getParents >().size() > 0) { diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_DemandElement.h sumo-1.12.0/src/netedit/changes/GNEChange_DemandElement.h --- sumo-1.11.0/src/netedit/changes/GNEChange_DemandElement.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_DemandElement.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Edge.cpp sumo-1.12.0/src/netedit/changes/GNEChange_Edge.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_Edge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Edge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Edge.h sumo-1.12.0/src/netedit/changes/GNEChange_Edge.h --- sumo-1.11.0/src/netedit/changes/GNEChange_Edge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Edge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_EdgeType.cpp sumo-1.12.0/src/netedit/changes/GNEChange_EdgeType.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_EdgeType.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_EdgeType.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_EdgeType.h sumo-1.12.0/src/netedit/changes/GNEChange_EdgeType.h --- sumo-1.11.0/src/netedit/changes/GNEChange_EdgeType.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_EdgeType.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_EnableAttribute.cpp sumo-1.12.0/src/netedit/changes/GNEChange_EnableAttribute.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_EnableAttribute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_EnableAttribute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,11 +32,24 @@ // member method definitions // =========================================================================== -GNEChange_EnableAttribute::GNEChange_EnableAttribute(GNEAttributeCarrier* ac, const int originalAttributes, const int newAttributes) : +GNEChange_EnableAttribute::GNEChange_EnableAttribute(GNEAttributeCarrier* ac, const SumoXMLAttr key, const bool value) : GNEChange(ac->getTagProperty().getSupermode(), true, false), myAC(ac), - myOriginalAttributes(originalAttributes), - myNewAttributes(newAttributes) { + myKey(key), + myOrigValue(ac->isAttributeEnabled(key)), + myNewValue(value), + myPreviousParameters(-1) { + myAC->incRef("GNEChange_EnableAttribute " + myAC->getTagProperty().getTagStr()); +} + + +GNEChange_EnableAttribute::GNEChange_EnableAttribute(GNEAttributeCarrier* ac, const SumoXMLAttr key, const bool value, const int previousParameters) : + GNEChange(ac->getTagProperty().getSupermode(), true, false), + myAC(ac), + myKey(key), + myOrigValue(ac->isAttributeEnabled(key)), + myNewValue(value), + myPreviousParameters(previousParameters) { myAC->incRef("GNEChange_EnableAttribute " + myAC->getTagProperty().getTagStr()); } @@ -58,8 +71,8 @@ GNEChange_EnableAttribute::undo() { // show extra information for tests WRITE_DEBUG("Setting previous attribute into " + myAC->getTagStr() + " '" + myAC->getID() + "'"); - // set original attributes - myAC->setEnabledAttribute(myOriginalAttributes); + // set original value + myAC->toogleAttribute(myKey, myOrigValue, myPreviousParameters); // check if networkElements, additional or shapes has to be saved if (myAC->getTagProperty().isNetworkElement()) { myAC->getNet()->requireSaveNet(true); @@ -76,7 +89,7 @@ // show extra information for tests WRITE_DEBUG("Setting new attribute into " + myAC->getTagStr() + " '" + myAC->getID() + "'"); // set new attributes - myAC->setEnabledAttribute(myNewAttributes); + myAC->toogleAttribute(myKey, myNewValue, myPreviousParameters); // check if networkElements, additional or shapes has to be saved if (myAC->getTagProperty().isNetworkElement()) { myAC->getNet()->requireSaveNet(true); @@ -90,14 +103,21 @@ std::string GNEChange_EnableAttribute::undoName() const { - return ("Undo change " + myAC->getTagStr() + " attribute"); + if (myNewValue) { + return ("Undo enable " + myAC->getTagStr() + " attribute"); + } else { + return ("Undo enable " + myAC->getTagStr() + " attribute"); + } } std::string GNEChange_EnableAttribute::redoName() const { - return ("Redo change " + myAC->getTagStr() + " attribute"); + if (myNewValue) { + return ("Redo enable " + myAC->getTagStr() + " attribute"); + } else { + return ("Redo enable " + myAC->getTagStr() + " attribute"); + } } - /****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_EnableAttribute.h sumo-1.12.0/src/netedit/changes/GNEChange_EnableAttribute.h --- sumo-1.11.0/src/netedit/changes/GNEChange_EnableAttribute.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_EnableAttribute.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -33,12 +33,20 @@ FXDECLARE_ABSTRACT(GNEChange_EnableAttribute) public: - /**@brief Constructor + /**@brief constructor * @param[in] ac The attribute-carrier to be modified - * @param[in] originalAttributes original set of attributes - * @param[in] newAttributes new set of attributes + * @param[in] key The attribute key + * @param[in] value The new value */ - GNEChange_EnableAttribute(GNEAttributeCarrier* ac, const int originalAttributes, const int newAttributes); + GNEChange_EnableAttribute(GNEAttributeCarrier* ac, const SumoXMLAttr key, const bool value); + + /**@brief constructor + * @param[in] ac The attribute-carrier to be modified + * @param[in] key The attribute key + * @param[in] value The new value + * @param[in] previousParameters previous values (used by flows) + */ + GNEChange_EnableAttribute(GNEAttributeCarrier* ac, const SumoXMLAttr key, const bool value, const int previousParameters); /// @brief Destructor ~GNEChange_EnableAttribute(); @@ -64,9 +72,15 @@ */ GNEAttributeCarrier* myAC; - /// @brief original attributes - const int myOriginalAttributes; + /// @brief The attribute name + const SumoXMLAttr myKey; + + /// @brief the original value + const bool myOrigValue; + + /// @brief the new value + const bool myNewValue; - /// @brief original attributes - const int myNewAttributes; + /// @brief previous values (used by flows) + const int myPreviousParameters; }; diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_GenericData.cpp sumo-1.12.0/src/netedit/changes/GNEChange_GenericData.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_GenericData.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_GenericData.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_GenericData.h sumo-1.12.0/src/netedit/changes/GNEChange_GenericData.h --- sumo-1.11.0/src/netedit/changes/GNEChange_GenericData.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_GenericData.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChangeGroup.cpp sumo-1.12.0/src/netedit/changes/GNEChangeGroup.cpp --- sumo-1.11.0/src/netedit/changes/GNEChangeGroup.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChangeGroup.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChangeGroup.h sumo-1.12.0/src/netedit/changes/GNEChangeGroup.h --- sumo-1.11.0/src/netedit/changes/GNEChangeGroup.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChangeGroup.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange.h sumo-1.12.0/src/netedit/changes/GNEChange.h --- sumo-1.11.0/src/netedit/changes/GNEChange.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Junction.cpp sumo-1.12.0/src/netedit/changes/GNEChange_Junction.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_Junction.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Junction.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Junction.h sumo-1.12.0/src/netedit/changes/GNEChange_Junction.h --- sumo-1.11.0/src/netedit/changes/GNEChange_Junction.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Junction.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Lane.cpp sumo-1.12.0/src/netedit/changes/GNEChange_Lane.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_Lane.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Lane.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Lane.h sumo-1.12.0/src/netedit/changes/GNEChange_Lane.h --- sumo-1.11.0/src/netedit/changes/GNEChange_Lane.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Lane.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_LaneType.cpp sumo-1.12.0/src/netedit/changes/GNEChange_LaneType.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_LaneType.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_LaneType.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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_LaneType.cpp -/// @author Pablo Alvarez Lopez -/// @date Nov 2020 -/// -// A network change in which a single laneType is created or deleted -/****************************************************************************/ -#include - -#include -#include -#include - -#include "GNEChange_LaneType.h" - -// =========================================================================== -// FOX-declarations -// =========================================================================== -FXIMPLEMENT_ABSTRACT(GNEChange_LaneType, GNEChange, nullptr, 0) - -// =========================================================================== -// member method definitions -// =========================================================================== - - -/// @brief constructor for creating an laneType -GNEChange_LaneType::GNEChange_LaneType(GNELaneType* laneType, const int position, bool forward): - GNEChange(Supermode::NETWORK, laneType, forward, laneType->isAttributeCarrierSelected()), - myLaneType(laneType), - myPosition(position) { - laneType->incRef("GNEChange_LaneType"); -} - - -GNEChange_LaneType::~GNEChange_LaneType() { - myLaneType->decRef("GNEChange_LaneType"); - if (myLaneType->unreferenced()) { - // get lane types - const auto& laneTypes = myLaneType->getEdgeTypeParent()->getLaneTypes(); - // remove it from edgeType - if (std::find(laneTypes.begin(), laneTypes.end(), myLaneType) != laneTypes.end()) { - myLaneType->getEdgeTypeParent()->removeLaneType(myLaneType); - } - // show extra information for tests - WRITE_DEBUG("Deleting unreferenced " + myLaneType->getTagStr() + " '" + myLaneType->getID() + "' GNEChange_LaneType"); - // delete laneType - delete myLaneType; - } -} - - -void -GNEChange_LaneType::undo() { - if (myForward) { - // show extra information for tests - WRITE_DEBUG("Removing " + myLaneType->getTagStr() + " from " + toString(SUMO_TAG_NET)); - // delete laneType from edgeType parent - myLaneType->getEdgeTypeParent()->removeLaneType(myLaneType); - } else { - // show extra information for tests - WRITE_DEBUG("Adding " + myLaneType->getTagStr() + " into " + toString(SUMO_TAG_NET)); - // insert laneType into edgeType parent - myLaneType->getEdgeTypeParent()->addLaneType(myLaneType, myPosition); - } - // enable save networkElements - myLaneType->getNet()->requireSaveNet(true); -} - - -void -GNEChange_LaneType::redo() { - if (myForward) { - // show extra information for tests - WRITE_DEBUG("Adding " + myLaneType->getTagStr() + " into " + toString(SUMO_TAG_NET)); - // insert laneType into edgeType parent - myLaneType->getEdgeTypeParent()->addLaneType(myLaneType, myPosition); - } else { - // show extra information for tests - WRITE_DEBUG("Removing " + myLaneType->getTagStr() + " from " + toString(SUMO_TAG_NET)); - // delete laneType from edgeType parent - myLaneType->getEdgeTypeParent()->removeLaneType(myLaneType); - } - // enable save networkElements - myLaneType->getNet()->requireSaveNet(true); -} - - -std::string -GNEChange_LaneType::undoName() const { - if (myForward) { - return "Undo create laneType"; - } else { - return "Undo delete laneType"; - } -} - - -std::string -GNEChange_LaneType::redoName() const { - if (myForward) { - return "Redo create laneType"; - } else { - return "Redo delete laneType"; - } -} diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_LaneType.h sumo-1.12.0/src/netedit/changes/GNEChange_LaneType.h --- sumo-1.11.0/src/netedit/changes/GNEChange_LaneType.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_LaneType.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,70 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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_LaneType.h -/// @author Pablo Alvarez Lopez -/// @date Nov 2020 -/// -// A network change in which a single laneType is created or deleted -/****************************************************************************/ -#pragma once -#include - -#include "GNEChange.h" - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEChange_LaneType - * A network change in which a single laneType is created or deleted - */ -class GNEChange_LaneType : public GNEChange { - // @brief FOX Declaration - FXDECLARE_ABSTRACT(GNEChange_LaneType) - -public: - /**@brief Constructor for creating/deleting an laneType - * @param[in] laneType The laneType to be created/deleted - * @param[in] position lane position - * @param[in] forward Whether to create/delete (true/false) - */ - GNEChange_LaneType(GNELaneType* laneType, const int position, bool forward); - - /// @brief Destructor - ~GNEChange_LaneType(); - - /// @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 laneType that is to be created/deleted - * @note we assume shared responsibility for the pointer (via reference counting) - */ - GNELaneType* myLaneType; - - /// @brief position in edgeType Parent - const int myPosition; -}; diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Shape.cpp sumo-1.12.0/src/netedit/changes/GNEChange_Shape.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_Shape.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Shape.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_Shape.h sumo-1.12.0/src/netedit/changes/GNEChange_Shape.h --- sumo-1.11.0/src/netedit/changes/GNEChange_Shape.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_Shape.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_TAZElement.cpp sumo-1.12.0/src/netedit/changes/GNEChange_TAZElement.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_TAZElement.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_TAZElement.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_TAZElement.h sumo-1.12.0/src/netedit/changes/GNEChange_TAZElement.h --- sumo-1.11.0/src/netedit/changes/GNEChange_TAZElement.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_TAZElement.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_TLS.cpp sumo-1.12.0/src/netedit/changes/GNEChange_TLS.cpp --- sumo-1.11.0/src/netedit/changes/GNEChange_TLS.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_TLS.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/changes/GNEChange_TLS.h sumo-1.12.0/src/netedit/changes/GNEChange_TLS.h --- sumo-1.11.0/src/netedit/changes/GNEChange_TLS.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/changes/GNEChange_TLS.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/CMakeLists.txt sumo-1.12.0/src/netedit/CMakeLists.txt --- sumo-1.11.0/src/netedit/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -49,6 +49,6 @@ endif() target_link_libraries(netedit opengl32 glu32) endif () -add_dependencies(netedit generate-version-h) +add_dependencies(netedit generate-version-h install_dll) install(TARGETS netedit RUNTIME DESTINATION bin) diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEAbout.cpp sumo-1.12.0/src/netedit/dialogs/GNEAbout.cpp --- sumo-1.11.0/src/netedit/dialogs/GNEAbout.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEAbout.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -62,7 +62,7 @@ WRITE_DEBUG(("Modules: " + modules).c_str()); // copyright notice - new FXLabel(this, "Copyright (C) 2001-2021 German Aerospace Center (DLR) and others.", nullptr, GUIDesignLabelAboutInfo); + new FXLabel(this, "Copyright (C) 2001-2022 German Aerospace Center (DLR) and others.", nullptr, GUIDesignLabelAboutInfo); new FXLabel(this, "This application is based on code provided by the Eclipse SUMO project.", nullptr, GUIDesignLabelAboutInfo); new FXLabel(this, "These core components are available under the conditions of the Eclipse Public License v2.", nullptr, GUIDesignLabelAboutInfo); (new FXLinkLabel(this, "SPDX-License-Identifier: EPL-2.0", nullptr, GUIDesignLabelAboutInfo))->setTipText("https://www.eclipse.org/legal/epl-v20.html"); diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEAbout.h sumo-1.12.0/src/netedit/dialogs/GNEAbout.h --- sumo-1.11.0/src/netedit/dialogs/GNEAbout.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEAbout.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEAdditionalDialog.cpp sumo-1.12.0/src/netedit/dialogs/GNEAdditionalDialog.cpp --- sumo-1.11.0/src/netedit/dialogs/GNEAdditionalDialog.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEAdditionalDialog.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEAdditionalDialog.h sumo-1.12.0/src/netedit/dialogs/GNEAdditionalDialog.h --- sumo-1.11.0/src/netedit/dialogs/GNEAdditionalDialog.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEAdditionalDialog.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEAllowDisallow.cpp sumo-1.12.0/src/netedit/dialogs/GNEAllowDisallow.cpp --- sumo-1.11.0/src/netedit/dialogs/GNEAllowDisallow.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEAllowDisallow.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -57,21 +57,19 @@ myAC(AC), myEditedAttr(attr), myAcceptChanges(acceptChanges), - myAllow(nullptr), - myDisAllow(nullptr) { + myAllow(nullptr) { // call constructor constructor(); } -GNEAllowDisallow::GNEAllowDisallow(GNEViewNet* viewNet, std::string* allow, std::string* disallow, bool* acceptChanges) : +GNEAllowDisallow::GNEAllowDisallow(GNEViewNet* viewNet, std::string* allow, bool* acceptChanges) : FXDialogBox(viewNet->getApp(), ("Edit " + toString(SUMO_ATTR_ALLOW) + " " + toString(SUMO_ATTR_VCLASS) + "es").c_str(), GUIDesignDialogBox), myViewNet(viewNet), myAC(nullptr), myEditedAttr(SUMO_ATTR_ALLOW), myAcceptChanges(acceptChanges), - myAllow(allow), - myDisAllow(disallow) { + myAllow(allow) { // call constructor constructor(); } @@ -165,7 +163,6 @@ } else { // update strings *myAllow = joinToString(allowedVehicles, " "); - *myDisAllow = joinToString(disallowedVehicles, " "); } // enable accept flag *myAcceptChanges = true; diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEAllowDisallow.h sumo-1.12.0/src/netedit/dialogs/GNEAllowDisallow.h --- sumo-1.11.0/src/netedit/dialogs/GNEAllowDisallow.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEAllowDisallow.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -46,7 +46,7 @@ GNEAllowDisallow(GNEViewNet* viewNet, GNEAttributeCarrier* AC, SumoXMLAttr attr, bool* acceptChanges); /// @brief Constructor (For - GNEAllowDisallow(GNEViewNet* viewNet, std::string* allow, std::string* disallow, bool* acceptChanges); + GNEAllowDisallow(GNEViewNet* viewNet, std::string* allow, bool* acceptChanges); /// @brief destructor ~GNEAllowDisallow(); @@ -97,9 +97,6 @@ /// @brief allow vehicles std::string* myAllow; - /// @brief disallow vehicles - std::string* myDisAllow; - /// @brief accept button FXButton* myAcceptButton; diff -Nru sumo-1.11.0/src/netedit/dialogs/GNECalibratorDialog.cpp sumo-1.12.0/src/netedit/dialogs/GNECalibratorDialog.cpp --- sumo-1.11.0/src/netedit/dialogs/GNECalibratorDialog.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNECalibratorDialog.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include "GNECalibratorDialog.h" #include "GNECalibratorFlowDialog.h" @@ -226,7 +226,7 @@ GNECalibratorDialog::onCmdAddFlow(FXObject*, FXSelector, void*) { // get routes and vTypes const auto& routes = myEditedAdditional->getNet()->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE); - GNEDemandElement* defaultVType = myEditedAdditional->getNet()->getViewNet()->getNet()->getAttributeCarriers()->getDefaultVType(); + GNEDemandElement* defaultVType = myEditedAdditional->getNet()->getViewNet()->getNet()->getAttributeCarriers()->getDefaultType(); // only add flow if there is at least a GNERoute (There is always a Vehicle Type) if (routes.size() > 0) { // create new calibrator and configure it with GNECalibratorFlowDialog @@ -267,7 +267,7 @@ GNECalibratorDialog::onCmdAddVehicleType(FXObject*, FXSelector, void*) { // create a new Vehicle Type and configure it with GNEVehicleTypeDialog std::string vehicleTypeID = myEditedAdditional->getNet()->getViewNet()->getNet()->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_VTYPE); - GNEVehicleTypeDialog(new GNEVehicleType(myEditedAdditional->getNet(), vehicleTypeID, SVC_PASSENGER, SUMO_TAG_VTYPE), false); + GNEVehicleTypeDialog(new GNEVType(myEditedAdditional->getNet(), vehicleTypeID, SVC_PASSENGER), false); // update vehicle types table updateVehicleTypeTable(); return 1; diff -Nru sumo-1.11.0/src/netedit/dialogs/GNECalibratorDialog.h sumo-1.12.0/src/netedit/dialogs/GNECalibratorDialog.h --- sumo-1.11.0/src/netedit/dialogs/GNECalibratorDialog.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNECalibratorDialog.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -30,7 +30,7 @@ class GNECalibrator; class GNERoute; class GNECalibratorFlow; -class GNEVehicleType; +class GNEVType; // =========================================================================== // class definitions diff -Nru sumo-1.11.0/src/netedit/dialogs/GNECalibratorFlowDialog.cpp sumo-1.12.0/src/netedit/dialogs/GNECalibratorFlowDialog.cpp --- sumo-1.11.0/src/netedit/dialogs/GNECalibratorFlowDialog.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNECalibratorFlowDialog.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNECalibratorFlowDialog.h sumo-1.12.0/src/netedit/dialogs/GNECalibratorFlowDialog.h --- sumo-1.11.0/src/netedit/dialogs/GNECalibratorFlowDialog.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNECalibratorFlowDialog.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEDemandElementDialog.cpp sumo-1.12.0/src/netedit/dialogs/GNEDemandElementDialog.cpp --- sumo-1.11.0/src/netedit/dialogs/GNEDemandElementDialog.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEDemandElementDialog.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEDemandElementDialog.h sumo-1.12.0/src/netedit/dialogs/GNEDemandElementDialog.h --- sumo-1.11.0/src/netedit/dialogs/GNEDemandElementDialog.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEDemandElementDialog.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEDialogACChooser.cpp sumo-1.12.0/src/netedit/dialogs/GNEDialogACChooser.cpp --- sumo-1.11.0/src/netedit/dialogs/GNEDialogACChooser.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEDialogACChooser.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEDialogACChooser.h sumo-1.12.0/src/netedit/dialogs/GNEDialogACChooser.h --- sumo-1.11.0/src/netedit/dialogs/GNEDialogACChooser.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEDialogACChooser.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEFixAdditionalElements.cpp sumo-1.12.0/src/netedit/dialogs/GNEFixAdditionalElements.cpp --- sumo-1.11.0/src/netedit/dialogs/GNEFixAdditionalElements.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEFixAdditionalElements.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -250,7 +250,7 @@ // --------------------------------------------------------------------------- GNEFixAdditionalElements::PositionOptions::PositionOptions(GNEFixAdditionalElements* fixAdditionalPositions) : - FXGroupBox(fixAdditionalPositions->myMainFrame, "Select a solution for StoppingPlaces and E2 detectors", GUIDesignGroupBoxFrame) { + FXGroupBoxModule(fixAdditionalPositions->myMainFrame, "Select a solution for StoppingPlaces and E2 detectors", FXGroupBoxModule::Options::NOTHING) { // create horizontal frames for radio buttons FXHorizontalFrame* RadioButtons = new FXHorizontalFrame(this, GUIDesignHorizontalFrame); // create Vertical Frame for left options @@ -318,7 +318,7 @@ // --------------------------------------------------------------------------- GNEFixAdditionalElements::ConsecutiveLaneOptions::ConsecutiveLaneOptions(GNEFixAdditionalElements* fixAdditionalPositions) : - FXGroupBox(fixAdditionalPositions->myMainFrame, "Select a solution for Multilane E2 detectors", GUIDesignGroupBoxFrame) { + FXGroupBoxModule(fixAdditionalPositions->myMainFrame, "Select a solution for Multilane E2 detectors", FXGroupBoxModule::Options::NOTHING) { // create horizontal frames for radio buttons FXHorizontalFrame* RadioButtons = new FXHorizontalFrame(this, GUIDesignHorizontalFrame); // create Vertical Frame for left options diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEFixAdditionalElements.h sumo-1.12.0/src/netedit/dialogs/GNEFixAdditionalElements.h --- sumo-1.11.0/src/netedit/dialogs/GNEFixAdditionalElements.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEFixAdditionalElements.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -20,7 +20,7 @@ #pragma once #include -#include +#include // =========================================================================== // class declarations @@ -79,7 +79,7 @@ }; /// @brief groupbox for group all radio buttons related to additionals with single lanes - class PositionOptions : public FXGroupBox { + class PositionOptions : public FXGroupBoxModule { public: /// @brief build Position Options @@ -108,7 +108,7 @@ }; /// @brief groupbox for group all radio buttons related to additionals with consecutive lanes - class ConsecutiveLaneOptions : public FXGroupBox { + class ConsecutiveLaneOptions : public FXGroupBoxModule { public: /// @brief build consecutive lane Options diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEFixDemandElements.cpp sumo-1.12.0/src/netedit/dialogs/GNEFixDemandElements.cpp --- sumo-1.11.0/src/netedit/dialogs/GNEFixDemandElements.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEFixDemandElements.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -45,47 +45,50 @@ // member method definitions // =========================================================================== +// --------------------------------------------------------------------------- +// GNEFixDemandElements - methods +// --------------------------------------------------------------------------- + GNEFixDemandElements::GNEFixDemandElements(GNEViewNet* viewNet, const std::vector& invalidDemandElements) : - FXDialogBox(viewNet->getApp(), "Fix demand elements problems", GUIDesignDialogBoxExplicit(800, 600)), + FXDialogBox(viewNet->getApp(), "Fix demand elements problems", GUIDesignDialogBoxExplicit(800, 620)), myViewNet(viewNet) { // set busStop icon for this dialog - setIcon(GUIIconSubSys::getIcon(GUIIcon::ROUTE)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDEMAND)); // create main frame myMainFrame = new FXVerticalFrame(this, GUIDesignAuxiliarFrame); - // create demand list - myDemandList = new DemandList(this, invalidDemandElements); + // create frames for options + FXHorizontalFrame* optionsFrame = new FXHorizontalFrame(myMainFrame, GUIDesignAuxiliarFrame); + myLeftFrame = new FXVerticalFrame(optionsFrame, GUIDesignAuxiliarFrame); + myRightFrame = new FXVerticalFrame(optionsFrame, GUIDesignAuxiliarFrame); // create fix route options - myFixRouteOptions = new FixRouteOptions(this); + myFixRouteOptions = new FixRouteOptions(this, viewNet); // create fix vehicle options - myFixVehicleOptions = new FixVehicleOptions(this); + myFixVehicleOptions = new FixVehicleOptions(this, viewNet); // create fix stops options - myFixStopOptions = new FixStopOptions(this); + myFixStopPositionOptions = new FixStopPositionOptions(this, viewNet); // create fix person plans options - myFixPersonPlanOptions = new FixPersonPlanOptions(this); - // check if fix route options has to be disabled - if (myDemandList->myInvalidRoutes.empty()) { - myFixRouteOptions->disableFixRouteOptions(); - } - // check if fix vehicle options has to be disabled - if (myDemandList->myInvalidVehicles.empty()) { - myFixVehicleOptions->disableFixVehicleOptions(); - } - // check if fix stop options has to be disabled - if (myDemandList->myInvalidStops.empty()) { - myFixStopOptions->disableFixStopOptions(); - } - // check if fix person plan options has to be disabled - if (myDemandList->myInvalidPersonPlans.empty()) { - myFixPersonPlanOptions->disableFixPersonPlanOptions(); - } - // create dialog buttons bot centered - FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(myMainFrame, GUIDesignHorizontalFrame); - new FXHorizontalFrame(buttonsFrame, GUIDesignAuxiliarHorizontalFrame); - myAcceptButton = new FXButton(buttonsFrame, FXWindow::tr("&Accept"), GUIIconSubSys::getIcon(GUIIcon::ACCEPT), this, MID_GNE_BUTTON_ACCEPT, GUIDesignButtonAccept); - myCancelButton = new FXButton(buttonsFrame, FXWindow::tr("&Cancel"), GUIIconSubSys::getIcon(GUIIcon::CANCEL), this, MID_GNE_BUTTON_CANCEL, GUIDesignButtonCancel); - new FXHorizontalFrame(buttonsFrame, GUIDesignAuxiliarHorizontalFrame); - // set focus in accept button - myAcceptButton->setFocus(); + myFixPersonPlanOptions = new FixPersonPlanOptions(this, viewNet); + // create buttons + myButtons = new Buttons(this); + // split invalidDemandElements in four groups + std::vector invalidRoutes, invalidVehicles, invalidStops, invalidPlans; + // fill groups + for (const auto& invalidDemandElement : invalidDemandElements) { + if (invalidDemandElement->getTagProperty().isRoute()) { + invalidRoutes.push_back(invalidDemandElement); + } else if (invalidDemandElement->getTagProperty().isVehicle()) { + invalidVehicles.push_back(invalidDemandElement); + } else if (invalidDemandElement->getTagProperty().isStop()) { + invalidStops.push_back(invalidDemandElement); + } else { + invalidPlans.push_back(invalidDemandElement); + } + } + // fill options + myFixRouteOptions->setInvalidElements(invalidRoutes); + myFixVehicleOptions->setInvalidElements(invalidVehicles); + myFixStopPositionOptions->setInvalidElements(invalidStops); + myFixPersonPlanOptions->setInvalidElements(invalidPlans); } @@ -95,9 +98,10 @@ long GNEFixDemandElements::onCmdSelectOption(FXObject* obj, FXSelector, void*) { + // select options myFixRouteOptions->selectOption(obj); myFixVehicleOptions->selectOption(obj); - myFixStopOptions->selectOption(obj); + myFixStopPositionOptions->selectOption(obj); myFixPersonPlanOptions->selectOption(obj); return 1; } @@ -105,114 +109,19 @@ long GNEFixDemandElements::onCmdAccept(FXObject*, FXSelector, void*) { - bool continueSaving = true; - // check options for invalid routes - if (myDemandList->myInvalidRoutes.size() > 0) { - if (myFixRouteOptions->removeInvalidRoutes->getCheck() == TRUE) { - // begin undo list - myViewNet->getUndoList()->begin(GUIIcon::ROUTE, "delete invalid routes"); - // iterate over invalid routes to delete it - for (auto i : myDemandList->myInvalidRoutes) { - myViewNet->getNet()->deleteDemandElement(i, myViewNet->getUndoList()); - } - // end undo list - myViewNet->getUndoList()->end(); - } else if (myFixRouteOptions->selectInvalidRoutesAndCancel->getCheck() == TRUE) { - // begin undo list - myViewNet->getUndoList()->begin(GUIIcon::ROUTE, "select invalid routes"); - // iterate over invalid single lane elements to select all elements - for (auto i : myDemandList->myInvalidRoutes) { - i->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList()); - } - // end undo list - myViewNet->getUndoList()->end(); - // abort saving - continueSaving = false; - } - } - // check options for invalid vehicles - if (myDemandList->myInvalidVehicles.size() > 0) { - if (myFixVehicleOptions->removeInvalidVehicles->getCheck() == TRUE) { - // begin undo list - myViewNet->getUndoList()->begin(GUIIcon::VEHICLE, "delete invalid vehicles"); - // iterate over invalid stops to delete it - for (auto i : myDemandList->myInvalidVehicles) { - myViewNet->getNet()->deleteDemandElement(i, myViewNet->getUndoList()); - } - // end undo list - myViewNet->getUndoList()->end(); - } else if (myFixVehicleOptions->selectInvalidVehiclesAndCancel->getCheck() == TRUE) { - // begin undo list - myViewNet->getUndoList()->begin(GUIIcon::VEHICLE, "select invalid vehicles"); - // iterate over invalid single lane elements to select all elements - for (auto i : myDemandList->myInvalidVehicles) { - i->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList()); - } - // end undo list - myViewNet->getUndoList()->end(); - // abort saving - continueSaving = false; - } - } - // check options for stops - if (myDemandList->myInvalidStops.size() > 0) { - if (myFixStopOptions->activateFriendlyPositionAndSave->getCheck() == TRUE) { - // begin undo list - myViewNet->getUndoList()->begin(GUIIcon::STOP, "change " + toString(SUMO_ATTR_FRIENDLY_POS) + " of invalid stops"); - // iterate over invalid stops to enable friendly position - for (auto i : myDemandList->myInvalidStops) { - i->setAttribute(SUMO_ATTR_FRIENDLY_POS, "true", myViewNet->getUndoList()); - } - myViewNet->getUndoList()->end(); - } else if (myFixStopOptions->fixPositionsAndSave->getCheck() == TRUE) { - myViewNet->getUndoList()->begin(GUIIcon::STOP, "fix positions of invalid stops"); - // iterate over invalid stops to fix positions - for (auto i : myDemandList->myInvalidStops) { - i->fixDemandElementProblem(); - } - myViewNet->getUndoList()->end(); - } else if (myFixStopOptions->selectInvalidStopsAndCancel->getCheck() == TRUE) { - myViewNet->getUndoList()->begin(GUIIcon::STOP, "select invalid stops"); - // iterate over invalid stops to select all elements - for (auto i : myDemandList->myInvalidStops) { - i->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList()); - } - // end undo list - myViewNet->getUndoList()->end(); - // abort saving - continueSaving = false; - } - } - // check options for person plans - if (myDemandList->myInvalidPersonPlans.size() > 0) { - if (myFixPersonPlanOptions->deletePersonPlan->getCheck() == TRUE) { - /* - // begin undo list - myViewNet->getUndoList()->begin("change " + toString(SUMO_ATTR_FRIENDLY_POS) + " of invalid person plans"); - // iterate over invalid person plans to enable friendly position - for (auto i : myDemandList->myInvalidPersonPlans) { - i->setAttribute(SUMO_ATTR_FRIENDLY_POS, "true", myViewNet->getUndoList()); - } - myViewNet->getUndoList()->end(); - */ - } else if (myFixPersonPlanOptions->selectInvalidPersonPlansAndCancel->getCheck() == TRUE) { - myViewNet->getUndoList()->begin(GUIIcon::MODEPERSONPLAN, "select invalid person plans"); - // iterate over invalid person plans to select all elements - for (auto i : myDemandList->myInvalidPersonPlans) { - i->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList()); - } - // end undo list - myViewNet->getUndoList()->end(); - // abort saving - continueSaving = false; - } - } - if (continueSaving) { - // stop modal with TRUE (continue saving) - getApp()->stopModal(this, TRUE); - } else { + bool abortSaving = false; + // fix elements + myFixRouteOptions->fixElements(abortSaving); + myFixVehicleOptions->fixElements(abortSaving); + myFixStopPositionOptions->fixElements(abortSaving); + myFixPersonPlanOptions->fixElements(abortSaving); + // check if abort saving + if (abortSaving) { // stop modal with TRUE (abort saving) getApp()->stopModal(this, FALSE); + } else { + // stop modal with TRUE (continue saving) + getApp()->stopModal(this, TRUE); } return 1; } @@ -226,159 +135,123 @@ } // --------------------------------------------------------------------------- -// GNEFixDemandElements::DemandList - methods +// GNEFixDemandElements::FixOptions - methods // --------------------------------------------------------------------------- -GNEFixDemandElements::DemandList::DemandList(GNEFixDemandElements* fixDemandElementsDialogParents, const std::vector& invalidDemandElements) : - FXGroupBox(fixDemandElementsDialogParents->myMainFrame, "Routes and Vehicles with conflicts", GUIDesignGroupBoxFrameFill) { - // Create table, copy intervals and update table - myTable = new FXTable(this, this, MID_GNE_FIXSTOPPINGPLACES_CHANGE, GUIDesignTableAdditionals); +GNEFixDemandElements::FixOptions::FixOptions(FXVerticalFrame* frameParent, const std::string& title, GNEViewNet* viewNet) : + FXGroupBoxModule(frameParent, title, FXGroupBoxModule::Options::SAVE), + myViewNet(viewNet) { + // Create table + myTable = new FXTable(this, this, MID_TABLE, GUIDesignTableFixElements); + // create horizontal frame + FXHorizontalFrame* horizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + // create vertical frames + myLeftFrame = new FXVerticalFrame(horizontalFrame, GUIDesignAuxiliarVerticalFrame); + myRightFrame = new FXVerticalFrame(horizontalFrame, GUIDesignAuxiliarVerticalFrame); +} + + +void +GNEFixDemandElements::FixOptions::setInvalidElements(const std::vector& invalidElements) { + // update invalid elements + myInvalidElements = invalidElements; + // configure table + myTable->setTableSize((int)(myInvalidElements.size()), 3); myTable->setSelBackColor(FXRGBA(255, 255, 255, 255)); myTable->setSelTextColor(FXRGBA(0, 0, 0, 255)); myTable->setEditable(false); - // separate demand elements in three groups - for (const auto& i : invalidDemandElements) { - if (i->getTagProperty().isVehicle()) { - myInvalidVehicles.push_back(i); - } else if (i->getTagProperty().isStop() || i->getTagProperty().isStopPerson()) { - myInvalidStops.push_back(i); - } else if (i->getTagProperty().isPersonPlan()) { - myInvalidPersonPlans.push_back(i); - } else { - myInvalidRoutes.push_back(i); - } - } - // clear table - myTable->clearItems(); - // set number of rows - myTable->setTableSize((int)(myInvalidRoutes.size() + myInvalidVehicles.size() + myInvalidStops.size() + myInvalidPersonPlans.size()), 3); - // Configure list + // configure header myTable->setVisibleColumns(4); myTable->setColumnWidth(0, GUIDesignHeight); - myTable->setColumnWidth(1, 160); - myTable->setColumnWidth(2, 580); + myTable->setColumnWidth(1, 150); + myTable->setColumnWidth(2, 200); myTable->setColumnText(0, ""); myTable->setColumnText(1, toString(SUMO_ATTR_ID).c_str()); myTable->setColumnText(2, "Conflict"); myTable->getRowHeader()->setWidth(0); - // Declare index for rows and pointer to FXTableItem - int indexRow = 0; + // Declare pointer to FXTableItem FXTableItem* item = nullptr; - // declare textSize - int textSize = 0; // iterate over invalid routes - for (const auto& invalidRoute : myInvalidRoutes) { + for (int i = 0; i < (int)myInvalidElements.size(); i++) { // Set icon - item = new FXTableItem("", invalidRoute->getIcon()); + item = new FXTableItem("", myInvalidElements.at(i)->getIcon()); item->setIconPosition(FXTableItem::CENTER_X); - myTable->setItem(indexRow, 0, item); + myTable->setItem(i, 0, item); // Set ID - item = new FXTableItem(invalidRoute->getID().c_str()); + item = new FXTableItem(myInvalidElements.at(i)->getID().c_str()); item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y); - myTable->setItem(indexRow, 1, item); + myTable->setItem(i, 1, item); // Set conflict - const auto demandElementProblem = invalidRoute->getDemandElementProblem(); - if ((int)demandElementProblem.size() > textSize) { - textSize = (int)demandElementProblem.size(); - } - item = new FXTableItem(demandElementProblem.c_str()); + item = new FXTableItem(myInvalidElements.at(i)->getDemandElementProblem().c_str()); item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y); - myTable->setItem(indexRow, 2, item); - // Update index - indexRow++; + myTable->setItem(i, 2, item); } - // iterate over invalid vehicles - for (const auto& invalidVehicle : myInvalidVehicles) { - // Set icon - item = new FXTableItem("", invalidVehicle->getIcon()); - item->setIconPosition(FXTableItem::CENTER_X); - myTable->setItem(indexRow, 0, item); - // Set ID - item = new FXTableItem(invalidVehicle->getID().c_str()); - item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y); - myTable->setItem(indexRow, 1, item); - // Set conflict - const auto demandElementProblem = invalidVehicle->getDemandElementProblem(); - if ((int)demandElementProblem.size() > textSize) { - textSize = (int)demandElementProblem.size(); - } - item = new FXTableItem(demandElementProblem.c_str()); - item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y); - myTable->setItem(indexRow, 2, item); - // Update index - indexRow++; - } - // iterate over invalid stops - for (const auto& invalidStop : myInvalidStops) { - // Set icon - item = new FXTableItem("", invalidStop->getIcon()); - item->setIconPosition(FXTableItem::CENTER_X); - myTable->setItem(indexRow, 0, item); - // Set ID - item = new FXTableItem(invalidStop->getID().c_str()); - item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y); - myTable->setItem(indexRow, 1, item); - // Set conflict - const auto demandElementProblem = invalidStop->getDemandElementProblem(); - if ((int)demandElementProblem.size() > textSize) { - textSize = (int)demandElementProblem.size(); - } - item = new FXTableItem(demandElementProblem.c_str()); - item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y); - myTable->setItem(indexRow, 2, item); - // Update index - indexRow++; - } - // iterate over invalid person plans - for (const auto& invalidPersonPlan : myInvalidPersonPlans) { - // Set icon - item = new FXTableItem("", invalidPersonPlan->getIcon()); - item->setIconPosition(FXTableItem::CENTER_X); - myTable->setItem(indexRow, 0, item); - // Set ID - item = new FXTableItem(invalidPersonPlan->getID().c_str()); - item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y); - myTable->setItem(indexRow, 1, item); - // Set conflict - const auto demandElementProblem = invalidPersonPlan->getDemandElementProblem(); - if ((int)demandElementProblem.size() > textSize) { - textSize = (int)demandElementProblem.size(); - } - item = new FXTableItem(demandElementProblem.c_str()); - item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y); - myTable->setItem(indexRow, 2, item); - // Update index - indexRow++; - } - // update Column Width - myTable->setColumnWidth(2, 6 * textSize); - if ((6 * textSize) > 580) { - myTable->setScrollStyle(HSCROLLING_ON | VSCROLLING_ON); + // check if enable or disable options + if (invalidElements.size() > 0) { + enableOptions(); + toogleSaveButton(true); } else { - myTable->setScrollStyle(HSCROLLING_OFF | VSCROLLING_ON); + disableOptions(); + toogleSaveButton(false); } } +bool +GNEFixDemandElements::FixOptions::saveContents() const { + const FXString file = MFXUtils::getFilename2Write(myTable, + "Save list of conflicted items", ".txt", + GUIIconSubSys::getIcon(GUIIcon::SAVE), gCurrentFolder); + if (file == "") { + return false; + } + try { + // open output device + OutputDevice& dev = OutputDevice::getDevice(file.text()); + // get invalid element ID and problem + for (const auto& invalidElement : myInvalidElements) { + dev << invalidElement->getID() << ":" << invalidElement->getDemandElementProblem() << "\n"; + } + // close output device + dev.close(); + // write warning if netedit is running in testing mode + WRITE_DEBUG("Opening FXMessageBox 'Saving list of conflicted items sucesfully'"); + // open message box error + FXMessageBox::information(myTable, MBOX_OK, "Saving sucesfully", "%s", "List of conflicted items was sucesfully saved"); + // write warning if netedit is running in testing mode + WRITE_DEBUG("Closed FXMessageBox 'Saving list of conflicted items sucesfully' with 'OK'"); + } catch (IOError& e) { + // write warning if netedit is running in testing mode + WRITE_DEBUG("Opening FXMessageBox 'error saving list of conflicted items'"); + // open message box error + FXMessageBox::error(myTable, MBOX_OK, "Saving list of conflicted items failed", "%s", e.what()); + // write warning if netedit is running in testing mode + WRITE_DEBUG("Closed FXMessageBox 'error saving list of conflicted items' with 'OK'"); + } + return true; +} // --------------------------------------------------------------------------- // GNEFixDemandElements::FixRouteOptions - methods // --------------------------------------------------------------------------- -GNEFixDemandElements::FixRouteOptions::FixRouteOptions(GNEFixDemandElements* fixDemandElementsDialogParents) : - FXGroupBox(fixDemandElementsDialogParents->myMainFrame, "Solution for routes", GUIDesignGroupBoxFrame) { - // create horizontal frames for radio buttons - FXHorizontalFrame* radioButtonsFrame = new FXHorizontalFrame(this, GUIDesignHorizontalFrame); - // create radio button for remove invalid routes - removeInvalidRoutes = new FXRadioButton(radioButtonsFrame, "Remove invalid routes", - fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - // create radio button for save invalid routes - saveInvalidRoutes = new FXRadioButton(radioButtonsFrame, "Save invalid routes", - fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - // create radio button for select invalid routes - selectInvalidRoutesAndCancel = new FXRadioButton(radioButtonsFrame, "Select invalid routes", - fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); +GNEFixDemandElements::FixRouteOptions::FixRouteOptions(GNEFixDemandElements* fixDemandElementsParent, GNEViewNet* viewNet) : + FixOptions(fixDemandElementsParent->myLeftFrame, "Routes", viewNet) { + // Remove invalid routes + removeInvalidRoutes = new FXRadioButton(myLeftFrame, "Remove invalid routes", + fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix); + // Save invalid routes + saveInvalidRoutes = new FXRadioButton(myLeftFrame, "Save invalid routes", + fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix); + // Select invalid routes + selectInvalidRoutesAndCancel = new FXRadioButton(myRightFrame, "Select conflicted routes", + fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix); + // Remove stops out of route + removeStopsOutOfRoute = new FXCheckButton(myRightFrame, "Remove stops out of route", + fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignCheckButtonFix); // leave option "removeInvalidRoutes" as default removeInvalidRoutes->setCheck(true); + // ... and remove stops out of route + removeStopsOutOfRoute->setCheck(TRUE); } @@ -401,39 +274,90 @@ void -GNEFixDemandElements::FixRouteOptions::enableFixRouteOptions() { +GNEFixDemandElements::FixRouteOptions::fixElements(bool& abortSaving) { + if (myInvalidElements.size() > 0) { + if (removeInvalidRoutes->getCheck() == TRUE) { + // begin undo list + myViewNet->getUndoList()->begin(GUIIcon::ROUTE, "delete invalid routes"); + // iterate over invalid routes to delete it + for (const auto& invalidRoute : myInvalidElements) { + myViewNet->getNet()->deleteDemandElement(invalidRoute, myViewNet->getUndoList()); + } + // end undo list + myViewNet->getUndoList()->end(); + } else if (selectInvalidRoutesAndCancel->getCheck() == TRUE) { + // begin undo list + myViewNet->getUndoList()->begin(GUIIcon::ROUTE, "select invalid routes"); + // iterate over invalid single lane elements to select all elements + for (const auto& invalidRoute : myInvalidElements) { + invalidRoute->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList()); + } + // end undo list + myViewNet->getUndoList()->end(); + // abort saving + abortSaving = true; + } + // check if remove stops + if (removeStopsOutOfRoute->getCheck() == TRUE) { + // get all stops to remove + std::vector stopsToRemove; + for (const auto& invalidRoute : myInvalidElements) { + const auto invaldstops = invalidRoute->getInvalidStops(); + // append to stopsToRemove + stopsToRemove.insert(stopsToRemove.end(), invaldstops.begin(), invaldstops.end()); + } + // begin undo list + myViewNet->getUndoList()->begin(GUIIcon::ROUTE, "delete invalid stops"); + // remove all + for (const auto& stopToRemove : stopsToRemove) { + myViewNet->getNet()->deleteDemandElement(stopToRemove, myViewNet->getUndoList()); + } + // end undo list + myViewNet->getUndoList()->end(); + } + } +} + + +void +GNEFixDemandElements::FixRouteOptions::enableOptions() { removeInvalidRoutes->enable(); saveInvalidRoutes->enable(); selectInvalidRoutesAndCancel->enable(); + removeStopsOutOfRoute->enable(); } void -GNEFixDemandElements::FixRouteOptions::disableFixRouteOptions() { +GNEFixDemandElements::FixRouteOptions::disableOptions() { removeInvalidRoutes->disable(); saveInvalidRoutes->disable(); selectInvalidRoutesAndCancel->disable(); + removeStopsOutOfRoute->disable(); } // --------------------------------------------------------------------------- // GNEFixDemandElements::FixVehicleOptions - methods // --------------------------------------------------------------------------- -GNEFixDemandElements::FixVehicleOptions::FixVehicleOptions(GNEFixDemandElements* fixDemandElementsDialogParents) : - FXGroupBox(fixDemandElementsDialogParents->myMainFrame, "Solution for vehicles", GUIDesignGroupBoxFrame) { - // create horizontal frames for radio buttons - FXHorizontalFrame* radioButtonsFrame = new FXHorizontalFrame(this, GUIDesignHorizontalFrame); - // create radio button for remove invalid vehicles - removeInvalidVehicles = new FXRadioButton(radioButtonsFrame, "Remove invalid vehicles", - fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - // create radio button for save invalid vehicles - saveInvalidVehicles = new FXRadioButton(radioButtonsFrame, "Save invalid vehicles", - fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - // create radio button for select invalid vehicles - selectInvalidVehiclesAndCancel = new FXRadioButton(radioButtonsFrame, "Select invalid vehicle", - fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - // leave option "buildConnectionBetweenLanes" and "removeInvalidRoutes" as default - removeInvalidVehicles->setCheck(true); +GNEFixDemandElements::FixVehicleOptions::FixVehicleOptions(GNEFixDemandElements* fixDemandElementsParent, GNEViewNet* viewNet) : + FixOptions(fixDemandElementsParent->myLeftFrame, "Vehicles", viewNet) { + // Remove invalid vehicles + removeInvalidVehicles = new FXRadioButton(myLeftFrame, "Remove invalid vehicles", + fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix); + // Save invalid vehicles + saveInvalidVehicles = new FXRadioButton(myLeftFrame, "Save invalid vehicles", + fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix); + // Select invalid vehicle + selectInvalidVehiclesAndCancel = new FXRadioButton(myRightFrame, "Select conflicted vehicle", + fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix); + // Remove stops out of route + removeStopsOutOfVehicle = new FXCheckButton(myRightFrame, "Remove stops out of vehicle's route", + fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignCheckButtonFix); + // by default remove invalid vehicles + removeInvalidVehicles->setCheck(TRUE); + // ... and remove stops out of route + removeStopsOutOfVehicle->setCheck(TRUE); } @@ -456,47 +380,93 @@ void -GNEFixDemandElements::FixVehicleOptions::enableFixVehicleOptions() { +GNEFixDemandElements::FixVehicleOptions::fixElements(bool& abortSaving) { + if (myInvalidElements.size() > 0) { + if (removeInvalidVehicles->getCheck() == TRUE) { + // begin undo list + myViewNet->getUndoList()->begin(GUIIcon::ROUTE, "delete invalid routes"); + // iterate over invalid routes to delete it + for (const auto& invalidVehicle : myInvalidElements) { + myViewNet->getNet()->deleteDemandElement(invalidVehicle, myViewNet->getUndoList()); + } + // end undo list + myViewNet->getUndoList()->end(); + } else if (selectInvalidVehiclesAndCancel->getCheck() == TRUE) { + // begin undo list + myViewNet->getUndoList()->begin(GUIIcon::ROUTE, "select invalid routes"); + // iterate over invalid single lane elements to select all elements + for (const auto& invalidVehicle : myInvalidElements) { + invalidVehicle->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList()); + } + // end undo list + myViewNet->getUndoList()->end(); + // abort saving + abortSaving = true; + } + // check if remove stops + if (removeStopsOutOfVehicle->getCheck() == TRUE) { + // get all stops to remove + std::vector stopsToRemove; + for (const auto& invalidVehicle : myInvalidElements) { + const auto invaldstops = invalidVehicle->getInvalidStops(); + // append to stopsToRemove + stopsToRemove.insert(stopsToRemove.end(), invaldstops.begin(), invaldstops.end()); + } + // begin undo list + myViewNet->getUndoList()->begin(GUIIcon::ROUTE, "delete invalid stops"); + // remove all + for (const auto& stopToRemove : stopsToRemove) { + myViewNet->getNet()->deleteDemandElement(stopToRemove, myViewNet->getUndoList()); + } + // end undo list + myViewNet->getUndoList()->end(); + } + } +} + + +void +GNEFixDemandElements::FixVehicleOptions::enableOptions() { removeInvalidVehicles->enable(); saveInvalidVehicles->enable(); selectInvalidVehiclesAndCancel->enable(); + removeStopsOutOfVehicle->enable(); } void -GNEFixDemandElements::FixVehicleOptions::disableFixVehicleOptions() { +GNEFixDemandElements::FixVehicleOptions::disableOptions() { removeInvalidVehicles->disable(); saveInvalidVehicles->disable(); selectInvalidVehiclesAndCancel->disable(); + removeStopsOutOfVehicle->disable(); } // --------------------------------------------------------------------------- -// GNEFixDemandElements::FixStopOptions - methods +// GNEFixDemandElements::FixStopPositionOptions - methods // --------------------------------------------------------------------------- -GNEFixDemandElements::FixStopOptions::FixStopOptions(GNEFixDemandElements* fixDemandElementsDialogParents) : - FXGroupBox(fixDemandElementsDialogParents->myMainFrame, "Select a solution for stops", GUIDesignGroupBoxFrame) { - // create horizontal frames for radio buttons - FXHorizontalFrame* RadioButtons = new FXHorizontalFrame(this, GUIDesignHorizontalFrame); - // create Vertical Frame for left options - FXVerticalFrame* RadioButtonsLeft = new FXVerticalFrame(RadioButtons, GUIDesignAuxiliarVerticalFrame); - activateFriendlyPositionAndSave = new FXRadioButton(RadioButtonsLeft, "Activate friendlyPos and save", - fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - saveInvalid = new FXRadioButton(RadioButtonsLeft, "Save invalid positions", - fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - // create Vertical Frame for right options - FXVerticalFrame* RadioButtonsRight = new FXVerticalFrame(RadioButtons, GUIDesignAuxiliarVerticalFrame); - selectInvalidStopsAndCancel = new FXRadioButton(RadioButtonsRight, "Select invalid Stops", - fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - fixPositionsAndSave = new FXRadioButton(RadioButtonsRight, "Fix positions and save", - fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); +GNEFixDemandElements::FixStopPositionOptions::FixStopPositionOptions(GNEFixDemandElements* fixDemandElementsParent, GNEViewNet* viewNet) : + FixOptions(fixDemandElementsParent->myRightFrame, "Stop positions", viewNet) { + // Activate friendlyPos and save + activateFriendlyPositionAndSave = new FXRadioButton(myLeftFrame, "Activate friendlyPos and save", + fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix); + // Save invalid position + saveInvalid = new FXRadioButton(myLeftFrame, "Save invalid positions", + fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix); + // Select invalid Stops + selectInvalidStopsAndCancel = new FXRadioButton(myRightFrame, "Select conflicted Stops", + fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix); + // Fix positions and save + fixPositionsAndSave = new FXRadioButton(myRightFrame, "Fix positions and save", + fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix); // leave option "activateFriendlyPositionAndSave" as default activateFriendlyPositionAndSave->setCheck(true); } void -GNEFixDemandElements::FixStopOptions::selectOption(FXObject* option) { +GNEFixDemandElements::FixStopPositionOptions::selectOption(FXObject* option) { if (option == activateFriendlyPositionAndSave) { activateFriendlyPositionAndSave->setCheck(true); fixPositionsAndSave->setCheck(false); @@ -522,7 +492,41 @@ void -GNEFixDemandElements::FixStopOptions::enableFixStopOptions() { +GNEFixDemandElements::FixStopPositionOptions::fixElements(bool& abortSaving) { + // check options for stops + if (myInvalidElements.size() > 0) { + if (activateFriendlyPositionAndSave->getCheck() == TRUE) { + // begin undo list + myViewNet->getUndoList()->begin(GUIIcon::STOP, "change " + toString(SUMO_ATTR_FRIENDLY_POS) + " of invalid stops"); + // iterate over invalid stops to enable friendly position + for (const auto& stop : myInvalidElements) { + stop->setAttribute(SUMO_ATTR_FRIENDLY_POS, "true", myViewNet->getUndoList()); + } + myViewNet->getUndoList()->end(); + } else if (fixPositionsAndSave->getCheck() == TRUE) { + myViewNet->getUndoList()->begin(GUIIcon::STOP, "fix positions of invalid stops"); + // iterate over invalid stops to fix positions + for (const auto& stop : myInvalidElements) { + stop->fixDemandElementProblem(); + } + myViewNet->getUndoList()->end(); + } else if (selectInvalidStopsAndCancel->getCheck() == TRUE) { + myViewNet->getUndoList()->begin(GUIIcon::STOP, "select invalid stops"); + // iterate over invalid stops to select all elements + for (const auto& stop : myInvalidElements) { + stop->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList()); + } + // end undo list + myViewNet->getUndoList()->end(); + // abort saving + abortSaving = true; + } + } +} + + +void +GNEFixDemandElements::FixStopPositionOptions::enableOptions() { activateFriendlyPositionAndSave->enable(); fixPositionsAndSave->enable(); saveInvalid->enable(); @@ -531,7 +535,7 @@ void -GNEFixDemandElements::FixStopOptions::disableFixStopOptions() { +GNEFixDemandElements::FixStopPositionOptions::disableOptions() { activateFriendlyPositionAndSave->disable(); fixPositionsAndSave->disable(); saveInvalid->disable(); @@ -542,20 +546,17 @@ // GNEFixDemandElements::FixPersonPlanOptions - methods // --------------------------------------------------------------------------- -GNEFixDemandElements::FixPersonPlanOptions::FixPersonPlanOptions(GNEFixDemandElements* fixDemandElementsDialogParents) : - FXGroupBox(fixDemandElementsDialogParents->myMainFrame, "Select a solution for person plans", GUIDesignGroupBoxFrame) { - // create horizontal frames for radio buttons - FXHorizontalFrame* RadioButtons = new FXHorizontalFrame(this, GUIDesignHorizontalFrame); - // create Vertical Frame for left options - FXVerticalFrame* RadioButtonsLeft = new FXVerticalFrame(RadioButtons, GUIDesignAuxiliarVerticalFrame); - deletePersonPlan = new FXRadioButton(RadioButtonsLeft, "Delete person plan", - fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - saveInvalid = new FXRadioButton(RadioButtonsLeft, "Save invalid person plans", - fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - // create Vertical Frame for right options - FXVerticalFrame* RadioButtonsRight = new FXVerticalFrame(RadioButtons, GUIDesignAuxiliarVerticalFrame); - selectInvalidPersonPlansAndCancel = new FXRadioButton(RadioButtonsRight, "Select invalid person plans", - fixDemandElementsDialogParents, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); +GNEFixDemandElements::FixPersonPlanOptions::FixPersonPlanOptions(GNEFixDemandElements* fixDemandElementsParent, GNEViewNet* viewNet) : + FixOptions(fixDemandElementsParent->myRightFrame, "Person/container plans", viewNet) { + // Delete person plan + deletePersonPlan = new FXRadioButton(myLeftFrame, "Delete person plan", + fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix); + // Save invalid person plans + saveInvalid = new FXRadioButton(myLeftFrame, "Save invalid person plans", + fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix); + // Select invalid person plans + selectInvalidPersonPlansAndCancel = new FXRadioButton(myRightFrame, "Select conflicted person plans", + fixDemandElementsParent, MID_CHOOSEN_OPERATION, GUIDesignRadioButtonFix); // leave option "activateFriendlyPositionAndSave" as default deletePersonPlan->setCheck(true); } @@ -581,7 +582,34 @@ void -GNEFixDemandElements::FixPersonPlanOptions::enableFixPersonPlanOptions() { +GNEFixDemandElements::FixPersonPlanOptions::fixElements(bool& abortSaving) { + // check options for person plans + if (myInvalidElements.size() > 0) { + if (deletePersonPlan->getCheck() == TRUE) { + // begin undo list + myViewNet->getUndoList()->begin(GUIIcon::MODEPERSONPLAN, "delete invalid person plans"); + // remove all invalid person plans + for (const auto& personPlan : myInvalidElements) { + myViewNet->getNet()->deleteDemandElement(personPlan, myViewNet->getUndoList()); + } + myViewNet->getUndoList()->end(); + } else if (selectInvalidPersonPlansAndCancel->getCheck() == TRUE) { + myViewNet->getUndoList()->begin(GUIIcon::MODEPERSONPLAN, "select invalid person plans"); + // iterate over invalid person plans to select all elements + for (const auto& personPlan : myInvalidElements) { + personPlan->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList()); + } + // end undo list + myViewNet->getUndoList()->end(); + // abort saving + abortSaving = false; + } + } +} + + +void +GNEFixDemandElements::FixPersonPlanOptions::enableOptions() { deletePersonPlan->enable(); saveInvalid->enable(); selectInvalidPersonPlansAndCancel->enable(); @@ -589,10 +617,24 @@ void -GNEFixDemandElements::FixPersonPlanOptions::disableFixPersonPlanOptions() { +GNEFixDemandElements::FixPersonPlanOptions::disableOptions() { deletePersonPlan->disable(); saveInvalid->disable(); selectInvalidPersonPlansAndCancel->disable(); } +// --------------------------------------------------------------------------- +// GNEFixDemandElements::Buttons - methods +// --------------------------------------------------------------------------- + +GNEFixDemandElements::Buttons::Buttons(GNEFixDemandElements* fixDemandElementsParent) : + FXHorizontalFrame(fixDemandElementsParent->myMainFrame, GUIDesignHorizontalFrame) { + new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myAcceptButton = new FXButton(this, FXWindow::tr("&Accept"), GUIIconSubSys::getIcon(GUIIcon::ACCEPT), fixDemandElementsParent, MID_GNE_BUTTON_ACCEPT, GUIDesignButtonAccept); + myCancelButton = new FXButton(this, FXWindow::tr("&Cancel"), GUIIconSubSys::getIcon(GUIIcon::CANCEL), fixDemandElementsParent, MID_GNE_BUTTON_CANCEL, GUIDesignButtonCancel); + new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + // set focus in accept button + myAcceptButton->setFocus(); +} + /****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEFixDemandElements.h sumo-1.12.0/src/netedit/dialogs/GNEFixDemandElements.h --- sumo-1.11.0/src/netedit/dialogs/GNEFixDemandElements.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEFixDemandElements.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -20,7 +20,7 @@ #pragma once #include -#include +#include // =========================================================================== // class declarations @@ -60,44 +60,61 @@ /// @} protected: - /// @brief groupbox for list - class DemandList : protected FXGroupBox { + /// @brief FOX need this + FOX_CONSTRUCTOR(GNEFixDemandElements) + + /// @brief general GroupBox for fix options + class FixOptions : public FXGroupBoxModule { public: /// @brief constructor - DemandList(GNEFixDemandElements* fixDemandElementsDialogParents, const std::vector& invalidDemandElements); + FixOptions(FXVerticalFrame* frameParent, const std::string& title, GNEViewNet* viewNet); + + /// @brief set invalid demand elements + void setInvalidElements(const std::vector& invalidElements); + + /// @brief fix elements + virtual void fixElements(bool& abortSaving) = 0; - /// @brief vector with the invalid routes - std::vector myInvalidRoutes; + protected: + /// @brief save contents + bool saveContents() const; - /// @brief vector with the invalid vehicles - std::vector myInvalidVehicles; + /// @brief vertical left frame + FXVerticalFrame* myLeftFrame = nullptr; - /// @brief vector with the invalid stops - std::vector myInvalidStops; + /// @brief vertical right frame + FXVerticalFrame* myRightFrame = nullptr; - /// @brief vector with the invalid person plans - std::vector myInvalidPersonPlans; + /// @brief pointer to viewNet + GNEViewNet* myViewNet; - /// @brief list with the demand elements - FXTable* myTable; + /// @brief vector with the invalid demand elements + std::vector myInvalidElements; + + private: + /// @brief enable options + virtual void enableOptions() = 0; + + /// @brief disable options + virtual void disableOptions() = 0; + + /// @brief Table with the demand elements + FXTable* myTable = nullptr; }; /// @brief groupbox for all radio buttons related with fix route options - class FixRouteOptions : protected FXGroupBox { + class FixRouteOptions : public FixOptions { public: /// @brief constructor - FixRouteOptions(GNEFixDemandElements* fixDemandElementsDialogParents); + FixRouteOptions(GNEFixDemandElements* fixDemandElementsParent, GNEViewNet* viewNet); /// @brief select option void selectOption(FXObject* option); - /// @brief enable position options - void enableFixRouteOptions(); - - /// @brief disable position options - void disableFixRouteOptions(); + /// @brief fix elements + void fixElements(bool& abortSaving); /// @brief Option "Remove invalid routes" FXRadioButton* removeInvalidRoutes; @@ -107,23 +124,30 @@ /// @brief Option "Select invalid routes and cancel" FXRadioButton* selectInvalidRoutesAndCancel; + + /// @brief Option "Remove stops out of route" + FXCheckButton* removeStopsOutOfRoute; + + private: + /// @brief enable route options + void enableOptions(); + + /// @brief disable route options + void disableOptions(); }; /// @brief groupbox for all radio buttons related with fix vehicle options - class FixVehicleOptions : protected FXGroupBox { + class FixVehicleOptions : public FixOptions { public: /// @brief constructor - FixVehicleOptions(GNEFixDemandElements* fixDemandElementsDialogParents); + FixVehicleOptions(GNEFixDemandElements* fixDemandElementsParent, GNEViewNet* viewNet); /// @brief select option void selectOption(FXObject* option); - /// @brief enable consecutive lane options - void enableFixVehicleOptions(); - - /// @brief disable consecutive lane options - void disableFixVehicleOptions(); + /// @brief fix elements + void fixElements(bool& abortSaving); /// @brief Option "remove invalid elements" FXRadioButton* removeInvalidVehicles; @@ -133,23 +157,30 @@ /// @brief Option "Select invalid vehicles and cancel" FXRadioButton* selectInvalidVehiclesAndCancel; + + /// @brief Option "Remove stops out of vehicle" + FXCheckButton* removeStopsOutOfVehicle; + + private: + /// @brief enable vehicle options + void enableOptions(); + + /// @brief disable vehicle options + void disableOptions(); }; /// @brief groupbox for all radio buttons related with fix stop options - class FixStopOptions : public FXGroupBox { + class FixStopPositionOptions : public FixOptions { public: /// @brief build Position Options - FixStopOptions(GNEFixDemandElements* fixDemandElementsDialogParents); + FixStopPositionOptions(GNEFixDemandElements* fixDemandElementsParent, GNEViewNet* viewNet); /// @brief select option void selectOption(FXObject* option); - /// @brief enable position options - void enableFixStopOptions(); - - /// @brief disable position options - void disableFixStopOptions(); + /// @brief fix elements + void fixElements(bool& abortSaving); /// @brief Option "Activate friendlyPos and save" FXRadioButton* activateFriendlyPositionAndSave; @@ -162,23 +193,27 @@ /// @brief Option "Select invalid stops and cancel" FXRadioButton* selectInvalidStopsAndCancel; + + private: + /// @brief enable stop options + void enableOptions(); + + /// @brief disable stop options + void disableOptions(); }; /// @brief groupbox for all radio buttons related with fix person plan options - class FixPersonPlanOptions : public FXGroupBox { + class FixPersonPlanOptions : public FixOptions { public: /// @brief build Position Options - FixPersonPlanOptions(GNEFixDemandElements* fixDemandElementsDialogParents); + FixPersonPlanOptions(GNEFixDemandElements* fixDemandElementsParent, GNEViewNet* viewNet); /// @brief select option void selectOption(FXObject* option); - /// @brief enable position options - void enableFixPersonPlanOptions(); - - /// @brief disable position options - void disableFixPersonPlanOptions(); + /// @brief fix elements + void fixElements(bool& abortSaving); /// @brief Option "delete person plan" FXRadioButton* deletePersonPlan; @@ -188,36 +223,56 @@ /// @brief Option "Select invalid person plans and cancel" FXRadioButton* selectInvalidPersonPlansAndCancel; + + private: + /// @brief enable personPlan options + void enableOptions(); + + /// @brief disable personPlan options + void disableOptions(); }; - FOX_CONSTRUCTOR(GNEFixDemandElements) + /// @brief horizontal frame for buttons + class Buttons : public FXHorizontalFrame { + + public: + /// @brief build Position Options + Buttons(GNEFixDemandElements* fixDemandElementsParent); + + private: + /// @brief accept button + FXButton* myAcceptButton = nullptr; + + /// @brief cancel button + FXButton* myCancelButton = nullptr; + }; /// @brief view net - GNEViewNet* myViewNet; + GNEViewNet* myViewNet = nullptr; /// @brief main frame - FXVerticalFrame* myMainFrame; + FXVerticalFrame* myMainFrame = nullptr; + + /// @brief vertical left frame + FXVerticalFrame* myLeftFrame = nullptr; - /// @brief list with the demand elements - DemandList* myDemandList; + /// @brief vertical right frame + FXVerticalFrame* myRightFrame = nullptr; /// @brief fix route options - FixRouteOptions* myFixRouteOptions; + FixRouteOptions* myFixRouteOptions = nullptr; /// @brief fix vehicle options - FixVehicleOptions* myFixVehicleOptions; + FixVehicleOptions* myFixVehicleOptions = nullptr; /// @brief fix stop options - FixStopOptions* myFixStopOptions; + FixStopPositionOptions* myFixStopPositionOptions = nullptr; /// @brief fix person plan options - FixPersonPlanOptions* myFixPersonPlanOptions; - - /// @brief accept button - FXButton* myAcceptButton; + FixPersonPlanOptions* myFixPersonPlanOptions = nullptr; - /// @brief cancel button - FXButton* myCancelButton; + /// @brief buttons + Buttons* myButtons = nullptr; private: /// @brief Invalidated copy constructor. diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEGeometryPointDialog.cpp sumo-1.12.0/src/netedit/dialogs/GNEGeometryPointDialog.cpp --- sumo-1.11.0/src/netedit/dialogs/GNEGeometryPointDialog.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEGeometryPointDialog.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEGeometryPointDialog.h sumo-1.12.0/src/netedit/dialogs/GNEGeometryPointDialog.h --- sumo-1.11.0/src/netedit/dialogs/GNEGeometryPointDialog.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEGeometryPointDialog.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEMultipleParametersDialog.cpp sumo-1.12.0/src/netedit/dialogs/GNEMultipleParametersDialog.cpp --- sumo-1.11.0/src/netedit/dialogs/GNEMultipleParametersDialog.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEMultipleParametersDialog.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -492,9 +492,9 @@ // GNEMultipleParametersDialog - methods // --------------------------------------------------------------------------- -GNEMultipleParametersDialog::GNEMultipleParametersDialog(GNEInspectorFrame::ParametersEditorInspector* parametersEditorInspector) : +GNEMultipleParametersDialog::GNEMultipleParametersDialog(GNEInspectorFrame::ParametersEditor* parametersEditorInspector) : FXDialogBox(parametersEditorInspector->getInspectorFrameParent()->getViewNet()->getApp(), "Edit parameters", GUIDesignDialogBoxExplicitStretchable(430, 300)), - myParametersEditorInspector(parametersEditorInspector) { + myParametersEditor(parametersEditorInspector) { // call auxiliar constructor constructor(); // reset @@ -507,10 +507,10 @@ long GNEMultipleParametersDialog::onCmdAccept(FXObject*, FXSelector, void*) { - const auto& ACs = myParametersEditorInspector->getInspectorFrameParent()->getViewNet()->getInspectedAttributeCarriers(); + const auto& ACs = myParametersEditor->getInspectorFrameParent()->getViewNet()->getInspectedAttributeCarriers(); if (ACs.size() > 0) { // get undo list - GNEUndoList* undoList = myParametersEditorInspector->getInspectorFrameParent()->getViewNet()->getUndoList(); + GNEUndoList* undoList = myParametersEditor->getInspectorFrameParent()->getViewNet()->getUndoList(); // declare vector for parameters in stringvector format std::vector > parametersChanged; // declare keep keys vector @@ -596,7 +596,7 @@ // declare a map for key-values std::map > keyValuesMap; // fill keys - for (const auto& AC : myParametersEditorInspector->getInspectorFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { + for (const auto& AC : myParametersEditor->getInspectorFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { for (const auto& keyAttribute : AC->getACParametersMap()) { keyValuesMap[keyAttribute.first].push_back(keyAttribute.second); } diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEMultipleParametersDialog.h sumo-1.12.0/src/netedit/dialogs/GNEMultipleParametersDialog.h --- sumo-1.11.0/src/netedit/dialogs/GNEMultipleParametersDialog.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEMultipleParametersDialog.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -22,7 +22,7 @@ #include #include -#include +#include #include // =========================================================================== @@ -254,7 +254,7 @@ }; /// @brief Constructor for parameter editor inspector - GNEMultipleParametersDialog(GNEInspectorFrame::ParametersEditorInspector* parametersEditorInspector); + GNEMultipleParametersDialog(GNEInspectorFrame::ParametersEditor* parametersEditorInspector); /// @brief destructor ~GNEMultipleParametersDialog(); @@ -275,8 +275,8 @@ /// @brief FOX need this FOX_CONSTRUCTOR(GNEMultipleParametersDialog) - /// @brief pointer to ParametersEditorInspector - GNEInspectorFrame::ParametersEditorInspector* myParametersEditorInspector; + /// @brief pointer to ParametersEditor + GNEInspectorFrame::ParametersEditor* myParametersEditor; /// @brief pointer to parameters values ParametersValues* myParametersValues; diff -Nru sumo-1.11.0/src/netedit/dialogs/GNERerouterDialog.cpp sumo-1.12.0/src/netedit/dialogs/GNERerouterDialog.cpp --- sumo-1.11.0/src/netedit/dialogs/GNERerouterDialog.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNERerouterDialog.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNERerouterDialog.h sumo-1.12.0/src/netedit/dialogs/GNERerouterDialog.h --- sumo-1.11.0/src/netedit/dialogs/GNERerouterDialog.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNERerouterDialog.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNERerouterIntervalDialog.cpp sumo-1.12.0/src/netedit/dialogs/GNERerouterIntervalDialog.cpp --- sumo-1.11.0/src/netedit/dialogs/GNERerouterIntervalDialog.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNERerouterIntervalDialog.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNERerouterIntervalDialog.h sumo-1.12.0/src/netedit/dialogs/GNERerouterIntervalDialog.h --- sumo-1.11.0/src/netedit/dialogs/GNERerouterIntervalDialog.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNERerouterIntervalDialog.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNERouteDialog.cpp sumo-1.12.0/src/netedit/dialogs/GNERouteDialog.cpp --- sumo-1.11.0/src/netedit/dialogs/GNERouteDialog.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNERouteDialog.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNERouteDialog.h sumo-1.12.0/src/netedit/dialogs/GNERouteDialog.h --- sumo-1.11.0/src/netedit/dialogs/GNERouteDialog.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNERouteDialog.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNESingleParametersDialog.cpp sumo-1.12.0/src/netedit/dialogs/GNESingleParametersDialog.cpp --- sumo-1.11.0/src/netedit/dialogs/GNESingleParametersDialog.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNESingleParametersDialog.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -71,8 +71,8 @@ // GNESingleParametersDialog::ParametersValues - methods // --------------------------------------------------------------------------- -GNESingleParametersDialog::ParametersValues::ParametersValues(FXHorizontalFrame* frame) : - FXGroupBox(frame, " Parameters", GUIDesignGroupBoxFrameFill) { +GNESingleParametersDialog::ParametersValues::ParametersValues(FXHorizontalFrame* frame, const std::string& name) : + FXGroupBox(frame, name.c_str(), GUIDesignGroupBoxFrameFill) { // create labels for keys and values FXHorizontalFrame* horizontalFrameLabels = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); myKeyLabel = new FXLabel(horizontalFrameLabels, "key", nullptr, GUIDesignLabelThick100); @@ -477,31 +477,31 @@ // GNESingleParametersDialog - methods // --------------------------------------------------------------------------- -GNESingleParametersDialog::GNESingleParametersDialog(GNEFrameAttributesModuls::ParametersEditorCreator* parametersEditorCreator) : - FXDialogBox(parametersEditorCreator->getFrameParent()->getViewNet()->getApp(), "Edit parameters", GUIDesignDialogBoxExplicitStretchable(400, 300)), - myParametersEditorCreator(parametersEditorCreator), - myParametersEditorInspector(nullptr), +GNESingleParametersDialog::GNESingleParametersDialog(GNEFrameAttributeModules::GenericDataAttributes* genericDataAttributes) : + FXDialogBox(genericDataAttributes->getFrameParent()->getViewNet()->getApp(), "Edit attributes", GUIDesignDialogBoxExplicitStretchable(400, 300)), + myGenericDataAttributes(genericDataAttributes), + myParametersEditor(nullptr), VTypeAttributeRow(nullptr), myAttributeCarrier(nullptr), myTLDef(nullptr) { // call auxiliar constructor for elements - constructor(); + constructor("Attributes"); // fill myParametersValues - myParametersValues->setParameters(parametersEditorCreator->getParameters()); + myParametersValues->setParameters(genericDataAttributes->getParameters()); } -GNESingleParametersDialog::GNESingleParametersDialog(GNEInspectorFrame::ParametersEditorInspector* parametersEditorInspector) : - FXDialogBox(parametersEditorInspector->getInspectorFrameParent()->getViewNet()->getApp(), "Edit parameters", GUIDesignDialogBoxExplicitStretchable(400, 300)), - myParametersEditorCreator(nullptr), - myParametersEditorInspector(parametersEditorInspector), +GNESingleParametersDialog::GNESingleParametersDialog(GNEInspectorFrame::ParametersEditor* parametersEditor) : + FXDialogBox(parametersEditor->getInspectorFrameParent()->getViewNet()->getApp(), "Edit parameters", GUIDesignDialogBoxExplicitStretchable(400, 300)), + myGenericDataAttributes(nullptr), + myParametersEditor(parametersEditor), VTypeAttributeRow(nullptr), myAttributeCarrier(nullptr), myTLDef(nullptr) { // call auxiliar constructor - constructor(); + constructor("Parameters"); // get AC Front - const GNEAttributeCarrier* AC = parametersEditorInspector->getInspectorFrameParent()->getViewNet()->getInspectedAttributeCarriers().front(); + const GNEAttributeCarrier* AC = parametersEditor->getInspectorFrameParent()->getViewNet()->getInspectedAttributeCarriers().front(); // fill myParametersValues myParametersValues->setParameters(AC->getACParameters > >()); } @@ -510,13 +510,13 @@ GNESingleParametersDialog::GNESingleParametersDialog(GNEVehicleTypeDialog::VTypeAtributes::VTypeAttributeRow* VTypeAttributeRow, GNEViewNet* viewNet) : FXDialogBox(viewNet->getApp(), "Edit parameters", GUIDesignDialogBoxExplicitStretchable(400, 300)), - myParametersEditorCreator(nullptr), - myParametersEditorInspector(nullptr), + myGenericDataAttributes(nullptr), + myParametersEditor(nullptr), VTypeAttributeRow(VTypeAttributeRow), myAttributeCarrier(nullptr), myTLDef(nullptr) { // call auxiliar constructor - constructor(); + constructor("Parameters"); // fill myEditedParameters myParametersValues->setParameters(VTypeAttributeRow->getParametersVectorStr()); } @@ -524,13 +524,13 @@ GNESingleParametersDialog::GNESingleParametersDialog(GNEAttributeCarrier* attributeCarrier) : FXDialogBox(attributeCarrier->getNet()->getViewNet()->getApp(), "Edit parameters", GUIDesignDialogBoxExplicitStretchable(400, 300)), - myParametersEditorCreator(nullptr), - myParametersEditorInspector(nullptr), + myGenericDataAttributes(nullptr), + myParametersEditor(nullptr), VTypeAttributeRow(nullptr), myAttributeCarrier(attributeCarrier), myTLDef(nullptr) { // call auxiliar constructor - constructor(); + constructor("Parameters"); // fill myEditedParameters myParametersValues->setParameters(myAttributeCarrier->getACParameters > >()); } @@ -538,13 +538,13 @@ GNESingleParametersDialog::GNESingleParametersDialog(FXApp* app, NBLoadedSUMOTLDef* TLDef) : FXDialogBox(app, "Edit parameters", GUIDesignDialogBoxExplicitStretchable(400, 300)), - myParametersEditorCreator(nullptr), - myParametersEditorInspector(nullptr), + myGenericDataAttributes(nullptr), + myParametersEditor(nullptr), VTypeAttributeRow(nullptr), myAttributeCarrier(nullptr), myTLDef(TLDef) { // call auxiliar constructor - constructor(); + constructor("Parameters"); // transform parameters to a=b|c=d... format std::vector > parametersStr; // Generate a vector string using the following structure: ", ,... @@ -603,16 +603,16 @@ } } // set parameters in Parameters editor parents - if (myParametersEditorCreator) { + if (myGenericDataAttributes) { // set parameter in editor creator - myParametersEditorCreator->setParameters(parameters); - } else if (myParametersEditorInspector) { + myGenericDataAttributes->setParameters(parameters); + } else if (myParametersEditor) { // get inspected AC - GNEAttributeCarrier* AC = myParametersEditorInspector->getInspectorFrameParent()->getViewNet()->getInspectedAttributeCarriers().front(); + GNEAttributeCarrier* AC = myParametersEditor->getInspectorFrameParent()->getViewNet()->getInspectedAttributeCarriers().front(); // set parameter in AC using undoList - myParametersEditorInspector->getInspectorFrameParent()->getViewNet()->getUndoList()->begin(AC->getTagProperty().getGUIIcon(), "change parameters"); - AC->setACParameters(parameters, myParametersEditorInspector->getInspectorFrameParent()->getViewNet()->getUndoList()); - myParametersEditorInspector->getInspectorFrameParent()->getViewNet()->getUndoList()->end(); + myParametersEditor->getInspectorFrameParent()->getViewNet()->getUndoList()->begin(AC->getTagProperty().getGUIIcon(), "change parameters"); + AC->setACParameters(parameters, myParametersEditor->getInspectorFrameParent()->getViewNet()->getUndoList()); + myParametersEditor->getInspectorFrameParent()->getViewNet()->getUndoList()->end(); } else if (VTypeAttributeRow) { // set parameter in VTypeAttributeRow VTypeAttributeRow->setParameters(parameters); @@ -648,10 +648,10 @@ long GNESingleParametersDialog::onCmdReset(FXObject*, FXSelector, void*) { // restore original parameters - if (myParametersEditorCreator) { - myParametersValues->setParameters(myParametersEditorCreator->getParameters()); - } else if (myParametersEditorInspector) { - const GNEAttributeCarrier* AC = myParametersEditorInspector->getInspectorFrameParent()->getViewNet()->getInspectedAttributeCarriers().front(); + if (myGenericDataAttributes) { + myParametersValues->setParameters(myGenericDataAttributes->getParameters()); + } else if (myParametersEditor) { + const GNEAttributeCarrier* AC = myParametersEditor->getInspectorFrameParent()->getViewNet()->getInspectedAttributeCarriers().front(); myParametersValues->setParameters(AC->getACParameters > >()); } else if (VTypeAttributeRow) { myParametersValues->setParameters(VTypeAttributeRow->getParametersVectorStr()); @@ -672,7 +672,7 @@ void -GNESingleParametersDialog::constructor() { +GNESingleParametersDialog::constructor(const std::string& name) { // set vehicle icon for this dialog setIcon(GUIIconSubSys::getIcon(GUIIcon::APP_TABLE)); // create main frame @@ -680,7 +680,7 @@ // create frame for Parameters and operations FXHorizontalFrame* horizontalFrameExtras = new FXHorizontalFrame(mainFrame, GUIDesignAuxiliarFrame); // create parameters values - myParametersValues = new ParametersValues(horizontalFrameExtras); + myParametersValues = new ParametersValues(horizontalFrameExtras, name); // create parameters operations myParametersOperations = new ParametersOperations(horizontalFrameExtras, this); // add separator diff -Nru sumo-1.11.0/src/netedit/dialogs/GNESingleParametersDialog.h sumo-1.12.0/src/netedit/dialogs/GNESingleParametersDialog.h --- sumo-1.11.0/src/netedit/dialogs/GNESingleParametersDialog.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNESingleParametersDialog.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -61,7 +61,7 @@ public: /// @brief constructor - ParametersValues(FXHorizontalFrame* frame); + ParametersValues(FXHorizontalFrame* frame, const std::string& name); /// @brief destructor ~ParametersValues(); @@ -230,11 +230,11 @@ FXButton* myHelpButton; }; - /// @brief Constructor for parameter editor creator - GNESingleParametersDialog(GNEFrameAttributesModuls::ParametersEditorCreator* parametersEditorCreator); + /// @brief Constructor for generic data attributes + GNESingleParametersDialog(GNEFrameAttributeModules::GenericDataAttributes* genericDataAttributes); - /// @brief Constructor for parameter editor inspector - GNESingleParametersDialog(GNEInspectorFrame::ParametersEditorInspector* parametersEditorInspector); + /// @brief Constructor for parameter editor + GNESingleParametersDialog(GNEInspectorFrame::ParametersEditor* parametersEditor); /// @brief Constructor for Vehicle Type Row (Vehicle Type Dialog) GNESingleParametersDialog(GNEVehicleTypeDialog::VTypeAtributes::VTypeAttributeRow* VTypeAttributeRow, GNEViewNet* viewNet); @@ -264,11 +264,11 @@ /// @brief FOX need this FOX_CONSTRUCTOR(GNESingleParametersDialog) - /// @brief pointer to ParametersEditorCreator - GNEFrameAttributesModuls::ParametersEditorCreator* myParametersEditorCreator; + /// @brief pointer to GenericDataAttributes + GNEFrameAttributeModules::GenericDataAttributes* myGenericDataAttributes; - /// @brief pointer to ParametersEditorInspector - GNEInspectorFrame::ParametersEditorInspector* myParametersEditorInspector; + /// @brief pointer to ParametersEditor + GNEInspectorFrame::ParametersEditor* myParametersEditor; /// @brief pointer to VTypeAttributeRow GNEVehicleTypeDialog::VTypeAtributes::VTypeAttributeRow* VTypeAttributeRow; @@ -296,7 +296,7 @@ private: /// @brief auxiliar constructor - void constructor(); + void constructor(const std::string& name); /// @brief Invalidated copy constructor. GNESingleParametersDialog(const GNESingleParametersDialog&) = delete; diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEUndoListDialog.cpp sumo-1.12.0/src/netedit/dialogs/GNEUndoListDialog.cpp --- sumo-1.11.0/src/netedit/dialogs/GNEUndoListDialog.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEUndoListDialog.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEUndoListDialog.h sumo-1.12.0/src/netedit/dialogs/GNEUndoListDialog.h --- sumo-1.11.0/src/netedit/dialogs/GNEUndoListDialog.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEUndoListDialog.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEVariableSpeedSignDialog.cpp sumo-1.12.0/src/netedit/dialogs/GNEVariableSpeedSignDialog.cpp --- sumo-1.11.0/src/netedit/dialogs/GNEVariableSpeedSignDialog.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEVariableSpeedSignDialog.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEVariableSpeedSignDialog.h sumo-1.12.0/src/netedit/dialogs/GNEVariableSpeedSignDialog.h --- sumo-1.11.0/src/netedit/dialogs/GNEVariableSpeedSignDialog.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEVariableSpeedSignDialog.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEVehicleTypeDialog.cpp sumo-1.12.0/src/netedit/dialogs/GNEVehicleTypeDialog.cpp --- sumo-1.11.0/src/netedit/dialogs/GNEVehicleTypeDialog.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEVehicleTypeDialog.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -265,7 +265,7 @@ // fill combo Box with all vehicle shapes std::vector VShapeStrings = SumoVehicleShapeStrings.getStrings(); for (auto i : VShapeStrings) { - if (i != SumoVehicleShapeStrings.getString(SVS_UNKNOWN)) { + if (i != SumoVehicleShapeStrings.getString(SUMOVehicleShape::UNKNOWN)) { myComboBoxShape->appendItem(i.c_str()); } } @@ -301,88 +301,93 @@ GNEVehicleTypeDialog::VTypeAtributes::VShapeRow::setVShapeLabelImage() { // set Icon in label depending of current VClass switch (getVehicleShapeID(myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(SUMO_ATTR_GUISHAPE))) { - case SVS_UNKNOWN: + case SUMOVehicleShape::UNKNOWN: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_UNKNOWN)); break; - case SVS_PEDESTRIAN: + case SUMOVehicleShape::PEDESTRIAN: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PEDESTRIAN)); break; - case SVS_BICYCLE: + case SUMOVehicleShape::BICYCLE: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_BICYCLE)); break; - case SVS_MOPED: + case SUMOVehicleShape::MOPED: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_MOPED)); break; - case SVS_MOTORCYCLE: + case SUMOVehicleShape::MOTORCYCLE: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_MOTORCYCLE)); break; - case SVS_PASSENGER: + case SUMOVehicleShape::PASSENGER: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PASSENGER)); break; - case SVS_PASSENGER_SEDAN: + case SUMOVehicleShape::PASSENGER_SEDAN: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PASSENGER_SEDAN)); break; - case SVS_PASSENGER_HATCHBACK: + case SUMOVehicleShape::PASSENGER_HATCHBACK: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PASSENGER_HATCHBACK)); break; - case SVS_PASSENGER_WAGON: + case SUMOVehicleShape::PASSENGER_WAGON: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PASSENGER_WAGON)); break; - case SVS_PASSENGER_VAN: + case SUMOVehicleShape::PASSENGER_VAN: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PASSENGER_VAN)); break; - case SVS_DELIVERY: + case SUMOVehicleShape::DELIVERY: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_DELIVERY)); break; - case SVS_TRUCK: + case SUMOVehicleShape::TRUCK: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_TRUCK)); break; - case SVS_TRUCK_SEMITRAILER: + case SUMOVehicleShape::TRUCK_SEMITRAILER: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_TRUCK_SEMITRAILER)); break; - case SVS_TRUCK_1TRAILER: + case SUMOVehicleShape::TRUCK_1TRAILER: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_TRUCK_1TRAILER)); break; - case SVS_BUS: + case SUMOVehicleShape::BUS: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_BUS)); break; - case SVS_BUS_COACH: + case SUMOVehicleShape::BUS_COACH: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_BUS_COACH)); break; - case SVS_BUS_FLEXIBLE: + case SUMOVehicleShape::BUS_FLEXIBLE: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_BUS_FLEXIBLE)); break; - case SVS_BUS_TROLLEY: + case SUMOVehicleShape::BUS_TROLLEY: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_BUS_TROLLEY)); break; - case SVS_RAIL: + case SUMOVehicleShape::RAIL: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_RAIL)); break; - case SVS_RAIL_CAR: + case SUMOVehicleShape::RAIL_CAR: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_RAIL_CAR)); break; - case SVS_RAIL_CARGO: + case SUMOVehicleShape::RAIL_CARGO: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_RAIL_CARGO)); break; - case SVS_E_VEHICLE: + case SUMOVehicleShape::E_VEHICLE: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_E_VEHICLE)); break; - case SVS_ANT: + case SUMOVehicleShape::ANT: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_ANT)); break; - case SVS_SHIP: + case SUMOVehicleShape::SHIP: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_SHIP)); break; - case SVS_EMERGENCY: - case SVS_FIREBRIGADE: + case SUMOVehicleShape::EMERGENCY: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_EMERGENCY)); break; - case SVS_POLICE: + case SUMOVehicleShape::FIREBRIGADE: + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_FIREBRIGADE)); + break; + case SUMOVehicleShape::POLICE: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_POLICE)); break; - case SVS_RICKSHAW: + case SUMOVehicleShape::RICKSHAW: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_RICKSHAW)); break; + case SUMOVehicleShape::SCOOTER: + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_SCOOTER)); + break; default: myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_IGNORING)); break; diff -Nru sumo-1.11.0/src/netedit/dialogs/GNEVehicleTypeDialog.h sumo-1.12.0/src/netedit/dialogs/GNEVehicleTypeDialog.h --- sumo-1.11.0/src/netedit/dialogs/GNEVehicleTypeDialog.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/dialogs/GNEVehicleTypeDialog.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -28,7 +28,7 @@ // class declarations // =========================================================================== -class GNEVehicleType; +class GNEVType; // =========================================================================== // class definitions diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEAccess.cpp sumo-1.12.0/src/netedit/elements/additional/GNEAccess.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEAccess.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEAccess.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -37,6 +37,18 @@ // member method definitions // =========================================================================== +GNEAccess::GNEAccess(GNENet* net) : + GNEAdditional("", net, GLO_ACCESS, SUMO_TAG_ACCESS, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), + myPositionOverLane(0), + myLength(0), +myFriendlyPosition(false) { + // reset default values + resetDefaultValues(); +} + + GNEAccess::GNEAccess(GNEAdditional* busStop, GNELane* lane, GNENet* net, double pos, const double length, bool friendlyPos, const std::map& parameters) : GNEAdditional(net, GLO_ACCESS, SUMO_TAG_ACCESS, "", diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEAccess.h sumo-1.12.0/src/netedit/elements/additional/GNEAccess.h --- sumo-1.11.0/src/netedit/elements/additional/GNEAccess.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEAccess.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -36,6 +36,9 @@ class GNEAccess : public GNEAdditional { public: + /// @brief Default constructor + GNEAccess(GNENet* net); + /**@brief Constructor * @param[in] id The storage of gl-ids to get the one for this lane representation from * @param[in] busStop GNEBusStop of this Access belongs diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEAdditional.cpp sumo-1.12.0/src/netedit/elements/additional/GNEAdditional.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEAdditional.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEAdditional.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -50,6 +50,7 @@ GNEPathManager::PathElement(GNEPathManager::PathElement::Options::ADDITIONAL_ELEMENT), Parameterised(parameters), myAdditionalName(additionalName) { + myIsTemplate = (id == ""); } @@ -103,7 +104,7 @@ mySpecialColor = color; } - +/* void GNEAdditional::writeAdditional(OutputDevice& device) const { // first check if minimum number of children is correct @@ -204,7 +205,7 @@ device.closeTag(); } } - +*/ bool GNEAdditional::isAdditionalValid() const { @@ -489,17 +490,6 @@ // GNEAdditional - protected methods // --------------------------------------------------------------------------- -void -GNEAdditional::setDefaultValues() { - // iterate over attributes and set default value - for (const auto& attr : myTagProperty) { - if (attr.hasStaticDefaultValue()) { - setAttribute(attr.getAttr(), attr.getDefaultValue()); - } - } -} - - bool GNEAdditional::isValidAdditionalID(const std::string& newID) const { if (SUMOXMLDefinitions::isValidAdditionalID(newID) && (myNet->getAttributeCarriers()->retrieveAdditional(myTagProperty.getTag(), newID, false) == nullptr)) { @@ -522,7 +512,7 @@ void GNEAdditional::drawAdditionalID(const GUIVisualizationSettings& s) const { - if (s.addName.show && (myAdditionalGeometry.getShape().size() > 0) && !s.drawForRectangleSelection && !s.drawForPositionSelection) { + if (s.addName.show(this) && (myAdditionalGeometry.getShape().size() > 0) && !s.drawForRectangleSelection && !s.drawForPositionSelection) { // calculate middle point const double middlePoint = (myAdditionalGeometry.getShape().length2D() * 0.5); // calculate position @@ -541,7 +531,7 @@ void GNEAdditional::drawAdditionalName(const GUIVisualizationSettings& s) const { - if (s.addFullName.show && (myAdditionalGeometry.getShape().size() > 0) && (myAdditionalName != "") && !s.drawForRectangleSelection && !s.drawForPositionSelection) { + if (s.addFullName.show(this) && (myAdditionalGeometry.getShape().size() > 0) && (myAdditionalName != "") && !s.drawForRectangleSelection && !s.drawForPositionSelection) { // calculate middle point const double middlePoint = (myAdditionalGeometry.getShape().length2D() * 0.5); // calculate position @@ -965,8 +955,8 @@ void -GNEAdditional::setEnabledAttribute(const int /*enabledAttributes*/) { - // +GNEAdditional::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { + // nothing to toogle in Additionals } diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEAdditional.h sumo-1.12.0/src/netedit/elements/additional/GNEAdditional.h --- sumo-1.11.0/src/netedit/elements/additional/GNEAdditional.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEAdditional.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -129,7 +129,7 @@ /**@brief writte additional element into a xml file * @param[in] device device in which write parameters of additional element */ - virtual void writeAdditional(OutputDevice& device) const; + virtual void writeAdditional(OutputDevice& device) const = 0; /// @brief check if current additional is valid to be writed into XML (by default true, can be reimplemented in children) virtual bool isAdditionalValid() const; @@ -334,9 +334,6 @@ /// @brief pointer to special color (used for drawing Additional with a certain color, mainly used for selections) const RGBColor* mySpecialColor = nullptr; - /// @brief change all attributes of additional with their default values (note: this cannot be undo) - void setDefaultValues(); - /// @name Functions relative to change values in setAttribute(...) /// @{ @@ -400,8 +397,8 @@ /// @brief commit move shape virtual void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) = 0; - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + virtual void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief draw geometry point static void drawSemiCircleGeometryPoint(const GNEViewNet* viewNet, const Position& pos, const double rot, const RGBColor& baseColor, diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEAdditionalHandler.cpp sumo-1.12.0/src/netedit/elements/additional/GNEAdditionalHandler.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEAdditionalHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEAdditionalHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -1353,7 +1353,7 @@ // check if TAZSink has to be created if (TAZSink == nullptr) { // Create TAZ with weight 0 (default) - TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, edge, 1); + TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, edge, 0); // add it depending of allow undoRed if (myAllowUndoRedo) { myNet->getViewNet()->getUndoList()->begin(GUIIcon::TAZ, "add " + toString(SUMO_TAG_TAZSINK)); @@ -1423,7 +1423,7 @@ // check if TAZSource has to be created if (TAZSource == nullptr) { // Create TAZ with empty value - TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, edge, 1); + TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, edge, 0); // add it depending of allow undoRed if (myAllowUndoRedo) { myNet->getViewNet()->getUndoList()->begin(GUIIcon::TAZ, "add " + toString(SUMO_TAG_TAZSOURCE)); @@ -1592,6 +1592,8 @@ writeErrorInvalidNegativeValue(SUMO_TAG_POI, id, SUMO_ATTR_HEIGHT); } else if (!SUMOXMLDefinitions::isValidFilename(imgFile)) { writeErrorInvalidFilename(SUMO_TAG_POI, id); + } else if (GeoConvHelper::getFinal().getProjString() == "!") { + WRITE_ERROR("Could not build " + toString(SUMO_TAG_POI) + " with ID '" + id + "' in netedit; Networ requieres a geo projection."); } else if (myNet->getAttributeCarriers()->retrieveShape(SUMO_TAG_POI, id, false) == nullptr) { // get NETEDIT parameters NeteditParameters neteditParameters(sumoBaseObject); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEAdditionalHandler.h sumo-1.12.0/src/netedit/elements/additional/GNEAdditionalHandler.h --- sumo-1.11.0/src/netedit/elements/additional/GNEAdditionalHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEAdditionalHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEBusStop.cpp sumo-1.12.0/src/netedit/elements/additional/GNEBusStop.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEBusStop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEBusStop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -33,6 +33,16 @@ // method definitions // =========================================================================== +GNEBusStop::GNEBusStop(SumoXMLTag tag, GNENet* net) : + GNEStoppingPlace("", net, GLO_BUS_STOP, tag, nullptr, 0, 0, "", false, std::map()), + myPersonCapacity(0), + myParkingLength(0), + myColor(RGBColor::BLACK) { + // reset default values + resetDefaultValues(); +} + + GNEBusStop::GNEBusStop(SumoXMLTag tag, const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos, const std::string& name, const std::vector& lines, int personCapacity, double parkingLength, const RGBColor& color, bool friendlyPosition, const std::map& parameters) : @@ -66,16 +76,16 @@ if (myFriendlyPosition) { device.writeAttr(SUMO_ATTR_FRIENDLY_POS, "true"); } - if (myLines.size() > 0) { + if (getAttribute(SUMO_ATTR_LINES) != myTagProperty.getDefaultValue(SUMO_ATTR_LINES)) { device.writeAttr(SUMO_ATTR_LINES, toString(myLines)); } - if (myPersonCapacity != 6) { + if (getAttribute(SUMO_ATTR_PERSON_CAPACITY) != myTagProperty.getDefaultValue(SUMO_ATTR_PERSON_CAPACITY)) { device.writeAttr(SUMO_ATTR_PERSON_CAPACITY, myPersonCapacity); } - if (myParkingLength > 0) { + if (getAttribute(SUMO_ATTR_PARKING_LENGTH) != myTagProperty.getDefaultValue(SUMO_ATTR_PARKING_LENGTH)) { device.writeAttr(SUMO_ATTR_PARKING_LENGTH, myParkingLength); } - if (myColor.isValid()) { + if (getAttribute(SUMO_ATTR_COLOR).size() > 0) { device.writeAttr(SUMO_ATTR_COLOR, myColor); } // write all access @@ -147,7 +157,7 @@ // set base color GLHelper::setColor(baseColor); // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration - GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, stopWidth * busStopExaggeration); + GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, stopWidth * MIN2(1.0, busStopExaggeration)); // draw detail if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, busStopExaggeration)) { // draw lines @@ -325,10 +335,16 @@ case SUMO_ATTR_ID: // update microsimID setMicrosimID(value); - // Change IDs of all access children + // change IDs of all access children for (const auto& access : getChildAdditionals()) { access->setMicrosimID(getID()); } + // enable save demand elements if there are stops + for (const auto& stop : getChildDemandElements()) { + if (stop->getTagProperty().isStop() || stop->getTagProperty().isStopPerson()) { + myNet->requireSaveDemandElements(true); + } + } break; case SUMO_ATTR_LANE: replaceAdditionalParentLanes(value); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEBusStop.h sumo-1.12.0/src/netedit/elements/additional/GNEBusStop.h --- sumo-1.11.0/src/netedit/elements/additional/GNEBusStop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEBusStop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -33,7 +33,10 @@ class GNEBusStop : public GNEStoppingPlace { public: - /**@brief Constructor + /// @brief default constructor + GNEBusStop(SumoXMLTag tag, GNENet* net); + + /**@brief parameter Constructor * @param[in] tag busStop or trainStop tag * @param[in] id The storage of gl-ids to get the one for this lane representation from * @param[in] lane Lane of this StoppingPlace belongs diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNECalibrator.cpp sumo-1.12.0/src/netedit/elements/additional/GNECalibrator.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNECalibrator.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNECalibrator.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,6 +32,18 @@ // member method definitions // =========================================================================== +GNECalibrator::GNECalibrator(SumoXMLTag tag, GNENet* net) : + GNEAdditional("", net, GLO_CALIBRATOR, tag, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), + myPositionOverLane(0), + myFrequency(0), +myJamThreshold(0) { + // reset default values + resetDefaultValues(); +} + + GNECalibrator::GNECalibrator(const std::string& id, GNENet* net, GNEEdge* edge, double pos, SUMOTime frequency, const std::string& name, const std::string& output, const double jamThreshold, const std::vector& vTypes, const std::map& parameters) : GNEAdditional(id, net, GLO_CALIBRATOR, SUMO_TAG_CALIBRATOR, name, @@ -232,9 +244,19 @@ } // pop name GLHelper::popName(); + // draw additional ID + drawAdditionalID(s); + // iterate over additionals and check if drawn + for (const auto& calibratorFlow : getChildAdditionals()) { + // if rerouter or their intevals are selected, then draw + if (myNet->getViewNet()->getNetworkViewOptions().showSubAdditionals() || + isAttributeCarrierSelected() || myNet->getViewNet()->isAttributeCarrierInspected(this) || + calibratorFlow->isAttributeCarrierSelected() || myNet->getViewNet()->isAttributeCarrierInspected(calibratorFlow) || + (myNet->getViewNet()->getFrontAttributeCarrier() == calibratorFlow)) { + calibratorFlow->drawGL(s); + } + } } - // draw additional ID - drawAdditionalID(s); } } @@ -398,8 +420,6 @@ // =========================================================================== void GNECalibrator::drawCalibratorSymbol(const GUIVisualizationSettings& s, const double exaggeration, const Position& pos, const double rot) const { - // draw parent and child lines - drawParentChildLines(s, s.additionalSettings.connectionColor); // push layer matrix GLHelper::pushMatrix(); // translate to front diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNECalibratorFlow.cpp sumo-1.12.0/src/netedit/elements/additional/GNECalibratorFlow.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNECalibratorFlow.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNECalibratorFlow.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -29,6 +29,17 @@ // member method definitions // =========================================================================== +GNECalibratorFlow::GNECalibratorFlow(GNENet* net) : + GNEAdditional("", net, GLO_CALIBRATOR, GNE_TAG_FLOW_CALIBRATOR, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()) { + // reset default values + resetDefaultValues(); + // set VPH and speed enabled + toogleAttribute(SUMO_ATTR_VEHSPERHOUR, true, 0); + toogleAttribute(SUMO_ATTR_SPEED, true, 0); +} + GNECalibratorFlow::GNECalibratorFlow(GNEAdditional* calibratorParent, GNEDemandElement* vehicleType, GNEDemandElement* route) : GNEAdditional(calibratorParent->getNet(), GLO_CALIBRATOR, GNE_TAG_FLOW_CALIBRATOR, "", @@ -55,30 +66,25 @@ void GNECalibratorFlow::writeAdditional(OutputDevice& device) const { - // open tag - device.openTag(SUMO_TAG_FLOW); - // attribute VType musn't be written if is DEFAULT_VTYPE_ID - if (getParentDemandElements().at(0)->getID() == DEFAULT_VTYPE_ID) { - // unset VType parameter - parametersSet &= ~VEHPARS_VTYPE_SET; - // write vehicle attributes (VType will not be written) - write(device, OptionsCont::getOptions(), myTagProperty.getXMLTag()); - // set VType parameter again - parametersSet |= VEHPARS_VTYPE_SET; - } else { - // write vehicle attributes, including VType + if (isAttributeEnabled(SUMO_ATTR_TYPE) || isAttributeEnabled(SUMO_ATTR_VEHSPERHOUR) || isAttributeEnabled(SUMO_ATTR_SPEED)) { + // open tag + device.openTag(SUMO_TAG_FLOW); + // write route + device.writeAttr(SUMO_ATTR_ROUTE, getParentDemandElements().at(1)->getID()); + // write vehicle attributes write(device, OptionsCont::getOptions(), myTagProperty.getXMLTag(), getParentDemandElements().at(0)->getID()); + // VPH + if (isAttributeEnabled(SUMO_ATTR_VEHSPERHOUR)) { + device.writeAttr(SUMO_ATTR_VEHSPERHOUR, getAttribute(SUMO_ATTR_VEHSPERHOUR)); + } + // write parameters + SUMOVehicleParameter::writeParams(device); + // close vehicle tag + device.closeTag(); + } else { + WRITE_WARNING(toString(GNE_TAG_FLOW_CALIBRATOR) + " of calibrator '" + getParentAdditionals().front()->getID() + + "' cannot be written. Either type or vehsPerHour or speed must be enabled"); } - // write route - device.writeAttr(SUMO_ATTR_ROUTE, getParentDemandElements().at(1)->getID()); - // VPH - if (isAttributeEnabled(SUMO_ATTR_VEHSPERHOUR)) { - device.writeAttr(SUMO_ATTR_VEHSPERHOUR, 3600. / STEPS2TIME(repetitionOffset)); - } - // write parameters - SUMOVehicleParameter::writeParams(device); - // close vehicle tag - device.closeTag(); } @@ -91,20 +97,27 @@ void GNECalibratorFlow::updateGeometry() { - // use geometry of calibrator parent - myAdditionalGeometry = getParentAdditionals().front()->getAdditionalGeometry(); + // update centering boundary (needed for centering) + updateCenteringBoundary(false); } Position GNECalibratorFlow::getPositionInView() const { - return getParentAdditionals().front()->getPositionInView(); + // get rerouter parent position + Position signPosition = getParentAdditionals().front()->getPositionInView(); + // set position depending of indexes + signPosition.add(4.5, (getDrawPositionIndex() * -1) + 1, 0); + // return signPosition + return signPosition; } void GNECalibratorFlow::updateCenteringBoundary(const bool /*updateGrid*/) { - myAdditionalBoundary = getParentAdditionals().front()->getCenteringBoundary(); + myAdditionalBoundary.reset(); + myAdditionalBoundary.add(getPositionInView()); + myAdditionalBoundary.grow(5); } @@ -121,8 +134,10 @@ void -GNECalibratorFlow::drawGL(const GUIVisualizationSettings& /* s */) const { - // Currently This additional isn't drawn +GNECalibratorFlow::drawGL(const GUIVisualizationSettings& s) const { + // draw rerouter interval as listed attribute + drawListedAddtional(s, getParentAdditionals().front()->getPositionInView(), + 0, 0, s.additionalSettings.calibratorColor, RGBColor::BLACK, GUITexture::VARIABLESPEEDSIGN_STEP, "Flow: " + getID()); } @@ -132,21 +147,13 @@ case SUMO_ATTR_ID: return getID(); case SUMO_ATTR_TYPE: - return getParentDemandElements().at(0)->getID(); + return vtypeid; case SUMO_ATTR_ROUTE: return getParentDemandElements().at(1)->getID(); case SUMO_ATTR_VEHSPERHOUR: - if (wasSet(VEHPARS_VPH_SET)) { - return toString(3600 / STEPS2TIME(repetitionOffset)); - } else { - return ""; - } + return toString(3600 / STEPS2TIME(repetitionOffset)); case SUMO_ATTR_SPEED: - if (wasSet(VEHPARS_CALIBRATORSPEED_SET)) { - return toString(calibratorSpeed); - } else { - return ""; - } + return toString(calibratorSpeed); case SUMO_ATTR_COLOR: if (wasSet(VEHPARS_COLOR_SET)) { return toString(color); @@ -231,6 +238,8 @@ } case GNE_ATTR_PARENT: return getParentAdditionals().at(0)->getID(); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); case GNE_ATTR_PARAMETERS: return SUMOVehicleParameter::getParametersStr(); default: @@ -296,6 +305,7 @@ case SUMO_ATTR_REROUTE: case SUMO_ATTR_DEPARTPOS_LAT: case SUMO_ATTR_ARRIVALPOS_LAT: + case GNE_ATTR_SELECTED: case GNE_ATTR_PARAMETERS: undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); break; @@ -323,7 +333,8 @@ return true; } } else if (canParse(value)) { - return (parse(value) >= 0); + const double dVal = parse(value); + return (dVal >= 0 || dVal == -1); } else { return false; } @@ -336,7 +347,8 @@ return true; } } else if (canParse(value)) { - return (parse(value) >= 0); + const double dVal = parse(value); + return (dVal >= 0 || dVal == -1); } else { return false; } @@ -402,6 +414,8 @@ } else { return canParse(value); } + case GNE_ATTR_SELECTED: + return canParse(value); case GNE_ATTR_PARAMETERS: return Parameterised::areParametersValid(value); default: @@ -413,16 +427,12 @@ bool GNECalibratorFlow::isAttributeEnabled(SumoXMLAttr key) const { switch (key) { - case SUMO_ATTR_END: - return (parametersSet & VEHPARS_END_SET) != 0; - case SUMO_ATTR_NUMBER: - return (parametersSet & VEHPARS_NUMBER_SET) != 0; + case SUMO_ATTR_TYPE: + return (parametersSet & VEHPARS_VTYPE_SET) != 0; case SUMO_ATTR_VEHSPERHOUR: return (parametersSet & VEHPARS_VPH_SET) != 0; - case SUMO_ATTR_PERIOD: - return (parametersSet & VEHPARS_PERIOD_SET) != 0; - case SUMO_ATTR_PROB: - return (parametersSet & VEHPARS_PROB_SET) != 0; + case SUMO_ATTR_SPEED: + return (parametersSet & VEHPARS_CALIBRATORSPEED_SET) != 0; default: return true; } @@ -454,27 +464,28 @@ setMicrosimID(value); break; case SUMO_ATTR_TYPE: - replaceDemandElementParent(SUMO_TAG_VTYPE, value, 0); + if (!isTemplate()) { + if (value.empty()) { + replaceDemandElementParent(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID, 0); + } else { + replaceDemandElementParent(SUMO_TAG_VTYPE, value, 0); + } + } // set manually vtypeID (needed for saving) vtypeid = value; break; case SUMO_ATTR_ROUTE: - if (getParentDemandElements().size() == 2) { - replaceDemandElementParent(SUMO_TAG_ROUTE, value, 1); - } - updateGeometry(); + replaceDemandElementParent(SUMO_TAG_ROUTE, value, 1); break; case SUMO_ATTR_VEHSPERHOUR: repetitionOffset = TIME2STEPS(3600 / parse(value)); // set parameters - parametersSet &= ~VEHPARS_CALIBRATORSPEED_SET; parametersSet |= VEHPARS_VPH_SET; break; case SUMO_ATTR_SPEED: calibratorSpeed = parse(value); // mark parameter as set parametersSet |= VEHPARS_CALIBRATORSPEED_SET; - parametersSet &= ~VEHPARS_VPH_SET; break; case SUMO_ATTR_COLOR: if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { @@ -517,7 +528,10 @@ // unset parameter parametersSet &= ~VEHPARS_DEPARTPOS_SET; } - updateGeometry(); + // update geometry (except for template) + if (getParentAdditionals().size() > 0) { + updateGeometry(); + } break; case SUMO_ATTR_DEPARTSPEED: if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { @@ -554,7 +568,10 @@ // unset parameter parametersSet &= ~VEHPARS_ARRIVALPOS_SET; } - updateGeometry(); + // update geometry (except for template) + if (getParentAdditionals().size() > 0) { + updateGeometry(); + } break; case SUMO_ATTR_ARRIVALSPEED: if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { @@ -638,6 +655,13 @@ } parseArrivalPosLat(value, toString(SUMO_TAG_VEHICLE), id, arrivalPosLat, arrivalPosLatProcedure, error); break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; case GNE_ATTR_PARAMETERS: SUMOVehicleParameter::setParametersStr(value); break; @@ -647,13 +671,44 @@ } -void GNECalibratorFlow::setMoveShape(const GNEMoveResult& /*moveResult*/) { +void +GNECalibratorFlow::setMoveShape(const GNEMoveResult& /*moveResult*/) { // nothing to do } -void GNECalibratorFlow::commitMoveShape(const GNEMoveResult& /*moveResult*/, GNEUndoList* /*undoList*/) { +void +GNECalibratorFlow::commitMoveShape(const GNEMoveResult& /*moveResult*/, GNEUndoList* /*undoList*/) { // nothing to do } +void +GNECalibratorFlow::toogleAttribute(SumoXMLAttr key, const bool value, const int /*previousParameters*/) { + switch (key) { + case SUMO_ATTR_TYPE: + if (value) { + parametersSet |= VEHPARS_VTYPE_SET; + } else { + parametersSet &= ~VEHPARS_VTYPE_SET; + } + break; + case SUMO_ATTR_VEHSPERHOUR: + if (value) { + parametersSet |= VEHPARS_VPH_SET; + } else { + parametersSet &= ~VEHPARS_VPH_SET; + } + break; + case SUMO_ATTR_SPEED: + if (value) { + parametersSet |= VEHPARS_CALIBRATORSPEED_SET; + } else { + parametersSet &= ~VEHPARS_CALIBRATORSPEED_SET; + } + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + /****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNECalibratorFlow.h sumo-1.12.0/src/netedit/elements/additional/GNECalibratorFlow.h --- sumo-1.11.0/src/netedit/elements/additional/GNECalibratorFlow.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNECalibratorFlow.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -40,6 +40,9 @@ class GNECalibratorFlow : public GNEAdditional, public SUMOVehicleParameter { public: + /// @brief default constructor + GNECalibratorFlow(GNENet* net); + /// @brief default constructor (used only in GNECalibratorDialog) GNECalibratorFlow(GNEAdditional* calibratorParent, GNEDemandElement* vehicleType, GNEDemandElement* route); @@ -139,6 +142,9 @@ /// @brief commit move shape void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList); + /// @brief toogle attribute + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); + /// @brief Invalidated copy constructor. GNECalibratorFlow(const GNECalibratorFlow&) = delete; diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNECalibrator.h sumo-1.12.0/src/netedit/elements/additional/GNECalibrator.h --- sumo-1.11.0/src/netedit/elements/additional/GNECalibrator.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNECalibrator.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -39,6 +39,9 @@ class GNECalibrator : public GNEAdditional { public: + /// @brief Default constructor + GNECalibrator(SumoXMLTag tag, GNENet* net); + /**@brief Constructor using edge * @param[in] id The storage of gl-ids to get the one for this lane representation from * @param[in] net pointer to GNENet of this additional element belongs diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEChargingStation.cpp sumo-1.12.0/src/netedit/elements/additional/GNEChargingStation.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEChargingStation.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEChargingStation.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -33,6 +33,17 @@ // member method definitions // =========================================================================== +GNEChargingStation::GNEChargingStation(GNENet* net) : + GNEStoppingPlace("", net, GLO_CHARGING_STATION, SUMO_TAG_CHARGING_STATION, nullptr, 0, 0, "", false, std::map()), + myChargingPower(0), + myEfficiency(0), + myChargeInTransit(0), + myChargeDelay(0) { + // reset default values + resetDefaultValues(); +} + + GNEChargingStation::GNEChargingStation(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos, const std::string& name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, bool friendlyPosition, const std::map& parameters) : @@ -51,8 +62,36 @@ void GNEChargingStation::writeAdditional(OutputDevice& device) const { - // use write additional of gneAdditional - GNEAdditional::writeAdditional(device); + device.openTag(getTagProperty().getTag()); + device.writeAttr(SUMO_ATTR_ID, getID()); + if (!myAdditionalName.empty()) { + device.writeAttr(SUMO_ATTR_NAME, StringUtils::escapeXML(myAdditionalName)); + } + device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID()); + if (myStartPosition != INVALID_DOUBLE) { + device.writeAttr(SUMO_ATTR_STARTPOS, myStartPosition); + } + if (myEndPosition != INVALID_DOUBLE) { + device.writeAttr(SUMO_ATTR_ENDPOS, myEndPosition); + } + if (myFriendlyPosition) { + device.writeAttr(SUMO_ATTR_FRIENDLY_POS, "true"); + } + if (getAttribute(SUMO_ATTR_CHARGINGPOWER) != myTagProperty.getDefaultValue(SUMO_ATTR_CHARGINGPOWER)) { + device.writeAttr(SUMO_ATTR_CHARGINGPOWER, toString(myChargingPower)); + } + if (getAttribute(SUMO_ATTR_EFFICIENCY) != myTagProperty.getDefaultValue(SUMO_ATTR_EFFICIENCY)) { + device.writeAttr(SUMO_ATTR_EFFICIENCY, myEfficiency); + } + if (getAttribute(SUMO_ATTR_CHARGEINTRANSIT) != myTagProperty.getDefaultValue(SUMO_ATTR_CHARGEINTRANSIT)) { + device.writeAttr(SUMO_ATTR_CHARGEINTRANSIT, myChargeInTransit); + } + if (getAttribute(SUMO_ATTR_CHARGEDELAY) != myTagProperty.getDefaultValue(SUMO_ATTR_CHARGEDELAY)) { + device.writeAttr(SUMO_ATTR_CHARGEDELAY, myChargeDelay); + } + // write parameters (Always after children to avoid problems with additionals.xsd) + writeParams(device); + device.closeTag(); } @@ -107,7 +146,7 @@ // set base color GLHelper::setColor(baseColor); // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration - GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, s.stoppingPlaceSettings.chargingStationWidth * chargingStationExaggeration); + GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, s.stoppingPlaceSettings.chargingStationWidth * MIN2(1.0, chargingStationExaggeration)); // draw detail if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, chargingStationExaggeration)) { // draw charging power and efficiency @@ -277,6 +316,12 @@ case SUMO_ATTR_ID: // update microsimID setMicrosimID(value); + // enable save demand elements if there are stops + for (const auto& stop : getChildDemandElements()) { + if (stop->getTagProperty().isStop() || stop->getTagProperty().isStopPerson()) { + myNet->requireSaveDemandElements(true); + } + } break; case SUMO_ATTR_LANE: replaceAdditionalParentLanes(value); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEChargingStation.h sumo-1.12.0/src/netedit/elements/additional/GNEChargingStation.h --- sumo-1.11.0/src/netedit/elements/additional/GNEChargingStation.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEChargingStation.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -29,6 +29,9 @@ class GNEChargingStation : public GNEStoppingPlace { public: + /// @brief default Constructor of charging station + GNEChargingStation(GNENet* net); + /**@brief Constructor of charging station * @param[in] id The storage of gl-ids to get the one for this lane representation from * @param[in] lane Lane of this StoppingPlace belongs diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEClosingLaneReroute.cpp sumo-1.12.0/src/netedit/elements/additional/GNEClosingLaneReroute.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEClosingLaneReroute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEClosingLaneReroute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -30,12 +30,23 @@ // member method definitions // =========================================================================== +GNEClosingLaneReroute::GNEClosingLaneReroute(GNENet* net) : + GNEAdditional("", net, GLO_REROUTER_CLOSINGLANEREROUTE, SUMO_TAG_CLOSING_LANE_REROUTE, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), + myClosedLane(nullptr), +myPermissions(0) { + // reset default values + resetDefaultValues(); +} + + GNEClosingLaneReroute::GNEClosingLaneReroute(GNEAdditional* rerouterIntervalParent, GNELane* closedLane, SVCPermissions permissions) : GNEAdditional(rerouterIntervalParent->getNet(), GLO_REROUTER_CLOSINGLANEREROUTE, SUMO_TAG_CLOSING_LANE_REROUTE, "", - {}, {}, {}, {rerouterIntervalParent}, {}, {}, {}, {}, - std::map()), - myClosedLane(closedLane), - myPermissions(permissions) { +{}, {}, {}, {rerouterIntervalParent}, {}, {}, {}, {}, +std::map()), +myClosedLane(closedLane), +myPermissions(permissions) { // update boundary of rerouter parent rerouterIntervalParent->getParentAdditionals().front()->updateCenteringBoundary(true); } @@ -44,7 +55,7 @@ GNEClosingLaneReroute::~GNEClosingLaneReroute() {} -void +void GNEClosingLaneReroute::writeAdditional(OutputDevice& device) const { device.openTag(SUMO_TAG_CLOSING_LANE_REROUTE); device.writeAttr(SUMO_ATTR_ID, getAttribute(SUMO_ATTR_LANE)); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEClosingLaneReroute.h sumo-1.12.0/src/netedit/elements/additional/GNEClosingLaneReroute.h --- sumo-1.11.0/src/netedit/elements/additional/GNEClosingLaneReroute.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEClosingLaneReroute.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -40,6 +40,9 @@ public: /// @brief parameter constructor + GNEClosingLaneReroute(GNENet* net); + + /// @brief parameter constructor GNEClosingLaneReroute(GNEAdditional* rerouterIntervalParent, GNELane* closedLane, SVCPermissions permissions); /// @brief destructor diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEClosingReroute.cpp sumo-1.12.0/src/netedit/elements/additional/GNEClosingReroute.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEClosingReroute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEClosingReroute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -30,12 +30,23 @@ // member method definitions // =========================================================================== +GNEClosingReroute::GNEClosingReroute(GNENet* net) : + GNEAdditional("", net, GLO_REROUTER_CLOSINGREROUTE, SUMO_TAG_CLOSING_REROUTE, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), + myClosedEdge(nullptr), +myPermissions(0) { + // reset default values + resetDefaultValues(); +} + + GNEClosingReroute::GNEClosingReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* closedEdge, SVCPermissions permissions) : GNEAdditional(rerouterIntervalParent->getNet(), GLO_REROUTER_CLOSINGREROUTE, SUMO_TAG_CLOSING_REROUTE, "", - {}, {}, {}, {rerouterIntervalParent}, {}, {}, {}, {}, - std::map()), - myClosedEdge(closedEdge), - myPermissions(permissions) { +{}, {}, {}, {rerouterIntervalParent}, {}, {}, {}, {}, +std::map()), +myClosedEdge(closedEdge), +myPermissions(permissions) { // update boundary of rerouter parent rerouterIntervalParent->getParentAdditionals().front()->updateCenteringBoundary(true); } diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEClosingReroute.h sumo-1.12.0/src/netedit/elements/additional/GNEClosingReroute.h --- sumo-1.11.0/src/netedit/elements/additional/GNEClosingReroute.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEClosingReroute.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -38,6 +38,9 @@ class GNEClosingReroute : public GNEAdditional { public: + /// @brief default constructor + GNEClosingReroute(GNENet* net); + /// @brief parameter constructor GNEClosingReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* closedEdge, SVCPermissions permissions); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEContainerStop.cpp sumo-1.12.0/src/netedit/elements/additional/GNEContainerStop.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEContainerStop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEContainerStop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -33,6 +33,16 @@ // method definitions // =========================================================================== +GNEContainerStop::GNEContainerStop(GNENet* net) : + GNEStoppingPlace("", net, GLO_CONTAINER_STOP, SUMO_TAG_CONTAINER_STOP, nullptr, 0, 0, "", false, std::map()), + myContainerCapacity(0), + myParkingLength(0), + myColor(RGBColor::BLACK) { + // reset default values + resetDefaultValues(); +} + + GNEContainerStop::GNEContainerStop(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos, const std::string& name, const std::vector& lines, int containerCapacity, double parkingLength, const RGBColor& color, bool friendlyPosition, const std::map& parameters) : @@ -51,8 +61,36 @@ void GNEContainerStop::writeAdditional(OutputDevice& device) const { - // use write additional of gneAdditional - GNEAdditional::writeAdditional(device); + device.openTag(getTagProperty().getTag()); + device.writeAttr(SUMO_ATTR_ID, getID()); + if (!myAdditionalName.empty()) { + device.writeAttr(SUMO_ATTR_NAME, StringUtils::escapeXML(myAdditionalName)); + } + device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID()); + if (myStartPosition != INVALID_DOUBLE) { + device.writeAttr(SUMO_ATTR_STARTPOS, myStartPosition); + } + if (myEndPosition != INVALID_DOUBLE) { + device.writeAttr(SUMO_ATTR_ENDPOS, myEndPosition); + } + if (myFriendlyPosition) { + device.writeAttr(SUMO_ATTR_FRIENDLY_POS, "true"); + } + if (getAttribute(SUMO_ATTR_LINES) != myTagProperty.getDefaultValue(SUMO_ATTR_LINES)) { + device.writeAttr(SUMO_ATTR_LINES, toString(myLines)); + } + if (getAttribute(SUMO_ATTR_CONTAINER_CAPACITY) != myTagProperty.getDefaultValue(SUMO_ATTR_CONTAINER_CAPACITY)) { + device.writeAttr(SUMO_ATTR_CONTAINER_CAPACITY, myContainerCapacity); + } + if (getAttribute(SUMO_ATTR_PARKING_LENGTH) != myTagProperty.getDefaultValue(SUMO_ATTR_PARKING_LENGTH)) { + device.writeAttr(SUMO_ATTR_PARKING_LENGTH, myParkingLength); + } + if (getAttribute(SUMO_ATTR_COLOR).size() > 0) { + device.writeAttr(SUMO_ATTR_COLOR, myColor); + } + // write parameters (Always after children to avoid problems with additionals.xsd) + writeParams(device); + device.closeTag(); } @@ -60,16 +98,15 @@ GNEContainerStop::updateGeometry() { // Get value of option "lefthand" const double offsetSign = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1; - // Update common geometry of stopping place setStoppingPlaceGeometry(getParentLanes().front()->getParentEdge()->getNBEdge()->getLaneWidth(getParentLanes().front()->getIndex()) / 2); - // Obtain a copy of the shape PositionVector tmpShape = myAdditionalGeometry.getShape(); - + // move entire shape and update + tmpShape.move2side(2); + myAdditionalGeometry.updateGeometry(tmpShape); // Move shape to side tmpShape.move2side(myNet->getViewNet()->getVisualisationSettings().stoppingPlaceSettings.stoppingPlaceSignOffset * offsetSign); - // Get position of the sign mySignPos = tmpShape.getLineCenter(); } @@ -110,7 +147,7 @@ // set base color GLHelper::setColor(baseColor); // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration - GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, s.stoppingPlaceSettings.containerStopWidth * containerStopExaggeration); + GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, s.stoppingPlaceSettings.containerStopWidth * MIN2(1.0, containerStopExaggeration)); // draw detail if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, containerStopExaggeration)) { // draw lines @@ -288,6 +325,12 @@ case SUMO_ATTR_ID: // update microsimID setMicrosimID(value); + // enable save demand elements if there are stops + for (const auto& stop : getChildDemandElements()) { + if (stop->getTagProperty().isStop() || stop->getTagProperty().isStopPerson()) { + myNet->requireSaveDemandElements(true); + } + } break; case SUMO_ATTR_LANE: replaceAdditionalParentLanes(value); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEContainerStop.h sumo-1.12.0/src/netedit/elements/additional/GNEContainerStop.h --- sumo-1.11.0/src/netedit/elements/additional/GNEContainerStop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEContainerStop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -33,6 +33,9 @@ class GNEContainerStop : public GNEStoppingPlace { public: + /// @brief default constructor + GNEContainerStop(GNENet* net); + /**@brief Constructor * @param[in] id The storage of gl-ids to get the one for this lane representation from * @param[in] lane Lane of this StoppingPlace belongs diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEDestProbReroute.cpp sumo-1.12.0/src/netedit/elements/additional/GNEDestProbReroute.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEDestProbReroute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEDestProbReroute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -29,12 +29,23 @@ // member method definitions // =========================================================================== +GNEDestProbReroute::GNEDestProbReroute(GNENet* net): + GNEAdditional("", net, GLO_REROUTER_DESTPROBREROUTE, SUMO_TAG_DEST_PROB_REROUTE, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), + myNewEdgeDestination(nullptr), +myProbability(0) { + // reset default values + resetDefaultValues(); +} + + GNEDestProbReroute::GNEDestProbReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* newEdgeDestination, double probability): GNEAdditional(rerouterIntervalParent->getNet(), GLO_REROUTER_DESTPROBREROUTE, SUMO_TAG_DEST_PROB_REROUTE, "", - {}, {}, {}, {rerouterIntervalParent}, {}, {}, {}, {}, - std::map()), - myNewEdgeDestination(newEdgeDestination), - myProbability(probability) { +{}, {}, {}, {rerouterIntervalParent}, {}, {}, {}, {}, +std::map()), +myNewEdgeDestination(newEdgeDestination), +myProbability(probability) { // update boundary of rerouter parent rerouterIntervalParent->getParentAdditionals().front()->updateCenteringBoundary(true); } diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEDestProbReroute.h sumo-1.12.0/src/netedit/elements/additional/GNEDestProbReroute.h --- sumo-1.11.0/src/netedit/elements/additional/GNEDestProbReroute.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEDestProbReroute.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -40,6 +40,9 @@ public: /// @brief constructor + GNEDestProbReroute(GNENet* net); + + /// @brief constructor GNEDestProbReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* newEdgeDestination, double probability); /// @brief destructor diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEDetector.cpp sumo-1.12.0/src/netedit/elements/additional/GNEDetector.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEDetector.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEDetector.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -52,8 +52,7 @@ GNEDetector::GNEDetector(GNEAdditional* additionalParent, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, const double pos, const SUMOTime freq, const std::vector& parentLanes, const std::string& filename, const std::string& name, const bool friendlyPos, const std::map& parameters) : - GNEAdditional(net, type, tag, name, {}, {}, parentLanes, {additionalParent}, {}, {}, {}, {}, -parameters), + GNEAdditional(net, type, tag, name, {}, {}, parentLanes, {additionalParent}, {}, {}, {}, {}, parameters), myPositionOverLane(pos), myFreq(freq), myFilename(filename), diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE1.cpp sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE1.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE1.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE1.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,6 +32,13 @@ // member method definitions // =========================================================================== +GNEDetectorE1::GNEDetectorE1(GNENet* net) : + GNEDetector("", net, GLO_E1DETECTOR, SUMO_TAG_E1DETECTOR, 0, 0, {}, "", {}, "", false, std::map()) { + // reset default values + resetDefaultValues(); +} + + GNEDetectorE1::GNEDetectorE1(const std::string& id, GNELane* lane, GNENet* net, const double pos, const SUMOTime freq, const std::string& filename, const std::vector& vehicleTypes, const std::string& name, bool friendlyPos, const std::map& parameters) : GNEDetector(id, net, GLO_E1DETECTOR, SUMO_TAG_E1DETECTOR, pos, freq, { @@ -46,6 +53,31 @@ } +void +GNEDetectorE1::writeAdditional(OutputDevice& device) const { + device.openTag(getTagProperty().getTag()); + device.writeAttr(SUMO_ATTR_ID, getID()); + if (!myAdditionalName.empty()) { + device.writeAttr(SUMO_ATTR_NAME, StringUtils::escapeXML(myAdditionalName)); + } + device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID()); + device.writeAttr(SUMO_ATTR_POSITION, myPositionOverLane); + device.writeAttr(SUMO_ATTR_FREQUENCY, time2string(myFreq)); + if (myFilename.size() > 0) { + device.writeAttr(SUMO_ATTR_FILE, myFilename); + } + if (myVehicleTypes.size() > 0) { + device.writeAttr(SUMO_ATTR_VTYPES, myVehicleTypes); + } + if (myFriendlyPosition) { + device.writeAttr(SUMO_ATTR_FRIENDLY_POS, true); + } + // write parameters (Always after children to avoid problems with additionals.xsd) + writeParams(device); + device.closeTag(); +} + + bool GNEDetectorE1::isAdditionalValid() const { // with friendly position enabled position are "always fixed" diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE1.h sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE1.h --- sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE1.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE1.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,6 +32,9 @@ class GNEDetectorE1 : public GNEDetector { public: + /// @brief default constructor + GNEDetectorE1(GNENet* net); + /**@brief Constructor * @param[in] id The storage of gl-ids to get the one for this lane representation from * @param[in] lane Lane of this StoppingPlace belongs @@ -53,6 +56,11 @@ /// @name members and functions relative to write additionals into XML /// @{ + /**@brief writte additional element into a xml file + * @param[in] device device in which write parameters of additional element + */ + void writeAdditional(OutputDevice& device) const; + /// @brief check if current additional is valid to be writed into XML bool isAdditionalValid() const; diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE1Instant.cpp sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE1Instant.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE1Instant.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE1Instant.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,6 +32,13 @@ // member method definitions // =========================================================================== +GNEDetectorE1Instant::GNEDetectorE1Instant(GNENet* net) : + GNEDetector("", net, GLO_E1DETECTOR_INSTANT, SUMO_TAG_INSTANT_INDUCTION_LOOP, 0, 0, {}, "", {}, "", false, std::map()) { + // reset default values + resetDefaultValues(); +} + + GNEDetectorE1Instant::GNEDetectorE1Instant(const std::string& id, GNELane* lane, GNENet* net, const double pos, const std::string& filename, const std::vector& vehicleTypes, const std::string& name, const bool friendlyPos, const std::map& parameters) : GNEDetector(id, net, GLO_E1DETECTOR_INSTANT, SUMO_TAG_INSTANT_INDUCTION_LOOP, pos, 0, { @@ -46,6 +53,30 @@ } +void +GNEDetectorE1Instant::writeAdditional(OutputDevice& device) const { + device.openTag(getTagProperty().getTag()); + device.writeAttr(SUMO_ATTR_ID, getID()); + if (!myAdditionalName.empty()) { + device.writeAttr(SUMO_ATTR_NAME, StringUtils::escapeXML(myAdditionalName)); + } + device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID()); + device.writeAttr(SUMO_ATTR_POSITION, myPositionOverLane); + if (myFilename.size() > 0) { + device.writeAttr(SUMO_ATTR_FILE, myFilename); + } + if (myVehicleTypes.size() > 0) { + device.writeAttr(SUMO_ATTR_VTYPES, myVehicleTypes); + } + if (myFriendlyPosition) { + device.writeAttr(SUMO_ATTR_FRIENDLY_POS, true); + } + // write parameters (Always after children to avoid problems with additionals.xsd) + writeParams(device); + device.closeTag(); +} + + bool GNEDetectorE1Instant::isAdditionalValid() const { // with friendly position enabled position are "always fixed" diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE1Instant.h sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE1Instant.h --- sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE1Instant.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE1Instant.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,6 +32,9 @@ class GNEDetectorE1Instant : public GNEDetector { public: + /// @brief default Constructor + GNEDetectorE1Instant(GNENet* net); + /**@brief Constructor * @param[in] id The storage of gl-ids to get the one for this lane representation from * @param[in] lane Lane of this StoppingPlace belongs @@ -52,6 +55,11 @@ /// @name members and functions relative to write additionals into XML /// @{ + /**@brief writte additional element into a xml file + * @param[in] device device in which write parameters of additional element + */ + void writeAdditional(OutputDevice& device) const; + /// @brief check if current additional is valid to be writed into XML bool isAdditionalValid() const; diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE2.cpp sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE2.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE2.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE2.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -34,6 +34,17 @@ // member method definitions // =========================================================================== +GNEDetectorE2::GNEDetectorE2(SumoXMLTag tag, GNENet* net) : + GNEDetector("", net, GLO_E2DETECTOR, tag, 0, 0, {}, "", {}, "", false, std::map()), + myEndPositionOverLane(0), + myTimeThreshold(0), + mySpeedThreshold(0), +myJamThreshold(0) { + // reset default values + resetDefaultValues(); +} + + GNEDetectorE2::GNEDetectorE2(const std::string& id, GNELane* lane, GNENet* net, double pos, double length, const SUMOTime freq, const std::string& trafficLight, const std::string& filename, const std::vector& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, @@ -69,6 +80,52 @@ } +void +GNEDetectorE2::writeAdditional(OutputDevice& device) const { + device.openTag(SUMO_TAG_E2DETECTOR); + device.writeAttr(SUMO_ATTR_ID, getID()); + if (!myAdditionalName.empty()) { + device.writeAttr(SUMO_ATTR_NAME, StringUtils::escapeXML(myAdditionalName)); + } + // continue depending of E2 type + if (myTagProperty.getTag() == SUMO_TAG_E2DETECTOR) { + device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID()); + device.writeAttr(SUMO_ATTR_POSITION, myPositionOverLane); + device.writeAttr(SUMO_ATTR_LENGTH, toString(myEndPositionOverLane - myPositionOverLane)); + } else { + device.writeAttr(SUMO_ATTR_LANES, getAttribute(SUMO_ATTR_LANES)); + device.writeAttr(SUMO_ATTR_POSITION, myPositionOverLane); + device.writeAttr(SUMO_ATTR_ENDPOS, myEndPositionOverLane); + } + if (myTrafficLight.size() > 0) { + device.writeAttr(SUMO_ATTR_TLID, myTrafficLight); + } else { + device.writeAttr(SUMO_ATTR_FREQUENCY, time2string(myFreq)); + } + if (myFilename.size() > 0) { + device.writeAttr(SUMO_ATTR_FILE, myFilename); + } + if (myVehicleTypes.size() > 0) { + device.writeAttr(SUMO_ATTR_VTYPES, myVehicleTypes); + } + if (getAttribute(SUMO_ATTR_HALTING_TIME_THRESHOLD) != myTagProperty.getDefaultValue(SUMO_ATTR_HALTING_TIME_THRESHOLD)) { + device.writeAttr(SUMO_ATTR_HALTING_TIME_THRESHOLD, mySpeedThreshold); + } + if (getAttribute(SUMO_ATTR_HALTING_SPEED_THRESHOLD) != myTagProperty.getDefaultValue(SUMO_ATTR_HALTING_SPEED_THRESHOLD)) { + device.writeAttr(SUMO_ATTR_HALTING_SPEED_THRESHOLD, mySpeedThreshold); + } + if (getAttribute(SUMO_ATTR_JAM_DIST_THRESHOLD) != myTagProperty.getDefaultValue(SUMO_ATTR_JAM_DIST_THRESHOLD)) { + device.writeAttr(SUMO_ATTR_JAM_DIST_THRESHOLD, mySpeedThreshold); + } + if (myFriendlyPosition) { + device.writeAttr(SUMO_ATTR_FRIENDLY_POS, true); + } + // write parameters (Always after children to avoid problems with additionals.xsd) + writeParams(device); + device.closeTag(); +} + + bool GNEDetectorE2::isAdditionalValid() const { if (getParentLanes().size() == 1) { @@ -445,11 +502,17 @@ break; case SUMO_ATTR_POSITION: myPositionOverLane = parse(value); - updateGeometry(); + // update geometry (except for template) + if (getParentLanes().size() > 0) { + updateGeometry(); + } break; case SUMO_ATTR_ENDPOS: myEndPositionOverLane = parse(value); - updateGeometry(); + // update geometry (except for template) + if (getParentLanes().size() > 0) { + updateGeometry(); + } break; case SUMO_ATTR_FREQUENCY: myFreq = string2time(value); @@ -459,7 +522,10 @@ break; case SUMO_ATTR_LENGTH: myEndPositionOverLane = (myPositionOverLane + parse(value)); - updateGeometry(); + // update geometry (except for template) + if (getParentLanes().size() > 0) { + updateGeometry(); + } break; case SUMO_ATTR_NAME: myAdditionalName = value; diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE2.h sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE2.h --- sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE2.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE2.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,6 +32,9 @@ class GNEDetectorE2 : public GNEDetector { public: + /// @brief default Constructor + GNEDetectorE2(SumoXMLTag tag, GNENet* net); + /**@brief Constructor for Single-Lane E2 detectors * @param[in] id The storage of gl-ids to get the one for this lane representation from * @param[in] lane Lane of this StoppingPlace belongs @@ -79,6 +82,11 @@ /// @name members and functions relative to write additionals into XML /// @{ + /**@brief writte additional element into a xml file + * @param[in] device device in which write parameters of additional element + */ + void writeAdditional(OutputDevice& device) const; + /// @brief check if current additional is valid to be writed into XML bool isAdditionalValid() const; diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE3.cpp sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE3.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE3.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE3.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -28,6 +28,19 @@ // member method definitions // =========================================================================== +GNEDetectorE3::GNEDetectorE3(GNENet* net) : + GNEAdditional("", net, GLO_E3DETECTOR, SUMO_TAG_E3DETECTOR, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), + myFreq(0), + myFilename(""), + myTimeThreshold(0), +mySpeedThreshold(0) { + // reset default values + resetDefaultValues(); +} + + GNEDetectorE3::GNEDetectorE3(const std::string& id, GNENet* net, const Position pos, const SUMOTime freq, const std::string& filename, const std::vector& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, const std::map& parameters) : @@ -56,6 +69,37 @@ void +GNEDetectorE3::writeAdditional(OutputDevice& device) const { + device.openTag(getTagProperty().getTag()); + device.writeAttr(SUMO_ATTR_ID, getID()); + if (!myAdditionalName.empty()) { + device.writeAttr(SUMO_ATTR_NAME, StringUtils::escapeXML(myAdditionalName)); + } + device.writeAttr(SUMO_ATTR_POSITION, myPosition); + device.writeAttr(SUMO_ATTR_FREQUENCY, time2string(myFreq)); + if (myFilename.size() > 0) { + device.writeAttr(SUMO_ATTR_FILE, myFilename); + } + if (myVehicleTypes.size() > 0) { + device.writeAttr(SUMO_ATTR_VTYPES, myVehicleTypes); + } + if (getAttribute(SUMO_ATTR_HALTING_TIME_THRESHOLD) != myTagProperty.getDefaultValue(SUMO_ATTR_HALTING_TIME_THRESHOLD)) { + device.writeAttr(SUMO_ATTR_HALTING_TIME_THRESHOLD, myTimeThreshold); + } + if (getAttribute(SUMO_ATTR_HALTING_SPEED_THRESHOLD) != myTagProperty.getDefaultValue(SUMO_ATTR_HALTING_SPEED_THRESHOLD)) { + device.writeAttr(SUMO_ATTR_HALTING_SPEED_THRESHOLD, mySpeedThreshold); + } + // write all entry/exits + for (const auto& access : getChildAdditionals()) { + access->writeAdditional(device); + } + // write parameters (Always after children to avoid problems with additionals.xsd) + writeParams(device); + device.closeTag(); +} + + +void GNEDetectorE3::updateGeometry() { // update additional geometry myAdditionalGeometry.updateSinglePosGeometry(myPosition, 0); @@ -262,8 +306,10 @@ break; case SUMO_ATTR_POSITION: myPosition = parse(value); - // update boundary - updateCenteringBoundary(true); + // update boundary (except for template) + if (getID().size() > 0) { + updateCenteringBoundary(true); + } break; case SUMO_ATTR_FREQUENCY: myFreq = string2time(value); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE3.h sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE3.h --- sumo-1.11.0/src/netedit/elements/additional/GNEDetectorE3.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEDetectorE3.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,6 +32,9 @@ class GNEDetectorE3 : public GNEAdditional { public: + /// @brief default constructor + GNEDetectorE3(GNENet* net); + /**@brief GNEDetectorE3 Constructor * @param[in] id The storage of gl-ids to get the one for this lane representation from * @param[in] net pointer to GNENet of this additional element belongs @@ -57,6 +60,11 @@ /// @name Functions related with geometry of element /// @{ + /**@brief writte additional element into a xml file + * @param[in] device device in which write parameters of additional element + */ + void writeAdditional(OutputDevice& device) const; + /// @brief update pre-computed geometry information void updateGeometry(); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEDetectorEntryExit.cpp sumo-1.12.0/src/netedit/elements/additional/GNEDetectorEntryExit.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEDetectorEntryExit.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEDetectorEntryExit.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,15 +32,18 @@ // member method definitions // =========================================================================== +GNEDetectorEntryExit::GNEDetectorEntryExit(SumoXMLTag entryExitTag, GNENet* net) : + GNEDetector("", net, GLO_DET_ENTRY, entryExitTag, 0, 0, {}, "", {}, "", false, std::map()) { + // reset default values + resetDefaultValues(); +} + + GNEDetectorEntryExit::GNEDetectorEntryExit(SumoXMLTag entryExitTag, GNENet* net, GNEAdditional* parent, GNELane* lane, const double pos, const bool friendlyPos, const std::map& parameters) : GNEDetector(parent, net, GLO_DET_ENTRY, entryExitTag, pos, 0, { lane }, "", "", friendlyPos, parameters) { - // check that this is a Entry/Exit - if ((entryExitTag != SUMO_TAG_DET_ENTRY) && (entryExitTag != SUMO_TAG_DET_EXIT)) { - throw InvalidArgument("Invalid E3 Child Tag"); - } // update centering boundary without updating grid updateCenteringBoundary(false); } @@ -49,6 +52,18 @@ GNEDetectorEntryExit::~GNEDetectorEntryExit() {} +void +GNEDetectorEntryExit::writeAdditional(OutputDevice& device) const { + device.openTag(getTagProperty().getTag()); + device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID()); + device.writeAttr(SUMO_ATTR_POSITION, myPositionOverLane); + if (myFriendlyPosition) { + device.writeAttr(SUMO_ATTR_FRIENDLY_POS, true); + } + device.closeTag(); +} + + bool GNEDetectorEntryExit::isAdditionalValid() const { // with friendly position enabled position are "always fixed" diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEDetectorEntryExit.h sumo-1.12.0/src/netedit/elements/additional/GNEDetectorEntryExit.h --- sumo-1.11.0/src/netedit/elements/additional/GNEDetectorEntryExit.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEDetectorEntryExit.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -36,6 +36,9 @@ class GNEDetectorEntryExit : public GNEDetector { public: + /// @brief default Constructor + GNEDetectorEntryExit(SumoXMLTag entryExitTag, GNENet* net); + /**@brief Constructor * @param[in] entryExitTag Child Tag (Either SUMO_TAG_DET_ENTRY or SUMO_TAG_DET_EXIT) * @param[in] net pointer to GNENet of this additional element belongs @@ -53,6 +56,11 @@ /// @name members and functions relative to write additionals into XML /// @{ + /**@brief writte additional element into a xml file + * @param[in] device device in which write parameters of additional element + */ + void writeAdditional(OutputDevice& device) const; + /// @brief check if current additional is valid to be writed into XML bool isAdditionalValid() const; diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEDetector.h sumo-1.12.0/src/netedit/elements/additional/GNEDetector.h --- sumo-1.11.0/src/netedit/elements/additional/GNEDetector.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEDetector.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -76,6 +76,11 @@ /// @name members and functions relative to write additionals into XML /// @{ + /**@brief writte additional element into a xml file + * @param[in] device device in which write parameters of additional element + */ + virtual void writeAdditional(OutputDevice& device) const = 0; + /// @brief check if current additional is valid to be writed into XML (must be reimplemented in all detector children) virtual bool isAdditionalValid() const = 0; diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEParkingArea.cpp sumo-1.12.0/src/netedit/elements/additional/GNEParkingArea.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEParkingArea.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEParkingArea.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -33,6 +33,18 @@ // method definitions // =========================================================================== +GNEParkingArea::GNEParkingArea(GNENet* net) : + GNEStoppingPlace("", net, GLO_PARKING_AREA, SUMO_TAG_PARKING_AREA, nullptr, 0, 0, "", false, std::map()), + myRoadSideCapacity(0), + myOnRoad(false), + myWidth(0), + myLength(0), + myAngle(0) { + // reset default values + resetDefaultValues(); +} + + GNEParkingArea::GNEParkingArea(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos, const std::string& departPos, const std::string& name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width, const double length, double angle, const std::map& parameters) : @@ -53,8 +65,42 @@ void GNEParkingArea::writeAdditional(OutputDevice& device) const { - // use write additional of gneAdditional - GNEAdditional::writeAdditional(device); + device.openTag(getTagProperty().getTag()); + device.writeAttr(SUMO_ATTR_ID, getID()); + if (!myAdditionalName.empty()) { + device.writeAttr(SUMO_ATTR_NAME, StringUtils::escapeXML(myAdditionalName)); + } + device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID()); + if (myStartPosition != INVALID_DOUBLE) { + device.writeAttr(SUMO_ATTR_STARTPOS, myStartPosition); + } + if (myEndPosition != INVALID_DOUBLE) { + device.writeAttr(SUMO_ATTR_ENDPOS, myEndPosition); + } + if (myFriendlyPosition) { + device.writeAttr(SUMO_ATTR_FRIENDLY_POS, "true"); + } + if (getAttribute(SUMO_ATTR_ROADSIDE_CAPACITY) != myTagProperty.getDefaultValue(SUMO_ATTR_ROADSIDE_CAPACITY)) { + device.writeAttr(SUMO_ATTR_ROADSIDE_CAPACITY, toString(myRoadSideCapacity)); + } + if (getAttribute(SUMO_ATTR_ONROAD) != myTagProperty.getDefaultValue(SUMO_ATTR_ONROAD)) { + device.writeAttr(SUMO_ATTR_ONROAD, myOnRoad); + } + if (getAttribute(SUMO_ATTR_WIDTH) != myTagProperty.getDefaultValue(SUMO_ATTR_WIDTH)) { + device.writeAttr(SUMO_ATTR_WIDTH, myWidth); + } + if (getAttribute(SUMO_ATTR_LENGTH) != myTagProperty.getDefaultValue(SUMO_ATTR_LENGTH)) { + device.writeAttr(SUMO_ATTR_LENGTH, myLength); + } + // write all parking spaces + for (const auto& space : getChildAdditionals()) { + if (space->getTagProperty().getTag() == SUMO_TAG_PARKING_SPACE) { + space->writeAdditional(device); + } + } + // write parameters (Always after children to avoid problems with additionals.xsd) + writeParams(device); + device.closeTag(); } @@ -96,10 +142,6 @@ if (myNet->getViewNet()->getDataViewOptions().showAdditionals()) { // check exaggeration if (s.drawAdditionals(parkingAreaExaggeration)) { - // check if boundary has to be drawn - if (s.drawBoundaries) { - GLHelper::drawBoundary(getCenteringBoundary()); - } // declare colors RGBColor baseColor, signColor; // set colors @@ -124,7 +166,7 @@ // set base color GLHelper::setColor(baseColor); // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration - GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, myWidth * 0.5 * parkingAreaExaggeration); + GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myAdditionalGeometry, myWidth * 0.5 * MIN2(1.0, parkingAreaExaggeration)); // draw detail if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, parkingAreaExaggeration)) { // draw sign @@ -384,6 +426,12 @@ for (const auto& parkingSpace : getChildAdditionals()) { parkingSpace->setMicrosimID(getID()); } + // enable save demand elements if there are stops + for (const auto& stop : getChildDemandElements()) { + if (stop->getTagProperty().isStop() || stop->getTagProperty().isStopPerson()) { + myNet->requireSaveDemandElements(true); + } + } break; case SUMO_ATTR_LANE: replaceAdditionalParentLanes(value); @@ -394,8 +442,7 @@ } else { myStartPosition = parse(value); } - // update boundary - updateCenteringBoundary(true); + updateCenteringBoundary(false); break; case SUMO_ATTR_ENDPOS: if (value == "") { @@ -403,8 +450,7 @@ } else { myEndPosition = parse(value); } - // update boundary - updateCenteringBoundary(true); + updateCenteringBoundary(false); break; case SUMO_ATTR_DEPARTPOS: myDepartPos = value; @@ -417,8 +463,7 @@ break; case SUMO_ATTR_ROADSIDE_CAPACITY: myRoadSideCapacity = parse(value); - // update boundary - updateCenteringBoundary(true); + updateCenteringBoundary(false); break; case SUMO_ATTR_ONROAD: myOnRoad = parse(value); @@ -429,8 +474,10 @@ for (const auto& space : getChildAdditionals()) { space->updateGeometry(); } - // update boundary - updateCenteringBoundary(true); + updateCenteringBoundary(false); + if (!isTemplate()) { + getParentLanes().front()->getParentEdge()->updateCenteringBoundary(true); + } break; case SUMO_ATTR_LENGTH: myLength = parse(value); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEParkingArea.h sumo-1.12.0/src/netedit/elements/additional/GNEParkingArea.h --- sumo-1.11.0/src/netedit/elements/additional/GNEParkingArea.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEParkingArea.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -33,6 +33,9 @@ class GNEParkingArea : public GNEStoppingPlace { public: + /// @brief default constructor + GNEParkingArea(GNENet* net); + /**@brief Constructor * @param[in] id The storage of gl-ids to get the one for this lane representation from * @param[in] lane Lane of this StoppingPlace belongs diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEParkingAreaReroute.cpp sumo-1.12.0/src/netedit/elements/additional/GNEParkingAreaReroute.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEParkingAreaReroute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEParkingAreaReroute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -29,11 +29,22 @@ // member method definitions // =========================================================================== +GNEParkingAreaReroute::GNEParkingAreaReroute(GNENet* net): + GNEAdditional("", net, GLO_REROUTER, SUMO_TAG_PARKING_AREA_REROUTE, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), + myProbability(0), +myVisible(0) { + // reset default values + resetDefaultValues(); +} + + GNEParkingAreaReroute::GNEParkingAreaReroute(GNEAdditional* rerouterIntervalParent, GNEAdditional* newParkingArea, double probability, bool visible): GNEAdditional(rerouterIntervalParent->getNet(), GLO_REROUTER, SUMO_TAG_PARKING_AREA_REROUTE, "", {}, {}, {}, {rerouterIntervalParent, newParkingArea}, {}, {}, {}, {}, std::map()), - myProbability(probability), +myProbability(probability), myVisible(visible) { // update boundary of rerouter parent rerouterIntervalParent->getParentAdditionals().front()->updateCenteringBoundary(true); @@ -43,7 +54,7 @@ GNEParkingAreaReroute::~GNEParkingAreaReroute() {} -void +void GNEParkingAreaReroute::writeAdditional(OutputDevice& device) const { device.openTag(SUMO_TAG_PARKING_AREA_REROUTE); device.writeAttr(SUMO_ATTR_ID, getAttribute(SUMO_ATTR_PARKING)); @@ -215,7 +226,11 @@ myVisible = parse(value); break; case GNE_ATTR_SELECTED: - setParametersStr(value); + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } break; default: throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEParkingAreaReroute.h sumo-1.12.0/src/netedit/elements/additional/GNEParkingAreaReroute.h --- sumo-1.11.0/src/netedit/elements/additional/GNEParkingAreaReroute.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEParkingAreaReroute.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -41,6 +41,9 @@ public: /// @brief constructor + GNEParkingAreaReroute(GNENet* net); + + /// @brief constructor GNEParkingAreaReroute(GNEAdditional* rerouterIntervalParent, GNEAdditional* newParkingArea, double probability, bool visible); /// @brief destructor diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEParkingSpace.cpp sumo-1.12.0/src/netedit/elements/additional/GNEParkingSpace.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEParkingSpace.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEParkingSpace.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -31,6 +31,16 @@ // method definitions // =========================================================================== +GNEParkingSpace::GNEParkingSpace(GNENet* net) : + GNEAdditional("", net, GLO_PARKING_SPACE, SUMO_TAG_PARKING_SPACE, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), +mySlope(0) { + // reset default values + resetDefaultValues(); +} + + GNEParkingSpace::GNEParkingSpace(GNENet* net, GNEAdditional* parkingAreaParent, const Position& pos, const std::string& width, const std::string& length, const std::string& angle, double slope, const std::string& name, const std::map& parameters) : @@ -80,6 +90,35 @@ void +GNEParkingSpace::writeAdditional(OutputDevice& device) const { + device.openTag(getTagProperty().getTag()); + if (!myAdditionalName.empty()) { + device.writeAttr(SUMO_ATTR_NAME, StringUtils::escapeXML(myAdditionalName)); + } + device.writeAttr(SUMO_ATTR_X, myPosition.x()); + device.writeAttr(SUMO_ATTR_Y, myPosition.y()); + if (myPosition.z() != 0) { + device.writeAttr(SUMO_ATTR_Z, myPosition.z()); + } + if (myWidth.size() > 0) { + device.writeAttr(SUMO_ATTR_WIDTH, myWidth); + } + if (myLength.size() > 0) { + device.writeAttr(SUMO_ATTR_LENGTH, myLength); + } + if (myAngle.size() > 0) { + device.writeAttr(SUMO_ATTR_ANGLE, myAngle); + } + if (getAttribute(SUMO_ATTR_SLOPE) != myTagProperty.getDefaultValue(SUMO_ATTR_SLOPE)) { + device.writeAttr(SUMO_ATTR_SLOPE, myAngle); + } + // write parameters (Always after children to avoid problems with additionals.xsd) + writeParams(device); + device.closeTag(); +} + + +void GNEParkingSpace::updateGeometry() { // get width an lenght const double width = getAttributeDouble(SUMO_ATTR_WIDTH) <= 0 ? POSITION_EPS : getAttributeDouble(SUMO_ATTR_WIDTH); @@ -328,18 +367,24 @@ break; case SUMO_ATTR_WIDTH: myWidth = value; - // update geometry - updateGeometry(); + // update geometry (except for template) + if (getParentAdditionals().size() > 0) { + updateGeometry(); + } break; case SUMO_ATTR_LENGTH: myLength = value; - // update geometry - updateGeometry(); + // update geometry (except for template) + if (getParentAdditionals().size() > 0) { + updateGeometry(); + } break; case SUMO_ATTR_ANGLE: myAngle = value; - // update geometry - updateGeometry(); + // update geometry (except for template) + if (getParentAdditionals().size() > 0) { + updateGeometry(); + } break; case SUMO_ATTR_SLOPE: mySlope = parse(value); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEParkingSpace.h sumo-1.12.0/src/netedit/elements/additional/GNEParkingSpace.h --- sumo-1.11.0/src/netedit/elements/additional/GNEParkingSpace.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEParkingSpace.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -37,6 +37,9 @@ class GNEParkingSpace : public GNEAdditional { public: + /// @brief Constructor + GNEParkingSpace(GNENet* net); + /**@brief Constructor * @param[in] net pointer to GNENet of this additional element belongs * @param[in] parkingAreaParent pointer to Parking Area parent @@ -62,6 +65,11 @@ /// @name Functions related with geometry of element /// @{ + /**@brief writte additional element into a xml file + * @param[in] device device in which write parameters of additional element + */ + void writeAdditional(OutputDevice& device) const; + /// @brief update pre-computed geometry information void updateGeometry(); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEPOI.cpp sumo-1.12.0/src/netedit/elements/additional/GNEPOI.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEPOI.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEPOI.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -40,14 +40,20 @@ // method definitions // =========================================================================== +GNEPOI::GNEPOI(SumoXMLTag tag, GNENet* net) : + PointOfInterest("", "", RGBColor::BLACK, Position(0, 0), false, "", 0, false, 0, 0, 0, "", false, 0, 0, "", std::map()), + GNEShape("", net, GLO_POI, tag, {}, {}, {}, {}, {}, {}, {}, {}) { + // reset default values + resetDefaultValues(); +} + + GNEPOI::GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, const double xLon, const double yLat, const bool geo, const double layer, const double angle, const std::string& imgFile, const bool relativePath, const double width, const double height, const std::string& name, const std::map& parameters) : PointOfInterest(id, type, color, Position(xLon, yLat), geo, "", 0, false, 0, layer, angle, imgFile, relativePath, width, height, name, parameters), - GNEShape(id, net, GLO_POI, geo ? GNE_TAG_POIGEO : SUMO_TAG_POI, -{}, {}, {}, {}, {}, {}, {}, {} - ) { + GNEShape(id, net, GLO_POI, geo ? GNE_TAG_POIGEO : SUMO_TAG_POI, {}, {}, {}, {}, {}, {}, {}, {}) { // update position depending of GEO if (geo) { Position cartesian(x(), y()); @@ -603,12 +609,16 @@ break; case SUMO_ATTR_IMGFILE: // first remove object from grid due img file affect to boundary - myNet->removeGLObjectFromGrid(this); + if (getID().size() > 0) { + myNet->removeGLObjectFromGrid(this); + } setShapeImgFile(value); // all textures must be refresh GUITexturesHelper::clearTextures(); // add object into grid again - myNet->addGLObjectIntoGrid(this); + if (getID().size() > 0) { + myNet->addGLObjectIntoGrid(this); + } break; case SUMO_ATTR_RELATIVEPATH: setShapeRelativePath(parse(value)); @@ -616,18 +626,20 @@ case SUMO_ATTR_WIDTH: // set new width setWidth(parse(value)); - // update centering boundary - updateCenteringBoundary(true); - // update geometry - updateGeometry(); + // update centering boundary and geometry (except for templates) + if (getID().size() > 0) { + updateCenteringBoundary(true); + updateGeometry(); + } break; case SUMO_ATTR_HEIGHT: // set new height setHeight(parse(value)); - // update centering boundary - updateCenteringBoundary(true); - // update geometry - updateGeometry(); + // update centering boundary and geometry (except for templates) + if (getID().size() > 0) { + updateCenteringBoundary(true); + updateGeometry(); + } break; case SUMO_ATTR_ANGLE: setShapeNaviDegree(parse(value)); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEPOI.h sumo-1.12.0/src/netedit/elements/additional/GNEPOI.h --- sumo-1.11.0/src/netedit/elements/additional/GNEPOI.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEPOI.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -46,7 +46,10 @@ /// @brief needed to avoid diamond problem between PointOfInterest and GNEShape using GNEShape::getID; - /** @brief Constructor + /// @brief Constructor + GNEPOI(SumoXMLTag tag, GNENet* net); + + /**@brief Constructor * @param[in] net net in which this polygon is placed * @param[in] id The name of the POI * @param[in] type The (abstract) type of the POI @@ -68,7 +71,7 @@ const bool relativePath, const double width, const double height, const std::string& name, const std::map& parameters); - /** @brief Constructor + /**@brief Constructor * @param[in] net net in which this polygon is placed * @param[in] id The name of the POI * @param[in] type The (abstract) type of the POI diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEPoly.cpp sumo-1.12.0/src/netedit/elements/additional/GNEPoly.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEPoly.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEPoly.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -38,12 +38,21 @@ // =========================================================================== // method definitions // =========================================================================== + +GNEPoly::GNEPoly(GNENet* net) : + SUMOPolygon("", "", RGBColor::BLACK, {}, false, false, 0, 0, 0, "", false, "", std::map()), + GNEShape("", net, GLO_POLYGON, SUMO_TAG_POLY, {}, {}, {}, {}, {}, {}, {}, {}), +mySimplifiedShape(false) { + // reset default values + resetDefaultValues(); +} + + GNEPoly::GNEPoly(GNENet* net, const std::string& id, const std::string& type, const PositionVector& shape, bool geo, bool fill, double lineWidth, const RGBColor& color, double layer, double angle, const std::string& imgFile, bool relativePath, const std::string& name, const std::map& parameters) : SUMOPolygon(id, type, color, shape, geo, fill, lineWidth, layer, angle, imgFile, relativePath, name, parameters), - GNEShape(id, net, GLO_POLYGON, SUMO_TAG_POLY, -{}, {}, {}, {}, {}, {}, {}, {}), + GNEShape(id, net, GLO_POLYGON, SUMO_TAG_POLY, {}, {}, {}, {}, {}, {}, {}, {}), mySimplifiedShape(false) { // update centering boundary without updating grid updateCenteringBoundary(false); @@ -336,7 +345,7 @@ // draw name drawName(namePos, s.scale, s.polyName, s.angle); // check if draw poly type - if (s.polyType.show) { + if (s.polyType.show(this)) { const Position p = namePos + Position(0, -0.6 * s.polyType.size / s.scale); GLHelper::drawTextSettings(s.polyType, getShapeType(), p, s.scale, s.angle); } diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEPoly.h sumo-1.12.0/src/netedit/elements/additional/GNEPoly.h --- sumo-1.11.0/src/netedit/elements/additional/GNEPoly.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEPoly.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -46,6 +46,9 @@ /// @brief needed to avoid diamond problem between SUMOPolygon and GNEShape using GNEShape::getID; + /// @brief default Constructor + GNEPoly(GNENet* net); + /** @brief Constructor * @param[in] net net in which this polygon is placed * @param[in] id The name of the polygon diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNERerouter.cpp sumo-1.12.0/src/netedit/elements/additional/GNERerouter.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNERerouter.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNERerouter.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,18 +32,30 @@ // member method definitions // =========================================================================== +GNERerouter::GNERerouter(GNENet* net) : + GNEAdditional("", net, GLO_REROUTER, SUMO_TAG_REROUTER, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), + myProbability(0), + myOff(false), +myTimeThreshold(0) { + // reset default values + resetDefaultValues(); +} + + GNERerouter::GNERerouter(const std::string& id, GNENet* net, const Position& pos, const std::string& name, const std::string& filename, double probability, bool off, SUMOTime timeThreshold, const std::vector& vTypes, const std::map& parameters) : GNEAdditional(id, net, GLO_REROUTER, SUMO_TAG_REROUTER, name, - {}, {}, {}, {}, {}, {}, {}, {}, - parameters), - myPosition(pos), - myFilename(filename), - myProbability(probability), - myOff(off), - myTimeThreshold(timeThreshold), - myVTypes(vTypes) { +{}, {}, {}, {}, {}, {}, {}, {}, +parameters), +myPosition(pos), +myFilename(filename), +myProbability(probability), +myOff(off), +myTimeThreshold(timeThreshold), +myVTypes(vTypes) { // update centering boundary without updating grid updateCenteringBoundary(false); } @@ -337,8 +349,10 @@ break; case SUMO_ATTR_POSITION: myPosition = parse(value); - // update boundary - updateCenteringBoundary(true); + // update boundary (except for template) + if (getID().size() > 0) { + updateCenteringBoundary(true); + } break; case SUMO_ATTR_NAME: myAdditionalName = value; diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNERerouter.h sumo-1.12.0/src/netedit/elements/additional/GNERerouter.h --- sumo-1.11.0/src/netedit/elements/additional/GNERerouter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNERerouter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -37,6 +37,9 @@ class GNERerouter : public GNEAdditional { public: + /// @brief default Constructor + GNERerouter(GNENet* net); + /**@brief Constructor * @param[in] id The storage of gl-ids to get the one for this lane representation from * @param[in] net pointer to GNENet of this additional element belongs diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNERerouterInterval.cpp sumo-1.12.0/src/netedit/elements/additional/GNERerouterInterval.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNERerouterInterval.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNERerouterInterval.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -31,14 +31,25 @@ // member method definitions // =========================================================================== +GNERerouterInterval::GNERerouterInterval(GNENet* net) : + GNEAdditional("", net, GLO_REROUTER_INTERVAL, SUMO_TAG_INTERVAL, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), + myBegin(0), +myEnd(0) { + // reset default values + resetDefaultValues(); +} + + GNERerouterInterval::GNERerouterInterval(GNERerouterDialog* rerouterDialog) : GNEAdditional(rerouterDialog->getEditedAdditional()->getNet(), GLO_REROUTER_INTERVAL, SUMO_TAG_INTERVAL, "", - {}, {}, {}, {rerouterDialog->getEditedAdditional()}, {}, {}, {}, {}, - std::map()), - myBegin(0), - myEnd(0) { - // fill reroute interval with default values - setDefaultValues(); +{}, {}, {}, {rerouterDialog->getEditedAdditional()}, {}, {}, {}, {}, +std::map()), +myBegin(0), +myEnd(0) { + // reset default values + resetDefaultValues(); // update boundary of rerouter parent rerouterDialog->getEditedAdditional()->updateCenteringBoundary(true); } @@ -46,10 +57,10 @@ GNERerouterInterval::GNERerouterInterval(GNEAdditional* rerouterParent, SUMOTime begin, SUMOTime end) : GNEAdditional(rerouterParent->getNet(), GLO_REROUTER, SUMO_TAG_INTERVAL, "", - {}, {}, {}, {rerouterParent}, {}, {}, {}, {}, - std::map()), - myBegin(begin), - myEnd(end) { +{}, {}, {}, {rerouterParent}, {}, {}, {}, {}, +std::map()), +myBegin(begin), +myEnd(end) { // update boundary of rerouter parent rerouterParent->updateCenteringBoundary(true); } diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNERerouterInterval.h sumo-1.12.0/src/netedit/elements/additional/GNERerouterInterval.h --- sumo-1.11.0/src/netedit/elements/additional/GNERerouterInterval.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNERerouterInterval.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -43,6 +43,9 @@ class GNERerouterInterval : public GNEAdditional { public: + /// @brief default constructor + GNERerouterInterval(GNENet* net); + /// @brief constructor (Used in GNERerouterDialog) GNERerouterInterval(GNERerouterDialog* rerouterDialog); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNERerouterSymbol.cpp sumo-1.12.0/src/netedit/elements/additional/GNERerouterSymbol.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNERerouterSymbol.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNERerouterSymbol.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -51,11 +51,21 @@ void +GNERerouterSymbol::writeAdditional(OutputDevice& /*device*/) const { + // noting to write +} + + +void GNERerouterSymbol::updateGeometry() { // clear geometries mySymbolGeometries.clear(); // iterate over all lanes + NBEdge* nbe = getParentEdges().front()->getNBEdge(); for (const auto& lane : getParentEdges().front()->getLanes()) { + if ((nbe->getPermissions(lane->getIndex()) & ~SVC_PEDESTRIAN) == 0) { + continue; + } // declare geometry GUIGeometry symbolGeometry; // update it with lane and pos over lane diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNERerouterSymbol.h sumo-1.12.0/src/netedit/elements/additional/GNERerouterSymbol.h --- sumo-1.11.0/src/netedit/elements/additional/GNERerouterSymbol.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNERerouterSymbol.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -53,6 +53,11 @@ /// @name Functions related with geometry of element /// @{ + /**@brief writte additional element into a xml file + * @param[in] device device in which write parameters of additional element + */ + void writeAdditional(OutputDevice& device) const; + /// @brief update pre-computed geometry information void updateGeometry(); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNERouteProbe.cpp sumo-1.12.0/src/netedit/elements/additional/GNERouteProbe.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNERouteProbe.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNERouteProbe.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -34,6 +34,17 @@ // member method definitions // =========================================================================== +GNERouteProbe::GNERouteProbe(GNENet* net) : + GNEAdditional("", net, GLO_ROUTEPROBE, SUMO_TAG_ROUTEPROBE, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), + myFrequency(0), +myBegin(0) { + // update centering boundary without updating grid + updateCenteringBoundary(false); +} + + GNERouteProbe::GNERouteProbe(const std::string& id, GNENet* net, GNEEdge* edge, const SUMOTime frequency, const std::string& name, const std::string& filename, SUMOTime begin, const std::map& parameters) : GNEAdditional(id, net, GLO_ROUTEPROBE, SUMO_TAG_ROUTEPROBE, name, diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNERouteProbe.h sumo-1.12.0/src/netedit/elements/additional/GNERouteProbe.h --- sumo-1.11.0/src/netedit/elements/additional/GNERouteProbe.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNERouteProbe.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,6 +32,9 @@ class GNERouteProbe : public GNEAdditional { public: + /// @brief Constructor + GNERouteProbe(GNENet* net); + /**@brief Constructor * @param[in] id The storage of gl-ids to get the one for this lane representation from * @param[in] net pointer to GNENet of this additional element belongs diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNERouteProbReroute.cpp sumo-1.12.0/src/netedit/elements/additional/GNERouteProbReroute.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNERouteProbReroute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNERouteProbReroute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -29,11 +29,21 @@ // member method definitions // =========================================================================== +GNERouteProbReroute::GNERouteProbReroute(GNENet* net) : + GNEAdditional("", net, GLO_REROUTER_ROUTEPROBREROUTE, SUMO_TAG_ROUTE_PROB_REROUTE, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), +myProbability(0) { + // reset default values + resetDefaultValues(); +} + + GNERouteProbReroute::GNERouteProbReroute(GNEAdditional* rerouterIntervalParent, GNEDemandElement* route, double probability) : GNEAdditional(rerouterIntervalParent->getNet(), GLO_REROUTER_ROUTEPROBREROUTE, SUMO_TAG_ROUTE_PROB_REROUTE, "", - {}, {}, {}, {rerouterIntervalParent}, {}, {}, {route}, {}, - std::map()), - myProbability(probability) { +{}, {}, {}, {rerouterIntervalParent}, {}, {}, {route}, {}, +std::map()), +myProbability(probability) { // update boundary of rerouter parent rerouterIntervalParent->getParentAdditionals().front()->updateCenteringBoundary(true); } diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNERouteProbReroute.h sumo-1.12.0/src/netedit/elements/additional/GNERouteProbReroute.h --- sumo-1.11.0/src/netedit/elements/additional/GNERouteProbReroute.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNERouteProbReroute.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -40,6 +40,9 @@ class GNERouteProbReroute : public GNEAdditional { public: + /// @brief default constructor + GNERouteProbReroute(GNENet* net); + /// @brief constructor GNERouteProbReroute(GNEAdditional* rerouterIntervalParent, GNEDemandElement* route, double probability); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEShape.cpp sumo-1.12.0/src/netedit/elements/additional/GNEShape.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEShape.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEShape.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -113,9 +113,8 @@ void -GNEShape::setEnabledAttribute(const int /*enabledAttributes*/) { - // +GNEShape::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { + // throw InvalidArgument("Nothing to enable"); } - /****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEShape.h sumo-1.12.0/src/netedit/elements/additional/GNEShape.h --- sumo-1.11.0/src/netedit/elements/additional/GNEShape.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEShape.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -222,8 +222,8 @@ /// @brief commit move shape virtual void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) = 0; - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief Invalidated copy constructor. GNEShape(const GNEShape&) = delete; diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEStoppingPlace.cpp sumo-1.12.0/src/netedit/elements/additional/GNEStoppingPlace.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEStoppingPlace.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEStoppingPlace.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -165,10 +165,9 @@ void -GNEStoppingPlace::updateCenteringBoundary(const bool updateGrid) { - // remove additional from grid - if (updateGrid && myTagProperty.isPlacedInRTree()) { - myNet->removeGLObjectFromGrid(this); +GNEStoppingPlace::updateCenteringBoundary(const bool /*updateGrid*/) { + if (isTemplate()) { + return; } // update geometry updateGeometry(); @@ -177,7 +176,7 @@ // grow with "width" if (myTagProperty.hasAttribute(SUMO_ATTR_WIDTH)) { // we cannot use "getAttributeDouble(...)" - myAdditionalBoundary.growWidth(parse(getAttribute(SUMO_ATTR_WIDTH))); + myAdditionalBoundary.grow(parse(getAttribute(SUMO_ATTR_WIDTH))); } // grow myAdditionalBoundary.grow(10); @@ -187,10 +186,6 @@ myAdditionalBoundary.add(parkingSpace->getCenteringBoundary()); } } - // add additional into RTREE again - if (updateGrid && myTagProperty.isPlacedInRTree()) { - myNet->addGLObjectIntoGrid(this); - } } diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEStoppingPlace.h sumo-1.12.0/src/netedit/elements/additional/GNEStoppingPlace.h --- sumo-1.11.0/src/netedit/elements/additional/GNEStoppingPlace.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEStoppingPlace.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNETAZ.cpp sumo-1.12.0/src/netedit/elements/additional/GNETAZ.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNETAZ.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNETAZ.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -46,6 +46,22 @@ // member method definitions // =========================================================================== +GNETAZ::GNETAZ(GNENet* net) : + GNETAZElement("", net, GLO_TAZ, SUMO_TAG_TAZ, +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), + SUMOPolygon("", "", RGBColor::BLACK, {}, false, false, 1, Shape::DEFAULT_LAYER, Shape::DEFAULT_ANGLE, Shape::DEFAULT_IMG_FILE, Shape::DEFAULT_RELATIVEPATH, ""), + myMaxWeightSource(0), + myMinWeightSource(0), + myAverageWeightSource(0), + myMaxWeightSink(0), + myMinWeightSink(0), +myAverageWeightSink(0) { + // reset default values + resetDefaultValues(); +} + + GNETAZ::GNETAZ(const std::string& id, GNENet* net, const PositionVector& shape, const Position& center, const bool fill, const RGBColor& color, const std::string& name, const std::map& parameters) : GNETAZElement(id, net, GLO_TAZ, SUMO_TAG_TAZ, @@ -158,9 +174,14 @@ device.writeAttr(SUMO_ATTR_NAME, getShapeName()); } device.writeAttr(SUMO_ATTR_COLOR, getShapeColor()); - // write all TAZ Source/sinks + // sort all Source/Sinks by ID + std::map, GNETAZElement*> sortedSourceSinks; for (const auto& sourceSink : getChildTAZElements()) { - sourceSink->writeTAZElement(device); + sortedSourceSinks[std::make_pair(sourceSink->getAttribute(SUMO_ATTR_EDGE), sourceSink->getTagProperty().getTag())] = sourceSink; + } + // write all TAZ Source/sinks + for (const auto& sortedSourceSink : sortedSourceSinks) { + sortedSourceSink.second->writeTAZElement(device); } // write params GNETAZElement::writeParams(device); @@ -349,7 +370,7 @@ // draw name drawName(myTAZCenter, s.scale, s.polyName, s.angle); // check if draw poly type - if (s.polyType.show) { + if (s.polyType.show(this)) { const Position p = namePos + Position(0, -0.6 * s.polyType.size / s.scale); GLHelper::drawTextSettings(s.polyType, getShapeType(), p, s.scale, s.angle); } @@ -657,9 +678,11 @@ case SUMO_ATTR_SHAPE: { const bool updateCenter = (myTAZCenter == myShape.getCentroid()); // remove TAZ and TAZRelDatas - myNet->removeGLObjectFromGrid(this); - for (const auto& TAZRelData : getChildGenericDatas()) { - myNet->removeGLObjectFromGrid(TAZRelData); + if (getID().size() > 0) { + myNet->removeGLObjectFromGrid(this); + for (const auto& TAZRelData : getChildGenericDatas()) { + myNet->removeGLObjectFromGrid(TAZRelData); + } } myShape = parse(value); // always close shape @@ -673,18 +696,22 @@ myTAZCenter = myShape.getCentroid(); } // add TAZ and TAZRelDatas - myNet->addGLObjectIntoGrid(this); - for (const auto& TAZRelData : getChildGenericDatas()) { - TAZRelData->updateGeometry(); - myNet->addGLObjectIntoGrid(TAZRelData); + if (getID().size() > 0) { + myNet->addGLObjectIntoGrid(this); + for (const auto& TAZRelData : getChildGenericDatas()) { + TAZRelData->updateGeometry(); + myNet->addGLObjectIntoGrid(TAZRelData); + } } break; } case SUMO_ATTR_CENTER: // remove TAZ and TAZRelDatas - myNet->removeGLObjectFromGrid(this); - for (const auto& TAZRelData : getChildGenericDatas()) { - myNet->removeGLObjectFromGrid(TAZRelData); + if (getID().size() > 0) { + myNet->removeGLObjectFromGrid(this); + for (const auto& TAZRelData : getChildGenericDatas()) { + myNet->removeGLObjectFromGrid(TAZRelData); + } } if (value.empty()) { myTAZCenter = myShape.getCentroid(); @@ -692,10 +719,12 @@ myTAZCenter = parse(value); } // add TAZ and TAZRelDatas - myNet->addGLObjectIntoGrid(this); - for (const auto& TAZRelData : getChildGenericDatas()) { - TAZRelData->updateGeometry(); - myNet->addGLObjectIntoGrid(TAZRelData); + if (getID().size() > 0) { + myNet->addGLObjectIntoGrid(this); + for (const auto& TAZRelData : getChildGenericDatas()) { + TAZRelData->updateGeometry(); + myNet->addGLObjectIntoGrid(TAZRelData); + } } break; case SUMO_ATTR_COLOR: diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNETAZElement.cpp sumo-1.12.0/src/netedit/elements/additional/GNETAZElement.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNETAZElement.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNETAZElement.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -142,9 +142,8 @@ void -GNETAZElement::setEnabledAttribute(const int /*enabledAttributes*/) { - // +GNETAZElement::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { + throw InvalidArgument("Nothing to enable"); } - /****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNETAZElement.h sumo-1.12.0/src/netedit/elements/additional/GNETAZElement.h --- sumo-1.11.0/src/netedit/elements/additional/GNETAZElement.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNETAZElement.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -240,8 +240,8 @@ /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0; - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief Invalidated copy constructor. GNETAZElement(const GNETAZElement&) = delete; diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNETAZ.h sumo-1.12.0/src/netedit/elements/additional/GNETAZ.h --- sumo-1.11.0/src/netedit/elements/additional/GNETAZ.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNETAZ.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -37,6 +37,9 @@ /// @brief needed to avoid diamond Problem between GUIPolygon and GNETAZElement using GNETAZElement::getID; + /// @default GNETAZ Constructor + GNETAZ(GNENet* net); + /**@brief GNETAZ Constructor * @param[in] id The storage of gl-ids to get the one for this lane representation from * @param[in] net pointer to GNENet of this additional element belongs diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNETAZSourceSink.cpp sumo-1.12.0/src/netedit/elements/additional/GNETAZSourceSink.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNETAZSourceSink.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNETAZSourceSink.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -34,6 +34,16 @@ // member method definitions // =========================================================================== +GNETAZSourceSink::GNETAZSourceSink(SumoXMLTag tag, GNENet* net) : + GNETAZElement("", net, GLO_TAZ, tag, +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), +myDepartWeight(0) { + // reset default values + resetDefaultValues(); +} + + GNETAZSourceSink::GNETAZSourceSink(SumoXMLTag sourceSinkTag, GNETAZElement* TAZParent, GNEEdge* edge, double departWeight) : GNETAZElement(TAZParent, TAZParent->getNet(), GLO_TAZ, sourceSinkTag, {}, {edge}, {}, {}, {}, {TAZParent}, {}, {}, diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNETAZSourceSink.h sumo-1.12.0/src/netedit/elements/additional/GNETAZSourceSink.h --- sumo-1.11.0/src/netedit/elements/additional/GNETAZSourceSink.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNETAZSourceSink.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,6 +32,9 @@ class GNETAZSourceSink : public GNETAZElement { public: + /// @brief default Constructor + GNETAZSourceSink(SumoXMLTag tag, GNENet* net); + /**@brief Constructor * @param[in] sourceSinkTag Child Tag (Either SUMO_TAG_TAZSOURCE or SUMO_TAG_TAZINK) * @param[in] parent pointer to TAZ of this TAZSourceSinks belongs diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEVaporizer.cpp sumo-1.12.0/src/netedit/elements/additional/GNEVaporizer.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEVaporizer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEVaporizer.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,6 +32,17 @@ // member method definitions // =========================================================================== +GNEVaporizer::GNEVaporizer(GNENet* net) : + GNEAdditional("", net, GLO_VAPORIZER, SUMO_TAG_VAPORIZER, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), + myBegin(0), +myEnd(0) { + // reset default values + resetDefaultValues(); +} + + GNEVaporizer::GNEVaporizer(GNENet* net, GNEEdge* edge, SUMOTime from, SUMOTime end, const std::string& name, const std::map& parameters) : GNEAdditional(edge->getID(), net, GLO_VAPORIZER, SUMO_TAG_VAPORIZER, name, @@ -55,6 +66,21 @@ } +void +GNEVaporizer::writeAdditional(OutputDevice& device) const { + device.openTag(getTagProperty().getTag()); + device.writeAttr(SUMO_ATTR_ID, getID()); + if (!myAdditionalName.empty()) { + device.writeAttr(SUMO_ATTR_NAME, StringUtils::escapeXML(myAdditionalName)); + } + device.writeAttr(SUMO_ATTR_BEGIN, time2string(myBegin)); + device.writeAttr(SUMO_ATTR_END, time2string(myEnd)); + // write parameters (Always after children to avoid problems with additionals.xsd) + writeParams(device); + device.closeTag(); +} + + void GNEVaporizer::updateGeometry() { // calculate perpendicular line diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEVaporizer.h sumo-1.12.0/src/netedit/elements/additional/GNEVaporizer.h --- sumo-1.11.0/src/netedit/elements/additional/GNEVaporizer.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEVaporizer.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -33,6 +33,9 @@ class GNEVaporizer : public GNEAdditional { public: + /// @brief default Constructor + GNEVaporizer(GNENet* net); + /**@brief Constructor * @param[in] net pointer to GNENet of this additional element belongs * @param[in] edge edge in which this vaporizer is placed @@ -54,6 +57,11 @@ /// @name Functions related with geometry of element /// @{ + /**@brief writte additional element into a xml file + * @param[in] device device in which write parameters of additional element + */ + void writeAdditional(OutputDevice& device) const; + /// @brief update pre-computed geometry information void updateGeometry(); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEVariableSpeedSign.cpp sumo-1.12.0/src/netedit/elements/additional/GNEVariableSpeedSign.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEVariableSpeedSign.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEVariableSpeedSign.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -34,6 +34,15 @@ // member method definitions // =========================================================================== +GNEVariableSpeedSign::GNEVariableSpeedSign(GNENet* net) : + GNEAdditional("", net, GLO_VSS, SUMO_TAG_VSS, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()) { + // reset default values + resetDefaultValues(); +} + + GNEVariableSpeedSign::GNEVariableSpeedSign(const std::string& id, GNENet* net, const Position& pos, const std::string& name, const std::vector& vTypes, const std::map& parameters) : GNEAdditional(id, net, GLO_VSS, SUMO_TAG_VSS, name, @@ -281,8 +290,10 @@ break; case SUMO_ATTR_POSITION: myPosition = parse(value); - // update boundary - updateCenteringBoundary(true); + // update boundary (except for template) + if (getID().size() > 0) { + updateCenteringBoundary(true); + } break; case SUMO_ATTR_NAME: myAdditionalName = value; diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEVariableSpeedSign.h sumo-1.12.0/src/netedit/elements/additional/GNEVariableSpeedSign.h --- sumo-1.11.0/src/netedit/elements/additional/GNEVariableSpeedSign.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEVariableSpeedSign.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -37,6 +37,9 @@ class GNEVariableSpeedSign : public GNEAdditional { public: + /// @brief default Constructor + GNEVariableSpeedSign(GNENet* net); + /**@brief Constructor * @param[in] id The storage of gl-ids to get the one for this lane representation from * @param[in] net pointer to GNENet of this additional element belongs diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEVariableSpeedSignStep.cpp sumo-1.12.0/src/netedit/elements/additional/GNEVariableSpeedSignStep.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEVariableSpeedSignStep.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEVariableSpeedSignStep.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -29,12 +29,22 @@ // member method definitions // =========================================================================== +GNEVariableSpeedSignStep::GNEVariableSpeedSignStep(GNENet* net) : + GNEAdditional("", net, GLO_VSS_STEP, SUMO_TAG_STEP, "", +{}, {}, {}, {}, {}, {}, {}, {}, +std::map()), +myTime(0) { + // reset default values + resetDefaultValues(); +} + + GNEVariableSpeedSignStep::GNEVariableSpeedSignStep(GNEAdditional* variableSpeedSignParent, SUMOTime time, const std::string& speed) : GNEAdditional(variableSpeedSignParent->getNet(), GLO_VSS_STEP, SUMO_TAG_STEP, "", - {}, {}, {}, {variableSpeedSignParent}, {}, {}, {}, {}, - std::map()), - myTime(time), - mySpeed(speed) { +{}, {}, {}, {variableSpeedSignParent}, {}, {}, {}, {}, +std::map()), +myTime(time), +mySpeed(speed) { // update boundary of rerouter parent variableSpeedSignParent->updateCenteringBoundary(true); } diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEVariableSpeedSignStep.h sumo-1.12.0/src/netedit/elements/additional/GNEVariableSpeedSignStep.h --- sumo-1.11.0/src/netedit/elements/additional/GNEVariableSpeedSignStep.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEVariableSpeedSignStep.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -38,6 +38,9 @@ class GNEVariableSpeedSignStep : public GNEAdditional { public: + /// @brief default constructor + GNEVariableSpeedSignStep(GNENet* net); + /// @brief constructor GNEVariableSpeedSignStep(GNEAdditional* variableSpeedSignParent, SUMOTime time, const std::string& speed); diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEVariableSpeedSignSymbol.cpp sumo-1.12.0/src/netedit/elements/additional/GNEVariableSpeedSignSymbol.cpp --- sumo-1.11.0/src/netedit/elements/additional/GNEVariableSpeedSignSymbol.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEVariableSpeedSignSymbol.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -50,6 +50,11 @@ } +void GNEVariableSpeedSignSymbol::writeAdditional(OutputDevice& /*device*/) const { + // nothing to write +} + + void GNEVariableSpeedSignSymbol::updateGeometry() { // update additional geometry diff -Nru sumo-1.11.0/src/netedit/elements/additional/GNEVariableSpeedSignSymbol.h sumo-1.12.0/src/netedit/elements/additional/GNEVariableSpeedSignSymbol.h --- sumo-1.11.0/src/netedit/elements/additional/GNEVariableSpeedSignSymbol.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/additional/GNEVariableSpeedSignSymbol.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -53,6 +53,11 @@ /// @name Functions related with geometry of element /// @{ + /**@brief writte additional element into a xml file + * @param[in] device device in which write parameters of additional element + */ + void writeAdditional(OutputDevice& device) const; + /// @brief update pre-computed geometry information void updateGeometry(); diff -Nru sumo-1.11.0/src/netedit/elements/data/GNEDataHandler.cpp sumo-1.12.0/src/netedit/elements/data/GNEDataHandler.cpp --- sumo-1.11.0/src/netedit/elements/data/GNEDataHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/data/GNEDataHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/elements/data/GNEDataHandler.h sumo-1.12.0/src/netedit/elements/data/GNEDataHandler.h --- sumo-1.11.0/src/netedit/elements/data/GNEDataHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/data/GNEDataHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/elements/data/GNEDataInterval.cpp sumo-1.12.0/src/netedit/elements/data/GNEDataInterval.cpp --- sumo-1.11.0/src/netedit/elements/data/GNEDataInterval.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/data/GNEDataInterval.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -369,7 +369,7 @@ void -GNEDataInterval::setEnabledAttribute(const int /*enabledAttributes*/) { +GNEDataInterval::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { throw InvalidArgument("Nothing to enable"); } diff -Nru sumo-1.11.0/src/netedit/elements/data/GNEDataInterval.h sumo-1.12.0/src/netedit/elements/data/GNEDataInterval.h --- sumo-1.11.0/src/netedit/elements/data/GNEDataInterval.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/data/GNEDataInterval.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -205,8 +205,8 @@ /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) void setAttribute(SumoXMLAttr key, const std::string& value); - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief Invalidated copy constructor. GNEDataInterval(const GNEDataInterval&) = delete; diff -Nru sumo-1.11.0/src/netedit/elements/data/GNEDataSet.cpp sumo-1.12.0/src/netedit/elements/data/GNEDataSet.cpp --- sumo-1.11.0/src/netedit/elements/data/GNEDataSet.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/data/GNEDataSet.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -121,6 +121,12 @@ GNEDataSet::~GNEDataSet() {} +GNEHierarchicalElement* +GNEDataSet::getHierarchicalElement() { + return nullptr; +} + + const std::string& GNEDataSet::getID() const { return myDataSetID; @@ -397,7 +403,7 @@ void -GNEDataSet::setEnabledAttribute(const int /*enabledAttributes*/) { +GNEDataSet::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { throw InvalidArgument("Nothing to enable"); } diff -Nru sumo-1.11.0/src/netedit/elements/data/GNEDataSet.h sumo-1.12.0/src/netedit/elements/data/GNEDataSet.h --- sumo-1.11.0/src/netedit/elements/data/GNEDataSet.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/data/GNEDataSet.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -84,6 +84,9 @@ /// @brief Destructor ~GNEDataSet(); + /// @brief get GNEHierarchicalElement associated with this AttributeCarrier + GNEHierarchicalElement* getHierarchicalElement(); + /// @brief get ID const std::string& getID() const; @@ -216,8 +219,8 @@ /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) void setAttribute(SumoXMLAttr key, const std::string& value); - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief check if a new GNEDataInterval with the given begin and end can be inserted in current GNEDataSet static bool checkNewInterval(const std::map& dataIntervalMap, const double newBegin, const double newEnd); diff -Nru sumo-1.11.0/src/netedit/elements/data/GNEEdgeData.cpp sumo-1.12.0/src/netedit/elements/data/GNEEdgeData.cpp --- sumo-1.11.0/src/netedit/elements/data/GNEEdgeData.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/data/GNEEdgeData.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -354,7 +354,7 @@ void -GNEEdgeData::setEnabledAttribute(const int /*enabledAttributes*/) { +GNEEdgeData::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { throw InvalidArgument("Nothing to enable"); } diff -Nru sumo-1.11.0/src/netedit/elements/data/GNEEdgeData.h sumo-1.12.0/src/netedit/elements/data/GNEEdgeData.h --- sumo-1.11.0/src/netedit/elements/data/GNEEdgeData.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/data/GNEEdgeData.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -182,8 +182,8 @@ /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) void setAttribute(SumoXMLAttr key, const std::string& value); - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief Invalidated copy constructor. GNEEdgeData(const GNEEdgeData&) = delete; diff -Nru sumo-1.11.0/src/netedit/elements/data/GNEEdgeRelData.cpp sumo-1.12.0/src/netedit/elements/data/GNEEdgeRelData.cpp --- sumo-1.11.0/src/netedit/elements/data/GNEEdgeRelData.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/data/GNEEdgeRelData.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -506,7 +506,7 @@ void -GNEEdgeRelData::setEnabledAttribute(const int /*enabledAttributes*/) { +GNEEdgeRelData::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { throw InvalidArgument("Nothing to enable"); } diff -Nru sumo-1.11.0/src/netedit/elements/data/GNEEdgeRelData.h sumo-1.12.0/src/netedit/elements/data/GNEEdgeRelData.h --- sumo-1.11.0/src/netedit/elements/data/GNEEdgeRelData.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/data/GNEEdgeRelData.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -184,8 +184,8 @@ /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) void setAttribute(SumoXMLAttr key, const std::string& value); - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief Invalidated copy constructor. GNEEdgeRelData(const GNEEdgeRelData&) = delete; diff -Nru sumo-1.11.0/src/netedit/elements/data/GNEGenericData.cpp sumo-1.12.0/src/netedit/elements/data/GNEGenericData.cpp --- sumo-1.11.0/src/netedit/elements/data/GNEGenericData.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/data/GNEGenericData.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/elements/data/GNEGenericData.h sumo-1.12.0/src/netedit/elements/data/GNEGenericData.h --- sumo-1.11.0/src/netedit/elements/data/GNEGenericData.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/data/GNEGenericData.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -288,8 +288,8 @@ /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0; - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - virtual void setEnabledAttribute(const int enabledAttributes) = 0; + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + virtual void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters) = 0; /// @brief Invalidated copy constructor. GNEGenericData(const GNEGenericData&) = delete; diff -Nru sumo-1.11.0/src/netedit/elements/data/GNETAZRelData.cpp sumo-1.12.0/src/netedit/elements/data/GNETAZRelData.cpp --- sumo-1.11.0/src/netedit/elements/data/GNETAZRelData.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/data/GNETAZRelData.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -107,7 +107,7 @@ DataEditMode dataMode = myNet->getViewNet()->getEditModes().dataEditMode; // check if we have to filter generic data if ((dataMode == DataEditMode::DATA_INSPECT) || (dataMode == DataEditMode::DATA_DELETE) || (dataMode == DataEditMode::DATA_SELECT)) { - return isVisibleInspectDeleteSelect(); + return /*isVisibleInspectDeleteSelect()*/ true; } else if (TAZRelDataFrame->shown()) { // check interval if ((TAZRelDataFrame->getIntervalSelector()->getDataInterval() != nullptr) && @@ -541,7 +541,7 @@ void -GNETAZRelData::setEnabledAttribute(const int /*enabledAttributes*/) { +GNETAZRelData::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { throw InvalidArgument("Nothing to enable"); } diff -Nru sumo-1.11.0/src/netedit/elements/data/GNETAZRelData.h sumo-1.12.0/src/netedit/elements/data/GNETAZRelData.h --- sumo-1.11.0/src/netedit/elements/data/GNETAZRelData.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/data/GNETAZRelData.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -209,8 +209,8 @@ /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) void setAttribute(SumoXMLAttr key, const std::string& value); - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief Invalidated copy constructor. GNETAZRelData(const GNETAZRelData&) = delete; diff -Nru sumo-1.11.0/src/netedit/elements/demand/CMakeLists.txt sumo-1.12.0/src/netedit/elements/demand/CMakeLists.txt --- sumo-1.11.0/src/netedit/elements/demand/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -5,8 +5,10 @@ GNEDemandElement.cpp GNERoute.h GNERoute.cpp - GNEVehicleType.h - GNEVehicleType.cpp + GNEVType.h + GNEVType.cpp + GNEVTypeDistribution.h + GNEVTypeDistribution.cpp GNEVehicle.h GNEVehicle.cpp GNEStop.h @@ -19,16 +21,12 @@ GNEWalk.cpp GNERide.h GNERide.cpp - GNEStopPerson.h - GNEStopPerson.cpp GNEContainer.h GNEContainer.cpp GNETranship.h GNETranship.cpp GNETransport.h GNETransport.cpp - GNEStopContainer.h - GNEStopContainer.cpp ) add_library(netedit_elements_demand STATIC ${netedit_elements_demand_SRCS}) diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEContainer.cpp sumo-1.12.0/src/netedit/elements/demand/GNEContainer.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNEContainer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEContainer.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -160,6 +160,14 @@ // member method definitions // =========================================================================== +GNEContainer::GNEContainer(SumoXMLTag tag, GNENet* net) : + GNEDemandElement("", net, GLO_CONTAINER, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {}, {}, {}, {}, {}, {}, {}) { + // reset default values + resetDefaultValues(); +} + + GNEContainer::GNEContainer(SumoXMLTag tag, GNENet* net, GNEDemandElement* pType, const SUMOVehicleParameter& containerparameters) : GNEDemandElement(containerparameters.id, net, (tag == SUMO_TAG_CONTAINERFLOW) ? GLO_CONTAINERFLOW : GLO_CONTAINER, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {}, {}, {}, {}, {}, {pType}, {}), @@ -254,10 +262,10 @@ } -bool +GNEDemandElement::Problem GNEContainer::isDemandElementValid() const { // a single container is always valid - return true; + return Problem::OK; } @@ -387,7 +395,7 @@ glScaled(exaggeration, exaggeration, 1); // draw container depending of detail level if (s.drawDetail(s.detailSettings.personShapes, exaggeration)) { - GUIBasePersonHelper::drawAction_drawAsImage(0, length, width, file, SVS_PEDESTRIAN, exaggeration); + GUIBasePersonHelper::drawAction_drawAsImage(0, length, width, file, SUMOVehicleShape::PEDESTRIAN, exaggeration); } else if (s.drawDetail(s.detailSettings.personCircles, exaggeration)) { GUIBasePersonHelper::drawAction_drawAsCircle(length, width, s.scale * exaggeration); } else if (s.drawDetail(s.detailSettings.personTriangles, exaggeration)) { @@ -399,7 +407,7 @@ GLHelper::popName(); // draw name drawName(containerPosition, s.scale, s.containerName, s.angle); - if (s.personValue.show) { + if (s.personValue.show(this)) { Position containerValuePosition = containerPosition + Position(0, 0.6 * s.containerName.scaledSize(s.scale)); const double value = getColorValue(s, s.containerColorer.getActive()); GLHelper::drawTextSettings(s.personValue, toString(value), containerValuePosition, s.scale, s.angle, GLO_MAX - getType()); @@ -670,12 +678,17 @@ void GNEContainer::enableAttribute(SumoXMLAttr key, GNEUndoList* undoList) { - // obtain a copy of parameter sets - int newParametersSet = parametersSet; - // modify newParametersSet - GNERouteHandler::setFlowParameters(key, newParametersSet); - // add GNEChange_EnableAttribute - undoList->add(new GNEChange_EnableAttribute(this, parametersSet, newParametersSet), true); + switch (key) { + case SUMO_ATTR_END: + case SUMO_ATTR_NUMBER: + case SUMO_ATTR_CONTAINERSPERHOUR: + case SUMO_ATTR_PERIOD: + case SUMO_ATTR_PROB: + undoList->add(new GNEChange_EnableAttribute(this, key, true, parametersSet), true); + return; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } } @@ -833,7 +846,7 @@ } break; case SUMO_ATTR_TYPE: - replaceDemandElementParent(SUMO_TAG_PTYPE, value, 0); + replaceDemandElementParent(SUMO_TAG_VTYPE, value, 0); // set manually vtypeID (needed for saving) vtypeid = value; break; @@ -906,8 +919,12 @@ void -GNEContainer::setEnabledAttribute(const int enabledAttributes) { - parametersSet = enabledAttributes; +GNEContainer::toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters) { + if (value) { + GNERouteHandler::setFlowParameters(key, parametersSet); + } else { + parametersSet = previousParameters; + } } diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEContainer.h sumo-1.12.0/src/netedit/elements/demand/GNEContainer.h --- sumo-1.11.0/src/netedit/elements/demand/GNEContainer.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEContainer.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -102,6 +102,9 @@ FXMenuCommand* myTransformToContainerFlow; }; + /// @brief default constructor + GNEContainer(SumoXMLTag tag, GNENet* net); + /// @brief constructor for containers GNEContainer(SumoXMLTag tag, GNENet* net, GNEDemandElement* pType, const SUMOVehicleParameter& containerparameters); @@ -125,7 +128,7 @@ void writeDemandElement(OutputDevice& device) const; /// @brief check if current demand element is valid to be writed into XML (by default true, can be reimplemented in children) - bool isDemandElementValid() const; + Problem isDemandElementValid() const; /// @brief return a string with the current demand element problem (by default empty, can be reimplemented in children) std::string getDemandElementProblem() const; @@ -317,8 +320,8 @@ /// @brief method for setting the attribute and nothing else void setAttribute(SumoXMLAttr key, const std::string& value); - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief set move shape void setMoveShape(const GNEMoveResult& moveResult); diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEDemandElement.cpp sumo-1.12.0/src/netedit/elements/demand/GNEDemandElement.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNEDemandElement.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEDemandElement.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -172,24 +172,6 @@ } -bool -GNEDemandElement::isDemandElementValid() const { - return true; -} - - -std::string -GNEDemandElement::getDemandElementProblem() const { - return ""; -} - - -void -GNEDemandElement::fixDemandElementProblem() { - throw InvalidArgument(getTagStr() + " cannot fix any problem"); -} - - void GNEDemandElement::openDemandElementDialog() { throw InvalidArgument(getTagStr() + " doesn't have an demand element dialog"); @@ -399,6 +381,40 @@ } +std::vector +GNEDemandElement::getInvalidStops() const { + // get stops + std::vector stops; + for (const auto& stop : getChildDemandElements()) { + if (stop->getTagProperty().getTag() == SUMO_TAG_STOP_LANE) { + stops.push_back(stop); + } + } + // check stops + if (stops.empty()) { + return stops; + } else { + // get sorted stops + std::vector sortedStops; + // continue depending of route + if (getTagProperty().getTag() == SUMO_TAG_ROUTE) { + sortedStops = getSortedStops(getParentEdges()); + } else if (getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED) { + sortedStops = getSortedStops(getChildDemandElements().front()->getParentEdges()); + } + // iterate over sortedStops + for (const auto& sortedStop : sortedStops) { + const auto it = std::find(stops.begin(), stops.end(), sortedStop); + if (it != stops.end()) { + stops.erase(it); + } + } + // return stops not found in sortedStops + return stops; + } +} + + bool GNEDemandElement::drawPersonPlan() const { // check conditions @@ -628,7 +644,7 @@ // Start with the drawing of the area traslating matrix to origin myNet->getViewNet()->drawTranslateFrontAttributeCarrier(this, getType(), offsetFront); // check if draw lane2lane connection or a red line - if (fromLane->getLane2laneConnections().exist(toLane)) { + if (fromLane && fromLane->getLane2laneConnections().exist(toLane)) { // obtain lane2lane geometry const GUIGeometry& lane2laneGeometry = fromLane->getLane2laneConnections().getLane2laneGeometry(toLane); // Set person plan color @@ -664,7 +680,7 @@ } -bool +GNEDemandElement::Problem GNEDemandElement::isPersonPlanValid() const { // get previous child const auto previousChild = getParentDemandElements().at(0)->getPreviousChildDemandElement(this); @@ -682,7 +698,7 @@ } // get first edge GNEEdge* firstEdge = nullptr; - // check edge + // check edge if (getParentLanes().size() == 1) { firstEdge = getParentLanes().front()->getParentEdge(); } else if (getParentEdges().size() > 0) { @@ -694,7 +710,7 @@ } // compare both edges if (previousEdge != firstEdge) { - return false; + return Problem::DISCONNECTED_PLAN; } } // get next child @@ -713,7 +729,7 @@ } // get last edge GNEEdge* lastEdge = nullptr; - // check edge + // check edge if (getParentLanes().size() == 1) { lastEdge = getParentLanes().front()->getParentEdge(); } else if (getParentAdditionals().size() == 1) { @@ -725,15 +741,15 @@ } // compare both edges if (nextEdge != lastEdge) { - return false; + return Problem::DISCONNECTED_PLAN; } } // all ok, then return true - return true; + return Problem::OK; } -std::string +std::string GNEDemandElement::getPersonPlanProblem() const { // get previous child const auto previousChild = getParentDemandElements().at(0)->getPreviousChildDemandElement(this); @@ -751,7 +767,7 @@ } // get first edge GNEEdge* firstEdge = nullptr; - // check edge + // check edge if (getParentLanes().size() == 1) { firstEdge = getParentLanes().front()->getParentEdge(); } else if (getParentEdges().size() > 0) { @@ -762,7 +778,7 @@ firstEdge = getParentDemandElements().at(1)->getParentEdges().front(); } // compare both edges - if (previousEdge != firstEdge) { + if (previousEdge && firstEdge && (previousEdge != firstEdge)) { return "Edge '" + previousEdge->getID() + "' is not consecutive with edge '" + firstEdge->getID() + "'"; } } @@ -782,7 +798,7 @@ } // get last edge GNEEdge* lastEdge = nullptr; - // check edge + // check edge if (getParentLanes().size() == 1) { lastEdge = getParentLanes().front()->getParentEdge(); } else if (getParentAdditionals().size() == 1) { @@ -793,7 +809,7 @@ lastEdge = getParentDemandElements().at(1)->getParentEdges().back(); } // compare both edges - if (nextEdge != lastEdge) { + if (nextEdge && lastEdge && (nextEdge != lastEdge)) { return "Edge '" + lastEdge->getID() + "' is not consecutive with edge '" + nextEdge->getID() + "'"; } } @@ -815,6 +831,24 @@ void +GNEDemandElement::replaceFirstParentJunction(const std::string& value) { + std::vector parentJunctions = getParentJunctions(); + parentJunctions[0] = myNet->getAttributeCarriers()->retrieveJunction(value); + // replace parent junctions + replaceParentElements(this, parentJunctions); +} + + +void +GNEDemandElement::replaceLastParentJunction(const std::string& value) { + std::vector parentJunctions = getParentJunctions(); + parentJunctions[(int)parentJunctions.size() - 1] = myNet->getAttributeCarriers()->retrieveJunction(value); + // replace parent junctions + replaceParentElements(this, parentJunctions); +} + + +void GNEDemandElement::replaceFirstParentEdge(const std::string& value) { std::vector parentEdges = getParentEdges(); parentEdges[0] = myNet->getAttributeCarriers()->retrieveEdge(value); @@ -865,10 +899,73 @@ } +void +GNEDemandElement::setVTypeDistributionParent(const std::string& value) { + std::vector parents; + if (value.size() > 0) { + parents.push_back(myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE_DISTRIBUTION, value)); + } + replaceParentElements(this, parents); +} + + bool GNEDemandElement::checkChildDemandElementRestriction() const { // throw exception because this function mus be implemented in child (see GNEE3Detector) throw ProcessError("Calling non-implemented function checkChildDemandElementRestriction during saving of " + getTagStr() + ". It muss be reimplemented in child class"); } + +GNEDemandElement::SortedStops::SortedStops(GNEEdge* edge_) : + edge(edge_) { +} + + +void +GNEDemandElement::SortedStops::addStop(const GNEDemandElement* stop) { + myStops.push_back(std::make_pair(stop->getAttributeDouble(SUMO_ATTR_ENDPOS), stop)); + // sort stops + std::sort(myStops.begin(), myStops.end()); +} + + +std::vector +GNEDemandElement::getSortedStops(const std::vector& edges) const { + std::vector stops; + // get stops + for (const auto& stop : getChildDemandElements()) { + if (stop->getTagProperty().isStop()) { + stops.push_back(stop); + } + } + // create SortedStops + std::vector sortedStops; + for (const auto& edge : edges) { + sortedStops.push_back(SortedStops(edge)); + } + // iterate over all stops and insert it in sortedStops + for (const auto& stop : stops) { + bool stopLoop = false; + // iterate over sortedStops + for (auto it = sortedStops.begin(); (it != sortedStops.end()) && !stopLoop; it++) { + if ((stop->getParentAdditionals().size() > 0) && (stop->getParentAdditionals().front()->getParentLanes().front()->getParentEdge() == it->edge)) { + it->addStop(stop); + stopLoop = true; + } else if ((stop->getParentLanes().size() > 0) && (stop->getParentLanes().front()->getParentEdge() == it->edge)) { + it->addStop(stop); + stopLoop = true; + } + } + } + // finally return sorted stops + std::vector solution; + for (const auto& sortedStop : sortedStops) { + for (const auto& stop : sortedStop.myStops) { + solution.push_back(stop.second); + } + } + return solution; +} + + /****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEDemandElement.h sumo-1.12.0/src/netedit/elements/demand/GNEDemandElement.h --- sumo-1.11.0/src/netedit/elements/demand/GNEDemandElement.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEDemandElement.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -52,6 +52,19 @@ class GNEDemandElement : public GUIGlObject, public GNEHierarchicalElement, public GNEMoveElement, public GNEPathManager::PathElement { public: + /// @brief friend declaration (needed for vTypes) + friend class GNERouteHandler; + + /// @brief enum class for demandElement problems + enum class Problem { + OK, // There is no problem + INVALID_ELEMENT, // Element is invalid (for example, a route without edges) + INVALID_PATH, // Path (route, trip... ) is not valid (i.e is empty) + DISCONNECTED_PLAN, // Plan element (person, containers) is not connected with the previous or next plan + INVALID_STOPPOSITION, // StopPosition is invalid (only used in stops over edges or lanes + STOP_DOWNSTREAM, // Stops don't follow their route parent + }; + /**@brief Constructor * @param[in] id Gl-id of the demand element element (Must be unique) * @param[in] net pointer to GNEViewNet of this demand element element belongs @@ -157,13 +170,13 @@ virtual void writeDemandElement(OutputDevice& device) const = 0; /// @brief check if current demand element is valid to be writed into XML (by default true, can be reimplemented in children) - virtual bool isDemandElementValid() const; + virtual Problem isDemandElementValid() const = 0; /// @brief return a string with the current demand element problem (by default empty, can be reimplemented in children) - virtual std::string getDemandElementProblem() const; + virtual std::string getDemandElementProblem() const = 0; /// @brief fix demand element problem (by default throw an exception, has to be reimplemented in children) - virtual void fixDemandElementProblem(); + virtual void fixDemandElementProblem() = 0; /// @} /**@brief open DemandElement Dialog @@ -340,6 +353,9 @@ /// @brief get personPlan start position const Position getBeginPosition(const double pedestrianDepartPos) const; + /// @brief get invalid stops + std::vector getInvalidStops() const; + protected: /// @brief demand element geometry (also called "stacked geometry") GUIGeometry myDemandElementGeometry; @@ -370,7 +386,7 @@ const double offsetFront, const double personPlanWidth, const RGBColor& personPlanColor) const; /// @brief check if person plan is valid - bool isPersonPlanValid() const; + Problem isPersonPlanValid() const; /// @brief get person plan problem std::string getPersonPlanProblem() const; @@ -380,12 +396,21 @@ /// @} + /// @name replace parent elements + /// @{ + /// @brief replace demand parent edges void replaceDemandParentEdges(const std::string& value); /// @brief replace demand parent lanes void replaceDemandParentLanes(const std::string& value); + /// @brief replace the first parent junction + void replaceFirstParentJunction(const std::string& value); + + /// @brief replace the last parent junction + void replaceLastParentJunction(const std::string& value); + /// @brief replace the first parent edge void replaceFirstParentEdge(const std::string& value); @@ -401,6 +426,29 @@ /// @brief replace demand element parent void replaceDemandElementParent(SumoXMLTag tag, const std::string& value, const int parentIndex); + /// @brief set VTypeDistribution parent + void setVTypeDistributionParent(const std::string& value); + + /// @} + + /// @brief struct for writting sorted stops + struct SortedStops { + /// @brief constructor + SortedStops(GNEEdge* edge_); + + /// @brief add (and sort) stop + void addStop(const GNEDemandElement* stop); + + /// @brief route's edge + const GNEEdge* edge; + + /// @brief stops sorted by end position + std::vector > myStops; + }; + + /// @brief get sorted stops + std::vector getSortedStops(const std::vector& edges) const; + private: /**@brief check restriction with the number of children * @throw ProcessError if itis called without be reimplemented in child class @@ -410,6 +458,9 @@ /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0; + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + virtual void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters) = 0; + /// @brief set move shape virtual void setMoveShape(const GNEMoveResult& moveResult) = 0; diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEPerson.cpp sumo-1.12.0/src/netedit/elements/demand/GNEPerson.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNEPerson.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEPerson.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -160,6 +160,14 @@ // member method definitions // =========================================================================== +GNEPerson::GNEPerson(SumoXMLTag tag, GNENet* net) : + GNEDemandElement("", net, GLO_PERSON, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {}, {}, {}, {}, {}, {}, {}) { + // reset default values + resetDefaultValues(); +} + + GNEPerson::GNEPerson(SumoXMLTag tag, GNENet* net, GNEDemandElement* pType, const SUMOVehicleParameter& personparameters) : GNEDemandElement(personparameters.id, net, (tag == SUMO_TAG_PERSONFLOW) ? GLO_PERSONFLOW : GLO_PERSON, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {}, {}, {}, {}, {}, {pType}, {}), @@ -254,10 +262,10 @@ } -bool +GNEDemandElement::Problem GNEPerson::isDemandElementValid() const { // a single person is always valid - return true; + return Problem::OK; } @@ -387,7 +395,7 @@ glScaled(exaggeration, exaggeration, 1); // draw person depending of detail level if (s.drawDetail(s.detailSettings.personShapes, exaggeration)) { - GUIBasePersonHelper::drawAction_drawAsImage(0, length, width, file, SVS_PEDESTRIAN, exaggeration); + GUIBasePersonHelper::drawAction_drawAsImage(0, length, width, file, SUMOVehicleShape::PEDESTRIAN, exaggeration); } else if (s.drawDetail(s.detailSettings.personCircles, exaggeration)) { GUIBasePersonHelper::drawAction_drawAsCircle(length, width, s.scale * exaggeration); } else if (s.drawDetail(s.detailSettings.personTriangles, exaggeration)) { @@ -399,7 +407,7 @@ GLHelper::popName(); // draw name drawName(personPosition, s.scale, s.personName, s.angle); - if (s.personValue.show) { + if (s.personValue.show(this)) { Position personValuePosition = personPosition + Position(0, 0.6 * s.personName.scaledSize(s.scale)); const double value = getColorValue(s, s.personColorer.getActive()); GLHelper::drawTextSettings(s.personValue, toString(value), personValuePosition, s.scale, s.angle, GLO_MAX - getType()); @@ -527,6 +535,8 @@ // first check if first person plan is a stop if (personPlan->getTagProperty().isStopPerson()) { return personPlan->getPositionInView(); + } else if (personPlan->getParentJunctions().size() > 0) { + return personPlan->getParentJunctions().front()->getPositionInView(); } else { // declare lane lane GNELane* lane = nullptr; @@ -670,12 +680,17 @@ void GNEPerson::enableAttribute(SumoXMLAttr key, GNEUndoList* undoList) { - // obtain a copy of parameter sets - int newParametersSet = parametersSet; - // modify newParametersSet - GNERouteHandler::setFlowParameters(key, newParametersSet); - // add GNEChange_EnableAttribute - undoList->add(new GNEChange_EnableAttribute(this, parametersSet, newParametersSet), true); + switch (key) { + case SUMO_ATTR_END: + case SUMO_ATTR_NUMBER: + case SUMO_ATTR_CONTAINERSPERHOUR: + case SUMO_ATTR_PERIOD: + case SUMO_ATTR_PROB: + undoList->add(new GNEChange_EnableAttribute(this, key, true, parametersSet), true); + return; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } } @@ -833,7 +848,7 @@ } break; case SUMO_ATTR_TYPE: - replaceDemandElementParent(SUMO_TAG_PTYPE, value, 0); + replaceDemandElementParent(SUMO_TAG_VTYPE, value, 0); // set manually vtypeID (needed for saving) vtypeid = value; break; @@ -906,8 +921,12 @@ void -GNEPerson::setEnabledAttribute(const int enabledAttributes) { - parametersSet = enabledAttributes; +GNEPerson::toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters) { + if (value) { + GNERouteHandler::setFlowParameters(key, parametersSet); + } else { + parametersSet = previousParameters; + } } diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEPerson.h sumo-1.12.0/src/netedit/elements/demand/GNEPerson.h --- sumo-1.11.0/src/netedit/elements/demand/GNEPerson.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEPerson.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -102,6 +102,9 @@ FXMenuCommand* myTransformToPersonFlow; }; + /// @brief default constructor + GNEPerson(SumoXMLTag tag, GNENet* net); + /// @brief constructor for persons GNEPerson(SumoXMLTag tag, GNENet* net, GNEDemandElement* pType, const SUMOVehicleParameter& personparameters); @@ -125,7 +128,7 @@ void writeDemandElement(OutputDevice& device) const; /// @brief check if current demand element is valid to be writed into XML (by default true, can be reimplemented in children) - bool isDemandElementValid() const; + Problem isDemandElementValid() const; /// @brief return a string with the current demand element problem (by default empty, can be reimplemented in children) std::string getDemandElementProblem() const; @@ -317,8 +320,8 @@ /// @brief method for setting the attribute and nothing else void setAttribute(SumoXMLAttr key, const std::string& value); - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief set move shape void setMoveShape(const GNEMoveResult& moveResult); diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEPersonTrip.cpp sumo-1.12.0/src/netedit/elements/demand/GNEPersonTrip.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNEPersonTrip.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEPersonTrip.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -35,6 +35,15 @@ // method definitions // =========================================================================== +GNEPersonTrip::GNEPersonTrip(SumoXMLTag tag, GNENet* net) : + GNEDemandElement("", net, GLO_PERSONTRIP, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {}, {}, {}, {}, {}, {}, {}), +myArrivalPosition(0) { + // reset default values + resetDefaultValues(); +} + + GNEPersonTrip::GNEPersonTrip(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, double arrivalPosition, const std::vector& types, const std::vector& modes) : GNEDemandElement(personParent, net, GLO_PERSONTRIP, GNE_TAG_PERSONTRIP_EDGE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, @@ -55,13 +64,24 @@ } +GNEPersonTrip::GNEPersonTrip(GNENet* net, GNEDemandElement* personParent, GNEJunction* fromJunction, GNEJunction* toJunction, + double arrivalPosition, const std::vector& types, const std::vector& modes) : + GNEDemandElement(personParent, net, GLO_PERSONTRIP, GNE_TAG_PERSONTRIP_JUNCTIONS, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, { + fromJunction, toJunction +}, {}, {}, {}, {}, {}, {personParent}, {}), +myArrivalPosition(arrivalPosition), +myVTypes(types), +myModes(modes) { +} + + GNEPersonTrip::~GNEPersonTrip() {} GNEMoveOperation* GNEPersonTrip::getMoveOperation() { // avoid move person plan that ends in busStop - if (getParentAdditionals().size() > 0) { + if ((getParentAdditionals().size() > 0) || (getParentJunctions().size() > 0)) { return nullptr; } // get geometry end pos @@ -109,12 +129,16 @@ // check if from attribute is enabled if (isAttributeEnabled(SUMO_ATTR_FROM)) { device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID()); + } else if (isAttributeEnabled(SUMO_ATTR_FROMJUNCTION)) { + device.writeAttr(SUMO_ATTR_FROMJUNCTION, getParentJunctions().front()->getID()); } - // write to depending if personplan ends in a busStop + // write to depending if personplan ends in a busStop, edge or junction if (getParentAdditionals().size() > 0) { device.writeAttr(SUMO_ATTR_BUS_STOP, getParentAdditionals().back()->getID()); - } else { + } else if (getParentEdges().size() > 0) { device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID()); + } else { + device.writeAttr(SUMO_ATTR_TOJUNCTION, getParentJunctions().back()->getID()); } // avoid writte arrival positions in person trip to busStop if (!((myTagProperty.getTag() == GNE_TAG_PERSONTRIP_BUSSTOP) && (myArrivalPosition == 0))) { @@ -138,7 +162,7 @@ } -bool +GNEDemandElement::Problem GNEPersonTrip::isDemandElementValid() const { return isPersonPlanValid(); } @@ -221,13 +245,24 @@ GNEPersonTrip::drawGL(const GUIVisualizationSettings& s) const { // force draw path myNet->getPathManager()->forceDrawPath(s, this); + // special case for junction walks + if (getParentJunctions().size() > 0) { + // get person parent + const GNEDemandElement* personParent = getParentDemandElements().front(); + if ((personParent->getChildDemandElements().size() > 0) && (personParent->getChildDemandElements().front() == this)) { + personParent->drawGL(s); + } + } } void GNEPersonTrip::computePathElement() { - // calculate path - myNet->getPathManager()->calculatePathLanes(this, SVC_PEDESTRIAN, {getFirstPathLane(), getLastPathLane()}); + // avoid calculate for junctions + if (getParentJunctions().empty()) { + // calculate path + myNet->getPathManager()->calculatePathLanes(this, SVC_PEDESTRIAN, {getFirstPathLane(), getLastPathLane()}); + } // update geometry updateGeometry(); } @@ -249,14 +284,20 @@ GNELane* GNEPersonTrip::getFirstPathLane() const { - return getParentEdges().front()->getLaneByDisallowedVClass(SVC_PEDESTRIAN); + if (getParentJunctions().size() > 0) { + throw ProcessError("This personTrip use junctions"); + } else { + return getParentEdges().front()->getLaneByDisallowedVClass(SVC_PEDESTRIAN); + } } GNELane* GNEPersonTrip::getLastPathLane() const { - // check if personPlan ends in a BusStop - if (getParentAdditionals().size() > 0) { + // check if personPlan ends in a BusStop or junction + if (getParentJunctions().size() > 0) { + throw ProcessError("This personTrip use junctions"); + } else if (getParentAdditionals().size() > 0) { return getParentAdditionals().front()->getParentLanes().front(); } else { return getParentEdges().back()->getLaneByDisallowedVClass(SVC_PEDESTRIAN); @@ -276,6 +317,10 @@ return getParentEdges().back()->getID(); case GNE_ATTR_TO_BUSSTOP: return getParentAdditionals().back()->getID(); + case SUMO_ATTR_FROMJUNCTION: + return getParentJunctions().front()->getID(); + case SUMO_ATTR_TOJUNCTION: + return getParentJunctions().back()->getID(); // specific person plan attributes case SUMO_ATTR_MODES: return joinToString(myModes, " "); @@ -305,7 +350,9 @@ GNEPersonTrip::getAttributeDouble(SumoXMLAttr key) const { switch (key) { case SUMO_ATTR_ARRIVALPOS: - if (myArrivalPosition != -1) { + if (getParentJunctions().size() > 0) { + return 0; + } else if (myArrivalPosition != -1) { return myArrivalPosition; } else { return (getLastPathLane()->getLaneShape().length() - POSITION_EPS); @@ -320,15 +367,19 @@ GNEPersonTrip::getAttributePosition(SumoXMLAttr key) const { switch (key) { case SUMO_ATTR_ARRIVALPOS: { - // get lane shape - const PositionVector& laneShape = getLastPathLane()->getLaneShape(); - // continue depending of arrival position - if (myArrivalPosition == 0) { - return laneShape.front(); - } else if ((myArrivalPosition == -1) || (myArrivalPosition >= laneShape.length2D())) { - return laneShape.back(); + if (getParentJunctions().size() > 0) { + return getParentJunctions().back()->getPositionInView(); } else { - return laneShape.positionAtOffset2D(myArrivalPosition); + // get lane shape + const PositionVector& laneShape = getLastPathLane()->getLaneShape(); + // continue depending of arrival position + if (myArrivalPosition == 0) { + return laneShape.front(); + } else if ((myArrivalPosition == -1) || (myArrivalPosition >= laneShape.length2D())) { + return laneShape.back(); + } else { + return laneShape.positionAtOffset2D(myArrivalPosition); + } } } default: @@ -342,6 +393,7 @@ switch (key) { // Common person plan attributes case SUMO_ATTR_FROM: + case SUMO_ATTR_FROMJUNCTION: case SUMO_ATTR_ARRIVALPOS: case SUMO_ATTR_MODES: case SUMO_ATTR_VTYPES: @@ -350,7 +402,8 @@ undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); break; // special case for "to" attributes - case SUMO_ATTR_TO: { + case SUMO_ATTR_TO: + case SUMO_ATTR_TOJUNCTION: { // get next personPlan GNEDemandElement* nextPersonPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this); // continue depending of nextPersonPlan @@ -394,6 +447,9 @@ case SUMO_ATTR_FROM: case SUMO_ATTR_TO: return SUMOXMLDefinitions::isValidNetID(value) && (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr); + case SUMO_ATTR_FROMJUNCTION: + case SUMO_ATTR_TOJUNCTION: + return SUMOXMLDefinitions::isValidNetID(value) && (myNet->getAttributeCarriers()->retrieveJunction(value, false) != nullptr); case GNE_ATTR_TO_BUSSTOP: return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr); // specific person plan attributes @@ -441,10 +497,12 @@ bool GNEPersonTrip::isAttributeEnabled(SumoXMLAttr key) const { - if (key == SUMO_ATTR_FROM) { - return (getParentDemandElements().at(0)->getPreviousChildDemandElement(this) == nullptr); - } else { - return true; + switch (key) { + case SUMO_ATTR_FROM: + case SUMO_ATTR_FROMJUNCTION: + return (getParentDemandElements().at(0)->getPreviousChildDemandElement(this) == nullptr); + default: + return true; } } @@ -459,6 +517,8 @@ GNEPersonTrip::getHierarchyName() const { if (myTagProperty.getTag() == GNE_TAG_PERSONTRIP_EDGE) { return "personTrip: " + getParentEdges().front()->getID() + " -> " + getParentEdges().back()->getID(); + } else if (myTagProperty.getTag() == GNE_TAG_PERSONTRIP_JUNCTIONS) { + return "personTrip: " + getParentJunctions().front()->getID() + " -> " + getParentJunctions().back()->getID(); } else if (myTagProperty.getTag() == GNE_TAG_PERSONTRIP_BUSSTOP) { return "personTrip: " + getParentEdges().front()->getID() + " -> " + getParentAdditionals().front()->getID(); } else { @@ -497,6 +557,18 @@ // compute person trip computePathElement(); break; + case SUMO_ATTR_FROMJUNCTION: + // change first junction + replaceFirstParentJunction(value); + // compute person trip + computePathElement(); + break; + case SUMO_ATTR_TOJUNCTION: + // change last junction + replaceLastParentJunction(value); + // compute person trip + computePathElement(); + break; // specific person plan attributes case SUMO_ATTR_MODES: myModes = GNEAttributeCarrier::parse >(value); @@ -529,8 +601,8 @@ void -GNEPersonTrip::setEnabledAttribute(const int /*enabledAttributes*/) { - // +GNEPersonTrip::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { + // nothing to toogle } diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEPersonTrip.h sumo-1.12.0/src/netedit/elements/demand/GNEPersonTrip.h --- sumo-1.11.0/src/netedit/elements/demand/GNEPersonTrip.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEPersonTrip.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ @@ -36,6 +36,9 @@ class GNEPersonTrip : public GNEDemandElement, public Parameterised { public: + /// @brief default constructor + GNEPersonTrip(SumoXMLTag tag, GNENet* net); + /**@brief parameter constructor for person edge->edge * @param[in] viewNet view in which this PersonTrip is placed * @param[in] personParent person parent @@ -60,6 +63,18 @@ GNEPersonTrip(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* toBusStop, double arrivalPosition, const std::vector& types, const std::vector& modes); + /**@brief parameter constructor for person junction->junction + * @param[in] viewNet view in which this PersonTrip is placed + * @param[in] personParent person parent + * @param[in] fromJunction from junction + * @param[in] toJunction to junction + * @param[in] arrivalPosition arrival position on the destination junction + * @param[in] types list of possible vehicle types to take + * @param[in] modes list of possible traffic modes + */ + GNEPersonTrip(GNENet* net, GNEDemandElement* personParent, GNEJunction* fromJunction, GNEJunction* toJunction, + double arrivalPosition, const std::vector& types, const std::vector& modes); + /// @brief destructor ~GNEPersonTrip(); @@ -74,7 +89,7 @@ void writeDemandElement(OutputDevice& device) const; /// @brief check if current demand element is valid to be writed into XML (by default true, can be reimplemented in children) - bool isDemandElementValid() const; + Problem isDemandElementValid() const; /// @brief return a string with the current demand element problem (by default empty, can be reimplemented in children) std::string getDemandElementProblem() const; @@ -245,8 +260,8 @@ /// @brief method for setting the attribute and nothing else void setAttribute(SumoXMLAttr key, const std::string& value); - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief set move shape void setMoveShape(const GNEMoveResult& moveResult); diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNERide.cpp sumo-1.12.0/src/netedit/elements/demand/GNERide.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNERide.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNERide.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -33,6 +33,15 @@ // method definitions // =========================================================================== +GNERide::GNERide(SumoXMLTag tag, GNENet* net) : + GNEDemandElement("", net, GLO_RIDE, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {}, {}, {}, {}, {}, {}, {}), +myArrivalPosition(0) { + // reset default values + resetDefaultValues(); +} + + GNERide::GNERide(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, double arrivalPosition, const std::vector& lines) : GNEDemandElement(personParent, net, GLO_RIDE, GNE_TAG_RIDE_EDGE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, @@ -132,7 +141,7 @@ } -bool +GNEDemandElement::Problem GNERide::isDemandElementValid() const { return isPersonPlanValid(); } @@ -528,8 +537,8 @@ void -GNERide::setEnabledAttribute(const int /*enabledAttributes*/) { - // +GNERide::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { + // nothing to toogle } diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNERide.h sumo-1.12.0/src/netedit/elements/demand/GNERide.h --- sumo-1.11.0/src/netedit/elements/demand/GNERide.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNERide.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ @@ -36,6 +36,9 @@ class GNERide : public GNEDemandElement, public Parameterised { public: + /// @brief default constructor + GNERide(SumoXMLTag tag, GNENet* net); + /**@brief parameter constructor for person edge->edge * @param[in] viewNet view in which this Ride is placed * @param[in] personParent person parent @@ -74,7 +77,7 @@ void writeDemandElement(OutputDevice& device) const; /// @brief check if current demand element is valid to be writed into XML (by default true, can be reimplemented in children) - bool isDemandElementValid() const; + Problem isDemandElementValid() const; /// @brief return a string with the current demand element problem (by default empty, can be reimplemented in children) std::string getDemandElementProblem() const; @@ -242,8 +245,8 @@ /// @brief method for setting the attribute and nothing else void setAttribute(SumoXMLAttr key, const std::string& value); - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief set move shape void setMoveShape(const GNEMoveResult& moveResult); diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNERoute.cpp sumo-1.12.0/src/netedit/elements/demand/GNERoute.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNERoute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNERoute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -70,15 +70,33 @@ // GNERoute - methods // =========================================================================== +GNERoute::GNERoute(SumoXMLTag tag, GNENet* net) : + GNEDemandElement("", net, GLO_ROUTE, tag, + GNEPathManager::PathElement::Options::DEMAND_ELEMENT | GNEPathManager::PathElement::Options::ROUTE, +{}, {}, {}, {}, {}, {}, {}, {}), +Parameterised(), +myColor(RGBColor::YELLOW), +myCustomColor(false), +myRepeat(0), +myCycleTime(0), +myVClass(SVC_PASSENGER) { + // reset default values + resetDefaultValues(); +} + + GNERoute::GNERoute(GNENet* net) : GNEDemandElement(net->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_ROUTE), net, GLO_ROUTE, SUMO_TAG_ROUTE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT | GNEPathManager::PathElement::Options::ROUTE, {}, {}, {}, {}, {}, {}, {}, {}), Parameterised(), myColor(RGBColor::YELLOW), +myCustomColor(false), myRepeat(0), myCycleTime(0), myVClass(SVC_PASSENGER) { + // reset default values + resetDefaultValues(); } @@ -89,6 +107,7 @@ {}, edges, {}, {}, {}, {}, {}, {}), Parameterised(parameters), myColor(color), +myCustomColor(color != RGBColor(false)), myRepeat(repeat), myCycleTime(cycleTime), myVClass(vClass) { @@ -102,6 +121,7 @@ {}, edges, {}, {}, {}, {}, {vehicleParent}, {}), Parameterised(parameters), myColor(color), +myCustomColor(color != RGBColor::INVISIBLE), myRepeat(repeat), myCycleTime(cycleTime), myVClass(vehicleParent->getVClass()) { @@ -114,6 +134,7 @@ {}, route->getParentEdges(), {}, {}, {}, {}, {}, {}), Parameterised(), myColor(route->getColor()), +myCustomColor(!route->getAttribute(SUMO_ATTR_COLOR).empty()), myRepeat(parse(route->getAttribute(SUMO_ATTR_REPEAT))), myCycleTime(parse(route->getAttribute(SUMO_ATTR_CYCLETIME))), myVClass(route->getVClass()) { @@ -159,22 +180,25 @@ void GNERoute::writeDemandElement(OutputDevice& device) const { device.openTag(SUMO_TAG_ROUTE); + // write id only for non-embedded routes + if (myTagProperty.getTag() == SUMO_TAG_ROUTE) { + device.writeAttr(SUMO_ATTR_ID, getID()); + } device.writeAttr(SUMO_ATTR_EDGES, parseIDs(getParentEdges())); - device.writeAttr(SUMO_ATTR_COLOR, toString(myColor)); + if (myCustomColor) { + device.writeAttr(SUMO_ATTR_COLOR, toString(myColor)); + } if (myRepeat != 0) { device.writeAttr(SUMO_ATTR_REPEAT, toString(myRepeat)); } if (myCycleTime != 0) { - device.writeAttr(SUMO_ATTR_CYCLETIME, toString(myCycleTime)); + device.writeAttr(SUMO_ATTR_CYCLETIME, time2string(myCycleTime)); } - // write extra attributes depending if is an embedded route + // write sorted stops if (myTagProperty.getTag() == SUMO_TAG_ROUTE) { - device.writeAttr(SUMO_ATTR_ID, getID()); - // write stops associated to this route - for (const auto& stop : getChildDemandElements()) { - if (stop->getTagProperty().isStop()) { - stop->writeDemandElement(device); - } + const auto sortedStops = getSortedStops(getParentEdges()); + for (const auto& stop : sortedStops) { + stop->writeDemandElement(device); } } // write parameters @@ -184,22 +208,49 @@ } -bool +GNEDemandElement::Problem GNERoute::isDemandElementValid() const { + // get sorted stops and check number + std::vector stops; + for (const auto& routeChild : getChildDemandElements()) { + if (routeChild->getTagProperty().isStop()) { + stops.push_back(routeChild); + } + } + const auto sortedStops = getSortedStops(getParentEdges()); + if (sortedStops.size() != stops.size()) { + return Problem::STOP_DOWNSTREAM; + } + // check parent edges if ((getParentEdges().size() == 2) && (getParentEdges().at(0) == getParentEdges().at(1))) { // from and to are the same edges, then return true - return true; + return Problem::OK; } else if (getParentEdges().size() > 0) { // check that exist a connection between every edge - return isRouteValid(getParentEdges()).empty(); + if (isRouteValid(getParentEdges()).size() > 0) { + return Problem::INVALID_PATH; + } else { + return Problem::OK; + } } else { - return false; + return Problem::INVALID_ELEMENT; } } std::string GNERoute::getDemandElementProblem() const { + // get sorted stops and check number + std::vector stops; + for (const auto& routeChild : getChildDemandElements()) { + if (routeChild->getTagProperty().isStop()) { + stops.push_back(routeChild); + } + } + const auto sortedStops = getSortedStops(getParentEdges()); + if (sortedStops.size() != stops.size()) { + return toString(stops.size() - sortedStops.size()) + " stops are outside of route (downstream)"; + } // return string with the problem obtained from isRouteValid return isRouteValid(getParentEdges()); } @@ -219,7 +270,15 @@ const RGBColor& GNERoute::getColor() const { - return myColor; + if (myCustomColor) { + return myColor; + } else if (myTagProperty.getTag() == GNE_TAG_ROUTE_EMBEDDED) { + return getParentDemandElements().front()->getColor(); + } else if (getChildDemandElements().size() > 0) { + return getChildDemandElements().front()->getColor(); + } else { + return RGBColor::YELLOW; + } } @@ -495,7 +554,11 @@ case SUMO_ATTR_EDGES: return parseIDs(getParentEdges()); case SUMO_ATTR_COLOR: - return toString(myColor); + if (myCustomColor) { + return toString(myColor); + } else { + return ""; + } case SUMO_ATTR_REPEAT: return toString(myRepeat); case SUMO_ATTR_CYCLETIME: @@ -599,7 +662,11 @@ return false; } case SUMO_ATTR_COLOR: - return canParse(value); + if (value.empty()) { + return true; + } else { + return canParse(value); + } case SUMO_ATTR_REPEAT: return canParse(value); case SUMO_ATTR_CYCLETIME: @@ -702,7 +769,13 @@ computePathElement(); break; case SUMO_ATTR_COLOR: - myColor = parse(value); + if (value.empty()) { + myCustomColor = false; + myColor = RGBColor::INVISIBLE; + } else { + myCustomColor = true; + myColor = parse(value); + } break; case SUMO_ATTR_REPEAT: myRepeat = parse(value); @@ -727,8 +800,8 @@ void -GNERoute::setEnabledAttribute(const int /*enabledAttributes*/) { - // +GNERoute::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { + // nothing to toogle } diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNERoute.h sumo-1.12.0/src/netedit/elements/demand/GNERoute.h --- sumo-1.11.0/src/netedit/elements/demand/GNERoute.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNERoute.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ @@ -64,9 +64,10 @@ GNERoutePopupMenu() {} }; - /**@brief default constructor - * @param[in] viewNet view in which this Route is placed - */ + /// @brief default constructor + GNERoute(SumoXMLTag tag, GNENet* net); + + /// @brief default constructor (used in calibrators) GNERoute(GNENet* net); /**@brief parameter constructor @@ -75,7 +76,7 @@ * @param[in] vClass vehicle class * @param[in] edges route edges * @param[in] color route color - * @param[in] repea tthe number of times that the edges of this route shall be repeated + * @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] parameters generic parameters */ @@ -87,7 +88,7 @@ * @param[in] vehicleParent vehicle parent of this embedded route * @param[in] edges route edges * @param[in] color route color - * @param[in] repea tthe number of times that the edges of this route shall be repeated + * @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] parameters generic parameters */ @@ -111,7 +112,7 @@ void writeDemandElement(OutputDevice& device) const; /// @brief check if current demand element is valid to be writed into XML (by default true, can be reimplemented in children) - bool isDemandElementValid() const; + Problem isDemandElementValid() const; /// @brief return a string with the current demand element problem (by default empty, can be reimplemented in children) std::string getDemandElementProblem() const; @@ -278,6 +279,9 @@ /// @brief route color RGBColor myColor; + /// @brief flag for enable/disable color + bool myCustomColor; + /// @brief repeat int myRepeat; @@ -291,8 +295,8 @@ /// @brief method for setting the attribute and nothing else void setAttribute(SumoXMLAttr key, const std::string& value); - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief set move shape void setMoveShape(const GNEMoveResult& moveResult); diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNERouteHandler.cpp sumo-1.12.0/src/netedit/elements/demand/GNERouteHandler.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNERouteHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNERouteHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -21,12 +21,12 @@ #include #include #include +#include #include +#include #include "GNEContainer.h" -#include "GNEStopContainer.h" #include "GNEPerson.h" -#include "GNEStopPerson.h" #include "GNEPersonTrip.h" #include "GNERide.h" #include "GNERoute.h" @@ -35,7 +35,8 @@ #include "GNETranship.h" #include "GNETransport.h" #include "GNEVehicle.h" -#include "GNEVehicleType.h" +#include "GNEVType.h" +#include "GNEVTypeDistribution.h" #include "GNEWalk.h" @@ -57,24 +58,31 @@ void -GNERouteHandler::buildVType(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVTypeParameter& vTypeParameter) { - // first check if we're creating a vType or a pType - SumoXMLTag vTypeTag = (vTypeParameter.vehicleClass == SVC_PEDESTRIAN) ? SUMO_TAG_PTYPE : SUMO_TAG_VTYPE; - // check if loaded vType/pType is a default vtype - if ((vTypeParameter.id == DEFAULT_VTYPE_ID) || (vTypeParameter.id == DEFAULT_PEDTYPE_ID) || (vTypeParameter.id == DEFAULT_BIKETYPE_ID)) { +GNERouteHandler::buildVType(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVTypeParameter& vTypeParameter) { + // check vTypeDistribution + const bool vTypeDistribution = sumoBaseObject->getParentSumoBaseObject() && (sumoBaseObject->getParentSumoBaseObject()->getTag() == SUMO_TAG_VTYPE_DISTRIBUTION); + // check if loaded type is a default type + if (DEFAULT_VTYPES.count(vTypeParameter.id) > 0) { // overwrite default vehicle type - GNEVehicleType::overwriteVType(myNet->getAttributeCarriers()->retrieveDemandElement(vTypeTag, vTypeParameter.id, false), vTypeParameter, myNet->getViewNet()->getUndoList()); - } else if (myNet->getAttributeCarriers()->retrieveDemandElement(vTypeTag, vTypeParameter.id, false) != nullptr) { - WRITE_ERROR("There is another " + toString(vTypeTag) + " with the same ID='" + vTypeParameter.id + "'."); + GNEVType::overwriteVType(myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, vTypeParameter.id, false), vTypeParameter, myNet->getViewNet()->getUndoList()); + } else if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, vTypeParameter.id, false) != nullptr) { + WRITE_ERROR("There is another " + toString(SUMO_TAG_VTYPE) + " with the same ID='" + vTypeParameter.id + "'."); } else { // create vType/pType using myCurrentVType - GNEDemandElement* vType = new GNEVehicleType(myNet, vTypeParameter, vTypeTag); + GNEDemandElement* vType = new GNEVType(myNet, vTypeParameter); if (myUndoDemandElements) { myNet->getViewNet()->getUndoList()->begin(GUIIcon::VTYPE, "add " + vType->getTagStr()); myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vType, true), true); + // check if place this vType within a vTypeDistribution + if (vTypeDistribution) { + vType->setAttribute(GNE_ATTR_VTYPE_DISTRIBUTION, sumoBaseObject->getParentSumoBaseObject()->getStringAttribute(SUMO_ATTR_ID), myNet->getViewNet()->getUndoList()); + } myNet->getViewNet()->getUndoList()->end(); } else { myNet->getAttributeCarriers()->insertDemandElement(vType); + if (vTypeDistribution) { + vType->setAttribute(GNE_ATTR_VTYPE_DISTRIBUTION, sumoBaseObject->getParentSumoBaseObject()->getStringAttribute(SUMO_ATTR_ID)); + } vType->incRef("buildVType"); } } @@ -82,9 +90,54 @@ void -GNERouteHandler::buildVTypeDistribution(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const std::string& /*id*/) { - // unsuported - WRITE_ERROR("NETEDIT doesn't support vType distributions"); +GNERouteHandler::buildVTypeDistribution(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, + const std::vector& vTypes) { + // first check conditions + if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE_DISTRIBUTION, id, false) != nullptr) { + WRITE_ERROR("There is another " + toString(SUMO_TAG_VTYPE) + " with the same ID='" + id + "'."); + } else if (vTypes.empty() && sumoBaseObject->getSumoBaseObjectChildren().empty()) { + WRITE_ERROR(toString(SUMO_TAG_VTYPE_DISTRIBUTION) + " need at least one " + toString(SUMO_TAG_VTYPE)); + } else { + bool checkVTypesOK = true; + // check vTypes + for (const auto& vType : vTypes) { + if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, vType, false) == nullptr) { + WRITE_ERROR(toString(SUMO_TAG_VTYPE) + " with id '" + vType + "' doesn't exist in " + toString(SUMO_TAG_VTYPE_DISTRIBUTION) + " '" + id + "'"); + checkVTypesOK = false; + } + } + // now check childrens + for (const auto& child : sumoBaseObject->getSumoBaseObjectChildren()) { + if (child->hasStringAttribute(SUMO_ATTR_ID) == false) { + WRITE_ERROR("Invalid definition for " + toString(SUMO_TAG_VTYPE) + " in " + toString(SUMO_TAG_VTYPE_DISTRIBUTION) + " '" + id + "'"); + checkVTypesOK = false; + } else if (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, child->getStringAttribute(SUMO_ATTR_ID), false) != nullptr) { + WRITE_ERROR(toString(SUMO_TAG_VTYPE) + " with id '" + child->getStringAttribute(SUMO_ATTR_ID) + "' cannot be created in " + toString(SUMO_TAG_VTYPE_DISTRIBUTION) + " '" + id + "'"); + checkVTypesOK = false; + } + } + // if all ok, then create vTypeDistribution + if (checkVTypesOK) { + GNEVTypeDistribution* vTypeDistribution = new GNEVTypeDistribution(myNet, id); + if (myUndoDemandElements) { + myNet->getViewNet()->getUndoList()->begin(GUIIcon::VTYPEDISTRIBUTION, "add " + vTypeDistribution->getTagStr()); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vTypeDistribution, true), true); + // set this vTypeDistribution as parent of the other vTypes + for (const auto& vTypeID : vTypes) { + auto vType = myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, vTypeID); + vType->setAttribute(GNE_ATTR_VTYPE_DISTRIBUTION, id, myNet->getViewNet()->getUndoList()); + } + myNet->getViewNet()->getUndoList()->end(); + } else { + myNet->getAttributeCarriers()->insertDemandElement(vTypeDistribution); + vTypeDistribution->incRef("buildVType"); + for (const auto& vTypeID : vTypes) { + auto vType = myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, vTypeID); + vType->setAttribute(GNE_ATTR_VTYPE_DISTRIBUTION, id); + } + } + } + } } @@ -289,12 +342,46 @@ void +GNERouteHandler::buildTrip(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& vehicleParameters, + const std::string& fromJunctionID, const std::string& toJunctionID) { + // parse junctions + const auto fromJunction = parseJunction(SUMO_TAG_TRIP, fromJunctionID); + const auto toJunction = parseJunction(SUMO_TAG_TRIP, toJunctionID); + // check if exist another vehicle with the same ID (note: Vehicles, Flows and Trips share namespace) + if (fromJunction && toJunction && !isVehicleIdDuplicated(myNet, vehicleParameters.id)) { + // obtain vtypes + GNEDemandElement* vType = myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, vehicleParameters.vtypeid, false); + if (vType == nullptr) { + WRITE_ERROR("Invalid vehicle type '" + vehicleParameters.vtypeid + "' used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'."); + } else { + // create trip using vehicleParameters + GNEDemandElement* flow = new GNEVehicle(GNE_TAG_TRIP_JUNCTIONS, myNet, vType, fromJunction, toJunction, vehicleParameters); + if (myUndoDemandElements) { + myNet->getViewNet()->getUndoList()->begin(flow->getTagProperty().getGUIIcon(), "add " + flow->getTagStr()); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(flow, true), true); + myNet->getViewNet()->getUndoList()->end(); + } else { + myNet->getAttributeCarriers()->insertDemandElement(flow); + // set vehicle as child of vType + vType->addChildElement(flow); + flow->incRef("buildFlow"); + // add reference in all junctions + fromJunction->addChildElement(flow); + toJunction->addChildElement(flow); + } + // compute path + flow->computePathElement(); + } + } +} + +void GNERouteHandler::buildFlow(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& vehicleParameters, const std::string& fromEdgeID, const std::string& toEdgeID, const std::vector& viaIDs) { // parse edges - const auto fromEdge = parseEdge(SUMO_TAG_TRIP, fromEdgeID); - const auto toEdge = parseEdge(SUMO_TAG_TRIP, toEdgeID); - const auto via = parseEdges(SUMO_TAG_TRIP, viaIDs); + const auto fromEdge = parseEdge(SUMO_TAG_FLOW, fromEdgeID); + const auto toEdge = parseEdge(SUMO_TAG_FLOW, toEdgeID); + const auto via = parseEdges(SUMO_TAG_FLOW, viaIDs); // check if exist another vehicle with the same ID (note: Vehicles, Flows and Trips share namespace) if (fromEdge && toEdge && !isVehicleIdDuplicated(myNet, vehicleParameters.id)) { // obtain vtypes @@ -336,24 +423,59 @@ void +GNERouteHandler::buildFlow(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& vehicleParameters, + const std::string& fromJunctionID, const std::string& toJunctionID) { + // parse junctions + const auto fromJunction = parseJunction(SUMO_TAG_TRIP, fromJunctionID); + const auto toJunction = parseJunction(SUMO_TAG_TRIP, toJunctionID); + // check if exist another vehicle with the same ID (note: Vehicles, Flows and Trips share namespace) + if (fromJunction && toJunction && !isVehicleIdDuplicated(myNet, vehicleParameters.id)) { + // obtain vtypes + GNEDemandElement* vType = myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, vehicleParameters.vtypeid, false); + if (vType == nullptr) { + WRITE_ERROR("Invalid vehicle type '" + vehicleParameters.vtypeid + "' used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'."); + } else { + // create flow using vehicleParameters + GNEDemandElement* flow = new GNEVehicle(GNE_TAG_FLOW_JUNCTIONS, myNet, vType, fromJunction, toJunction, vehicleParameters); + if (myUndoDemandElements) { + myNet->getViewNet()->getUndoList()->begin(flow->getTagProperty().getGUIIcon(), "add " + flow->getTagStr()); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(flow, true), true); + myNet->getViewNet()->getUndoList()->end(); + } else { + myNet->getAttributeCarriers()->insertDemandElement(flow); + // set vehicle as child of vType + vType->addChildElement(flow); + flow->incRef("buildFlow"); + // add reference in all junctions + fromJunction->addChildElement(flow); + toJunction->addChildElement(flow); + } + // compute path + flow->computePathElement(); + } + } +} + + +void GNERouteHandler::buildPerson(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& personParameters) { // first check if ID is duplicated if (!isPersonIdDuplicated(myNet, personParameters.id)) { - // obtain routes and vtypes - GNEDemandElement* pType = myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PTYPE, personParameters.vtypeid, false); - if (pType == nullptr) { + // obtain type + GNEDemandElement* type = myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, personParameters.vtypeid, false); + if (type == nullptr) { WRITE_ERROR("Invalid person type '" + personParameters.vtypeid + "' used in " + toString(personParameters.tag) + " '" + personParameters.id + "'."); } else { // create person using personParameters - GNEDemandElement* person = new GNEPerson(SUMO_TAG_PERSON, myNet, pType, personParameters); + GNEDemandElement* person = new GNEPerson(SUMO_TAG_PERSON, myNet, type, personParameters); if (myUndoDemandElements) { myNet->getViewNet()->getUndoList()->begin(person->getTagProperty().getGUIIcon(), "add " + person->getTagStr()); myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(person, true), true); myNet->getViewNet()->getUndoList()->end(); } else { myNet->getAttributeCarriers()->insertDemandElement(person); - // set person as child of pType and Route - pType->addChildElement(person); + // set person as child of type + type->addChildElement(person); person->incRef("buildPerson"); } } @@ -365,21 +487,21 @@ GNERouteHandler::buildPersonFlow(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& personFlowParameters) { // first check if ID is duplicated if (!isPersonIdDuplicated(myNet, personFlowParameters.id)) { - // obtain routes and vtypes - GNEDemandElement* pType = myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PTYPE, personFlowParameters.vtypeid, false); - if (pType == nullptr) { + // obtain type + GNEDemandElement* type = myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, personFlowParameters.vtypeid, false); + if (type == nullptr) { WRITE_ERROR("Invalid personFlow type '" + personFlowParameters.vtypeid + "' used in " + toString(personFlowParameters.tag) + " '" + personFlowParameters.id + "'."); } else { // create personFlow using personFlowParameters - GNEDemandElement* personFlow = new GNEPerson(SUMO_TAG_PERSONFLOW, myNet, pType, personFlowParameters); + GNEDemandElement* personFlow = new GNEPerson(SUMO_TAG_PERSONFLOW, myNet, type, personFlowParameters); if (myUndoDemandElements) { myNet->getViewNet()->getUndoList()->begin(personFlow->getTagProperty().getGUIIcon(), "add " + personFlow->getTagStr()); myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(personFlow, true), true); myNet->getViewNet()->getUndoList()->end(); } else { myNet->getAttributeCarriers()->insertDemandElement(personFlow); - // set personFlow as child of pType and Route - pType->addChildElement(personFlow); + // set personFlow as child of type + type->addChildElement(personFlow); personFlow->incRef("buildPersonFlow"); } } @@ -389,16 +511,19 @@ void GNERouteHandler::buildPersonTrip(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& fromEdgeID, const std::string& toEdgeID, - const std::string& toBusStopID, double arrivalPos, const std::vector& types, const std::vector& modes) { + const std::string& fromJunctionID, const std::string& toJunctionID, const std::string& toBusStopID, double arrivalPos, + const std::vector& types, const std::vector& modes) { // first parse parents GNEDemandElement* personParent = getPersonParent(sumoBaseObject); GNEEdge* fromEdge = fromEdgeID.empty() ? getPreviousPlanEdge(true, sumoBaseObject) : myNet->getAttributeCarriers()->retrieveEdge(fromEdgeID, false); GNEEdge* toEdge = myNet->getAttributeCarriers()->retrieveEdge(toEdgeID, false); + GNEJunction* fromJunction = myNet->getAttributeCarriers()->retrieveJunction(fromJunctionID, false); + GNEJunction* toJunction = myNet->getAttributeCarriers()->retrieveJunction(toJunctionID, false); GNEAdditional* toBusStop = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_BUS_STOP, toBusStopID, false); // check conditions - if (personParent && fromEdge) { - if (toEdge) { - // create personTrip from->to + if (personParent) { + if (fromEdge && toEdge) { + // create personTrip from->to (edges) GNEDemandElement* personTrip = new GNEPersonTrip(myNet, personParent, fromEdge, toEdge, arrivalPos, types, modes); if (myUndoDemandElements) { myNet->getViewNet()->getUndoList()->begin(personTrip->getTagProperty().getGUIIcon(), "add " + personTrip->getTagStr()); @@ -412,7 +537,7 @@ toEdge->addChildElement(personTrip); personTrip->incRef("buildPersonTripFromTo"); } - } else if (toBusStop) { + } else if (fromEdge && toBusStop) { // create personTrip from->busStop GNEDemandElement* personTrip = new GNEPersonTrip(myNet, personParent, fromEdge, toBusStop, arrivalPos, types, modes); if (myUndoDemandElements) { @@ -427,6 +552,21 @@ toBusStop->addChildElement(personTrip); personTrip->incRef("buildPersonTripFromBusStop"); } + } else if (fromJunction && toJunction) { + // create personTrip from->to (junctions) + GNEDemandElement* personTrip = new GNEPersonTrip(myNet, personParent, fromJunction, toJunction, arrivalPos, types, modes); + if (myUndoDemandElements) { + myNet->getViewNet()->getUndoList()->begin(personTrip->getTagProperty().getGUIIcon(), "add " + personTrip->getTagStr()); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(personTrip, true), true); + myNet->getViewNet()->getUndoList()->end(); + } else { + myNet->getAttributeCarriers()->insertDemandElement(personTrip); + // set child references + personParent->addChildElement(personTrip); + fromJunction->addChildElement(personTrip); + toJunction->addChildElement(personTrip); + personTrip->incRef("buildPersonTripFromTo"); + } } } } @@ -434,11 +574,14 @@ void GNERouteHandler::buildWalk(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& fromEdgeID, const std::string& toEdgeID, - const std::string& toBusStopID, const std::vector& edgeIDs, const std::string& routeID, double arrivalPos) { + const std::string& fromJunctionID, const std::string& toJunctionID, const std::string& toBusStopID, + const std::vector& edgeIDs, const std::string& routeID, double arrivalPos) { // first parse parents GNEDemandElement* personParent = getPersonParent(sumoBaseObject); GNEEdge* fromEdge = fromEdgeID.empty() ? getPreviousPlanEdge(true, sumoBaseObject) : myNet->getAttributeCarriers()->retrieveEdge(fromEdgeID, false); GNEEdge* toEdge = myNet->getAttributeCarriers()->retrieveEdge(toEdgeID, false); + GNEJunction* fromJunction = myNet->getAttributeCarriers()->retrieveJunction(fromJunctionID, false); + GNEJunction* toJunction = myNet->getAttributeCarriers()->retrieveJunction(toJunctionID, false); GNEAdditional* toBusStop = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_BUS_STOP, toBusStopID, false); GNEDemandElement* route = myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_ROUTE, routeID, false); std::vector edges = parseEdges(SUMO_TAG_WALK, edgeIDs); @@ -475,7 +618,7 @@ walk->incRef("buildWalkRoute"); } } else if (fromEdge && toEdge) { - // create walk from->to + // create walk from->to (edges) GNEDemandElement* walk = new GNEWalk(myNet, personParent, fromEdge, toEdge, arrivalPos); if (myUndoDemandElements) { myNet->getViewNet()->getUndoList()->begin(walk->getTagProperty().getGUIIcon(), "add " + walk->getTagStr()); @@ -504,6 +647,21 @@ toBusStop->addChildElement(walk); walk->incRef("buildWalkFromBusStop"); } + } else if (fromJunction && toJunction) { + // create walk from->to (junction) + GNEDemandElement* walk = new GNEWalk(myNet, personParent, fromJunction, toJunction, arrivalPos); + if (myUndoDemandElements) { + myNet->getViewNet()->getUndoList()->begin(walk->getTagProperty().getGUIIcon(), "add " + walk->getTagStr()); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(walk, true), true); + myNet->getViewNet()->getUndoList()->end(); + } else { + myNet->getAttributeCarriers()->insertDemandElement(walk); + // set child references + personParent->addChildElement(walk); + fromJunction->addChildElement(walk); + toJunction->addChildElement(walk); + walk->incRef("buildWalkFromTo"); + } } } } @@ -558,21 +716,21 @@ GNERouteHandler::buildContainer(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& containerParameters) { // first check if ID is duplicated if (!isContainerIdDuplicated(myNet, containerParameters.id)) { - // obtain routes and vtypes - GNEDemandElement* pType = myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PTYPE, containerParameters.vtypeid, false); - if (pType == nullptr) { + // obtain type + GNEDemandElement* type = myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, containerParameters.vtypeid, false); + if (type == nullptr) { WRITE_ERROR("Invalid container type '" + containerParameters.vtypeid + "' used in " + toString(containerParameters.tag) + " '" + containerParameters.id + "'."); } else { // create container using containerParameters - GNEDemandElement* container = new GNEContainer(SUMO_TAG_CONTAINER, myNet, pType, containerParameters); + GNEDemandElement* container = new GNEContainer(SUMO_TAG_CONTAINER, myNet, type, containerParameters); if (myUndoDemandElements) { myNet->getViewNet()->getUndoList()->begin(GUIIcon::CONTAINER, "add " + container->getTagStr()); myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(container, true), true); myNet->getViewNet()->getUndoList()->end(); } else { myNet->getAttributeCarriers()->insertDemandElement(container); - // set container as child of pType and Route - pType->addChildElement(container); + // set container as child of type + type->addChildElement(container); container->incRef("buildContainer"); } } @@ -584,21 +742,21 @@ GNERouteHandler::buildContainerFlow(const CommonXMLStructure::SumoBaseObject* /*sumoBaseObject*/, const SUMOVehicleParameter& containerFlowParameters) { // first check if ID is duplicated if (!isContainerIdDuplicated(myNet, containerFlowParameters.id)) { - // obtain routes and vtypes - GNEDemandElement* pType = myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PTYPE, containerFlowParameters.vtypeid, false); - if (pType == nullptr) { + // obtain type + GNEDemandElement* type = myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, containerFlowParameters.vtypeid, false); + if (type == nullptr) { WRITE_ERROR("Invalid containerFlow type '" + containerFlowParameters.vtypeid + "' used in " + toString(containerFlowParameters.tag) + " '" + containerFlowParameters.id + "'."); } else { // create containerFlow using containerFlowParameters - GNEDemandElement* containerFlow = new GNEContainer(SUMO_TAG_CONTAINERFLOW, myNet, pType, containerFlowParameters); + GNEDemandElement* containerFlow = new GNEContainer(SUMO_TAG_CONTAINERFLOW, myNet, type, containerFlowParameters); if (myUndoDemandElements) { myNet->getViewNet()->getUndoList()->begin(GUIIcon::CONTAINERFLOW, "add " + containerFlow->getTagStr()); myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(containerFlow, true), true); myNet->getViewNet()->getUndoList()->end(); } else { myNet->getAttributeCarriers()->insertDemandElement(containerFlow); - // set containerFlow as child of pType and Route - pType->addChildElement(containerFlow); + // set containerFlow as child of type + type->addChildElement(containerFlow); containerFlow->incRef("buildContainerFlow"); } } @@ -803,11 +961,11 @@ // create stop using stopParameters and stoppingPlace GNEDemandElement* stop = nullptr; if (stopParent->getTagProperty().isPerson()) { - stop = new GNEStopPerson(myNet, stopParent, stoppingPlace, stopParameters); + stop = new GNEStop(GNE_TAG_STOPPERSON_BUSSTOP, myNet, stopParent, stoppingPlace, stopParameters); } else if (stopParent->getTagProperty().isContainer()) { - stop = new GNEStopContainer(myNet, stopParent, stoppingPlace, stopParameters); + stop = new GNEStop(GNE_TAG_TRANSPORT_CONTAINERSTOP, myNet, stopParent, stoppingPlace, stopParameters); } else { - stop = new GNEStop(stopTagType, myNet, stopParameters, stoppingPlace, stopParent); + stop = new GNEStop(stopTagType, myNet, stopParent, stoppingPlace, stopParameters); } // add it depending of undoDemandElements if (myUndoDemandElements) { @@ -822,7 +980,7 @@ } } else if (lane) { // create stop using stopParameters and lane (only for vehicles) - GNEDemandElement* stop = new GNEStop(myNet, stopParameters, lane, stopParent); + GNEDemandElement* stop = new GNEStop(myNet, stopParent, lane, stopParameters); // add it depending of undoDemandElements if (myUndoDemandElements) { myNet->getViewNet()->getUndoList()->begin(stop->getTagProperty().getGUIIcon(), "add " + stop->getTagStr()); @@ -838,9 +996,9 @@ // create stop using stopParameters and edge GNEDemandElement* stop = nullptr; if (stopParent->getTagProperty().isPerson()) { - stop = new GNEStopPerson(myNet, stopParent, edge, stopParameters); + stop = new GNEStop(GNE_TAG_STOPPERSON_EDGE, myNet, stopParent, edge, stopParameters); } else { - stop = new GNEStopContainer(myNet, stopParent, edge, stopParameters); + stop = new GNEStop(GNE_TAG_STOPCONTAINER_EDGE, myNet, stopParent, edge, stopParameters); } // add it depending of undoDemandElements if (myUndoDemandElements) { @@ -860,8 +1018,8 @@ bool -GNERouteHandler::buildPersonPlan(SumoXMLTag tag, GNEDemandElement* personParent, GNEFrameAttributesModuls::AttributesCreator* personPlanAttributes, - GNEFrameModuls::PathCreator* pathCreator, const bool centerAfterCreation) { +GNERouteHandler::buildPersonPlan(SumoXMLTag tag, GNEDemandElement* personParent, GNEFrameAttributeModules::AttributesCreator* personPlanAttributes, + GNEFrameModules::PathCreator* pathCreator, const bool centerAfterCreation) { // clear and set person object myPlanObject->clear(); myPlanObject->setTag(personParent->getTagProperty().getTag()); @@ -893,6 +1051,9 @@ // get edges GNEEdge* fromEdge = (pathCreator->getSelectedEdges().size() > 0) ? pathCreator->getSelectedEdges().front() : nullptr; GNEEdge* toEdge = (pathCreator->getSelectedEdges().size() > 0) ? pathCreator->getSelectedEdges().back() : nullptr; + // get junctions + GNEJunction* fromJunction = (pathCreator->getSelectedJunctions().size() > 0) ? pathCreator->getSelectedJunctions().front() : nullptr; + GNEJunction* toJunction = (pathCreator->getSelectedJunctions().size() > 0) ? pathCreator->getSelectedJunctions().back() : nullptr; // get busStop GNEAdditional* toBusStop = pathCreator->getToStoppingPlace(SUMO_TAG_BUS_STOP); // get path edges @@ -910,7 +1071,7 @@ case GNE_TAG_PERSONTRIP_EDGE: { // check if person trip busStop->edge can be created if (fromEdge && toEdge) { - buildPersonTrip(personPlanObject, fromEdge->getID(), toEdge->getID(), "", arrivalPos, types, modes); + buildPersonTrip(personPlanObject, fromEdge->getID(), toEdge->getID(), "", "", "", arrivalPos, types, modes); } else { myNet->getViewNet()->setStatusBarText("A person trip from edge to edge needs two edges edge"); return false; @@ -920,18 +1081,28 @@ case GNE_TAG_PERSONTRIP_BUSSTOP: { // check if person trip busStop->busStop can be created if (fromEdge && toBusStop) { - buildPersonTrip(personPlanObject, fromEdge->getID(), "", toBusStop->getID(), arrivalPos, types, modes); + buildPersonTrip(personPlanObject, fromEdge->getID(), "", "", "", toBusStop->getID(), arrivalPos, types, modes); } else { myNet->getViewNet()->setStatusBarText("A person trip from edge to busStop needs one edge and one busStop"); return false; } break; } + case GNE_TAG_PERSONTRIP_JUNCTIONS: { + // check if person trip busStop->junction can be created + if (fromJunction && toJunction) { + buildPersonTrip(personPlanObject, "", "", fromJunction->getID(), toJunction->getID(), "", arrivalPos, types, modes); + } else { + myNet->getViewNet()->setStatusBarText("A person trip from junction to junction needs two junctions junction"); + return false; + } + break; + } // Walks case GNE_TAG_WALK_EDGE: { // check if transport busStop->edge can be created if (fromEdge && toEdge) { - buildWalk(personPlanObject, fromEdge->getID(), toEdge->getID(), "", {}, "", arrivalPos); + buildWalk(personPlanObject, fromEdge->getID(), toEdge->getID(), "", "", "", {}, "", arrivalPos); } else { myNet->getViewNet()->setStatusBarText("A ride from busStop to edge needs a busStop and an edge"); return false; @@ -941,7 +1112,7 @@ case GNE_TAG_WALK_BUSSTOP: { // check if transport busStop->busStop can be created if (fromEdge && toBusStop) { - buildWalk(personPlanObject, fromEdge->getID(), "", toBusStop->getID(), {}, "", arrivalPos); + buildWalk(personPlanObject, fromEdge->getID(), "", "", "", toBusStop->getID(), {}, "", arrivalPos); } else { myNet->getViewNet()->setStatusBarText("A transport from busStop to busStop needs two busStops"); return false; @@ -951,7 +1122,7 @@ case GNE_TAG_WALK_EDGES: { // check if transport edges can be created if (edges.size() > 0) { - buildWalk(personPlanObject, "", "", "", edges, "", arrivalPos); + buildWalk(personPlanObject, "", "", "", "", "", edges, "", arrivalPos); } else { myNet->getViewNet()->setStatusBarText("A transport with edges attribute needs a list of edges"); return false; @@ -961,13 +1132,23 @@ case GNE_TAG_WALK_ROUTE: { // check if transport edges can be created if (route) { - buildWalk(personPlanObject, "", "", "", {}, route->getID(), arrivalPos); + buildWalk(personPlanObject, "", "", "", "", "", {}, route->getID(), arrivalPos); } else { myNet->getViewNet()->setStatusBarText("A route transport needs a route"); return false; } break; } + case GNE_TAG_WALK_JUNCTIONS: { + // check if transport busStop->junction can be created + if (fromJunction && toJunction) { + buildWalk(personPlanObject, "", "", fromJunction->getID(), toJunction->getID(), "", {}, "", arrivalPos); + } else { + myNet->getViewNet()->setStatusBarText("A ride from busStop to junction needs a busStop and an junction"); + return false; + } + break; + } // Rides case GNE_TAG_RIDE_EDGE: { // check if ride busStop->edge can be created @@ -1017,8 +1198,8 @@ throw InvalidArgument("Invalid person plan tag"); } // get person - const auto person = myNet->getAttributeCarriers()->retrieveDemandElement(personPlanObject->getParentSumoBaseObject()->getTag(), - personPlanObject->getParentSumoBaseObject()->getStringAttribute(SUMO_ATTR_ID), false); + const auto person = myNet->getAttributeCarriers()->retrieveDemandElement(personPlanObject->getParentSumoBaseObject()->getTag(), + personPlanObject->getParentSumoBaseObject()->getStringAttribute(SUMO_ATTR_ID), false); if (person) { // compute person (and all person plans) person->computePathElement(); @@ -1032,7 +1213,7 @@ bool -GNERouteHandler::buildContainerPlan(SumoXMLTag tag, GNEDemandElement* containerParent, GNEFrameAttributesModuls::AttributesCreator* containerPlanAttributes, GNEFrameModuls::PathCreator* pathCreator) { +GNERouteHandler::buildContainerPlan(SumoXMLTag tag, GNEDemandElement* containerParent, GNEFrameAttributeModules::AttributesCreator* containerPlanAttributes, GNEFrameModules::PathCreator* pathCreator) { // clear and set planObject myPlanObject->clear(); myPlanObject->setTag(containerParent->getTagProperty().getTag()); @@ -1246,7 +1427,7 @@ vehicleBaseOBject->addStringAttribute(SUMO_ATTR_ID, vehicleParameters.id); vehicleBaseOBject->setVehicleParameter(&vehicleParameters); // build embedded route - routeHandler.buildEmbeddedRoute(routeBaseOBject, edgeIDs, routeColor, false, 0, {}); + routeHandler.buildEmbeddedRoute(routeBaseOBject, edgeIDs, "", false, 0, {}); delete vehicleBaseOBject; } else { // change tag in vehicle parameters @@ -1319,16 +1500,15 @@ net->deleteDemandElement(originalVehicle, net->getViewNet()->getUndoList()); // change depart if ((vehicleParameters.tag == SUMO_TAG_TRIP) || (vehicleParameters.tag == SUMO_TAG_VEHICLE) || (vehicleParameters.tag == GNE_TAG_VEHICLE_WITHROUTE)) { - // set end - vehicleParameters.repetitionEnd = vehicleParameters.depart + 3600; - // set number - vehicleParameters.repetitionNumber = 1800; - vehicleParameters.parametersSet |= VEHPARS_NUMBER_SET; - // unset parameters - vehicleParameters.parametersSet &= ~VEHPARS_END_SET; - vehicleParameters.parametersSet &= ~VEHPARS_VPH_SET; - vehicleParameters.parametersSet &= ~VEHPARS_PERIOD_SET; - vehicleParameters.parametersSet &= ~VEHPARS_PROB_SET; + // get template flow + const auto templateFlow = net->getViewNet()->getViewParent()->getVehicleFrame()->getVehicleTagSelector()->getTemplateAC(GNE_TAG_FLOW_ROUTE); + // set flow parameters + vehicleParameters.repetitionEnd = vehicleParameters.depart + string2time("3600"); + vehicleParameters.repetitionNumber = GNEAttributeCarrier::parse(templateFlow->getAttribute(SUMO_ATTR_NUMBER)); + vehicleParameters.repetitionOffset = string2time(templateFlow->getAttribute(SUMO_ATTR_PERIOD)); + vehicleParameters.repetitionProbability = GNEAttributeCarrier::parse(templateFlow->getAttribute(SUMO_ATTR_PROB)); + // by default, number and end enabled + vehicleParameters.parametersSet = GNEAttributeCarrier::parse(templateFlow->getAttribute(GNE_ATTR_FLOWPARAMETERS)); } // check if new vehicle must have an embedded route if (createEmbeddedRoute) { @@ -1342,7 +1522,7 @@ vehicleBaseOBject->addStringAttribute(SUMO_ATTR_ID, vehicleParameters.id); vehicleBaseOBject->setVehicleParameter(&vehicleParameters); // build embedded route - routeHandler.buildEmbeddedRoute(routeBaseOBject, edgeIDs, routeColor, false, 0, {}); + routeHandler.buildEmbeddedRoute(routeBaseOBject, edgeIDs, "", false, 0, {}); delete vehicleBaseOBject; } else { // change tag in vehicle parameters @@ -1470,16 +1650,15 @@ } // change depart if ((vehicleParameters.tag == SUMO_TAG_TRIP) || (vehicleParameters.tag == SUMO_TAG_VEHICLE) || (vehicleParameters.tag == GNE_TAG_VEHICLE_WITHROUTE)) { - // set end - vehicleParameters.repetitionEnd = vehicleParameters.depart + 3600; - // set number - vehicleParameters.repetitionNumber = 1800; - vehicleParameters.parametersSet |= VEHPARS_NUMBER_SET; - // unset parameters - vehicleParameters.parametersSet &= ~VEHPARS_END_SET; - vehicleParameters.parametersSet &= ~VEHPARS_VPH_SET; - vehicleParameters.parametersSet &= ~VEHPARS_PERIOD_SET; - vehicleParameters.parametersSet &= ~VEHPARS_PROB_SET; + // get template flow + const auto templateFlow = net->getViewNet()->getViewParent()->getVehicleFrame()->getVehicleTagSelector()->getTemplateAC(GNE_TAG_FLOW_ROUTE); + // set flow parameters + vehicleParameters.repetitionEnd = vehicleParameters.depart + string2time("3600"); + vehicleParameters.repetitionNumber = GNEAttributeCarrier::parse(templateFlow->getAttribute(SUMO_ATTR_NUMBER)); + vehicleParameters.repetitionOffset = string2time(templateFlow->getAttribute(SUMO_ATTR_PERIOD)); + vehicleParameters.repetitionProbability = GNEAttributeCarrier::parse(templateFlow->getAttribute(SUMO_ATTR_PROB)); + // by default, number and end enabled + vehicleParameters.parametersSet = GNEAttributeCarrier::parse(templateFlow->getAttribute(GNE_ATTR_FLOWPARAMETERS)); } // change tag in vehicle parameters vehicleParameters.tag = SUMO_TAG_FLOW; @@ -1517,7 +1696,7 @@ void GNERouteHandler::setFlowParameters(const SumoXMLAttr attribute, int& parameters) { - // modify parametersSetCopy depending of given Flow attribute + // modify parameters depending of given Flow attribute switch (attribute) { case SUMO_ATTR_END: { // give more priority to end @@ -1529,7 +1708,8 @@ parameters |= VEHPARS_NUMBER_SET; break; case SUMO_ATTR_VEHSPERHOUR: - case SUMO_ATTR_PERSONSPERHOUR: { + case SUMO_ATTR_PERSONSPERHOUR: + case SUMO_ATTR_CONTAINERSPERHOUR: { // give more priority to end if ((parameters & VEHPARS_END_SET) && (parameters & VEHPARS_NUMBER_SET)) { parameters = VEHPARS_END_SET; @@ -1577,6 +1757,17 @@ // protected // =========================================================================== +GNEJunction* +GNERouteHandler::parseJunction(const SumoXMLTag tag, const std::string& junctionID) const { + GNEJunction* junction = myNet->getAttributeCarriers()->retrieveJunction(junctionID, false); + // empty junctions aren't allowed. If junction is empty, write error, clear junctions and stop + if (junction == nullptr) { + WRITE_ERROR("Could not build " + toString(tag) + " in netedit; " + toString(SUMO_TAG_JUNCTION) + " doesn't exist."); + } + return junction; +} + + GNEEdge* GNERouteHandler::parseEdge(const SumoXMLTag tag, const std::string& edgeID) const { GNEEdge* edge = myNet->getAttributeCarriers()->retrieveEdge(edgeID, false); diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNERouteHandler.h sumo-1.12.0/src/netedit/elements/demand/GNERouteHandler.h --- sumo-1.11.0/src/netedit/elements/demand/GNERouteHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNERouteHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -20,8 +20,8 @@ #pragma once #include -#include -#include +#include +#include #include #include #include @@ -65,7 +65,8 @@ void buildVType(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVTypeParameter& vTypeParameter); /// @brief build vType distribution - void buildVTypeDistribution(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id); + void buildVTypeDistribution(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, + const std::vector& vTypes); /// @brief build route void buildRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, SUMOVehicleClass vClass, @@ -90,10 +91,18 @@ void buildTrip(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, const std::string& fromEdgeID, const std::string& toEdgeID, const std::vector& viaIDs); + /// @brief build trip + void buildTrip(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, + const std::string& fromJunctionID, const std::string& toJunctionID); + /// @brief build flow void buildFlow(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, const std::string& fromEdgeID, const std::string& toEdgeID, const std::vector& viaIDs); + /// @brief build flow + void buildFlow(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, + const std::string& fromJunctionID, const std::string& toJunctionID); + /// @brief build person void buildPerson(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& personParameters); @@ -102,11 +111,13 @@ /// @brief build person trip void buildPersonTrip(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& fromEdgeID, const std::string& toEdgeID, - const std::string& toBusStopID, double arrivalPos, const std::vector& types, const std::vector& modes); + const std::string& fromJunctionID, const std::string& toJunctionID, const std::string& toBusStopID, double arrivalPos, + const std::vector& types, const std::vector& modes); /// @brief build walk void buildWalk(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& fromEdgeID, const std::string& toEdgeID, - const std::string& toBusStopID, const std::vector& edgeIDs, const std::string& routeID, double arrivalPos); + const std::string& fromJunctionID, const std::string& toJunctionID, const std::string& toBusStopID, + const std::vector& edgeIDs, const std::string& routeID, double arrivalPos); /// @brief build ride void buildRide(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& fromEdgeID, const std::string& toEdgeID, @@ -132,11 +143,11 @@ void buildStop(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter::Stop& stopParameters); /// @brief build person plan - bool buildPersonPlan(SumoXMLTag tag, GNEDemandElement* personParent, GNEFrameAttributesModuls::AttributesCreator* personPlanAttributes, - GNEFrameModuls::PathCreator* pathCreator, const bool centerAfterCreation); + bool buildPersonPlan(SumoXMLTag tag, GNEDemandElement* personParent, GNEFrameAttributeModules::AttributesCreator* personPlanAttributes, + GNEFrameModules::PathCreator* pathCreator, const bool centerAfterCreation); /// @brief build container plan - bool buildContainerPlan(SumoXMLTag tag, GNEDemandElement* containerParent, GNEFrameAttributesModuls::AttributesCreator* containerPlanAttributes, GNEFrameModuls::PathCreator* pathCreator); + bool buildContainerPlan(SumoXMLTag tag, GNEDemandElement* containerParent, GNEFrameAttributeModules::AttributesCreator* containerPlanAttributes, GNEFrameModules::PathCreator* pathCreator); /// @brief check if there is already a vehicle (Vehicle, Trip, Flow or Flow) with the given ID static bool isVehicleIdDuplicated(GNENet* net, const std::string& id); @@ -186,10 +197,13 @@ /// @} - /// @brief configure flow parameters + /// @brief set flow parameters static void setFlowParameters(const SumoXMLAttr attribute, int& parameters); protected: + /// @brief parse junction + GNEJunction* parseJunction(const SumoXMLTag tag, const std::string& junctionID) const; + /// @brief parse edge GNEEdge* parseEdge(const SumoXMLTag tag, const std::string& edgeID) const; diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEStopContainer.cpp sumo-1.12.0/src/netedit/elements/demand/GNEStopContainer.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNEStopContainer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEStopContainer.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,763 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GNEStopContainer.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2021 -/// -// Representation of container stops in NETEDIT -/****************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEStopContainer.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEStopContainer::GNEStopContainer(GNENet* net, GNEDemandElement* containerParent, GNEAdditional* stoppingPlace, const SUMOVehicleParameter::Stop& stopParameter) : - GNEDemandElement(containerParent, net, GLO_STOP_CONTAINER, GNE_TAG_STOPCONTAINER_CONTAINERSTOP, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, -{}, {}, {}, {stoppingPlace}, {}, {}, {containerParent}, {}), -SUMOVehicleParameter::Stop(stopParameter) { -} - - -GNEStopContainer::GNEStopContainer(GNENet* net, GNEDemandElement* containerParent, GNEEdge* edge, const SUMOVehicleParameter::Stop& stopParameter) : - GNEDemandElement(containerParent, net, GLO_STOP_CONTAINER, GNE_TAG_STOPCONTAINER_EDGE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, -{}, {edge}, {}, {}, {}, {}, {containerParent}, {}), -SUMOVehicleParameter::Stop(stopParameter) { -} - - -GNEStopContainer::~GNEStopContainer() {} - - -GNEMoveOperation* -GNEStopContainer::getMoveOperation() { - if (myTagProperty.getTag() == GNE_TAG_STOPCONTAINER_EDGE) { - // return move operation for additional placed over shape - return new GNEMoveOperation(this, getParentEdges().front()->getLanes().front(), endPos, - myNet->getViewNet()->getViewParent()->getMoveFrame()->getCommonModeOptions()->getAllowChangeLane()); - } else { - return nullptr; - } -} - - -std::string -GNEStopContainer::getBegin() const { - return ""; -} - - -void -GNEStopContainer::writeDemandElement(OutputDevice& device) const { - write(device); -} - - -bool -GNEStopContainer::isDemandElementValid() const { - // get lane - const GNELane* firstLane = getFirstAllowedLane(); - // only Stops placed over lanes can be invalid - if (myTagProperty.getTag() != SUMO_TAG_STOP_LANE) { - return true; - } else if (friendlyPos) { - // with friendly position enabled position are "always fixed" - return true; - } else if (firstLane != nullptr) { - // obtain lane length - const double laneLength = getParentEdges().front()->getNBEdge()->getFinalLength() * firstLane->getLengthGeometryFactor(); - // declare end pos fixed - const double endPosFixed = (endPos < 0) ? (endPos + laneLength) : endPos; - // check values - return (endPosFixed <= getParentEdges().front()->getNBEdge()->getFinalLength()) && (endPosFixed > 0); - } else { - return false; - } -} - - -std::string -GNEStopContainer::getDemandElementProblem() const { - if (friendlyPos) { - return ""; - } else { - // obtain lane length - const double laneLength = getParentEdges().front()->getNBEdge()->getFinalLength(); - // declare end pos fixed - const double endPosFixed = (endPos < 0) ? (endPos + laneLength) : endPos; - // check positions over lane - if (endPosFixed < 0) { - return (toString(SUMO_ATTR_ENDPOS) + " < 0"); - } else if (endPosFixed > getParentEdges().front()->getNBEdge()->getFinalLength()) { - return (toString(SUMO_ATTR_ENDPOS) + " > lanes's length"); - } else { - return ""; - } - } -} - - -void -GNEStopContainer::fixDemandElementProblem() { - // -} - - -SUMOVehicleClass -GNEStopContainer::getVClass() const { - return getParentDemandElements().front()->getVClass(); -} - - -const RGBColor& -GNEStopContainer::getColor() const { - return myNet->getViewNet()->getVisualisationSettings().colorSettings.stopContainerColor; -} - - -void -GNEStopContainer::updateGeometry() { - // only update Stops over edges - if (getParentAdditionals().size() > 0) { - // get stopContainer shape - const PositionVector& stopContainerShape = getParentAdditionals().front()->getAdditionalGeometry().getShape(); - // update demand element geometry using both positions - myDemandElementGeometry.updateGeometry(stopContainerShape, stopContainerShape.length2D() - 0.6, stopContainerShape.length2D(), 0); - } else { - // get front and back lane - const GNELane* frontLane = getParentEdges().front()->getLanes().front(); - const GNELane* backLane = getParentEdges().front()->getLanes().back(); - // get lane drawing constants - GNELane::LaneDrawingConstants laneDrawingConstantsFront(myNet->getViewNet()->getVisualisationSettings(), frontLane); - GNELane::LaneDrawingConstants laneDrawingConstantBack(myNet->getViewNet()->getVisualisationSettings(), backLane); - // calculate front position - const Position frontPosition = frontLane->getLaneShape().positionAtOffset2D(getAttributeDouble(SUMO_ATTR_ARRIVALPOS), laneDrawingConstantsFront.halfWidth); - // calulate length between both shapes - const double length = backLane->getLaneShape().distance2D(frontPosition, true); - // calculate back position - const Position backPosition = frontLane->getLaneShape().positionAtOffset2D(getAttributeDouble(SUMO_ATTR_ARRIVALPOS), (length + laneDrawingConstantBack.halfWidth - laneDrawingConstantsFront.halfWidth) * -1); - // update demand element geometry using both positions - myDemandElementGeometry.updateGeometry({frontPosition, backPosition}); - } -} - - -Position -GNEStopContainer::getPositionInView() const { - // check if is placed over a stopContainer - if (getParentAdditionals().size() > 0) { - return getParentAdditionals().front()->getPositionInView(); - } else { - // get lane - const GNELane* containerLane = getParentEdges().front()->getLaneByAllowedVClass(SVC_PEDESTRIAN); - // get position over lane shape - if (endPos <= 0) { - return containerLane->getLaneShape().front(); - } else if (endPos >= containerLane->getLaneShape().length2D()) { - return containerLane->getLaneShape().back(); - } else { - return containerLane->getLaneShape().positionAtOffset2D(endPos); - } - } -} - - -std::string -GNEStopContainer::getParentName() const { - // get lane - const GNELane* const firstLane = getFirstAllowedLane(); - if (getParentDemandElements().size() > 0) { - return getParentDemandElements().front()->getID(); - } else if (getParentAdditionals().size() > 0) { - return getParentAdditionals().front()->getID(); - } else if (firstLane != nullptr) { - return firstLane->getID(); - } else { - throw ProcessError("Invalid parent"); - } -} - - -double -GNEStopContainer::getExaggeration(const GUIVisualizationSettings& s) const { - return s.addSize.getExaggeration(s, this); -} - - -Boundary -GNEStopContainer::getCenteringBoundary() const { - // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) - if (getParentAdditionals().size() > 0) { - return getParentAdditionals().at(0)->getCenteringBoundary(); - } else { - Boundary b; - b.add(getPositionInView()); - b.grow(20); - return b; - } -} - - -void -GNEStopContainer::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNEStopContainer::drawGL(const GUIVisualizationSettings& s) const { - // check if stop can be drawn - if (drawPersonPlan()) { - // Obtain exaggeration of the draw - const double exaggeration = getExaggeration(s); - // declare stop color - const RGBColor stopColor = drawUsingSelectColor() ? s.colorSettings.selectedContainerPlanColor : s.colorSettings.stopColor; - // Start drawing adding an gl identificator - GLHelper::pushName(getGlID()); - // Add layer matrix matrix - GLHelper::pushMatrix(); - // translate to front - myNet->getViewNet()->drawTranslateFrontAttributeCarrier(this, getType()); - // check if draw stopContainer over stopContainer oder over lane - if (getParentAdditionals().size() > 0) { - drawStopContainerOverStopContainer(s, exaggeration, stopColor); - } else { - drawStopContainerOverLane(s, exaggeration, stopColor); - } - // pop layer matrix - GLHelper::popMatrix(); - // Pop name - GLHelper::popName(); - // draw lock icon - GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), getPositionInView(), exaggeration); - // check if dotted contours has to be drawn - if (myNet->getViewNet()->isAttributeCarrierInspected(this)) { - GUIDottedGeometry::drawDottedContourShape(GUIDottedGeometry::DottedContourType::INSPECT, s, myDemandElementGeometry.getShape(), 0.3, - exaggeration, true, true); - } - if (myNet->getViewNet()->getFrontAttributeCarrier() == this) { - GUIDottedGeometry::drawDottedContourShape(GUIDottedGeometry::DottedContourType::FRONT, s, myDemandElementGeometry.getShape(), 0.3, - exaggeration, true, true); - } - // draw container parent if this stop if their first container plan child - if ((getParentDemandElements().size() == 1) && getParentDemandElements().front()->getChildDemandElements().front() == this) { - getParentDemandElements().front()->drawGL(s); - } - } -} - - -void -GNEStopContainer::computePathElement() { - // only update geometry - updateGeometry(); -} - - -void -GNEStopContainer::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*lane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const { - // stopContainers don't use drawPartialGL -} - - -void -GNEStopContainer::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*fromLane*/, const GNELane* /*toLane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const { - // stopContainers don't use drawPartialGL -} - - -GNELane* -GNEStopContainer::getFirstPathLane() const { - // check if stop is placed over a stopContainer - if (getParentAdditionals().size() > 0) { - return getParentAdditionals().front()->getParentLanes().front(); - } else { - return getParentEdges().front()->getLaneByAllowedVClass(SVC_PEDESTRIAN); - } -} - - -GNELane* -GNEStopContainer::getLastPathLane() const { - // first and last path lane are the same - return getFirstPathLane(); -} - - -std::string -GNEStopContainer::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getParentDemandElements().front()->getID(); - case SUMO_ATTR_DURATION: - if (parametersSet & STOP_DURATION_SET) { - return time2string(duration); - } else { - return ""; - } - case SUMO_ATTR_UNTIL: - if (parametersSet & STOP_UNTIL_SET) { - return time2string(until); - } else { - return ""; - } - case SUMO_ATTR_ACTTYPE: - return actType; - // specific of Stops over stoppingPlaces - case SUMO_ATTR_CONTAINER_STOP: - return getParentAdditionals().front()->getID(); - // specific of stops over edges/lanes - case SUMO_ATTR_EDGE: - return getParentEdges().front()->getID(); - case SUMO_ATTR_ENDPOS: - return toString(endPos); - case SUMO_ATTR_FRIENDLY_POS: - return toString(friendlyPos); - // - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARENT: - return getParentDemandElements().front()->getID(); - default: - throw InvalidArgument(getTagStr() + " doesn't have a attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEStopContainer::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - // we use SUMO_ATTR_ARRIVALPOS instead SUMO_ATTR_ENDPOS due it's a container plan - case SUMO_ATTR_ARRIVALPOS: - if (getParentAdditionals().size() > 0) { - return getParentAdditionals().front()->getAttributeDouble(SUMO_ATTR_ENDPOS); - } else { - return endPos; - } - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -Position -GNEStopContainer::getAttributePosition(SumoXMLAttr key) const { - switch (key) { - // we use SUMO_ATTR_ARRIVALPOS instead SUMO_ATTR_ENDPOS due it's a container plan - case SUMO_ATTR_ARRIVALPOS: { - if (getParentAdditionals().size() > 0) { - // return first position of stopContainer - return getParentAdditionals().front()->getAdditionalGeometry().getShape().front(); - } else { - // get lane shape - const PositionVector& laneShape = getLastPathLane()->getLaneShape(); - // continue depending of arrival position - if (endPos == 0) { - return laneShape.front(); - } else if ((endPos == -1) || (endPos >= laneShape.length2D())) { - return laneShape.back(); - } else { - return laneShape.positionAtOffset2D(endPos); - } - } - } - default: - throw InvalidArgument(getTagStr() + " doesn't have a position attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEStopContainer::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { - if (value == getAttribute(key)) { - return; //avoid needless changes, later logic relies on the fact that attributes have changed - } - switch (key) { - case SUMO_ATTR_DURATION: - case SUMO_ATTR_UNTIL: - case SUMO_ATTR_EXTENSION: - case SUMO_ATTR_ACTTYPE: - case GNE_ATTR_SELECTED: - case SUMO_ATTR_FRIENDLY_POS: - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - break; - case SUMO_ATTR_EDGE: { - // get next containerPlan - GNEDemandElement* nextContainerPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this); - // continue depending of nextContainerPlan - if (nextContainerPlan) { - undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next containerPlan"); - nextContainerPlan->setAttribute(SUMO_ATTR_FROM, value, undoList); - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - undoList->end(); - } else { - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - } - break; - } - case SUMO_ATTR_CONTAINER_STOP: { - // get next container plan - GNEDemandElement* nextContainerPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this); - // continue depending of nextContainerPlan - if (nextContainerPlan) { - // obtain stopContainer - const GNEAdditional* stopContainer = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, value); - // change from attribute using edge ID - undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next containerPlan"); - nextContainerPlan->setAttribute(SUMO_ATTR_FROM, stopContainer->getParentLanes().front()->getParentEdge()->getID(), undoList); - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - undoList->end(); - } else { - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - } - break; - } - case SUMO_ATTR_ENDPOS: { - // get previous container plan - GNEDemandElement* previousContainerPlan = getParentDemandElements().at(0)->getPreviousChildDemandElement(this); - // check if leave presonStop connected is enabled - if (myNet->getViewNet()->getViewParent()->getMoveFrame()->getDemandModeOptions()->getLeaveStopPersonsConnected() && - previousContainerPlan && previousContainerPlan->getTagProperty().hasAttribute(SUMO_ATTR_ARRIVALPOS)) { - // change from attribute using edge ID - undoList->begin(myTagProperty.getGUIIcon(), "Change arrivalPos attribute of previous containerPlan"); - previousContainerPlan->setAttribute(SUMO_ATTR_ARRIVALPOS, value, undoList); - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - undoList->end(); - } else { - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - } - break; - } - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEStopContainer::isValid(SumoXMLAttr key, const std::string& value) { - // declare string error - std::string error; - switch (key) { - case SUMO_ATTR_DURATION: - case SUMO_ATTR_UNTIL: - case SUMO_ATTR_EXTENSION: - if (canParse(value)) { - return parse(value) >= 0; - } else { - return false; - } - case SUMO_ATTR_ACTTYPE: - return true; - // specific of Stops over stoppingPlaces - case SUMO_ATTR_CONTAINER_STOP: - return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, value, false) != nullptr); - // specific of stops over edges/lanes - case SUMO_ATTR_EDGE: - if (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr) { - return true; - } else { - return false; - } - case SUMO_ATTR_ENDPOS: - return canParse(value) && fabs(parse(value)) < getParentEdges().front()->getNBEdge()->getFinalLength(); - case SUMO_ATTR_FRIENDLY_POS: - return canParse(value); - // - case GNE_ATTR_SELECTED: - return canParse(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEStopContainer::enableAttribute(SumoXMLAttr key, GNEUndoList* undoList) { - // obtain a copy of parameter sets - int newParametersSet = parametersSet; - // modify parametersSetCopy depending of attr - switch (key) { - case SUMO_ATTR_DURATION: - newParametersSet |= STOP_DURATION_SET; - break; - case SUMO_ATTR_UNTIL: - newParametersSet |= STOP_UNTIL_SET; - break; - default: - break; - } - // add GNEChange_EnableAttribute - undoList->add(new GNEChange_EnableAttribute(this, parametersSet, newParametersSet), true); - // modify parametersSetCopy depending of attr - switch (key) { - case SUMO_ATTR_DURATION: - undoList->changeAttribute(new GNEChange_Attribute(this, key, myTagProperty.getAttributeProperties(key).getDefaultValue())); - break; - case SUMO_ATTR_UNTIL: - case SUMO_ATTR_EXTENSION: - undoList->changeAttribute(new GNEChange_Attribute(this, key, myTagProperty.getAttributeProperties(key).getDefaultValue())); - break; - default: - break; - } -} - - -void -GNEStopContainer::disableAttribute(SumoXMLAttr key, GNEUndoList* undoList) { - // obtain a copy of parameter sets - int newParametersSet = parametersSet; - // modify parametersSetCopy depending of attr - switch (key) { - case SUMO_ATTR_DURATION: - newParametersSet &= ~STOP_DURATION_SET; - break; - case SUMO_ATTR_UNTIL: - newParametersSet &= ~STOP_UNTIL_SET; - break; - case SUMO_ATTR_EXTENSION: - newParametersSet &= ~STOP_EXTENSION_SET; - break; - default: - break; - } - // add GNEChange_EnableAttribute - undoList->add(new GNEChange_EnableAttribute(this, parametersSet, newParametersSet), true); -} - - -bool -GNEStopContainer::isAttributeEnabled(SumoXMLAttr key) const { - if (key == SUMO_ATTR_FROM) { - return (getParentDemandElements().at(0)->getPreviousChildDemandElement(this) == nullptr); - } else { - return true; - } -} - - -std::string -GNEStopContainer::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEStopContainer::getHierarchyName() const { - if (getParentAdditionals().size() > 0) { - return "container stop: " + getParentAdditionals().front()->getTagStr(); - } else { - return "container stop: lane"; - } -} - - -const std::map& -GNEStopContainer::getACParametersMap() const { - return getParametersMap(); -} - - -const GNELane* -GNEStopContainer::getFirstAllowedLane() const { - if (getParentEdges().empty()) { - return nullptr; - } - for (const auto& pLane : getParentEdges().front()->getLanes()) { - if (pLane->allowPedestrians()) { - return pLane; - } - } - return getParentEdges().front()->getLanes().front(); -} - - -void -GNEStopContainer::drawStopContainerOverLane(const GUIVisualizationSettings& s, const double exaggeration, const RGBColor& stopColor) const { - // declare central line color - const RGBColor centralLineColor = drawUsingSelectColor() ? stopColor.changedBrightness(-32) : RGBColor::WHITE; - // set base color - GLHelper::setColor(stopColor); - // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration - GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, 0.3 * exaggeration); - // move to front - glTranslated(0, 0, .1); - // set central color - GLHelper::setColor(centralLineColor); - // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration - GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, 0.05 * exaggeration); - // move to icon position and front - glTranslated(myDemandElementGeometry.getShape().front().x(), myDemandElementGeometry.getShape().front().y(), .1); - // rotate over lane - GUIGeometry::rotateOverLane((myDemandElementGeometry.getShapeRotations().front() * -1) + 90); - // move again - glTranslated(0, s.additionalSettings.vaporizerSize * exaggeration, 0); - // Draw icon depending of Route Probe is selected and if isn't being drawn for selecting - if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.laneTextures, exaggeration)) { - // set color - glColor3d(1, 1, 1); - // rotate texture - glRotated(180, 0, 0, 1); - // draw texture - if (drawUsingSelectColor()) { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GUITexture::STOPCONTAINER_SELECTED), s.additionalSettings.vaporizerSize * exaggeration); - } else { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GUITexture::STOPCONTAINER), s.additionalSettings.vaporizerSize * exaggeration); - } - } else { - // rotate - glRotated(22.5, 0, 0, 1); - // set stop color - GLHelper::setColor(stopColor); - // move matrix - glTranslated(0, 0, 0); - // draw filled circle - GLHelper::drawFilledCircle(0.1 + s.additionalSettings.vaporizerSize, 8); - } -} - - -void -GNEStopContainer::drawStopContainerOverStopContainer(const GUIVisualizationSettings& s, const double exaggeration, const RGBColor& stopColor) const { - // set base color - GLHelper::setColor(stopColor); - // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration - GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, s.stoppingPlaceSettings.containerStopWidth * exaggeration); - // move to icon position and front - glTranslated(myDemandElementGeometry.getShape().getLineCenter().x(), myDemandElementGeometry.getShape().getLineCenter().y(), .1); - // rotate over lane - GUIGeometry::rotateOverLane((myDemandElementGeometry.getShapeRotations().front() * -1) + 90); - // move again - glTranslated(s.stoppingPlaceSettings.containerStopWidth * exaggeration * -2, 0, 0); - // Draw icon depending of Route Probe is selected and if isn't being drawn for selecting - if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.laneTextures, exaggeration)) { - // set color - glColor3d(1, 1, 1); - // rotate texture - glRotated(-90, 0, 0, 1); - // draw texture - if (drawUsingSelectColor()) { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GUITexture::STOPCONTAINER_SELECTED), s.additionalSettings.vaporizerSize * exaggeration); - } else { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GUITexture::STOPCONTAINER), s.additionalSettings.vaporizerSize * exaggeration); - } - } else { - // rotate - glRotated(22.5, 0, 0, 1); - // set stop color - GLHelper::setColor(stopColor); - // move matrix - glTranslated(0, 0, 0); - // draw filled circle - GLHelper::drawFilledCircle(0.1 + s.additionalSettings.vaporizerSize, 8); - } -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEStopContainer::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_DURATION: - if (value.empty()) { - parametersSet &= ~STOP_DURATION_SET; - } else { - duration = string2time(value); - parametersSet |= STOP_DURATION_SET; - } - break; - case SUMO_ATTR_UNTIL: - if (value.empty()) { - parametersSet &= ~STOP_UNTIL_SET; - } else { - until = string2time(value); - parametersSet |= STOP_UNTIL_SET; - } - break; - case SUMO_ATTR_ACTTYPE: - actType = value; - break; - // specific of Stops over stoppingPlaces - case SUMO_ATTR_CONTAINER_STOP: - replaceAdditionalParent(SUMO_TAG_CONTAINER_STOP, value); - updateGeometry(); - break; - // specific of Stops over edges/lanes - case SUMO_ATTR_EDGE: - replaceDemandParentEdges(value); - updateGeometry(); - edge = value; - break; - case SUMO_ATTR_ENDPOS: - endPos = parse(value); - updateGeometry(); - break; - case SUMO_ATTR_FRIENDLY_POS: - friendlyPos = parse(value); - break; - // - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEStopContainer::setEnabledAttribute(const int enabledAttributes) { - parametersSet = enabledAttributes; -} - - -void -GNEStopContainer::setMoveShape(const GNEMoveResult& moveResult) { - // change endPos - endPos = moveResult.newFirstPos; - // update geometry - updateGeometry(); -} - - -void -GNEStopContainer::commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) { - undoList->begin(myTagProperty.getGUIIcon(), "endPos of " + getTagStr()); - // now adjust endPos position - setAttribute(SUMO_ATTR_ENDPOS, toString(moveResult.newFirstPos), undoList); - undoList->end(); -} - -/****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEStopContainer.h sumo-1.12.0/src/netedit/elements/demand/GNEStopContainer.h --- sumo-1.11.0/src/netedit/elements/demand/GNEStopContainer.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEStopContainer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,236 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GNEStopContainer.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2021 -/// -// Representation of container stops in NETEDIT -/****************************************************************************/ -#pragma once -#include -#include - -#include "GNEDemandElement.h" - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEStopContainer - */ -class GNEStopContainer : public GNEDemandElement, public SUMOVehicleParameter::Stop { - -public: - /// @brief constructor used for stops over stopContainers - GNEStopContainer(GNENet* net, GNEDemandElement* containerParent, GNEAdditional* stoppingPlace, const SUMOVehicleParameter::Stop& stopParameter); - - /// @brief constructor used for stops over lanes - GNEStopContainer(GNENet* net, GNEDemandElement* containerParent, GNEEdge* edge, const SUMOVehicleParameter::Stop& stopParameter); - - /// @brief destructor - ~GNEStopContainer(); - - /**@brief get move operation - * @note returned GNEMoveOperation can be nullptr - */ - GNEMoveOperation* getMoveOperation(); - - /**@brief get begin time of demand element - * @note: used by demand elements of type "Vehicle", and it has to be implemented as children - * @throw invalid argument if demand element doesn't has a begin time - */ - std::string getBegin() const; - - /**@brief writte demand element element into a xml file - * @param[in] device device in which write parameters of demand element element - */ - void writeDemandElement(OutputDevice& device) const; - - /// @brief check if current demand element is valid to be writed into XML (by default true, can be reimplemented in children) - bool isDemandElementValid() const; - - /// @brief return a string with the current demand element problem (by default empty, can be reimplemented in children) - std::string getDemandElementProblem() const; - - /// @brief fix demand element problem (by default throw an exception, has to be reimplemented in children) - void fixDemandElementProblem(); - - /// @name members and functions relative to elements common to all demand elements - /// @{ - /// @brief obtain VClass related with this demand element - SUMOVehicleClass getVClass() const; - - /// @brief get color - const RGBColor& getColor() const; - - /// @} - - /// @name Functions related with geometry of element - /// @{ - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief Returns position of demand element in view - Position getPositionInView() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /// @brief return exaggeration asociated with this GLObject - double getExaggeration(const GUIVisualizationSettings& s) const; - - /**@brief Returns the boundary to which the view shall be centered in order to show the object - * @return The boundary the object is within - */ - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); - - /**@brief Draws the object - * @param[in] s The settings for the current view (may influence drawing) - * @see GUIGlObject::drawGL - */ - void drawGL(const GUIVisualizationSettings& s) const; - - /// @} - - /// @name inherited from GNEPathManager::PathElement - /// @{ - - /// @brief compute pathElement - void computePathElement(); - - /**@brief Draws partial object - * @param[in] s The settings for the current view (may influence drawing) - * @param[in] lane lane in which draw partial - * @param[in] segment PathManager segment (used for segment options) - * @param[in] offsetFront extra front offset (used for drawing partial gl above other elements) - */ - void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const; - - /**@brief Draws partial object (junction) - * @param[in] s The settings for the current view (may influence drawing) - * @param[in] fromLane from GNELane - * @param[in] toLane to GNELane - * @param[in] segment PathManager segment (used for segment options) - * @param[in] offsetFront extra front offset (used for drawing partial gl above other elements) - */ - void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const; - - /// @brief get first path lane - GNELane* getFirstPathLane() const; - - /// @brief get last path lane - GNELane* getLastPathLane() const; - /// @} - - /// @brief inherited from GNEAttributeCarrier - /// @{ - /* @brief method for getting the Attribute of an XML key - * @param[in] key The attribute key - * @return string with the value associated to key - */ - std::string getAttribute(SumoXMLAttr key) const; - - /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse(...) for certain attributes) - * @param[in] key The attribute key - * @return double with the value associated to key - */ - double getAttributeDouble(SumoXMLAttr key) const; - - /* @brief method for getting the Attribute of an XML key in Position format (used in container plans) - * @param[in] key The attribute key - * @return double with the value associated to key - */ - Position getAttributePosition(SumoXMLAttr key) const; - - /* @brief method for setting the attribute and letting the object perform demand element changes - * @param[in] key The attribute key - * @param[in] value The new value - * @param[in] undoList The undoList on which to register changes - * @param[in] net optionally the GNENet to inform about gui updates - */ - void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList); - - /* @brief method for setting the attribute and letting the object perform demand element changes - * @param[in] key The attribute key - * @param[in] value The new value - * @param[in] undoList The undoList on which to register changes - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @brief method for enable attribute - * @param[in] key The attribute key - * @param[in] undoList The undoList on which to register changes - * @note certain attributes can be only enabled, and can produce the disabling of other attributes - */ - void enableAttribute(SumoXMLAttr key, GNEUndoList* undoList); - - /* @brief method for disable attribute - * @param[in] key The attribute key - * @param[in] undoList The undoList on which to register changes - * @note certain attributes can be only enabled, and can produce the disabling of other attributes - */ - void disableAttribute(SumoXMLAttr key, GNEUndoList* undoList); - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - bool isAttributeEnabled(SumoXMLAttr key) const; - - /// @brief get PopPup ID (Used in AC Hierarchy) - std::string getPopUpID() const; - - /// @brief get Hierarchy Name (Used in AC Hierarchy) - std::string getHierarchyName() const; - /// @} - - /// @brief get parameters map - const std::map& getACParametersMap() const; - -protected: - /// @brief get first valid lane - const GNELane* getFirstAllowedLane() const; - - /// @brief draw stopContainer over lane - void drawStopContainerOverLane(const GUIVisualizationSettings& s, const double exaggeration, const RGBColor& stopColor) const; - - /// @brief draw stopContainer over stopContainer - void drawStopContainerOverStopContainer(const GUIVisualizationSettings& s, const double exaggeration, const RGBColor& stopColor) const; - -private: - /// @brief method for setting the attribute and nothing else - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); - - /// @brief set move shape - void setMoveShape(const GNEMoveResult& moveResult); - - /// @brief commit move shape - void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList); - - /// @brief Invalidated copy constructor. - GNEStopContainer(const GNEStopContainer&) = delete; - - /// @brief Invalidated assignment operator - GNEStopContainer& operator=(const GNEStopContainer&) = delete; -}; diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEStop.cpp sumo-1.12.0/src/netedit/elements/demand/GNEStop.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNEStop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEStop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -35,17 +35,44 @@ // member method definitions // =========================================================================== -GNEStop::GNEStop(SumoXMLTag tag, GNENet* net, const SUMOVehicleParameter::Stop& stopParameter, GNEAdditional* stoppingPlace, GNEDemandElement* stopParent) : +GNEStop::GNEStop(SumoXMLTag tag, GNENet* net) : + GNEDemandElement("", net, GLO_STOP, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {}, {}, {}, {}, {}, {}, {}) { + // reset default values + resetDefaultValues(); +} + + +GNEStop::GNEStop(SumoXMLTag tag, GNENet* net, GNEDemandElement* stopParent, GNEAdditional* stoppingPlace, const SUMOVehicleParameter::Stop& stopParameter) : GNEDemandElement(stopParent, net, GLO_STOP, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {}, {}, {stoppingPlace}, {}, {}, {stopParent}, {}), SUMOVehicleParameter::Stop(stopParameter) { + // enable parking for stops in parkingAreas + if (tag == SUMO_TAG_STOP_PARKINGAREA) { + parking = true; + toogleAttribute(SUMO_ATTR_PARKING, parking, -1); + } else { + // set parking flag + parking = ((parametersSet & STOP_PARKING_SET) != 0); + } } -GNEStop::GNEStop(GNENet* net, const SUMOVehicleParameter::Stop& stopParameter, GNELane* lane, GNEDemandElement* stopParent) : +GNEStop::GNEStop(GNENet* net, GNEDemandElement* stopParent, GNELane* lane, const SUMOVehicleParameter::Stop& stopParameter) : GNEDemandElement(stopParent, net, GLO_STOP, SUMO_TAG_STOP_LANE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {}, {lane}, {}, {}, {}, {stopParent}, {}), SUMOVehicleParameter::Stop(stopParameter) { + // set parking flag + parking = ((parametersSet & STOP_PARKING_SET) != 0); +} + + +GNEStop::GNEStop(SumoXMLTag tag, GNENet* net, GNEDemandElement* stopParent, GNEEdge* edge, const SUMOVehicleParameter::Stop& stopParameter) : + GNEDemandElement(stopParent, net, GLO_STOP, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {edge}, {}, {}, {}, {}, {stopParent}, {}), +SUMOVehicleParameter::Stop(stopParameter) { + // set parking flag + parking = ((parametersSet & STOP_PARKING_SET) != 0); } @@ -54,7 +81,10 @@ GNEMoveOperation* GNEStop::getMoveOperation() { - if (myTagProperty.getTag() == SUMO_TAG_STOP_LANE) { + if ((myTagProperty.getTag() == GNE_TAG_STOPPERSON_EDGE) || (myTagProperty.getTag() == GNE_TAG_STOPCONTAINER_EDGE)) { + // return move operation for additional placed over shape + return new GNEMoveOperation(this, getParentEdges().front()->getLanes().front(), endPos, false); + } else if (myTagProperty.getTag() == SUMO_TAG_STOP_LANE) { // get allow change lane const bool allowChangeLane = myNet->getViewNet()->getViewParent()->getMoveFrame()->getCommonModeOptions()->getAllowChangeLane(); // fist check if we're moving only extremes @@ -107,24 +137,119 @@ void GNEStop::writeDemandElement(OutputDevice& device) const { - write(device); + device.openTag(SUMO_TAG_STOP); + if (getParentAdditionals().size() > 0) { + if (getParentAdditionals().front()->getTagProperty().getTag() == SUMO_TAG_BUS_STOP) { + device.writeAttr(SUMO_ATTR_BUS_STOP, getParentAdditionals().front()->getID()); + } + if (getParentAdditionals().front()->getTagProperty().getTag() == SUMO_TAG_CONTAINER_STOP) { + device.writeAttr(SUMO_ATTR_CONTAINER_STOP, getParentAdditionals().front()->getID()); + } + if (getParentAdditionals().front()->getTagProperty().getTag() == SUMO_TAG_CHARGING_STATION) { + device.writeAttr(SUMO_ATTR_CHARGING_STATION, getParentAdditionals().front()->getID()); + } + if (getParentAdditionals().front()->getTagProperty().getTag() == SUMO_TAG_PARKING_AREA) { + device.writeAttr(SUMO_ATTR_PARKING_AREA, getParentAdditionals().front()->getID()); + } + } else { + if (getParentLanes().size() > 0) { + device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID()); + } else { + device.writeAttr(SUMO_ATTR_EDGE, getParentEdges().front()->getID()); + } + if ((parametersSet & STOP_START_SET) != 0) { + device.writeAttr(SUMO_ATTR_STARTPOS, startPos); + } + if ((parametersSet & STOP_END_SET) != 0) { + device.writeAttr(SUMO_ATTR_ENDPOS, endPos); + } + } + // write rest of attributes + write(device, true, false); } -bool +GNEDemandElement::Problem GNEStop::isDemandElementValid() const { - // only Stops placed over lanes can be invalid - if (myTagProperty.getTag() != SUMO_TAG_STOP_LANE) { - return true; - } else if (friendlyPos) { - // with friendly position enabled position are "always fixed" - return true; + if (myTagProperty.isStopPerson() || myTagProperty.isStopContainer()) { + // get lane + const GNELane* firstLane = getFirstAllowedLane(); + // only Stops placed over lanes can be invalid + if (myTagProperty.getTag() != SUMO_TAG_STOP_LANE) { + return isPersonPlanValid(); + } else if (friendlyPos) { + // with friendly position enabled position are "always fixed" + return isPersonPlanValid(); + } else if (firstLane != nullptr) { + // obtain lane length + const double laneLength = getParentEdges().front()->getNBEdge()->getFinalLength() * firstLane->getLengthGeometryFactor(); + // declare end pos fixed + const double endPosFixed = (endPos < 0) ? (endPos + laneLength) : endPos; + // check values + if ((endPosFixed <= getParentEdges().front()->getNBEdge()->getFinalLength()) && (endPosFixed > 0)) { + return isPersonPlanValid(); + } else { + return Problem::INVALID_STOPPOSITION; + } + } else { + return Problem::INVALID_ELEMENT; + } + } else { + // only Stops placed over lanes can be invalid + if (myTagProperty.getTag() != SUMO_TAG_STOP_LANE) { + return Problem::OK; + } else if (friendlyPos) { + // with friendly position enabled position are "always fixed" + return Problem::OK; + } else { + // obtain lane length + double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() * getParentLanes().front()->getLengthGeometryFactor(); + // declare a copy of start and end positions + double startPosCopy = startPos; + double endPosCopy = endPos; + // check if position has to be fixed + if (startPosCopy < 0) { + startPosCopy += laneLength; + } + if (endPosCopy < 0) { + endPosCopy += laneLength; + } + // check values + if ((startPosCopy >= 0) && (endPosCopy <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) && ((endPosCopy - startPosCopy) >= POSITION_EPS)) { + return Problem::OK; + } else { + return Problem::INVALID_STOPPOSITION; + } + } + } +} + + +std::string +GNEStop::getDemandElementProblem() const { + if (myTagProperty.isStopPerson() || myTagProperty.isStopContainer()) { + if (friendlyPos) { + return getPersonPlanProblem(); + } else { + // obtain lane length + const double laneLength = getParentEdges().front()->getNBEdge()->getFinalLength(); + // declare end pos fixed + const double endPosFixed = (endPos < 0) ? (endPos + laneLength) : endPos; + // check positions over lane + if (endPosFixed < 0) { + return (toString(SUMO_ATTR_ENDPOS) + " < 0"); + } else if (endPosFixed > getParentEdges().front()->getNBEdge()->getFinalLength()) { + return (toString(SUMO_ATTR_ENDPOS) + " > lanes's length"); + } else { + return getPersonPlanProblem(); + } + } } else { - // obtain lane length - double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() * getParentLanes().front()->getLengthGeometryFactor(); // declare a copy of start and end positions double startPosCopy = startPos; double endPosCopy = endPos; + // obtain lane length + double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); // check if position has to be fixed if (startPosCopy < 0) { startPosCopy += laneLength; @@ -132,44 +257,25 @@ if (endPosCopy < 0) { endPosCopy += laneLength; } - // check values - return ((startPosCopy >= 0) && (endPosCopy <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) && ((endPosCopy - startPosCopy) >= POSITION_EPS)); - } -} - - -std::string -GNEStop::getDemandElementProblem() const { - // declare a copy of start and end positions - double startPosCopy = startPos; - double endPosCopy = endPos; - // obtain lane length - double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - // check if position has to be fixed - if (startPosCopy < 0) { - startPosCopy += laneLength; - } - if (endPosCopy < 0) { - endPosCopy += laneLength; - } - // declare variables - std::string errorStart, separator, errorEnd; - // check positions over lane - if (startPosCopy < 0) { - errorStart = (toString(SUMO_ATTR_STARTPOS) + " < 0"); - } else if (startPosCopy > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) { - errorStart = (toString(SUMO_ATTR_STARTPOS) + " > lanes's length"); - } - if (endPosCopy < 0) { - errorEnd = (toString(SUMO_ATTR_ENDPOS) + " < 0"); - } else if (endPosCopy > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) { - errorEnd = (toString(SUMO_ATTR_ENDPOS) + " > lanes's length"); - } - // check separator - if ((errorStart.size() > 0) && (errorEnd.size() > 0)) { - separator = " and "; + // declare variables + std::string errorStart, separator, errorEnd; + // check positions over lane + if (startPosCopy < 0) { + errorStart = (toString(SUMO_ATTR_STARTPOS) + " < 0"); + } else if (startPosCopy > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) { + errorStart = (toString(SUMO_ATTR_STARTPOS) + " > lanes's length"); + } + if (endPosCopy < 0) { + errorEnd = (toString(SUMO_ATTR_ENDPOS) + " < 0"); + } else if (endPosCopy > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) { + errorEnd = (toString(SUMO_ATTR_ENDPOS) + " > lanes's length"); + } + // check separator + if ((errorStart.size() > 0) && (errorEnd.size() > 0)) { + separator = " and "; + } + return errorStart + separator + errorEnd; } - return errorStart + separator + errorEnd; } @@ -187,7 +293,11 @@ const RGBColor& GNEStop::getColor() const { - return myNet->getViewNet()->getVisualisationSettings().colorSettings.stopColor; + if (getTagProperty().isPersonPlan() || getTagProperty().isContainerPlan()) { + return myNet->getViewNet()->getVisualisationSettings().colorSettings.stopColor; + } else { + return myNet->getViewNet()->getVisualisationSettings().colorSettings.stopPersonColor; + } } @@ -198,24 +308,66 @@ // Cut shape using as delimitators fixed start position and fixed end position myDemandElementGeometry.updateGeometry(getParentLanes().front()->getLaneShape(), getStartGeometryPositionOverLane(), getEndGeometryPositionOverLane(), myMoveElementLateralOffset); } else if (getParentAdditionals().size() > 0) { - // use geometry of additional (busStop) - myDemandElementGeometry = getParentAdditionals().at(0)->getAdditionalGeometry(); - } - // recompute geometry of all Demand elements related with this this stop - if (getParentDemandElements().front()->getTagProperty().isRoute()) { - getParentDemandElements().front()->updateGeometry(); - } + if (getTagProperty().isPersonPlan() || getTagProperty().isContainerPlan()) { + // get busStop shape + const PositionVector& busStopShape = getParentAdditionals().front()->getAdditionalGeometry().getShape(); + // update demand element geometry using both positions + myDemandElementGeometry.updateGeometry(busStopShape, busStopShape.length2D() - 0.6, busStopShape.length2D(), 0); + } else { + // use geometry of additional (busStop) + myDemandElementGeometry = getParentAdditionals().at(0)->getAdditionalGeometry(); + } + } else if (getParentEdges().size() > 0) { + // get front and back lane + const GNELane* frontLane = getParentEdges().front()->getLanes().front(); + const GNELane* backLane = getParentEdges().front()->getLanes().back(); + // get lane drawing constants + GNELane::LaneDrawingConstants laneDrawingConstantsFront(myNet->getViewNet()->getVisualisationSettings(), frontLane); + GNELane::LaneDrawingConstants laneDrawingConstantBack(myNet->getViewNet()->getVisualisationSettings(), backLane); + // calculate front position + const Position frontPosition = frontLane->getLaneShape().positionAtOffset2D(getAttributeDouble(SUMO_ATTR_ARRIVALPOS), laneDrawingConstantsFront.halfWidth); + // calulate length between both shapes + const double length = backLane->getLaneShape().distance2D(frontPosition, true); + // calculate back position + const Position backPosition = frontLane->getLaneShape().positionAtOffset2D(getAttributeDouble(SUMO_ATTR_ARRIVALPOS), (length + laneDrawingConstantBack.halfWidth - laneDrawingConstantsFront.halfWidth) * -1); + // update demand element geometry using both positions + myDemandElementGeometry.updateGeometry({frontPosition, backPosition}); + } + /* + // recompute geometry of all Demand elements related with this this stop + if (getParentDemandElements().front()->getTagProperty().isRoute()) { + getParentDemandElements().front()->updateGeometry(); + } + */ } Position GNEStop::getPositionInView() const { - if (getParentLanes().size() > 0) { - return getParentLanes().front()->getLaneShape().positionAtOffset((startPos + endPos) / 2.0); - } else if (getParentAdditionals().size() > 0) { - return getParentAdditionals().front()->getPositionInView(); + if (myTagProperty.isStopPerson() || myTagProperty.isStopContainer()) { + // check if is placed over a busStop + if (getParentAdditionals().size() > 0) { + return getParentAdditionals().front()->getPositionInView(); + } else { + // get lane + const GNELane* personLane = getParentEdges().front()->getLaneByAllowedVClass(SVC_PEDESTRIAN); + // get position over lane shape + if (endPos <= 0) { + return personLane->getLaneShape().front(); + } else if (endPos >= personLane->getLaneShape().length2D()) { + return personLane->getLaneShape().back(); + } else { + return personLane->getLaneShape().positionAtOffset2D(endPos); + } + } } else { - throw ProcessError("Invalid Stop parent"); + if (getParentLanes().size() > 0) { + return getParentLanes().front()->getLaneShape().positionAtOffset((startPos + endPos) / 2.0); + } else if (getParentAdditionals().size() > 0) { + return getParentAdditionals().front()->getPositionInView(); + } else { + throw ProcessError("Invalid Stop parent"); + } } } @@ -242,18 +394,19 @@ Boundary GNEStop::getCenteringBoundary() const { + Boundary b; // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) if (getParentAdditionals().size() > 0) { return getParentAdditionals().at(0)->getCenteringBoundary(); } else if (myMovingGeometryBoundary.isInitialised()) { return myMovingGeometryBoundary; } else if (myDemandElementGeometry.getShape().size() > 0) { - Boundary b = myDemandElementGeometry.getShape().getBoxBoundary(); - b.grow(20); - return b; + b = myDemandElementGeometry.getShape().getBoxBoundary(); } else { - return Boundary(-0.1, -0.1, 0.1, 0.1); + b.add(getPositionInView()); } + b.grow(20); + return b; } @@ -265,120 +418,37 @@ void GNEStop::drawGL(const GUIVisualizationSettings& s) const { - // declare flag to enable or disable draw person plan - bool drawPersonPlan = false; - if (myTagProperty.isStop()) { - if (myNet->getViewNet()->getNetworkViewOptions().showDemandElements() && myNet->getViewNet()->getDataViewOptions().showDemandElements() && - myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(this)) { - drawPersonPlan = true; - } - } else if (myNet->getViewNet()->getDemandViewOptions().showAllPersonPlans()) { - drawPersonPlan = true; - } else if (myNet->getViewNet()->isAttributeCarrierInspected(getParentDemandElements().front())) { - drawPersonPlan = true; - } else if (myNet->getViewNet()->getDemandViewOptions().getLockedPerson() == getParentDemandElements().front()) { - drawPersonPlan = true; - } else if (!myNet->getViewNet()->getInspectedAttributeCarriers().empty() && - (myNet->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(GNE_ATTR_PARENT) == getAttribute(GNE_ATTR_PARENT))) { - drawPersonPlan = true; - } + const bool draw = (getTagProperty().isStopPerson() || getTagProperty().isStopContainer()) ? drawPersonPlan() : canDrawVehicleStop(); // check if stop can be drawn - if (drawPersonPlan) { + if (draw) { // Obtain exaggeration of the draw const double exaggeration = getExaggeration(s); - // declare value to save stop color - RGBColor stopColor; - // Set color - if (drawUsingSelectColor()) { - stopColor = s.colorSettings.selectedRouteColor; - } else { - stopColor = s.colorSettings.stopColor; - } - // get lane - const auto& stopLane = getParentLanes().size() > 0 ? getParentLanes().front() : nullptr; - // get lane width - const double width = stopLane ? stopLane->getParentEdge()->getNBEdge()->getLaneWidth(stopLane->getIndex()) * 0.5 : exaggeration * 0.8; - // Start drawing adding an gl identificator - GLHelper::pushName(getGlID()); - // Add a layer matrix - GLHelper::pushMatrix(); - // set Color - GLHelper::setColor(stopColor); - // Start with the drawing of the area traslating matrix to origin - myNet->getViewNet()->drawTranslateFrontAttributeCarrier(this, getType()); - // draw depending of details - if (s.drawDetail(s.detailSettings.stopsDetails, exaggeration) && stopLane) { - // Draw top and bot lines using shape, shapeRotations, shapeLengths and value of exaggeration - GLHelper::drawBoxLines(myDemandElementGeometry.getShape(), - myDemandElementGeometry.getShapeRotations(), - myDemandElementGeometry.getShapeLengths(), - exaggeration * 0.1, 0, width); - GLHelper::drawBoxLines(myDemandElementGeometry.getShape(), - myDemandElementGeometry.getShapeRotations(), - myDemandElementGeometry.getShapeLengths(), - exaggeration * 0.1, 0, width * -1); - // Add a detail matrix - GLHelper::pushMatrix(); - // move to geometry front - glTranslated(myDemandElementGeometry.getShape().back().x(), myDemandElementGeometry.getShape().back().y(), 0.1); - // rotate - if (myDemandElementGeometry.getShapeRotations().size() > 0) { - glRotated(myDemandElementGeometry.getShapeRotations().back(), 0, 0, 1); - } - // move again - glTranslated(0, exaggeration * 0.5, 0); - // draw stop front - GLHelper::drawBoxLine(Position(0, 0), 0, exaggeration * 0.5, width); - // move to "S" position - glTranslated(0, 1, 0.1); - // only draw text if isn't being drawn for selecting - if (s.drawForRectangleSelection) { - GLHelper::setColor(stopColor); - GLHelper::drawBoxLine(Position(0, 1), 0, 2, 1); - } else if (s.drawDetail(s.detailSettings.stopsText, exaggeration)) { - // draw "S" symbol - GLHelper::drawText("S", Position(), .1, 2.8, stopColor); - // move to subtitle positin - glTranslated(0, 1.4, 0); - // draw subtitle depending of tag - GLHelper::drawText("lane", Position(), .1, 1, stopColor, 180); - } - // pop detail matrix - GLHelper::popMatrix(); - // draw geometry points - drawGeometryPoints(s, stopColor); + // check if draw an stop for person/containers or for vehicles/routes + if (getTagProperty().isStopPerson() || getTagProperty().isStopContainer()) { + // check if draw stopPerson over busStop oder over lane + if (getParentAdditionals().size() > 0) { + drawStopPersonOverBusStop(s, exaggeration); + } else { + drawStopPersonOverEdge(s, exaggeration); + } + // draw person parent if this stop if their first person plan child + if ((getParentDemandElements().size() == 1) && getParentDemandElements().front()->getChildDemandElements().front() == this) { + getParentDemandElements().front()->drawGL(s); + } } else { - // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration taked from stoppingPlace parent - GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, width); + // draw vehicle over stop + drawVehicleStop(s, exaggeration); } - // pop layer matrix - GLHelper::popMatrix(); - // Pop name - GLHelper::popName(); - // Draw name if isn't being drawn for selecting + // Draw name drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); - // draw lock icon - GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), getPositionInView(), exaggeration); - // check if dotted contour has to be drawn - if (myNet->getViewNet()->isAttributeCarrierInspected(this)) { - GUIDottedGeometry::drawDottedContourShape(GUIDottedGeometry::DottedContourType::INSPECT, s, myDemandElementGeometry.getShape(), - width, exaggeration, true, true); - } - if (myNet->getViewNet()->getFrontAttributeCarrier() == this) { - GUIDottedGeometry::drawDottedContourShape(GUIDottedGeometry::DottedContourType::FRONT, s, myDemandElementGeometry.getShape(), - width, exaggeration, true, true); - } - // draw person parent if this stop if their first person plan child - if ((getParentDemandElements().size() == 1) && getParentDemandElements().front()->getChildDemandElements().front() == this) { - getParentDemandElements().front()->drawGL(s); - } } } void GNEStop::computePathElement() { - // nothing to compute + // only update geometry + updateGeometry(); } @@ -399,6 +469,8 @@ // check if stop is placed over a busStop if (getParentAdditionals().size() > 0) { return getParentAdditionals().front()->getParentLanes().front(); + } else if (getParentEdges().size() > 0) { + return getParentEdges().front()->getLaneByAllowedVClass(SVC_PEDESTRIAN); } else { return getParentLanes().front(); } @@ -416,55 +488,45 @@ GNEStop::getAttribute(SumoXMLAttr key) const { switch (key) { case SUMO_ATTR_DURATION: - if (parametersSet & STOP_DURATION_SET) { + if (isAttributeEnabled(key)) { return time2string(duration); } else { return ""; } case SUMO_ATTR_UNTIL: - if (parametersSet & STOP_UNTIL_SET) { + if (isAttributeEnabled(key)) { return time2string(until); } else { return ""; } case SUMO_ATTR_EXTENSION: - if (parametersSet & STOP_EXTENSION_SET) { + if (isAttributeEnabled(key)) { return time2string(extension); } else { return ""; } case SUMO_ATTR_TRIGGERED: - // this is an special case - if (parametersSet & STOP_TRIGGER_SET) { - return "1"; - } else { - return "0"; - } - case SUMO_ATTR_CONTAINER_TRIGGERED: - // this is an special case - if (parametersSet & STOP_CONTAINER_TRIGGER_SET) { - return "1"; + if (triggered && containerTriggered) { + return "join"; + } else if (triggered) { + return "person"; + } else if (containerTriggered) { + return "container"; } else { - return "0"; + return "false"; } case SUMO_ATTR_EXPECTED: - if (parametersSet & STOP_EXPECTED_SET) { + if (isAttributeEnabled(key)) { return toString(awaitedPersons); } else { return ""; } - case SUMO_ATTR_EXPECTED_CONTAINERS: - if (parametersSet & STOP_EXPECTED_CONTAINERS_SET) { - return toString(awaitedContainers); - } else { - return ""; - } case SUMO_ATTR_PARKING: return toString(parking); case SUMO_ATTR_ACTTYPE: return actType; case SUMO_ATTR_TRIP_ID: - if (parametersSet & STOP_TRIP_ID_SET) { + if (isAttributeEnabled(key)) { return tripId; } else { return ""; @@ -475,6 +537,9 @@ case SUMO_ATTR_CHARGING_STATION: case SUMO_ATTR_PARKING_AREA: return getParentAdditionals().front()->getID(); + // specific of stops over edges + case SUMO_ATTR_EDGE: + return getParentEdges().front()->getID(); // specific of stops over lanes case SUMO_ATTR_LANE: return getParentLanes().front()->getID(); @@ -505,9 +570,18 @@ GNEStop::getAttributeDouble(SumoXMLAttr key) const { switch (key) { case SUMO_ATTR_STARTPOS: - return startPos; + if (getParentAdditionals().size() > 0) { + return getParentAdditionals().front()->getAttributeDouble(SUMO_ATTR_STARTPOS); + } else { + return startPos; + } case SUMO_ATTR_ENDPOS: - return endPos; + case SUMO_ATTR_ARRIVALPOS: // for person plans + if (getParentAdditionals().size() > 0) { + return getParentAdditionals().front()->getAttributeDouble(SUMO_ATTR_ENDPOS); + } else { + return endPos; + } default: throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); } @@ -516,7 +590,28 @@ Position GNEStop::getAttributePosition(SumoXMLAttr key) const { - throw InvalidArgument(getTagStr() + " doesn't have a Position attribute of type '" + toString(key) + "'"); + switch (key) { + // we use SUMO_ATTR_ARRIVALPOS instead SUMO_ATTR_ENDPOS due it's a person plan + case SUMO_ATTR_ARRIVALPOS: { + if (getParentAdditionals().size() > 0) { + // return first position of busStop + return getParentAdditionals().front()->getAdditionalGeometry().getShape().front(); + } else { + // get lane shape + const PositionVector& laneShape = getLastPathLane()->getLaneShape(); + // continue depending of arrival position + if (endPos == 0) { + return laneShape.front(); + } else if ((endPos == -1) || (endPos >= laneShape.length2D())) { + return laneShape.back(); + } else { + return laneShape.positionAtOffset2D(endPos); + } + } + } + default: + throw InvalidArgument(getTagStr() + " doesn't have a position attribute of type '" + toString(key) + "'"); + } } @@ -530,27 +625,96 @@ case SUMO_ATTR_UNTIL: case SUMO_ATTR_EXTENSION: case SUMO_ATTR_TRIGGERED: - case SUMO_ATTR_CONTAINER_TRIGGERED: case SUMO_ATTR_EXPECTED: - case SUMO_ATTR_EXPECTED_CONTAINERS: case SUMO_ATTR_PARKING: case SUMO_ATTR_ACTTYPE: case SUMO_ATTR_TRIP_ID: // specific of Stops over stoppingPlaces - case SUMO_ATTR_BUS_STOP: - case SUMO_ATTR_CONTAINER_STOP: case SUMO_ATTR_CHARGING_STATION: case SUMO_ATTR_PARKING_AREA: // specific of stops over lanes case SUMO_ATTR_LANE: case SUMO_ATTR_STARTPOS: - case SUMO_ATTR_ENDPOS: case SUMO_ATTR_FRIENDLY_POS: case SUMO_ATTR_POSITION_LAT: // case GNE_ATTR_SELECTED: undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); break; + // special case for person plans + case SUMO_ATTR_EDGE: { + // get next personPlan + GNEDemandElement* nextPersonPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this); + // continue depending of nextPersonPlan + if (nextPersonPlan) { + undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next personPlan"); + nextPersonPlan->setAttribute(SUMO_ATTR_FROM, value, undoList); + undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); + undoList->end(); + } else { + undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); + } + break; + } + case SUMO_ATTR_BUS_STOP: + if (myTagProperty.isStopPerson()) { + // get next person plan + GNEDemandElement* nextPersonPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this); + // continue depending of nextPersonPlan + if (nextPersonPlan) { + // obtain busStop + const GNEAdditional* busStop = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_BUS_STOP, value); + // change from attribute using edge ID + undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next personPlan"); + nextPersonPlan->setAttribute(SUMO_ATTR_FROM, busStop->getParentLanes().front()->getParentEdge()->getID(), undoList); + undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); + undoList->end(); + } else { + undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); + } + } else { + undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); + } + break; + case SUMO_ATTR_CONTAINER_STOP: + if (myTagProperty.isStopContainer()) { + // get next person plan + GNEDemandElement* nextPersonPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this); + // continue depending of nextPersonPlan + if (nextPersonPlan) { + // obtain containerStop + const GNEAdditional* containerStop = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, value); + // change from attribute using edge ID + undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next personPlan"); + nextPersonPlan->setAttribute(SUMO_ATTR_FROM, containerStop->getParentLanes().front()->getParentEdge()->getID(), undoList); + undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); + undoList->end(); + } else { + undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); + } + } else { + undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); + } + break; + case SUMO_ATTR_ENDPOS: + if (myTagProperty.isStopPerson() || myTagProperty.isStopContainer()) { + // get previous person plan + GNEDemandElement* previousPersonPlan = getParentDemandElements().at(0)->getPreviousChildDemandElement(this); + // check if leave presonStop connected is enabled + if (myNet->getViewNet()->getViewParent()->getMoveFrame()->getDemandModeOptions()->getLeaveStopPersonsConnected() && + previousPersonPlan && previousPersonPlan->getTagProperty().hasAttribute(SUMO_ATTR_ARRIVALPOS)) { + // change from attribute using edge ID + undoList->begin(myTagProperty.getGUIIcon(), "Change arrivalPos attribute of previous personPlan"); + previousPersonPlan->setAttribute(SUMO_ATTR_ARRIVALPOS, value, undoList); + undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); + undoList->end(); + } else { + undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); + } + } else { + undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); + } + break; default: throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); } @@ -571,17 +735,25 @@ return false; } case SUMO_ATTR_TRIGGERED: - return canParse(value); - case SUMO_ATTR_CONTAINER_TRIGGERED: - return canParse(value); - case SUMO_ATTR_EXPECTED: - case SUMO_ATTR_EXPECTED_CONTAINERS: if (value.empty()) { + return false; + } else { + const std::set expectedValues = {"true", "false", "person", "container", "join"}; + const std::vector triggeredValues = parse >(value); + for (const auto& triggeredValue : triggeredValues) { + if (expectedValues.find(triggeredValue) == expectedValues.end()) { + return false; + } + } return true; + } + case SUMO_ATTR_EXPECTED: + if (value.empty()) { + return false; } else { - std::vector IDs = parse>(value); - for (const auto& i : IDs) { - if (SUMOXMLDefinitions::isValidVehicleID(i) == false) { + const std::vector expectedValues = parse >(value); + for (const auto& expectedValue : expectedValues) { + if (!SUMOXMLDefinitions::isValidVehicleID(expectedValue)) { return false; } } @@ -602,6 +774,13 @@ return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_CHARGING_STATION, value, false) != nullptr); case SUMO_ATTR_PARKING_AREA: return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_PARKING_AREA, value, false) != nullptr); + // specific of stops over edges + case SUMO_ATTR_EDGE: + if (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr) { + return true; + } else { + return false; + } // specific of stops over lanes case SUMO_ATTR_LANE: if (myNet->getAttributeCarriers()->retrieveLane(value, false) != nullptr) { @@ -616,7 +795,9 @@ return false; } case SUMO_ATTR_ENDPOS: - if (canParse(value)) { + if (myTagProperty.isStopPerson() || myTagProperty.isStopContainer()) { + return canParse(value) && fabs(parse(value)) < getParentEdges().front()->getNBEdge()->getFinalLength(); + } else if (canParse(value)) { return SUMORouteHandler::isStopPosValid(startPos, parse(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, friendlyPos); } else { return false; @@ -640,77 +821,33 @@ void GNEStop::enableAttribute(SumoXMLAttr key, GNEUndoList* undoList) { - // obtain a copy of parameter sets - int newParametersSet = parametersSet; - // modify parametersSetCopy depending of attr switch (key) { case SUMO_ATTR_DURATION: - newParametersSet |= STOP_DURATION_SET; - break; case SUMO_ATTR_UNTIL: - newParametersSet |= STOP_UNTIL_SET; - break; case SUMO_ATTR_EXTENSION: - newParametersSet |= STOP_EXTENSION_SET; - break; case SUMO_ATTR_EXPECTED: - newParametersSet |= STOP_TRIGGER_SET; - break; case SUMO_ATTR_EXPECTED_CONTAINERS: - newParametersSet |= STOP_CONTAINER_TRIGGER_SET; - break; - case SUMO_ATTR_PARKING: - newParametersSet |= STOP_PARKING_SET; + undoList->add(new GNEChange_EnableAttribute(this, key, true)); break; default: - break; - } - // add GNEChange_EnableAttribute - undoList->add(new GNEChange_EnableAttribute(this, parametersSet, newParametersSet), true); - // modify parametersSetCopy depending of attr - switch (key) { - case SUMO_ATTR_DURATION: - undoList->changeAttribute(new GNEChange_Attribute(this, key, myTagProperty.getAttributeProperties(key).getDefaultValue())); - break; - case SUMO_ATTR_UNTIL: - case SUMO_ATTR_EXTENSION: - undoList->changeAttribute(new GNEChange_Attribute(this, key, myTagProperty.getAttributeProperties(key).getDefaultValue())); - break; - default: - break; + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); } } void GNEStop::disableAttribute(SumoXMLAttr key, GNEUndoList* undoList) { - // obtain a copy of parameter sets - int newParametersSet = parametersSet; - // modify parametersSetCopy depending of attr switch (key) { case SUMO_ATTR_DURATION: - newParametersSet &= ~STOP_DURATION_SET; - break; case SUMO_ATTR_UNTIL: - newParametersSet &= ~STOP_UNTIL_SET; - break; case SUMO_ATTR_EXTENSION: - newParametersSet &= ~STOP_EXTENSION_SET; - break; case SUMO_ATTR_EXPECTED: - newParametersSet &= ~STOP_TRIGGER_SET; - break; case SUMO_ATTR_EXPECTED_CONTAINERS: - newParametersSet &= ~STOP_CONTAINER_TRIGGER_SET; - break; - case SUMO_ATTR_PARKING: - newParametersSet &= ~STOP_PARKING_SET; + undoList->add(new GNEChange_EnableAttribute(this, key, false)); break; default: - break; + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); } - // add GNEChange_EnableAttribute - undoList->add(new GNEChange_EnableAttribute(this, parametersSet, newParametersSet), true); } @@ -734,7 +871,7 @@ case SUMO_ATTR_EXPECTED_CONTAINERS: return (parametersSet & STOP_CONTAINER_TRIGGER_SET) != 0; case SUMO_ATTR_PARKING: - return (parametersSet & STOP_PARKING_SET) != 0; + return (myTagProperty.getTag() != SUMO_TAG_STOP_PARKINGAREA); default: return true; } @@ -750,9 +887,11 @@ std::string GNEStop::getHierarchyName() const { if (getParentAdditionals().size() > 0) { - return "vehicle stop: " + getParentAdditionals().front()->getTagStr(); + return getTagProperty().getTagStr() + " stop: " + getParentAdditionals().front()->getTagStr(); + } else if (getParentEdges().size() > 0) { + return getTagProperty().getTagStr() + " stop: edge"; } else { - return "vehicle stop: lane"; + return getTagProperty().getTagStr() + " stop: lane"; } } @@ -784,6 +923,246 @@ } // =========================================================================== +// protected +// =========================================================================== + +const GNELane* +GNEStop::getFirstAllowedLane() const { + if (getParentEdges().empty()) { + return nullptr; + } + for (const auto& pLane : getParentEdges().front()->getLanes()) { + if (pLane->allowPedestrians()) { + return pLane; + } + } + return getParentEdges().front()->getLanes().front(); +} + + +bool +GNEStop::canDrawVehicleStop() const { + if (isAttributeCarrierSelected()) { + return true; + } else if (myNet->getViewNet()->isAttributeCarrierInspected(this)) { + return true; + } else if (myNet->getViewNet()->isAttributeCarrierInspected(getParentDemandElements().front())) { + return true; + } else if (myNet->getViewNet()->getDemandViewOptions().showAllTrips()) { + return true; + } else { + return false; + } +} + + +void +GNEStop::drawVehicleStop(const GUIVisualizationSettings& s, const double exaggeration) const { + // declare value to save stop color + const RGBColor stopColor = drawUsingSelectColor() ? s.colorSettings.selectedRouteColor : s.colorSettings.stopColor; + // get lane + const auto& stopLane = getParentLanes().size() > 0 ? getParentLanes().front() : nullptr; + // get lane width + const double width = stopLane ? stopLane->getParentEdge()->getNBEdge()->getLaneWidth(stopLane->getIndex()) * 0.5 : exaggeration * 0.8; + // Start drawing adding an gl identificator + GLHelper::pushName(getGlID()); + // Add a layer matrix + GLHelper::pushMatrix(); + // set Color + GLHelper::setColor(stopColor); + // Start with the drawing of the area traslating matrix to origin + myNet->getViewNet()->drawTranslateFrontAttributeCarrier(this, getType()); + // draw depending of details + if (s.drawDetail(s.detailSettings.stopsDetails, exaggeration) && stopLane) { + // Draw top and bot lines using shape, shapeRotations, shapeLengths and value of exaggeration + GLHelper::drawBoxLines(myDemandElementGeometry.getShape(), + myDemandElementGeometry.getShapeRotations(), + myDemandElementGeometry.getShapeLengths(), + exaggeration * 0.1, 0, width); + GLHelper::drawBoxLines(myDemandElementGeometry.getShape(), + myDemandElementGeometry.getShapeRotations(), + myDemandElementGeometry.getShapeLengths(), + exaggeration * 0.1, 0, width * -1); + // Add a detail matrix + GLHelper::pushMatrix(); + // move to geometry front + glTranslated(myDemandElementGeometry.getShape().back().x(), myDemandElementGeometry.getShape().back().y(), 0.1); + // rotate + if (myDemandElementGeometry.getShapeRotations().size() > 0) { + glRotated(myDemandElementGeometry.getShapeRotations().back(), 0, 0, 1); + } + // move again + glTranslated(0, exaggeration * 0.5, 0); + // draw stop front + GLHelper::drawBoxLine(Position(0, 0), 0, exaggeration * 0.5, width); + // move to "S" position + glTranslated(0, 1, 0.1); + // only draw text if isn't being drawn for selecting + if (s.drawForRectangleSelection) { + GLHelper::setColor(stopColor); + GLHelper::drawBoxLine(Position(0, 1), 0, 2, 1); + } else if (s.drawDetail(s.detailSettings.stopsText, exaggeration)) { + // draw "S" symbol + GLHelper::drawText("S", Position(), .1, 2.8, stopColor); + // move to subtitle positin + glTranslated(0, 1.4, 0); + // draw subtitle depending of tag + GLHelper::drawText("lane", Position(), .1, 1, stopColor, 180); + } + // pop detail matrix + GLHelper::popMatrix(); + // draw geometry points + drawGeometryPoints(s, stopColor); + } else { + // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration taked from stoppingPlace parent + GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, width); + } + // pop layer matrix + GLHelper::popMatrix(); + // Pop name + GLHelper::popName(); + // draw lock icon + GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), getPositionInView(), exaggeration); + // check if dotted contour has to be drawn + if (myNet->getViewNet()->isAttributeCarrierInspected(this)) { + GUIDottedGeometry::drawDottedContourShape(GUIDottedGeometry::DottedContourType::INSPECT, s, myDemandElementGeometry.getShape(), + width, exaggeration, true, true); + } + if (myNet->getViewNet()->getFrontAttributeCarrier() == this) { + GUIDottedGeometry::drawDottedContourShape(GUIDottedGeometry::DottedContourType::FRONT, s, myDemandElementGeometry.getShape(), + width, exaggeration, true, true); + } +} + + +void +GNEStop::drawStopPersonOverEdge(const GUIVisualizationSettings& s, const double exaggeration) const { + // Start drawing adding an gl identificator + GLHelper::pushName(getGlID()); + // Add layer matrix matrix + GLHelper::pushMatrix(); + // translate to front + myNet->getViewNet()->drawTranslateFrontAttributeCarrier(this, getType()); + // declare stop color + const RGBColor stopColor = drawUsingSelectColor() ? s.colorSettings.selectedPersonPlanColor : s.colorSettings.stopColor; + // declare central line color + const RGBColor centralLineColor = drawUsingSelectColor() ? stopColor.changedBrightness(-32) : RGBColor::WHITE; + // set base color + GLHelper::setColor(stopColor); + // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration + GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, 0.3 * exaggeration); + // move to front + glTranslated(0, 0, .1); + // set central color + GLHelper::setColor(centralLineColor); + // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration + GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, 0.05 * exaggeration); + // move to icon position and front + glTranslated(myDemandElementGeometry.getShape().front().x(), myDemandElementGeometry.getShape().front().y(), .1); + // rotate over lane + GUIGeometry::rotateOverLane((myDemandElementGeometry.getShapeRotations().front() * -1) + 90); + // move again + glTranslated(0, s.additionalSettings.vaporizerSize * exaggeration, 0); + // Draw icon depending of Route Probe is selected and if isn't being drawn for selecting + if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.laneTextures, exaggeration)) { + // set color + glColor3d(1, 1, 1); + // rotate texture + glRotated(180, 0, 0, 1); + // draw texture + if (drawUsingSelectColor()) { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GUITexture::STOPPERSON_SELECTED), s.additionalSettings.vaporizerSize * exaggeration); + } else { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GUITexture::STOPPERSON), s.additionalSettings.vaporizerSize * exaggeration); + } + } else { + // rotate + glRotated(22.5, 0, 0, 1); + // set stop color + GLHelper::setColor(stopColor); + // move matrix + glTranslated(0, 0, 0); + // draw filled circle + GLHelper::drawFilledCircle(0.1 + s.additionalSettings.vaporizerSize, 8); + } + // pop layer matrix + GLHelper::popMatrix(); + // Pop name + GLHelper::popName(); + // draw lock icon + GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), getPositionInView(), exaggeration); + // check if dotted contours has to be drawn + if (myNet->getViewNet()->isAttributeCarrierInspected(this)) { + GUIDottedGeometry::drawDottedContourShape(GUIDottedGeometry::DottedContourType::INSPECT, s, myDemandElementGeometry.getShape(), 0.3, + exaggeration, 1, 1); + } + if (myNet->getViewNet()->getFrontAttributeCarrier() == this) { + GUIDottedGeometry::drawDottedContourShape(GUIDottedGeometry::DottedContourType::FRONT, s, myDemandElementGeometry.getShape(), 0.3, + exaggeration, 1, 1); + } +} + + +void +GNEStop::drawStopPersonOverBusStop(const GUIVisualizationSettings& s, const double exaggeration) const { + // Start drawing adding an gl identificator + GLHelper::pushName(getGlID()); + // Add layer matrix matrix + GLHelper::pushMatrix(); + // translate to front + myNet->getViewNet()->drawTranslateFrontAttributeCarrier(this, getType()); + // declare stop color + const RGBColor stopColor = drawUsingSelectColor() ? s.colorSettings.selectedPersonPlanColor : s.colorSettings.stopColor; + // set base color + GLHelper::setColor(stopColor); + // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration + GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, s.stoppingPlaceSettings.busStopWidth * exaggeration); + // move to icon position and front + glTranslated(myDemandElementGeometry.getShape().getLineCenter().x(), myDemandElementGeometry.getShape().getLineCenter().y(), .1); + // rotate over lane + GUIGeometry::rotateOverLane((myDemandElementGeometry.getShapeRotations().front() * -1) + 90); + // move again + glTranslated(s.stoppingPlaceSettings.busStopWidth * exaggeration * -2, 0, 0); + // Draw icon depending of Route Probe is selected and if isn't being drawn for selecting + if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.laneTextures, exaggeration)) { + // set color + glColor3d(1, 1, 1); + // rotate texture + glRotated(-90, 0, 0, 1); + // draw texture + if (drawUsingSelectColor()) { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GUITexture::STOPPERSON_SELECTED), s.additionalSettings.vaporizerSize * exaggeration); + } else { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GUITexture::STOPPERSON), s.additionalSettings.vaporizerSize * exaggeration); + } + } else { + // rotate + glRotated(22.5, 0, 0, 1); + // set stop color + GLHelper::setColor(stopColor); + // move matrix + glTranslated(0, 0, 0); + // draw filled circle + GLHelper::drawFilledCircle(0.1 + s.additionalSettings.vaporizerSize, 8); + } + // pop layer matrix + GLHelper::popMatrix(); + // Pop name + GLHelper::popName(); + // draw lock icon + GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), getPositionInView(), exaggeration); + // check if dotted contours has to be drawn + if (myNet->getViewNet()->isAttributeCarrierInspected(this)) { + GUIDottedGeometry::drawDottedContourShape(GUIDottedGeometry::DottedContourType::INSPECT, s, myDemandElementGeometry.getShape(), 0.3, + exaggeration, 1, 1); + } + if (myNet->getViewNet()->getFrontAttributeCarrier() == this) { + GUIDottedGeometry::drawDottedContourShape(GUIDottedGeometry::DottedContourType::FRONT, s, myDemandElementGeometry.getShape(), 0.3, + exaggeration, 1, 1); + } +} + +// =========================================================================== // private // =========================================================================== @@ -792,74 +1171,62 @@ switch (key) { case SUMO_ATTR_DURATION: if (value.empty()) { - parametersSet &= ~STOP_DURATION_SET; + toogleAttribute(key, false, -1); } else { + toogleAttribute(key, true, -1); duration = string2time(value); - parametersSet |= STOP_DURATION_SET; } break; case SUMO_ATTR_UNTIL: if (value.empty()) { - parametersSet &= ~STOP_UNTIL_SET; + toogleAttribute(key, false, -1); } else { + toogleAttribute(key, true, -1); until = string2time(value); - parametersSet |= STOP_UNTIL_SET; } break; case SUMO_ATTR_EXTENSION: if (value.empty()) { - parametersSet &= ~STOP_EXTENSION_SET; + toogleAttribute(key, false, -1); } else { + toogleAttribute(key, true, -1); extension = string2time(value); - parametersSet |= STOP_EXTENSION_SET; } break; case SUMO_ATTR_TRIGGERED: - triggered = parse(value); - // this is an special case: only if SUMO_ATTR_TRIGGERED is true, it will be written in XML - if (triggered) { - parametersSet |= STOP_TRIGGER_SET; + if (value == "join") { + triggered = true; + containerTriggered = true; + } else if ((value == "person") || (value == "true")) { + triggered = true; + containerTriggered = false; + } else if (value == "container") { + triggered = false; + containerTriggered = true; } else { - parametersSet &= ~STOP_TRIGGER_SET; - } - break; - case SUMO_ATTR_CONTAINER_TRIGGERED: - containerTriggered = parse(value); - // this is an special case: only if SUMO_ATTR_CONTAINER_TRIGGERED is true, it will be written in XML - if (containerTriggered) { - parametersSet |= STOP_CONTAINER_TRIGGER_SET; - } else { - parametersSet &= ~STOP_CONTAINER_TRIGGER_SET; + triggered = false; + containerTriggered = false; } + toogleAttribute(SUMO_ATTR_TRIGGERED, triggered, -1); + toogleAttribute(SUMO_ATTR_EXPECTED, (awaitedPersons.size() > 0), -1); break; case SUMO_ATTR_EXPECTED: - if (value.empty()) { - parametersSet &= ~STOP_EXPECTED_SET; - } else { - awaitedPersons = parse >(value); - parametersSet |= STOP_EXPECTED_SET; - } - break; - case SUMO_ATTR_EXPECTED_CONTAINERS: - if (value.empty()) { - parametersSet &= ~STOP_EXPECTED_CONTAINERS_SET; - } else { - awaitedContainers = parse >(value); - parametersSet |= STOP_EXPECTED_CONTAINERS_SET; - } + awaitedPersons = parse >(value); + toogleAttribute(SUMO_ATTR_EXPECTED, (awaitedPersons.size() > 0), -1); break; case SUMO_ATTR_PARKING: parking = parse(value); + toogleAttribute(key, parking, -1); break; case SUMO_ATTR_ACTTYPE: actType = value; break; case SUMO_ATTR_TRIP_ID: if (value.empty()) { - parametersSet &= ~STOP_TRIP_ID_SET; + toogleAttribute(key, false, -1); } else { + toogleAttribute(key, true, -1); tripId = value; - parametersSet |= STOP_TRIP_ID_SET; } break; // specific of Stops over stoppingPlaces @@ -879,6 +1246,12 @@ replaceAdditionalParent(SUMO_TAG_PARKING_AREA, value); updateGeometry(); break; + // specific of Stops over edges + case SUMO_ATTR_EDGE: + replaceDemandParentEdges(value); + updateGeometry(); + edge = value; + break; // specific of Stops over lanes case SUMO_ATTR_LANE: replaceDemandParentLanes(value); @@ -897,11 +1270,11 @@ break; case SUMO_ATTR_POSITION_LAT: if (value.empty()) { + toogleAttribute(key, false, -1); posLat = INVALID_DOUBLE; - parametersSet &= ~ STOP_POSLAT_SET; } else { + toogleAttribute(key, true, -1); posLat = parse(value); - parametersSet |= STOP_POSLAT_SET; } break; // @@ -919,33 +1292,90 @@ void -GNEStop::setEnabledAttribute(const int enabledAttributes) { - parametersSet = enabledAttributes; +GNEStop::toogleAttribute(SumoXMLAttr key, const bool value, const int /*previousParameters*/) { + switch (key) { + case SUMO_ATTR_DURATION: + if (value) { + parametersSet |= STOP_DURATION_SET; + } else { + parametersSet &= ~STOP_DURATION_SET; + } + break; + case SUMO_ATTR_UNTIL: + if (value) { + parametersSet |= STOP_UNTIL_SET; + } else { + parametersSet &= ~STOP_UNTIL_SET; + } + break; + case SUMO_ATTR_EXTENSION: + if (value) { + parametersSet |= STOP_EXTENSION_SET; + } else { + parametersSet &= ~STOP_EXTENSION_SET; + } + break; + case SUMO_ATTR_TRIGGERED: + if (value) { + parametersSet |= STOP_TRIGGER_SET; + } else { + parametersSet &= ~STOP_TRIGGER_SET; + } + break; + case SUMO_ATTR_EXPECTED: + if (value) { + parametersSet |= STOP_EXPECTED_SET; + } else { + parametersSet &= ~STOP_EXPECTED_SET; + } + break; + case SUMO_ATTR_PARKING: + if (value) { + parametersSet |= STOP_PARKING_SET; + } else { + parametersSet &= ~STOP_PARKING_SET; + } + break; + case SUMO_ATTR_POSITION_LAT: + if (value) { + parametersSet |= STOP_POSLAT_SET; + } else { + parametersSet &= ~STOP_POSLAT_SET; + } + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } } void GNEStop::setMoveShape(const GNEMoveResult& moveResult) { - if (moveResult.operationType == GNEMoveOperation::OperationType::ONE_LANE_MOVEFIRST) { - // change only start position - startPos = moveResult.newFirstPos; - // adjust startPos - if (startPos > (getAttributeDouble(SUMO_ATTR_ENDPOS) - POSITION_EPS)) { - startPos = (getAttributeDouble(SUMO_ATTR_ENDPOS) - POSITION_EPS); - } - } else if (moveResult.operationType == GNEMoveOperation::OperationType::ONE_LANE_MOVESECOND) { - // change only end position + if (myTagProperty.isStopPerson() || myTagProperty.isStopContainer()) { + // change endPos endPos = moveResult.newFirstPos; - // adjust endPos - if (endPos < (getAttributeDouble(SUMO_ATTR_STARTPOS) + POSITION_EPS)) { - endPos = (getAttributeDouble(SUMO_ATTR_STARTPOS) + POSITION_EPS); - } } else { - // change both position - startPos = moveResult.newFirstPos; - endPos = moveResult.newSecondPos; - // set lateral offset - myMoveElementLateralOffset = moveResult.firstLaneOffset; + if (moveResult.operationType == GNEMoveOperation::OperationType::ONE_LANE_MOVEFIRST) { + // change only start position + startPos = moveResult.newFirstPos; + // adjust startPos + if (startPos > (getAttributeDouble(SUMO_ATTR_ENDPOS) - POSITION_EPS)) { + startPos = (getAttributeDouble(SUMO_ATTR_ENDPOS) - POSITION_EPS); + } + } else if (moveResult.operationType == GNEMoveOperation::OperationType::ONE_LANE_MOVESECOND) { + // change only end position + endPos = moveResult.newFirstPos; + // adjust endPos + if (endPos < (getAttributeDouble(SUMO_ATTR_STARTPOS) + POSITION_EPS)) { + endPos = (getAttributeDouble(SUMO_ATTR_STARTPOS) + POSITION_EPS); + } + } else { + // change both position + startPos = moveResult.newFirstPos; + endPos = moveResult.newSecondPos; + // set lateral offset + myMoveElementLateralOffset = moveResult.firstLaneOffset; + } } // update geometry updateGeometry(); @@ -956,21 +1386,26 @@ GNEStop::commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) { // begin change attribute undoList->begin(myTagProperty.getGUIIcon(), "position of " + getTagStr()); - // set attributes depending of operation type - if (moveResult.operationType == GNEMoveOperation::OperationType::ONE_LANE_MOVEFIRST) { - // set only start position - undoList->changeAttribute(new GNEChange_Attribute(this, SUMO_ATTR_STARTPOS, toString(moveResult.newFirstPos))); - } else if (moveResult.operationType == GNEMoveOperation::OperationType::ONE_LANE_MOVESECOND) { - // set only end position - undoList->changeAttribute(new GNEChange_Attribute(this, SUMO_ATTR_ENDPOS, toString(moveResult.newFirstPos))); - } else { - // set both - undoList->changeAttribute(new GNEChange_Attribute(this, SUMO_ATTR_STARTPOS, toString(moveResult.newFirstPos))); - undoList->changeAttribute(new GNEChange_Attribute(this, SUMO_ATTR_ENDPOS, toString(moveResult.newSecondPos))); - // check if lane has to be changed - if (moveResult.newFirstLane) { - // set new lane - setAttribute(SUMO_ATTR_LANE, moveResult.newFirstLane->getID(), undoList); + if (myTagProperty.isStopPerson() || myTagProperty.isStopContainer()) { + // now adjust endPos position + setAttribute(SUMO_ATTR_ENDPOS, toString(moveResult.newFirstPos), undoList); + } else { + // set attributes depending of operation type + if (moveResult.operationType == GNEMoveOperation::OperationType::ONE_LANE_MOVEFIRST) { + // set only start position + undoList->changeAttribute(new GNEChange_Attribute(this, SUMO_ATTR_STARTPOS, toString(moveResult.newFirstPos))); + } else if (moveResult.operationType == GNEMoveOperation::OperationType::ONE_LANE_MOVESECOND) { + // set only end position + undoList->changeAttribute(new GNEChange_Attribute(this, SUMO_ATTR_ENDPOS, toString(moveResult.newFirstPos))); + } else { + // set both + undoList->changeAttribute(new GNEChange_Attribute(this, SUMO_ATTR_STARTPOS, toString(moveResult.newFirstPos))); + undoList->changeAttribute(new GNEChange_Attribute(this, SUMO_ATTR_ENDPOS, toString(moveResult.newSecondPos))); + // check if lane has to be changed + if (moveResult.newFirstLane) { + // set new lane + setAttribute(SUMO_ATTR_LANE, moveResult.newFirstLane->getID(), undoList); + } } } // end change attribute diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEStop.h sumo-1.12.0/src/netedit/elements/demand/GNEStop.h --- sumo-1.11.0/src/netedit/elements/demand/GNEStop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEStop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,11 +32,17 @@ class GNEStop : public GNEDemandElement, public SUMOVehicleParameter::Stop { public: + /// @brief default constructor + GNEStop(SumoXMLTag tag, GNENet* net); + /// @brief constructor used for stops over stoppingPlaces - GNEStop(SumoXMLTag tag, GNENet* net, const SUMOVehicleParameter::Stop& stopParameter, GNEAdditional* stoppingPlace, GNEDemandElement* stopParent); + GNEStop(SumoXMLTag tag, GNENet* net, GNEDemandElement* stopParent, GNEAdditional* stoppingPlace, const SUMOVehicleParameter::Stop& stopParameter); + + /// @brief constructor used for stops over lane (only for vehicle/route stops) + GNEStop(GNENet* net, GNEDemandElement* stopParent, GNELane* lane, const SUMOVehicleParameter::Stop& stopParameter); - /// @brief constructor used for stops over lanes - GNEStop(GNENet* net, const SUMOVehicleParameter::Stop& stopParameter, GNELane* lane, GNEDemandElement* stopParent); + /// @brief constructor used for stops over edge (only for person/container stops) + GNEStop(SumoXMLTag tag, GNENet* net, GNEDemandElement* stopParent, GNEEdge* edge, const SUMOVehicleParameter::Stop& stopParameter); /// @brief destructor ~GNEStop(); @@ -58,7 +64,7 @@ void writeDemandElement(OutputDevice& device) const; /// @brief check if current demand element is valid to be writed into XML (by default true, can be reimplemented in children) - bool isDemandElementValid() const; + Problem isDemandElementValid() const; /// @brief return a string with the current demand element problem (by default empty, can be reimplemented in children) std::string getDemandElementProblem() const; @@ -224,12 +230,27 @@ /// @brief value for saving second original position over lane before moving std::string mySecondOriginalPosition; + /// @brief get first valid lane + const GNELane* getFirstAllowedLane() const; + + /// @brief check if vehicle stop can be draw + bool canDrawVehicleStop() const; + + /// @brief draw vehicle stop + void drawVehicleStop(const GUIVisualizationSettings& s, const double exaggeration) const; + + /// @brief draw stopPerson over lane + void drawStopPersonOverEdge(const GUIVisualizationSettings& s, const double exaggeration) const; + + /// @brief draw stopPerson over busStop + void drawStopPersonOverBusStop(const GUIVisualizationSettings& s, const double exaggeration) const; + private: /// @brief method for setting the attribute and nothing else void setAttribute(SumoXMLAttr key, const std::string& value); - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief set move shape void setMoveShape(const GNEMoveResult& moveResult); diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEStopPerson.cpp sumo-1.12.0/src/netedit/elements/demand/GNEStopPerson.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNEStopPerson.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEStopPerson.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,767 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GNEStopPerson.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2020 -/// -// Representation of person stops in NETEDIT -/****************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEStopPerson.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEStopPerson::GNEStopPerson(GNENet* net, GNEDemandElement* personParent, GNEAdditional* stoppingPlace, const SUMOVehicleParameter::Stop& stopParameter) : - GNEDemandElement(personParent, net, GLO_STOP_PERSON, GNE_TAG_STOPPERSON_BUSSTOP, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, -{}, {}, {}, {stoppingPlace}, {}, {}, {personParent}, {}), -SUMOVehicleParameter::Stop(stopParameter) { -} - - -GNEStopPerson::GNEStopPerson(GNENet* net, GNEDemandElement* personParent, GNEEdge* edge, const SUMOVehicleParameter::Stop& stopParameter) : - GNEDemandElement(personParent, net, GLO_STOP_PERSON, GNE_TAG_STOPPERSON_EDGE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, -{}, {edge}, {}, {}, {}, {}, {personParent}, {}), -SUMOVehicleParameter::Stop(stopParameter) { -} - - -GNEStopPerson::~GNEStopPerson() {} - - -GNEMoveOperation* -GNEStopPerson::getMoveOperation() { - if (myTagProperty.getTag() == GNE_TAG_STOPPERSON_EDGE) { - // return move operation for additional placed over shape - return new GNEMoveOperation(this, getParentEdges().front()->getLanes().front(), endPos, - myNet->getViewNet()->getViewParent()->getMoveFrame()->getCommonModeOptions()->getAllowChangeLane()); - } else { - return nullptr; - } -} - - -std::string -GNEStopPerson::getBegin() const { - return ""; -} - - -void -GNEStopPerson::writeDemandElement(OutputDevice& device) const { - write(device); -} - - -bool -GNEStopPerson::isDemandElementValid() const { - // get lane - const GNELane* firstLane = getFirstAllowedLane(); - // only Stops placed over lanes can be invalid - if (myTagProperty.getTag() != SUMO_TAG_STOP_LANE) { - return isPersonPlanValid(); - } else if (friendlyPos) { - // with friendly position enabled position are "always fixed" - return isPersonPlanValid();; - } else if (firstLane != nullptr) { - // obtain lane length - const double laneLength = getParentEdges().front()->getNBEdge()->getFinalLength() * firstLane->getLengthGeometryFactor(); - // declare end pos fixed - const double endPosFixed = (endPos < 0) ? (endPos + laneLength) : endPos; - // check values - if ((endPosFixed <= getParentEdges().front()->getNBEdge()->getFinalLength()) && (endPosFixed > 0)) { - return isPersonPlanValid(); - } else { - return false; - } - } else { - return false; - } -} - - -std::string -GNEStopPerson::getDemandElementProblem() const { - if (friendlyPos) { - return getPersonPlanProblem(); - } else { - // obtain lane length - const double laneLength = getParentEdges().front()->getNBEdge()->getFinalLength(); - // declare end pos fixed - const double endPosFixed = (endPos < 0) ? (endPos + laneLength) : endPos; - // check positions over lane - if (endPosFixed < 0) { - return (toString(SUMO_ATTR_ENDPOS) + " < 0"); - } else if (endPosFixed > getParentEdges().front()->getNBEdge()->getFinalLength()) { - return (toString(SUMO_ATTR_ENDPOS) + " > lanes's length"); - } else { - return getPersonPlanProblem(); - } - } -} - - -void -GNEStopPerson::fixDemandElementProblem() { - // -} - - -SUMOVehicleClass -GNEStopPerson::getVClass() const { - return getParentDemandElements().front()->getVClass(); -} - - -const RGBColor& -GNEStopPerson::getColor() const { - return myNet->getViewNet()->getVisualisationSettings().colorSettings.stopPersonColor; -} - - -void -GNEStopPerson::updateGeometry() { - // only update Stops over edges - if (getParentAdditionals().size() > 0) { - // get busStop shape - const PositionVector& busStopShape = getParentAdditionals().front()->getAdditionalGeometry().getShape(); - // update demand element geometry using both positions - myDemandElementGeometry.updateGeometry(busStopShape, busStopShape.length2D() - 0.6, busStopShape.length2D(), 0); - } else { - // get front and back lane - const GNELane* frontLane = getParentEdges().front()->getLanes().front(); - const GNELane* backLane = getParentEdges().front()->getLanes().back(); - // get lane drawing constants - GNELane::LaneDrawingConstants laneDrawingConstantsFront(myNet->getViewNet()->getVisualisationSettings(), frontLane); - GNELane::LaneDrawingConstants laneDrawingConstantBack(myNet->getViewNet()->getVisualisationSettings(), backLane); - // calculate front position - const Position frontPosition = frontLane->getLaneShape().positionAtOffset2D(getAttributeDouble(SUMO_ATTR_ARRIVALPOS), laneDrawingConstantsFront.halfWidth); - // calulate length between both shapes - const double length = backLane->getLaneShape().distance2D(frontPosition, true); - // calculate back position - const Position backPosition = frontLane->getLaneShape().positionAtOffset2D(getAttributeDouble(SUMO_ATTR_ARRIVALPOS), (length + laneDrawingConstantBack.halfWidth - laneDrawingConstantsFront.halfWidth) * -1); - // update demand element geometry using both positions - myDemandElementGeometry.updateGeometry({frontPosition, backPosition}); - } -} - - -Position -GNEStopPerson::getPositionInView() const { - // check if is placed over a busStop - if (getParentAdditionals().size() > 0) { - return getParentAdditionals().front()->getPositionInView(); - } else { - // get lane - const GNELane* personLane = getParentEdges().front()->getLaneByAllowedVClass(SVC_PEDESTRIAN); - // get position over lane shape - if (endPos <= 0) { - return personLane->getLaneShape().front(); - } else if (endPos >= personLane->getLaneShape().length2D()) { - return personLane->getLaneShape().back(); - } else { - return personLane->getLaneShape().positionAtOffset2D(endPos); - } - } -} - - -std::string -GNEStopPerson::getParentName() const { - // get lane - const GNELane* const firstLane = getFirstAllowedLane(); - if (getParentDemandElements().size() > 0) { - return getParentDemandElements().front()->getID(); - } else if (getParentAdditionals().size() > 0) { - return getParentAdditionals().front()->getID(); - } else if (firstLane != nullptr) { - return firstLane->getID(); - } else { - throw ProcessError("Invalid parent"); - } -} - - -double -GNEStopPerson::getExaggeration(const GUIVisualizationSettings& s) const { - return s.addSize.getExaggeration(s, this); -} - - -Boundary -GNEStopPerson::getCenteringBoundary() const { - // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) - if (getParentAdditionals().size() > 0) { - return getParentAdditionals().at(0)->getCenteringBoundary(); - } else { - Boundary b; - b.add(getPositionInView()); - b.grow(20); - return b; - } -} - - -void -GNEStopPerson::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNEStopPerson::drawGL(const GUIVisualizationSettings& s) const { - // check if stop can be drawn - if (drawPersonPlan()) { - // Obtain exaggeration of the draw - const double exaggeration = getExaggeration(s); - // declare stop color - const RGBColor stopColor = drawUsingSelectColor() ? s.colorSettings.selectedPersonPlanColor : s.colorSettings.stopColor; - // Start drawing adding an gl identificator - GLHelper::pushName(getGlID()); - // Add layer matrix matrix - GLHelper::pushMatrix(); - // translate to front - myNet->getViewNet()->drawTranslateFrontAttributeCarrier(this, getType()); - // check if draw stopPerson over busStop oder over lane - if (getParentAdditionals().size() > 0) { - drawStopPersonOverBusStop(s, exaggeration, stopColor); - } else { - drawStopPersonOverLane(s, exaggeration, stopColor); - } - // pop layer matrix - GLHelper::popMatrix(); - // Pop name - GLHelper::popName(); - // draw lock icon - GNEViewNetHelper::LockIcon::drawLockIcon(this, getType(), getPositionInView(), exaggeration); - // check if dotted contours has to be drawn - if (myNet->getViewNet()->isAttributeCarrierInspected(this)) { - GUIDottedGeometry::drawDottedContourShape(GUIDottedGeometry::DottedContourType::INSPECT, s, myDemandElementGeometry.getShape(), 0.3, - exaggeration, 1, 1); - } - if (myNet->getViewNet()->getFrontAttributeCarrier() == this) { - GUIDottedGeometry::drawDottedContourShape(GUIDottedGeometry::DottedContourType::FRONT, s, myDemandElementGeometry.getShape(), 0.3, - exaggeration, 1, 1); - } - // draw person parent if this stop if their first person plan child - if ((getParentDemandElements().size() == 1) && getParentDemandElements().front()->getChildDemandElements().front() == this) { - getParentDemandElements().front()->drawGL(s); - } - } -} - - -void -GNEStopPerson::computePathElement() { - // only update geometry - updateGeometry(); -} - - -void -GNEStopPerson::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*lane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const { - // stopPersons don't use drawPartialGL -} - - -void -GNEStopPerson::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*fromLane*/, const GNELane* /*toLane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const { - // stopPersons don't use drawPartialGL -} - - -GNELane* -GNEStopPerson::getFirstPathLane() const { - // check if stop is placed over a busStop - if (getParentAdditionals().size() > 0) { - return getParentAdditionals().front()->getParentLanes().front(); - } else { - return getParentEdges().front()->getLaneByAllowedVClass(SVC_PEDESTRIAN); - } -} - - -GNELane* -GNEStopPerson::getLastPathLane() const { - // first and last path lane are the same - return getFirstPathLane(); -} - - -std::string -GNEStopPerson::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getParentDemandElements().front()->getID(); - case SUMO_ATTR_DURATION: - if (parametersSet & STOP_DURATION_SET) { - return time2string(duration); - } else { - return ""; - } - case SUMO_ATTR_UNTIL: - if (parametersSet & STOP_UNTIL_SET) { - return time2string(until); - } else { - return ""; - } - case SUMO_ATTR_ACTTYPE: - return actType; - // specific of Stops over stoppingPlaces - case SUMO_ATTR_BUS_STOP: - return getParentAdditionals().front()->getID(); - // specific of stops over edges/lanes - case SUMO_ATTR_EDGE: - return getParentEdges().front()->getID(); - case SUMO_ATTR_ENDPOS: - return toString(endPos); - case SUMO_ATTR_FRIENDLY_POS: - return toString(friendlyPos); - // - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARENT: - return getParentDemandElements().front()->getID(); - default: - throw InvalidArgument(getTagStr() + " doesn't have a attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEStopPerson::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - // we use SUMO_ATTR_ARRIVALPOS instead SUMO_ATTR_ENDPOS due it's a person plan - case SUMO_ATTR_ARRIVALPOS: - if (getParentAdditionals().size() > 0) { - return getParentAdditionals().front()->getAttributeDouble(SUMO_ATTR_ENDPOS); - } else { - return endPos; - } - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -Position -GNEStopPerson::getAttributePosition(SumoXMLAttr key) const { - switch (key) { - // we use SUMO_ATTR_ARRIVALPOS instead SUMO_ATTR_ENDPOS due it's a person plan - case SUMO_ATTR_ARRIVALPOS: { - if (getParentAdditionals().size() > 0) { - // return first position of busStop - return getParentAdditionals().front()->getAdditionalGeometry().getShape().front(); - } else { - // get lane shape - const PositionVector& laneShape = getLastPathLane()->getLaneShape(); - // continue depending of arrival position - if (endPos == 0) { - return laneShape.front(); - } else if ((endPos == -1) || (endPos >= laneShape.length2D())) { - return laneShape.back(); - } else { - return laneShape.positionAtOffset2D(endPos); - } - } - } - default: - throw InvalidArgument(getTagStr() + " doesn't have a position attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEStopPerson::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { - if (value == getAttribute(key)) { - return; //avoid needless changes, later logic relies on the fact that attributes have changed - } - switch (key) { - case SUMO_ATTR_DURATION: - case SUMO_ATTR_UNTIL: - case SUMO_ATTR_EXTENSION: - case SUMO_ATTR_ACTTYPE: - case GNE_ATTR_SELECTED: - case SUMO_ATTR_FRIENDLY_POS: - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - break; - case SUMO_ATTR_EDGE: { - // get next personPlan - GNEDemandElement* nextPersonPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this); - // continue depending of nextPersonPlan - if (nextPersonPlan) { - undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next personPlan"); - nextPersonPlan->setAttribute(SUMO_ATTR_FROM, value, undoList); - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - undoList->end(); - } else { - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - } - break; - } - case SUMO_ATTR_BUS_STOP: { - // get next person plan - GNEDemandElement* nextPersonPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this); - // continue depending of nextPersonPlan - if (nextPersonPlan) { - // obtain busStop - const GNEAdditional* busStop = myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_BUS_STOP, value); - // change from attribute using edge ID - undoList->begin(myTagProperty.getGUIIcon(), "Change from attribute of next personPlan"); - nextPersonPlan->setAttribute(SUMO_ATTR_FROM, busStop->getParentLanes().front()->getParentEdge()->getID(), undoList); - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - undoList->end(); - } else { - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - } - break; - } - case SUMO_ATTR_ENDPOS: { - // get previous person plan - GNEDemandElement* previousPersonPlan = getParentDemandElements().at(0)->getPreviousChildDemandElement(this); - // check if leave presonStop connected is enabled - if (myNet->getViewNet()->getViewParent()->getMoveFrame()->getDemandModeOptions()->getLeaveStopPersonsConnected() && - previousPersonPlan && previousPersonPlan->getTagProperty().hasAttribute(SUMO_ATTR_ARRIVALPOS)) { - // change from attribute using edge ID - undoList->begin(myTagProperty.getGUIIcon(), "Change arrivalPos attribute of previous personPlan"); - previousPersonPlan->setAttribute(SUMO_ATTR_ARRIVALPOS, value, undoList); - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - undoList->end(); - } else { - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - } - break; - } - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEStopPerson::isValid(SumoXMLAttr key, const std::string& value) { - // declare string error - std::string error; - switch (key) { - case SUMO_ATTR_DURATION: - case SUMO_ATTR_UNTIL: - case SUMO_ATTR_EXTENSION: - if (canParse(value)) { - return parse(value) >= 0; - } else { - return false; - } - case SUMO_ATTR_ACTTYPE: - return true; - // specific of Stops over stoppingPlaces - case SUMO_ATTR_BUS_STOP: - return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr); - // specific of stops over edges/lanes - case SUMO_ATTR_EDGE: - if (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr) { - return true; - } else { - return false; - } - case SUMO_ATTR_ENDPOS: - return canParse(value) && fabs(parse(value)) < getParentEdges().front()->getNBEdge()->getFinalLength(); - case SUMO_ATTR_FRIENDLY_POS: - return canParse(value); - // - case GNE_ATTR_SELECTED: - return canParse(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEStopPerson::enableAttribute(SumoXMLAttr key, GNEUndoList* undoList) { - // obtain a copy of parameter sets - int newParametersSet = parametersSet; - // modify parametersSetCopy depending of attr - switch (key) { - case SUMO_ATTR_DURATION: - newParametersSet |= STOP_DURATION_SET; - break; - case SUMO_ATTR_UNTIL: - newParametersSet |= STOP_UNTIL_SET; - break; - default: - break; - } - // add GNEChange_EnableAttribute - undoList->add(new GNEChange_EnableAttribute(this, parametersSet, newParametersSet), true); - // modify parametersSetCopy depending of attr - switch (key) { - case SUMO_ATTR_DURATION: - undoList->changeAttribute(new GNEChange_Attribute(this, key, myTagProperty.getAttributeProperties(key).getDefaultValue())); - break; - case SUMO_ATTR_UNTIL: - case SUMO_ATTR_EXTENSION: - undoList->changeAttribute(new GNEChange_Attribute(this, key, myTagProperty.getAttributeProperties(key).getDefaultValue())); - break; - default: - break; - } -} - - -void -GNEStopPerson::disableAttribute(SumoXMLAttr key, GNEUndoList* undoList) { - // obtain a copy of parameter sets - int newParametersSet = parametersSet; - // modify parametersSetCopy depending of attr - switch (key) { - case SUMO_ATTR_DURATION: - newParametersSet &= ~STOP_DURATION_SET; - break; - case SUMO_ATTR_UNTIL: - newParametersSet &= ~STOP_UNTIL_SET; - break; - case SUMO_ATTR_EXTENSION: - newParametersSet &= ~STOP_EXTENSION_SET; - break; - default: - break; - } - // add GNEChange_EnableAttribute - undoList->add(new GNEChange_EnableAttribute(this, parametersSet, newParametersSet), true); -} - - -bool -GNEStopPerson::isAttributeEnabled(SumoXMLAttr key) const { - if (key == SUMO_ATTR_FROM) { - return (getParentDemandElements().at(0)->getPreviousChildDemandElement(this) == nullptr); - } else { - return true; - } -} - - -std::string -GNEStopPerson::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEStopPerson::getHierarchyName() const { - if (getParentAdditionals().size() > 0) { - return "person stop: " + getParentAdditionals().front()->getTagStr(); - } else { - return "person stop: lane"; - } -} - - -const std::map& -GNEStopPerson::getACParametersMap() const { - return getParametersMap(); -} - - -const GNELane* -GNEStopPerson::getFirstAllowedLane() const { - if (getParentEdges().empty()) { - return nullptr; - } - for (const auto& pLane : getParentEdges().front()->getLanes()) { - if (pLane->allowPedestrians()) { - return pLane; - } - } - return getParentEdges().front()->getLanes().front(); -} - - -void -GNEStopPerson::drawStopPersonOverLane(const GUIVisualizationSettings& s, const double exaggeration, const RGBColor& stopColor) const { - // declare central line color - const RGBColor centralLineColor = drawUsingSelectColor() ? stopColor.changedBrightness(-32) : RGBColor::WHITE; - // set base color - GLHelper::setColor(stopColor); - // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration - GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, 0.3 * exaggeration); - // move to front - glTranslated(0, 0, .1); - // set central color - GLHelper::setColor(centralLineColor); - // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration - GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, 0.05 * exaggeration); - // move to icon position and front - glTranslated(myDemandElementGeometry.getShape().front().x(), myDemandElementGeometry.getShape().front().y(), .1); - // rotate over lane - GUIGeometry::rotateOverLane((myDemandElementGeometry.getShapeRotations().front() * -1) + 90); - // move again - glTranslated(0, s.additionalSettings.vaporizerSize * exaggeration, 0); - // Draw icon depending of Route Probe is selected and if isn't being drawn for selecting - if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.laneTextures, exaggeration)) { - // set color - glColor3d(1, 1, 1); - // rotate texture - glRotated(180, 0, 0, 1); - // draw texture - if (drawUsingSelectColor()) { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GUITexture::STOPPERSON_SELECTED), s.additionalSettings.vaporizerSize * exaggeration); - } else { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GUITexture::STOPPERSON), s.additionalSettings.vaporizerSize * exaggeration); - } - } else { - // rotate - glRotated(22.5, 0, 0, 1); - // set stop color - GLHelper::setColor(stopColor); - // move matrix - glTranslated(0, 0, 0); - // draw filled circle - GLHelper::drawFilledCircle(0.1 + s.additionalSettings.vaporizerSize, 8); - } -} - - -void -GNEStopPerson::drawStopPersonOverBusStop(const GUIVisualizationSettings& s, const double exaggeration, const RGBColor& stopColor) const { - // set base color - GLHelper::setColor(stopColor); - // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration - GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myDemandElementGeometry, s.stoppingPlaceSettings.busStopWidth * exaggeration); - // move to icon position and front - glTranslated(myDemandElementGeometry.getShape().getLineCenter().x(), myDemandElementGeometry.getShape().getLineCenter().y(), .1); - // rotate over lane - GUIGeometry::rotateOverLane((myDemandElementGeometry.getShapeRotations().front() * -1) + 90); - // move again - glTranslated(s.stoppingPlaceSettings.busStopWidth * exaggeration * -2, 0, 0); - // Draw icon depending of Route Probe is selected and if isn't being drawn for selecting - if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.laneTextures, exaggeration)) { - // set color - glColor3d(1, 1, 1); - // rotate texture - glRotated(-90, 0, 0, 1); - // draw texture - if (drawUsingSelectColor()) { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GUITexture::STOPPERSON_SELECTED), s.additionalSettings.vaporizerSize * exaggeration); - } else { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GUITexture::STOPPERSON), s.additionalSettings.vaporizerSize * exaggeration); - } - } else { - // rotate - glRotated(22.5, 0, 0, 1); - // set stop color - GLHelper::setColor(stopColor); - // move matrix - glTranslated(0, 0, 0); - // draw filled circle - GLHelper::drawFilledCircle(0.1 + s.additionalSettings.vaporizerSize, 8); - } -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEStopPerson::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_DURATION: - if (value.empty()) { - parametersSet &= ~STOP_DURATION_SET; - } else { - duration = string2time(value); - parametersSet |= STOP_DURATION_SET; - } - break; - case SUMO_ATTR_UNTIL: - if (value.empty()) { - parametersSet &= ~STOP_UNTIL_SET; - } else { - until = string2time(value); - parametersSet |= STOP_UNTIL_SET; - } - break; - case SUMO_ATTR_ACTTYPE: - actType = value; - break; - // specific of Stops over stoppingPlaces - case SUMO_ATTR_BUS_STOP: - replaceAdditionalParent(SUMO_TAG_BUS_STOP, value); - updateGeometry(); - break; - // specific of Stops over edges/lanes - case SUMO_ATTR_EDGE: - replaceDemandParentEdges(value); - updateGeometry(); - edge = value; - break; - case SUMO_ATTR_ENDPOS: - endPos = parse(value); - updateGeometry(); - break; - case SUMO_ATTR_FRIENDLY_POS: - friendlyPos = parse(value); - break; - // - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEStopPerson::setEnabledAttribute(const int enabledAttributes) { - parametersSet = enabledAttributes; -} - - -void -GNEStopPerson::setMoveShape(const GNEMoveResult& moveResult) { - // change endPos - endPos = moveResult.newFirstPos; - // update geometry - updateGeometry(); -} - - -void -GNEStopPerson::commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) { - undoList->begin(myTagProperty.getGUIIcon(), "endPos of " + getTagStr()); - // now adjust endPos position - setAttribute(SUMO_ATTR_ENDPOS, toString(moveResult.newFirstPos), undoList); - undoList->end(); -} - -/****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEStopPerson.h sumo-1.12.0/src/netedit/elements/demand/GNEStopPerson.h --- sumo-1.11.0/src/netedit/elements/demand/GNEStopPerson.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEStopPerson.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,236 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GNEStopPerson.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2020 -/// -// Representation of person stops in NETEDIT -/****************************************************************************/ -#pragma once -#include -#include - -#include "GNEDemandElement.h" - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEStopPerson - */ -class GNEStopPerson : public GNEDemandElement, public SUMOVehicleParameter::Stop { - -public: - /// @brief constructor used for stops over busStops - GNEStopPerson(GNENet* net, GNEDemandElement* personParent, GNEAdditional* stoppingPlace, const SUMOVehicleParameter::Stop& stopParameter); - - /// @brief constructor used for stops over lanes - GNEStopPerson(GNENet* net, GNEDemandElement* personParent, GNEEdge* edge, const SUMOVehicleParameter::Stop& stopParameter); - - /// @brief destructor - ~GNEStopPerson(); - - /**@brief get move operation - * @note returned GNEMoveOperation can be nullptr - */ - GNEMoveOperation* getMoveOperation(); - - /**@brief get begin time of demand element - * @note: used by demand elements of type "Vehicle", and it has to be implemented as children - * @throw invalid argument if demand element doesn't has a begin time - */ - std::string getBegin() const; - - /**@brief writte demand element element into a xml file - * @param[in] device device in which write parameters of demand element element - */ - void writeDemandElement(OutputDevice& device) const; - - /// @brief check if current demand element is valid to be writed into XML (by default true, can be reimplemented in children) - bool isDemandElementValid() const; - - /// @brief return a string with the current demand element problem (by default empty, can be reimplemented in children) - std::string getDemandElementProblem() const; - - /// @brief fix demand element problem (by default throw an exception, has to be reimplemented in children) - void fixDemandElementProblem(); - - /// @name members and functions relative to elements common to all demand elements - /// @{ - /// @brief obtain VClass related with this demand element - SUMOVehicleClass getVClass() const; - - /// @brief get color - const RGBColor& getColor() const; - - /// @} - - /// @name Functions related with geometry of element - /// @{ - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief Returns position of demand element in view - Position getPositionInView() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /// @brief return exaggeration asociated with this GLObject - double getExaggeration(const GUIVisualizationSettings& s) const; - - /**@brief Returns the boundary to which the view shall be centered in order to show the object - * @return The boundary the object is within - */ - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); - - /**@brief Draws the object - * @param[in] s The settings for the current view (may influence drawing) - * @see GUIGlObject::drawGL - */ - void drawGL(const GUIVisualizationSettings& s) const; - - /// @} - - /// @name inherited from GNEPathManager::PathElement - /// @{ - - /// @brief compute pathElement - void computePathElement(); - - /**@brief Draws partial object - * @param[in] s The settings for the current view (may influence drawing) - * @param[in] lane lane in which draw partial - * @param[in] segment PathManager segment (used for segment options) - * @param[in] offsetFront extra front offset (used for drawing partial gl above other elements) - */ - void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const; - - /**@brief Draws partial object (junction) - * @param[in] s The settings for the current view (may influence drawing) - * @param[in] fromLane from GNELane - * @param[in] toLane to GNELane - * @param[in] segment PathManager segment (used for segment options) - * @param[in] offsetFront extra front offset (used for drawing partial gl above other elements) - */ - void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const; - - /// @brief get first path lane - GNELane* getFirstPathLane() const; - - /// @brief get last path lane - GNELane* getLastPathLane() const; - /// @} - - /// @brief inherited from GNEAttributeCarrier - /// @{ - /* @brief method for getting the Attribute of an XML key - * @param[in] key The attribute key - * @return string with the value associated to key - */ - std::string getAttribute(SumoXMLAttr key) const; - - /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse(...) for certain attributes) - * @param[in] key The attribute key - * @return double with the value associated to key - */ - double getAttributeDouble(SumoXMLAttr key) const; - - /* @brief method for getting the Attribute of an XML key in Position format (used in person plans) - * @param[in] key The attribute key - * @return double with the value associated to key - */ - Position getAttributePosition(SumoXMLAttr key) const; - - /* @brief method for setting the attribute and letting the object perform demand element changes - * @param[in] key The attribute key - * @param[in] value The new value - * @param[in] undoList The undoList on which to register changes - * @param[in] net optionally the GNENet to inform about gui updates - */ - void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList); - - /* @brief method for setting the attribute and letting the object perform demand element changes - * @param[in] key The attribute key - * @param[in] value The new value - * @param[in] undoList The undoList on which to register changes - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @brief method for enable attribute - * @param[in] key The attribute key - * @param[in] undoList The undoList on which to register changes - * @note certain attributes can be only enabled, and can produce the disabling of other attributes - */ - void enableAttribute(SumoXMLAttr key, GNEUndoList* undoList); - - /* @brief method for disable attribute - * @param[in] key The attribute key - * @param[in] undoList The undoList on which to register changes - * @note certain attributes can be only enabled, and can produce the disabling of other attributes - */ - void disableAttribute(SumoXMLAttr key, GNEUndoList* undoList); - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - bool isAttributeEnabled(SumoXMLAttr key) const; - - /// @brief get PopPup ID (Used in AC Hierarchy) - std::string getPopUpID() const; - - /// @brief get Hierarchy Name (Used in AC Hierarchy) - std::string getHierarchyName() const; - /// @} - - /// @brief get parameters map - const std::map& getACParametersMap() const; - -protected: - /// @brief get first valid lane - const GNELane* getFirstAllowedLane() const; - - /// @brief draw stopPerson over lane - void drawStopPersonOverLane(const GUIVisualizationSettings& s, const double exaggeration, const RGBColor& stopColor) const; - - /// @brief draw stopPerson over busStop - void drawStopPersonOverBusStop(const GUIVisualizationSettings& s, const double exaggeration, const RGBColor& stopColor) const; - -private: - /// @brief method for setting the attribute and nothing else - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); - - /// @brief set move shape - void setMoveShape(const GNEMoveResult& moveResult); - - /// @brief commit move shape - void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList); - - /// @brief Invalidated copy constructor. - GNEStopPerson(const GNEStopPerson&) = delete; - - /// @brief Invalidated assignment operator - GNEStopPerson& operator=(const GNEStopPerson&) = delete; -}; diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNETranship.cpp sumo-1.12.0/src/netedit/elements/demand/GNETranship.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNETranship.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNETranship.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -34,6 +34,17 @@ // method definitions // =========================================================================== +GNETranship::GNETranship(SumoXMLTag tag, GNENet* net) : + GNEDemandElement("", net, GLO_TRANSHIP, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {}, {}, {}, {}, {}, {}, {}), +mySpeed(0), +myDepartPosition(0), +myArrivalPosition(0) { + // reset default values + resetDefaultValues(); +} + + GNETranship::GNETranship(GNENet* net, GNEDemandElement* containerParent, GNEEdge* fromEdge, GNEEdge* toEdge, const double speed, const double departPosition, const double arrivalPosition) : GNEDemandElement(containerParent, net, GLO_TRANSHIP, GNE_TAG_TRANSHIP_EDGE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, @@ -146,23 +157,22 @@ } -bool +GNEDemandElement::Problem GNETranship::isDemandElementValid() const { if (getParentEdges().size() == 2) { if (getParentEdges().at(0) == getParentEdges().at(1)) { // from and to are the same edges, then path is valid - return true; + return Problem::OK; } else { // check if exist a route between parent edges - return (myNet->getPathManager()->getPathCalculator()->calculateDijkstraPath(getParentDemandElements().at(0)->getVClass(), getParentEdges()).size() > 0); + if (myNet->getPathManager()->getPathCalculator()->calculateDijkstraPath(getParentDemandElements().at(0)->getVClass(), getParentEdges()).size() > 0) { + return Problem::OK; + } else { + return Problem::INVALID_PATH; + } } - /* - } else if (getPath().size() > 0) { - // if path edges isn't empty, then there is a valid route - return true; - */ } else { - return false; + return Problem::INVALID_ELEMENT; } } @@ -626,8 +636,8 @@ void -GNETranship::setEnabledAttribute(const int /*enabledAttributes*/) { - // +GNETranship::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { + // nothing to toogle } diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNETranship.h sumo-1.12.0/src/netedit/elements/demand/GNETranship.h --- sumo-1.11.0/src/netedit/elements/demand/GNETranship.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNETranship.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ @@ -37,6 +37,9 @@ class GNETranship : public GNEDemandElement, public Parameterised { public: + /// @brief default constructor + GNETranship(SumoXMLTag tag, GNENet* net); + /**@brief parameter constructor for container edge->edge * @param[in] viewNet view in which this Tranship is placed * @param[in] containerParent container parent @@ -88,7 +91,7 @@ void writeDemandElement(OutputDevice& device) const; /// @brief check if current demand element is valid to be writed into XML (by default true, can be reimplemented in children) - bool isDemandElementValid() const; + Problem isDemandElementValid() const; /// @brief return a string with the current demand element problem (by default empty, can be reimplemented in children) std::string getDemandElementProblem() const; @@ -259,8 +262,8 @@ /// @brief method for setting the attribute and nothing else void setAttribute(SumoXMLAttr key, const std::string& value); - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief set move shape void setMoveShape(const GNEMoveResult& moveResult); diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNETransport.cpp sumo-1.12.0/src/netedit/elements/demand/GNETransport.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNETransport.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNETransport.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -34,6 +34,15 @@ // method definitions // =========================================================================== +GNETransport::GNETransport(SumoXMLTag tag, GNENet* net) : + GNEDemandElement("", net, GLO_TRANSPORT, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {}, {}, {}, {}, {}, {}, {}), +myArrivalPosition(0) { + // reset default values + resetDefaultValues(); +} + + GNETransport::GNETransport(GNENet* net, GNEDemandElement* containerParent, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& lines, const double arrivalPosition) : GNEDemandElement(containerParent, net, GLO_TRANSPORT, GNE_TAG_TRANSPORT_EDGE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {fromEdge, toEdge}, {}, {}, {}, {}, {containerParent}, {}), @@ -127,23 +136,22 @@ } -bool +GNEDemandElement::Problem GNETransport::isDemandElementValid() const { if (getParentEdges().size() == 2) { if (getParentEdges().at(0) == getParentEdges().at(1)) { // from and to are the same edges, then path is valid - return true; + return Problem::OK; } else { // check if exist a route between parent edges - return (myNet->getPathManager()->getPathCalculator()->calculateDijkstraPath(getParentDemandElements().at(0)->getVClass(), getParentEdges()).size() > 0); + if (myNet->getPathManager()->getPathCalculator()->calculateDijkstraPath(getParentDemandElements().at(0)->getVClass(), getParentEdges()).size() > 0) { + return Problem::OK; + } else { + return Problem::INVALID_PATH; + } } - /* - } else if (getPath().size() > 0) { - // if path edges isn't empty, then there is a valid route - return true; - */ } else { - return false; + return Problem::INVALID_ELEMENT;; } } @@ -532,8 +540,8 @@ void -GNETransport::setEnabledAttribute(const int /*enabledAttributes*/) { - // +GNETransport::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { + // nothing to toogle } diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNETransport.h sumo-1.12.0/src/netedit/elements/demand/GNETransport.h --- sumo-1.11.0/src/netedit/elements/demand/GNETransport.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNETransport.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ @@ -36,6 +36,9 @@ class GNETransport : public GNEDemandElement, public Parameterised { public: + /// @brief default constructor + GNETransport(SumoXMLTag tag, GNENet* net); + /**@brief parameter constructor for container edge->edge * @param[in] viewNet view in which this Transport is placed * @param[in] containerParent container parent @@ -70,7 +73,7 @@ void writeDemandElement(OutputDevice& device) const; /// @brief check if current demand element is valid to be writed into XML (by default true, can be reimplemented in children) - bool isDemandElementValid() const; + Problem isDemandElementValid() const; /// @brief return a string with the current demand element problem (by default empty, can be reimplemented in children) std::string getDemandElementProblem() const; @@ -238,8 +241,8 @@ /// @brief method for setting the attribute and nothing else void setAttribute(SumoXMLAttr key, const std::string& value); - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief set move shape void setMoveShape(const GNEMoveResult& moveResult); diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEVehicle.cpp sumo-1.12.0/src/netedit/elements/demand/GNEVehicle.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNEVehicle.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEVehicle.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -252,6 +252,18 @@ // member method definitions // =========================================================================== +GNEVehicle::GNEVehicle(SumoXMLTag tag, GNENet* net) : + GNEDemandElement("", net, GLO_VEHICLE, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {}, {}, {}, {}, {}, {}, {}), +SUMOVehicleParameter() { + // reset default values + resetDefaultValues(); + // set end and vehPerHours + toogleAttribute(SUMO_ATTR_END, 1, 0); + toogleAttribute(SUMO_ATTR_VEHSPERHOUR, 1, 0); +} + + GNEVehicle::GNEVehicle(SumoXMLTag tag, GNENet* net, const std::string& vehicleID, GNEDemandElement* vehicleType, GNEDemandElement* route) : GNEDemandElement(vehicleID, net, (tag == GNE_TAG_FLOW_ROUTE) ? GLO_ROUTEFLOW : GLO_VEHICLE, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {}, {}, {}, {}, {}, {vehicleType, route}, {}), @@ -307,6 +319,22 @@ } +GNEVehicle::GNEVehicle(SumoXMLTag tag, GNENet* net, const std::string& vehicleID, GNEDemandElement* vehicleType, GNEJunction* fromJunction, GNEJunction* toJunction) : + GNEDemandElement(vehicleID, net, (tag == GNE_TAG_FLOW_JUNCTIONS) ? GLO_FLOW : GLO_TRIP, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, { + fromJunction, toJunction +}, {}, {}, {}, {}, {}, {vehicleType}, {}), +SUMOVehicleParameter() { +} + + +GNEVehicle::GNEVehicle(SumoXMLTag tag, GNENet* net, GNEDemandElement* vehicleType, GNEJunction* fromJunction, GNEJunction* toJunction, const SUMOVehicleParameter& vehicleParameters) : + GNEDemandElement(vehicleParameters.id, net, (tag == GNE_TAG_FLOW_JUNCTIONS) ? GLO_FLOW : GLO_TRIP, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, { + fromJunction, toJunction +}, {}, {}, {}, {}, {}, {vehicleType}, {}), +SUMOVehicleParameter(vehicleParameters) { +} + + GNEVehicle::~GNEVehicle() {} @@ -378,11 +406,17 @@ device.writeAttr(SUMO_ATTR_VIA, via); } } + // write fronJunction and toJunction + if ((myTagProperty.getTag() == GNE_TAG_TRIP_JUNCTIONS) || (myTagProperty.getTag() == GNE_TAG_FLOW_JUNCTIONS)) { + // write manually from/to junctions (it correspond to fron and back parent junctions) + device.writeAttr(SUMO_ATTR_FROMJUNCTION, getParentJunctions().front()->getID()); + device.writeAttr(SUMO_ATTR_TOJUNCTION, getParentJunctions().back()->getID()); + } // write specific routeFlow/flow attributes - if ((myTagProperty.getTag() == GNE_TAG_FLOW_ROUTE) || (myTagProperty.getTag() == GNE_TAG_FLOW_WITHROUTE) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { + if (myTagProperty.isFlow()) { // write routeFlow values depending if it was set if (isAttributeEnabled(SUMO_ATTR_END)) { - device.writeAttr(SUMO_ATTR_END, time2string(repetitionEnd)); + device.writeAttr(SUMO_ATTR_END, time2string(repetitionEnd)); } if (isAttributeEnabled(SUMO_ATTR_NUMBER)) { device.writeAttr(SUMO_ATTR_NUMBER, repetitionNumber); @@ -399,37 +433,66 @@ } // write parameters writeParams(device); - // write child demand elements associated to this vehicle - for (const auto& i : getChildDemandElements()) { - i->writeDemandElement(device); + // write route elements associated to this vehicle + if (getChildDemandElements().size() > 0) { + if (getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED) { + // write embedded route + getChildDemandElements().front()->writeDemandElement(device); + // write sorted stops + const auto sortedStops = getSortedStops(getChildDemandElements().front()->getParentEdges()); + for (const auto& stop : sortedStops) { + stop->writeDemandElement(device); + } + } else { + for (const auto& route : getChildDemandElements()) { + route->writeDemandElement(device); + } + } } // close vehicle tag device.closeTag(); } -bool +GNEDemandElement::Problem GNEVehicle::isDemandElementValid() const { // only trips or flows can have problems if ((myTagProperty.getTag() == SUMO_TAG_TRIP) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { // check path - return myNet->getPathManager()->isPathValid(this); + if (myNet->getPathManager()->isPathValid(this)) { + return Problem::OK; + } else { + return Problem::INVALID_PATH; + } + } else if ((myTagProperty.getTag() == GNE_TAG_TRIP_JUNCTIONS) || (myTagProperty.getTag() == GNE_TAG_FLOW_JUNCTIONS)) { + return Problem::OK; } else if (getParentDemandElements().size() == 2) { // check if exist a valid path using route parent edges if (myNet->getPathManager()->getPathCalculator()->calculateDijkstraPath(getParentDemandElements().at(0)->getVClass(), getParentDemandElements().at(1)->getParentEdges()).size() > 0) { - return true; + return Problem::OK; } else { - return false; + return Problem::INVALID_PATH; } } else if (getChildDemandElements().size() > 0 && (getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) { + // get sorted stops and check number + std::vector embeddedRouteStops; + for (const auto& routeChild : getChildDemandElements()) { + if (routeChild->getTagProperty().isStop()) { + embeddedRouteStops.push_back(routeChild); + } + } + const auto sortedStops = getSortedStops(getChildDemandElements().front()->getParentEdges()); + if (sortedStops.size() != embeddedRouteStops.size()) { + return Problem::STOP_DOWNSTREAM; + } // check if exist a valid path using embebbed route edges if (myNet->getPathManager()->getPathCalculator()->calculateDijkstraPath(getParentDemandElements().at(0)->getVClass(), getChildDemandElements().front()->getParentEdges()).size() > 0) { - return true; + return Problem::OK; } else { - return false; + return Problem::INVALID_PATH; } } else { - return false; + return Problem::INVALID_ELEMENT; } } @@ -458,6 +521,17 @@ // there is connections bewteen all edges, then all ok return ""; } else if (getChildDemandElements().size() > 0 && (getChildDemandElements().front()->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED)) { + // get sorted stops and check number + std::vector embeddedRouteStops; + for (const auto& routeChild : getChildDemandElements()) { + if (routeChild->getTagProperty().isStop()) { + embeddedRouteStops.push_back(routeChild); + } + } + const auto sortedStops = getSortedStops(getChildDemandElements().front()->getParentEdges()); + if (sortedStops.size() != embeddedRouteStops.size()) { + return toString(embeddedRouteStops.size() - sortedStops.size()) + " stops are outside of embedded route (downstream)"; + } // get embebbed route edges const std::vector& routeEdges = getChildDemandElements().front()->getParentEdges(); // check if exist at least a connection between every edge @@ -494,23 +568,32 @@ void GNEVehicle::updateGeometry() { - // get first path lane - const GNELane* firstPathLane = getFirstPathLane(); - // check path lane - if (firstPathLane) { - // declare departPos - double posOverLane = 0; - if (canParse(getDepartPos())) { - posOverLane = parse(getDepartPos()); - } + if (getParentJunctions().size() > 0) { + // calculate rotation between both junctions + const Position posA = getParentJunctions().front()->getPositionInView(); + const Position posB = getParentJunctions().back()->getPositionInView(); + const double rot = ((double)atan2((posB.x() - posA.x()), (posA.y() - posB.y())) * (double) -180.0 / (double)M_PI); // update Geometry - myDemandElementGeometry.updateGeometry(firstPathLane->getLaneShape(), posOverLane, myMoveElementLateralOffset); - // compute route embedded vinculated with this vehicle - for (const auto& demandElement : getChildDemandElements()) { - if (demandElement->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED) { - demandElement->computePathElement(); + myDemandElementGeometry.updateSinglePosGeometry(getParentJunctions().front()->getPositionInView(), rot); + } else { + // get first path lane + const GNELane* firstPathLane = getFirstPathLane(); + // check path lane + if (firstPathLane) { + // declare departPos + double posOverLane = 0; + if (canParse(getDepartPos())) { + posOverLane = parse(getDepartPos()); + } + // update Geometry + myDemandElementGeometry.updateGeometry(firstPathLane->getLaneShape(), posOverLane, myMoveElementLateralOffset); + // compute route embedded vinculated with this vehicle + for (const auto& demandElement : getChildDemandElements()) { + if (demandElement->getTagProperty().getTag() == GNE_TAG_ROUTE_EMBEDDED) { + demandElement->computePathElement(); + } + demandElement->updateGeometry(); } - demandElement->updateGeometry(); } } } @@ -644,20 +727,6 @@ } else if (s.drawDetail(s.detailSettings.vehicleTriangles, exaggeration)) { GUIBaseVehicleHelper::drawAction_drawVehicleAsTrianglePlus(width, length); } - - /* - switch (s.vehicleQuality) { - case 0: - GUIBaseVehicleHelper::drawAction_drawVehicleAsTrianglePlus(width, length); - break; - case 1: - GUIBaseVehicleHelper::drawAction_drawVehicleAsBoxPlus(width, length); - break; - default: - GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly(s, shape, width, length); - break; - } - */ // check if min gap has to be drawn if (s.drawMinGap) { const double minGap = -1 * getParentDemandElements().at(0)->getAttributeDouble(SUMO_ATTR_MINGAP); @@ -675,7 +744,7 @@ glRotated(vehicleRotation, 0, 0, -1); drawName(Position(0, 0), s.scale, getParentDemandElements().at(0)->getAttribute(SUMO_ATTR_GUISHAPE) == "pedestrian" ? s.personName : s.vehicleName, s.angle); // draw line - if (s.vehicleName.show && line != "") { + if (s.vehicleName.show(this) && line != "") { glTranslated(0, 0.6 * s.vehicleName.scaledSize(s.scale), 0); GLHelper::drawTextSettings(s.vehicleName, "line:" + line, Position(0, 0), s.scale, s.angle); } @@ -687,7 +756,7 @@ drawStackLabel(vehiclePosition, vehicleRotation, width, length, exaggeration); } // draw flow label - if ((myTagProperty.getTag() == SUMO_TAG_FLOW) || (myTagProperty.getTag() == GNE_TAG_FLOW_ROUTE) || (myTagProperty.getTag() == GNE_TAG_FLOW_WITHROUTE)) { + if (myTagProperty.isFlow()) { drawFlowLabel(vehiclePosition, vehicleRotation, width, length, exaggeration); } // draw lock icon @@ -696,10 +765,14 @@ if (myNet->getViewNet()->isAttributeCarrierInspected(this)) { // draw using drawDottedContourClosedShape GUIDottedGeometry::drawDottedSquaredShape(GUIDottedGeometry::DottedContourType::INSPECT, s, vehiclePosition, length * 0.5, width * 0.5, length * -0.5, 0, vehicleRotation, exaggeration); + // draw junction line + drawJunctionLine(); } if (myNet->getViewNet()->getFrontAttributeCarrier() == this) { // draw using drawDottedContourClosedShape GUIDottedGeometry::drawDottedSquaredShape(GUIDottedGeometry::DottedContourType::FRONT, s, vehiclePosition, length * 0.5, width * 0.5, length * -0.5, 0, vehicleRotation, exaggeration); + // draw junction line + drawJunctionLine(); } } // pop name @@ -712,7 +785,9 @@ void GNEVehicle::computePathElement() { // calculate path (only for flows and trips) - if ((myTagProperty.getTag() == SUMO_TAG_FLOW) || (myTagProperty.getTag() == SUMO_TAG_TRIP)) { + if (getParentJunctions().size() > 0) { + // currently disabled + } else if ((myTagProperty.getTag() == SUMO_TAG_FLOW) || (myTagProperty.getTag() == SUMO_TAG_TRIP)) { // declare lane stops std::vector laneStops; // iterate over child demand elements @@ -1113,7 +1188,7 @@ } else { return ""; } - // Specific of Trips + // Specific of from-to edge case SUMO_ATTR_FROM: return getParentEdges().front()->getID(); case SUMO_ATTR_TO: @@ -1132,7 +1207,12 @@ } else { return toString(arrivalEdge); } - // Specific of routeFlows + // Specific of from-to junctions + case SUMO_ATTR_FROMJUNCTION: + return getParentJunctions().front()->getID(); + case SUMO_ATTR_TOJUNCTION: + return getParentJunctions().back()->getID(); + // Specific of flows case SUMO_ATTR_BEGIN: return time2string(depart); case SUMO_ATTR_END: @@ -1150,6 +1230,8 @@ return toString(isAttributeCarrierSelected()); case GNE_ATTR_PARAMETERS: return getParametersStr(); + case GNE_ATTR_FLOWPARAMETERS: + return toString(parametersSet); default: throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); } @@ -1251,13 +1333,16 @@ // Specific of vehicles case SUMO_ATTR_DEPART: case SUMO_ATTR_ROUTE: - // Specific of Trips + // Specific of from-to edges case SUMO_ATTR_FROM: case SUMO_ATTR_TO: case SUMO_ATTR_VIA: case SUMO_ATTR_DEPARTEDGE: case SUMO_ATTR_ARRIVALEDGE: - // Specific of routeFlows + // Specific of from-to junctions + case SUMO_ATTR_FROMJUNCTION: + case SUMO_ATTR_TOJUNCTION: + // Specific of flows case SUMO_ATTR_BEGIN: case SUMO_ATTR_END: case SUMO_ATTR_NUMBER: @@ -1389,7 +1474,7 @@ } else { return true; } - // Specific of Trips + // Specific of from-to edges case SUMO_ATTR_FROM: case SUMO_ATTR_TO: return SUMOXMLDefinitions::isValidNetID(value) && (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr); @@ -1420,7 +1505,11 @@ } else { return canParse >(myNet, value, false); } - // Specific of routeFlows + // Specific of from-to junctions + case SUMO_ATTR_FROMJUNCTION: + case SUMO_ATTR_TOJUNCTION: + return SUMOXMLDefinitions::isValidNetID(value) && (myNet->getAttributeCarriers()->retrieveJunction(value, false) != nullptr); + // Specific of flows case SUMO_ATTR_BEGIN: if (canParse(value)) { return (parse(value) >= 0); @@ -1478,12 +1567,17 @@ void GNEVehicle::enableAttribute(SumoXMLAttr key, GNEUndoList* undoList) { - // obtain a copy of parameter sets - int newParametersSet = parametersSet; - // modify newParametersSet - GNERouteHandler::setFlowParameters(key, newParametersSet); - // add GNEChange_EnableAttribute - undoList->add(new GNEChange_EnableAttribute(this, parametersSet, newParametersSet), true); + switch (key) { + case SUMO_ATTR_END: + case SUMO_ATTR_NUMBER: + case SUMO_ATTR_VEHSPERHOUR: + case SUMO_ATTR_PERIOD: + case SUMO_ATTR_PROB: + undoList->add(new GNEChange_EnableAttribute(this, key, true, parametersSet), true); + return; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } } @@ -1682,9 +1776,11 @@ } break; case SUMO_ATTR_TYPE: - replaceDemandElementParent(SUMO_TAG_VTYPE, value, 0); - // set manually vtypeID (needed for saving) - vtypeid = value; + if (getID().size() > 0) { + replaceDemandElementParent(SUMO_TAG_VTYPE, value, 0); + // set manually vtypeID (needed for saving) + vtypeid = value; + } break; case SUMO_ATTR_COLOR: if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { @@ -1721,8 +1817,10 @@ // unset parameter parametersSet &= ~VEHPARS_DEPARTPOS_SET; } - updateGeometry(); - updateSpreadStackGeometry = true; + if (getID().size() > 0) { + updateGeometry(); + updateSpreadStackGeometry = true; + } break; case SUMO_ATTR_DEPARTSPEED: if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { @@ -1759,8 +1857,10 @@ // unset parameter parametersSet &= ~VEHPARS_ARRIVALPOS_SET; } - updateGeometry(); - updateSpreadStackGeometry = true; + if (getID().size() > 0) { + updateGeometry(); + updateSpreadStackGeometry = true; + } break; case SUMO_ATTR_ARRIVALSPEED: if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { @@ -1856,7 +1956,7 @@ updateGeometry(); updateSpreadStackGeometry = true; break; - // Specific of Trips and flow + // Specific of from-to edges case SUMO_ATTR_FROM: { // change first edge replaceFirstParentEdge(value); @@ -1900,8 +2000,10 @@ departEdge = parse(value); } // compute vehicle - computePathElement(); - updateSpreadStackGeometry = true; + if (getID().size() > 0) { + computePathElement(); + updateSpreadStackGeometry = true; + } break; } case SUMO_ATTR_ARRIVALEDGE: { @@ -1911,12 +2013,31 @@ } else { arrivalEdge = parse(value); } + if (getID().size() > 0) { + // compute vehicle + computePathElement(); + updateSpreadStackGeometry = true; + } + break; + } + // Specific of from-to junctions + case SUMO_ATTR_FROMJUNCTION: { + // change first junction + replaceFirstParentJunction(value); // compute vehicle computePathElement(); updateSpreadStackGeometry = true; break; } - // Specific of routeFlows + case SUMO_ATTR_TOJUNCTION: { + // change last junction + replaceLastParentJunction(value); + // compute vehicle + computePathElement(); + updateSpreadStackGeometry = true; + break; + } + // Specific of flows case SUMO_ATTR_BEGIN: { depart = string2time(value); break; @@ -1967,8 +2088,12 @@ void -GNEVehicle::setEnabledAttribute(const int enabledAttributes) { - parametersSet = enabledAttributes; +GNEVehicle::toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters) { + if (value) { + GNERouteHandler::setFlowParameters(key, parametersSet); + } else { + parametersSet = previousParameters; + } } @@ -2074,4 +2199,26 @@ } +void +GNEVehicle::drawJunctionLine() const { + // draw line for trip/flows junctions + if ((myTagProperty.getTag() == GNE_TAG_TRIP_JUNCTIONS) || (myTagProperty.getTag() == GNE_TAG_FLOW_JUNCTIONS)) { + // get two points + const Position posA = getParentJunctions().front()->getPositionInView(); + const Position posB = getParentJunctions().back()->getPositionInView(); + const double rot = ((double)atan2((posB.x() - posA.x()), (posA.y() - posB.y())) * (double) 180.0 / (double)M_PI); + const double len = posA.distanceTo2D(posB); + // push draw matrix + GLHelper::pushMatrix(); + // Start with the drawing of the area traslating matrix to origin + myNet->getViewNet()->drawTranslateFrontAttributeCarrier(this, getType() + 0.1); + // set trip color + GLHelper::setColor(RGBColor::ORANGE); + // draw line + GLHelper::drawBoxLine(posA, rot, len, 0.25); + // pop draw matrix + GLHelper::popMatrix(); + } +} + /****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEVehicle.h sumo-1.12.0/src/netedit/elements/demand/GNEVehicle.h --- sumo-1.11.0/src/netedit/elements/demand/GNEVehicle.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEVehicle.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -145,6 +145,9 @@ FXMenuCommand* myTransformAllVehiclesToFlow; }; + /// @brief default constructor + GNEVehicle(SumoXMLTag tag, GNENet* net); + /// @brief default constructor for vehicles and routeFlows without embedded routes GNEVehicle(SumoXMLTag tag, GNENet* net, const std::string& vehicleID, GNEDemandElement* vehicleType, GNEDemandElement* route); @@ -154,12 +157,18 @@ /// @brief parameter constructor for vehicles and routeFlows with embedded routes (note: After creation create immediately a embedded route referencing this vehicle) GNEVehicle(SumoXMLTag tag, GNENet* net, GNEDemandElement* vehicleType, const SUMOVehicleParameter& vehicleParameters); - /// @brief default constructor for trips and Flows + /// @brief default constructor for trips and Flows over edges GNEVehicle(SumoXMLTag tag, GNENet* net, const std::string& vehicleID, GNEDemandElement* vehicleType, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via); - /// @brief parameter constructor for trips and Flows + /// @brief parameter constructor for trips and Flows over junctions GNEVehicle(SumoXMLTag tag, GNENet* net, GNEDemandElement* vehicleType, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via, const SUMOVehicleParameter& vehicleParameters); + /// @brief default constructor for trips and Flows over junctions + GNEVehicle(SumoXMLTag tag, GNENet* net, const std::string& vehicleID, GNEDemandElement* vehicleType, GNEJunction* fromJunction, GNEJunction* toJunction); + + /// @brief parameter constructor for trips and Flows over junctions + GNEVehicle(SumoXMLTag tag, GNENet* net, GNEDemandElement* vehicleType, GNEJunction* fromJunction, GNEJunction* toJunction, const SUMOVehicleParameter& vehicleParameters); + /// @brief destructor ~GNEVehicle(); @@ -180,7 +189,7 @@ void writeDemandElement(OutputDevice& device) const; /// @brief check if current demand element is valid to be writed into XML (by default true, can be reimplemented in children) - bool isDemandElementValid() const; + Problem isDemandElementValid() const; /// @brief return a string with the current demand element problem (by default empty, can be reimplemented in children) std::string getDemandElementProblem() const; @@ -347,8 +356,8 @@ /// @brief method for setting the attribute and nothing else void setAttribute(SumoXMLAttr key, const std::string& value); - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief set move shape void setMoveShape(const GNEMoveResult& moveResult); @@ -362,6 +371,9 @@ /// @brief draw flow label void drawFlowLabel(const Position& vehiclePosition, const double vehicleRotation, const double width, const double length, const double exaggeration) const; + /// @brief draw junction line + void drawJunctionLine() const; + /// @brief Invalidated copy constructor. GNEVehicle(const GNEVehicle&) = delete; diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEVehicleType.cpp sumo-1.12.0/src/netedit/elements/demand/GNEVehicleType.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNEVehicleType.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEVehicleType.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1730 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GNEVehicleType.cpp -/// @author Pablo Alvarez Lopez -/// @date Jan 2019 -/// -// Definition of Vehicle Types in NETEDIT -/****************************************************************************/ -#include -#include -#include -#include - -#include "GNEVehicleType.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - - -GNEVehicleType::GNEVehicleType(GNENet* net, const std::string& vTypeID, const SUMOVehicleClass& defaultVClass, SumoXMLTag tag) : - GNEDemandElement(vTypeID, net, GLO_VTYPE, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, -{}, {}, {}, {}, {}, {}, {}, {}), -SUMOVTypeParameter(vTypeID), -myDefaultVehicleType(true), -myDefaultVehicleTypeModified(false) { - // set default vehicle class - vehicleClass = defaultVClass; - parametersSet |= VTYPEPARS_VEHICLECLASS_SET; - // init Rail Visualization Parameters - initRailVisualizationParameters(); -} - - -GNEVehicleType::GNEVehicleType(GNENet* net, const SUMOVTypeParameter& vTypeParameter, SumoXMLTag tag) : - GNEDemandElement(vTypeParameter.id, net, GLO_VTYPE, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, -{}, {}, {}, {}, {}, {}, {}, {}), -SUMOVTypeParameter(vTypeParameter), -myDefaultVehicleType(false), -myDefaultVehicleTypeModified(false) { - // if we're creating a Person Type, set manually VClass - if (tag == SUMO_TAG_PTYPE) { - vehicleClass = SVC_PEDESTRIAN; - parametersSet |= VTYPEPARS_VEHICLECLASS_SET; - } - // init Rail Visualization Parameters - initRailVisualizationParameters(); -} - - -GNEVehicleType::GNEVehicleType(GNENet* net, const std::string& vTypeID, GNEVehicleType* vTypeOriginal) : - GNEDemandElement(vTypeID, net, GLO_VTYPE, vTypeOriginal->getTagProperty().getTag(), GNEPathManager::PathElement::Options::DEMAND_ELEMENT, -{}, {}, {}, {}, {}, {}, {}, {}), -SUMOVTypeParameter(*vTypeOriginal), -myDefaultVehicleType(false), -myDefaultVehicleTypeModified(false) { - // change manually the ID (to avoid to use the ID of vTypeOriginal) - id = vTypeID; - // init Rail Visualization Parameters - initRailVisualizationParameters(); -} - - -GNEVehicleType::~GNEVehicleType() {} - - -GNEMoveOperation* -GNEVehicleType::getMoveOperation() { - return nullptr; -} - - -void -GNEVehicleType::writeDemandElement(OutputDevice& device) const { - // only write default vehicle types if it was modified - if (myDefaultVehicleType) { - if (myDefaultVehicleTypeModified) { - write(device); - } - } else { - write(device); - } -} - - -SUMOVehicleClass -GNEVehicleType::getVClass() const { - return vehicleClass; -} - - -const RGBColor& -GNEVehicleType::getColor() const { - return color; -} - - -void -GNEVehicleType::updateGeometry() { - // update geometry of all childrens - for (const auto& i : getChildDemandElements()) { - i->updateGeometry(); - } -} - - -Position -GNEVehicleType::getPositionInView() const { - return Position(); -} - - -std::string -GNEVehicleType::getParentName() const { - return myNet->getMicrosimID(); -} - - -double -GNEVehicleType::getExaggeration(const GUIVisualizationSettings& /*s*/) const { - return 1; -} - - -Boundary -GNEVehicleType::getCenteringBoundary() const { - // Vehicle Types doesn't have boundaries - return Boundary(-0.1, -0.1, 0.1, 0.1); -} - - -void -GNEVehicleType::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNEVehicleType::drawGL(const GUIVisualizationSettings&) const { - // Vehicle Types aren't draw -} - - -void -GNEVehicleType::computePathElement() { - // nothing to compute -} - - -void -GNEVehicleType::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*lane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const { - // vehicleTypes don't use drawPartialGL -} - - -void -GNEVehicleType::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*fromLane*/, const GNELane* /*toLane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const { - // vehicleTypes don't use drawPartialGL -} - - -GNELane* -GNEVehicleType::getFirstPathLane() const { - // vehicle types don't use lanes - return nullptr; -} - - -GNELane* -GNEVehicleType::getLastPathLane() const { - // vehicle types don't use lanes - return nullptr; -} - - -std::string -GNEVehicleType::getAttribute(SumoXMLAttr key) const { - // obtain default values depending of vehicle class - VClassDefaultValues defaultValues(vehicleClass); - switch (key) { - case SUMO_ATTR_ID: - return getID(); - // CFM Attributes - case SUMO_ATTR_ACCEL: - case SUMO_ATTR_DECEL: - case SUMO_ATTR_APPARENTDECEL: - case SUMO_ATTR_EMERGENCYDECEL: - case SUMO_ATTR_SIGMA: - case SUMO_ATTR_TAU: - // this CFM has default values - return getCFParamString(key, myTagProperty.getDefaultValue(key)); - // JM Attributes - case SUMO_ATTR_JM_CROSSING_GAP: - case SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME: - case SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME: - case SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME: - case SUMO_ATTR_JM_DRIVE_RED_SPEED: - case SUMO_ATTR_JM_IGNORE_FOE_PROB: - case SUMO_ATTR_JM_IGNORE_FOE_SPEED: - case SUMO_ATTR_JM_SIGMA_MINOR: - case SUMO_ATTR_JM_TIMEGAP_MINOR: - // this JM has default values - return getJMParamString(key, myTagProperty.getDefaultValue(key)); - case SUMO_ATTR_IMPATIENCE: - if (wasSet(VTYPEPARS_IMPATIENCE_SET)) { - return toString(impatience); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_IMPATIENCE); - } - // LCM Attributes - case SUMO_ATTR_LCA_STRATEGIC_PARAM: - case SUMO_ATTR_LCA_COOPERATIVE_PARAM: - case SUMO_ATTR_LCA_SPEEDGAIN_PARAM: - case SUMO_ATTR_LCA_KEEPRIGHT_PARAM: - case SUMO_ATTR_LCA_SUBLANE_PARAM: - case SUMO_ATTR_LCA_OPPOSITE_PARAM: - case SUMO_ATTR_LCA_PUSHY: - case SUMO_ATTR_LCA_PUSHYGAP: - case SUMO_ATTR_LCA_ASSERTIVE: - case SUMO_ATTR_LCA_IMPATIENCE: - case SUMO_ATTR_LCA_TIME_TO_IMPATIENCE: - case SUMO_ATTR_LCA_ACCEL_LAT: - case SUMO_ATTR_LCA_LOOKAHEADLEFT: - case SUMO_ATTR_LCA_SPEEDGAINRIGHT: - case SUMO_ATTR_LCA_MAXSPEEDLATSTANDING: - case SUMO_ATTR_LCA_MAXSPEEDLATFACTOR: - case SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE: - case SUMO_ATTR_LCA_OVERTAKE_RIGHT: - /* case SUMO_ATTR_LCA_EXPERIMENTAL1: */ - return getLCParamString(key, myTagProperty.getDefaultValue(key)); - // - case SUMO_ATTR_COLLISION_MINGAP_FACTOR: - case SUMO_ATTR_TMP1: - case SUMO_ATTR_TMP2: - case SUMO_ATTR_TMP3: - case SUMO_ATTR_TMP4: - case SUMO_ATTR_TMP5: - case SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS: - case SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW: - case SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD: - case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE: - case SUMO_ATTR_CF_EIDM_T_REACTION: - case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE: - case SUMO_ATTR_CF_EIDM_C_COOLNESS: - case SUMO_ATTR_CF_EIDM_SIG_LEADER: - case SUMO_ATTR_CF_EIDM_SIG_GAP: - case SUMO_ATTR_CF_EIDM_SIG_ERROR: - case SUMO_ATTR_CF_EIDM_JERK_MAX: - case SUMO_ATTR_CF_EIDM_EPSILON_ACC: - case SUMO_ATTR_CF_EIDM_T_ACC_MAX: - case SUMO_ATTR_CF_EIDM_M_FLATNESS: - case SUMO_ATTR_CF_EIDM_M_BEGIN: - case SUMO_ATTR_CF_PWAGNER2009_TAULAST: - case SUMO_ATTR_CF_PWAGNER2009_APPROB: - case SUMO_ATTR_CF_IDMM_ADAPT_FACTOR: - case SUMO_ATTR_CF_IDMM_ADAPT_TIME: - case SUMO_ATTR_CF_WIEDEMANN_SECURITY: - case SUMO_ATTR_CF_WIEDEMANN_ESTIMATION: - case SUMO_ATTR_TRAIN_TYPE: - case SUMO_ATTR_K: - case SUMO_ATTR_CF_KERNER_PHI: - case SUMO_ATTR_CF_IDM_DELTA: - case SUMO_ATTR_CF_IDM_STEPPING: - return getCFParamString(key, ""); - // Mutable values - case SUMO_ATTR_LENGTH: - if (wasSet(VTYPEPARS_LENGTH_SET)) { - return toString(length); - } else { - return toString(defaultValues.length); - } - case SUMO_ATTR_MINGAP: - if (wasSet(VTYPEPARS_MINGAP_SET)) { - return toString(minGap); - } else { - return toString(defaultValues.minGap); - } - case SUMO_ATTR_MAXSPEED: - if (wasSet(VTYPEPARS_MAXSPEED_SET)) { - return toString(maxSpeed); - } else { - return toString(defaultValues.maxSpeed); - } - case SUMO_ATTR_SPEEDFACTOR: - if (wasSet(VTYPEPARS_SPEEDFACTOR_SET)) { - return toString(speedFactor); - } else { - return toString(defaultValues.speedFactor); - } - case SUMO_ATTR_PERSON_CAPACITY: - if (wasSet(VTYPEPARS_PERSON_CAPACITY)) { - return toString(personCapacity); - } else { - return toString(defaultValues.personCapacity); - } - case SUMO_ATTR_CONTAINER_CAPACITY: - if (wasSet(VTYPEPARS_CONTAINER_CAPACITY)) { - return toString(containerCapacity); - } else { - return toString(defaultValues.containerCapacity); - } - case SUMO_ATTR_OSGFILE: - if (wasSet(VTYPEPARS_OSGFILE_SET)) { - return osgFile; - } else { - return defaultValues.osgFile; - } - case SUMO_ATTR_COLOR: - if (wasSet(VTYPEPARS_COLOR_SET)) { - return toString(color); - } else { - return ""; - } - case SUMO_ATTR_VCLASS: - if (wasSet(VTYPEPARS_VEHICLECLASS_SET)) { - return toString(vehicleClass); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_VCLASS); - } - case SUMO_ATTR_EMISSIONCLASS: - if (wasSet(VTYPEPARS_EMISSIONCLASS_SET)) { - return PollutantsInterface::getName(emissionClass); - } else { - return PollutantsInterface::getName(defaultValues.emissionClass); - } - case SUMO_ATTR_GUISHAPE: - if (wasSet(VTYPEPARS_SHAPE_SET)) { - return getVehicleShapeName(shape); - } else { - return getVehicleShapeName(defaultValues.shape); - } - case SUMO_ATTR_WIDTH: - if (wasSet(VTYPEPARS_WIDTH_SET)) { - return toString(width); - } else { - return toString(defaultValues.width); - } - case SUMO_ATTR_HEIGHT: - if (wasSet(VTYPEPARS_HEIGHT_SET)) { - return toString(height); - } else { - return toString(defaultValues.height); - } - case SUMO_ATTR_IMGFILE: - if (wasSet(VTYPEPARS_IMGFILE_SET)) { - return imgFile; - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_IMGFILE); - } - case SUMO_ATTR_LANE_CHANGE_MODEL: - if (wasSet(VTYPEPARS_LANE_CHANGE_MODEL_SET)) { - return SUMOXMLDefinitions::LaneChangeModels.getString(lcModel); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_LANE_CHANGE_MODEL); - } - case SUMO_ATTR_CAR_FOLLOW_MODEL: - if (wasSet(VTYPEPARS_CAR_FOLLOW_MODEL)) { - return SUMOXMLDefinitions::CarFollowModels.getString(cfModel); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_CAR_FOLLOW_MODEL); - } - case SUMO_ATTR_BOARDING_DURATION: - if (wasSet(VTYPEPARS_BOARDING_DURATION)) { - return time2string(boardingDuration); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_BOARDING_DURATION); - } - case SUMO_ATTR_LOADING_DURATION: - if (wasSet(VTYPEPARS_LOADING_DURATION)) { - return time2string(loadingDuration); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_LOADING_DURATION); - } - case SUMO_ATTR_LATALIGNMENT: - if (wasSet(VTYPEPARS_LATALIGNMENT_SET)) { - if (latAlignmentProcedure != LatAlignmentDefinition::GIVEN) { - return toString(latAlignmentProcedure); - } else { - return toString(latAlignmentOffset); - } - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_LATALIGNMENT); - } - case SUMO_ATTR_MINGAP_LAT: - if (wasSet(VTYPEPARS_MINGAP_LAT_SET)) { - return toString(minGapLat); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_MINGAP_LAT); - } - case SUMO_ATTR_MAXSPEED_LAT: - if (wasSet(VTYPEPARS_MAXSPEED_LAT_SET)) { - return toString(maxSpeedLat); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_MAXSPEED_LAT); - } - case SUMO_ATTR_ACTIONSTEPLENGTH: - if (wasSet(VTYPEPARS_ACTIONSTEPLENGTH_SET)) { - return toString(actionStepLength); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_ACTIONSTEPLENGTH); - } - case SUMO_ATTR_PROB: - if (wasSet(VTYPEPARS_PROBABILITY_SET)) { - return toString(defaultProbability); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_PROB); - } - case SUMO_ATTR_CARRIAGE_LENGTH: - if (wasSet(VTYPEPARS_CARRIAGE_LENGTH_SET)) { - return toString(carriageLength); - } else { - return toString(defaultValues.carriageLength); - } - case SUMO_ATTR_LOCOMOTIVE_LENGTH: - if (wasSet(VTYPEPARS_LOCOMOTIVE_LENGTH_SET)) { - return toString(locomotiveLength); - } else { - return toString(defaultValues.locomotiveLength); - } - case SUMO_ATTR_CARRIAGE_GAP: - if (wasSet(VTYPEPARS_CARRIAGE_GAP_SET)) { - return toString(carriageGap); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_CARRIAGE_GAP); - } - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - case GNE_ATTR_DEFAULT_VTYPE: - return toString((getID() == DEFAULT_VTYPE_ID) || - (getID() == DEFAULT_PEDTYPE_ID) || - (getID() == DEFAULT_BIKETYPE_ID)); - case GNE_ATTR_DEFAULT_VTYPE_MODIFIED: - if (myDefaultVehicleType) { - return toString(myDefaultVehicleTypeModified); - } else { - return toString(false); - } - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEVehicleType::getAttributeDouble(SumoXMLAttr key) const { - // obtain default values depending of vehicle class - VClassDefaultValues defaultValues(vehicleClass); - switch (key) { - case SUMO_ATTR_LENGTH: - if (wasSet(VTYPEPARS_LENGTH_SET)) { - return length; - } else { - return defaultValues.length; - } - case SUMO_ATTR_MINGAP: - if (wasSet(VTYPEPARS_MINGAP_SET)) { - return minGap; - } else { - return defaultValues.minGap; - } - case SUMO_ATTR_WIDTH: - if (wasSet(VTYPEPARS_WIDTH_SET)) { - return width; - } else { - return defaultValues.width; - } - case SUMO_ATTR_HEIGHT: - if (wasSet(VTYPEPARS_HEIGHT_SET)) { - return height; - } else { - return defaultValues.height; - } - case SUMO_ATTR_MAXSPEED: - if (wasSet(VTYPEPARS_MAXSPEED_SET)) { - return maxSpeed; - } else { - return defaultValues.maxSpeed; - } - default: - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); - } -} - - -Position -GNEVehicleType::getAttributePosition(SumoXMLAttr key) const { - throw InvalidArgument(getTagStr() + " doesn't have a Position attribute of type '" + toString(key) + "'"); -} - - -void -GNEVehicleType::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { - GNEChange_Attribute* vTypeChangeAttributeForced = nullptr; - if (value == getAttribute(key)) { - return; //avoid needless changes, later logic relies on the fact that attributes have changed - } - switch (key) { - case SUMO_ATTR_ID: - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - break; - // CFM Attributes - case SUMO_ATTR_ACCEL: - case SUMO_ATTR_DECEL: - case SUMO_ATTR_APPARENTDECEL: - case SUMO_ATTR_EMERGENCYDECEL: - case SUMO_ATTR_SIGMA: - case SUMO_ATTR_TAU: - case SUMO_ATTR_COLLISION_MINGAP_FACTOR: - case SUMO_ATTR_TMP1: - case SUMO_ATTR_TMP2: - case SUMO_ATTR_TMP3: - case SUMO_ATTR_TMP4: - case SUMO_ATTR_TMP5: - case SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS: - case SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW: - case SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD: - case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE: - case SUMO_ATTR_CF_EIDM_T_REACTION: - case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE: - case SUMO_ATTR_CF_EIDM_C_COOLNESS: - case SUMO_ATTR_CF_EIDM_SIG_LEADER: - case SUMO_ATTR_CF_EIDM_SIG_GAP: - case SUMO_ATTR_CF_EIDM_SIG_ERROR: - case SUMO_ATTR_CF_EIDM_JERK_MAX: - case SUMO_ATTR_CF_EIDM_EPSILON_ACC: - case SUMO_ATTR_CF_EIDM_T_ACC_MAX: - case SUMO_ATTR_CF_EIDM_M_FLATNESS: - case SUMO_ATTR_CF_EIDM_M_BEGIN: - case SUMO_ATTR_CF_PWAGNER2009_TAULAST: - case SUMO_ATTR_CF_PWAGNER2009_APPROB: - case SUMO_ATTR_CF_IDMM_ADAPT_FACTOR: - case SUMO_ATTR_CF_IDMM_ADAPT_TIME: - case SUMO_ATTR_CF_WIEDEMANN_SECURITY: - case SUMO_ATTR_CF_WIEDEMANN_ESTIMATION: - case SUMO_ATTR_TRAIN_TYPE: - case SUMO_ATTR_K: - case SUMO_ATTR_CF_KERNER_PHI: - case SUMO_ATTR_CF_IDM_DELTA: - case SUMO_ATTR_CF_IDM_STEPPING: - // JM Attributes - case SUMO_ATTR_JM_CROSSING_GAP: - case SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME: - case SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME: - case SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME: - case SUMO_ATTR_JM_DRIVE_RED_SPEED: - case SUMO_ATTR_JM_IGNORE_FOE_PROB: - case SUMO_ATTR_JM_IGNORE_FOE_SPEED: - case SUMO_ATTR_JM_SIGMA_MINOR: - case SUMO_ATTR_JM_TIMEGAP_MINOR: - case SUMO_ATTR_IMPATIENCE: - // LCM Attributes - case SUMO_ATTR_LCA_STRATEGIC_PARAM: - case SUMO_ATTR_LCA_COOPERATIVE_PARAM: - case SUMO_ATTR_LCA_SPEEDGAIN_PARAM: - case SUMO_ATTR_LCA_KEEPRIGHT_PARAM: - case SUMO_ATTR_LCA_SUBLANE_PARAM: - case SUMO_ATTR_LCA_OPPOSITE_PARAM: - case SUMO_ATTR_LCA_PUSHY: - case SUMO_ATTR_LCA_PUSHYGAP: - case SUMO_ATTR_LCA_ASSERTIVE: - case SUMO_ATTR_LCA_IMPATIENCE: - case SUMO_ATTR_LCA_TIME_TO_IMPATIENCE: - case SUMO_ATTR_LCA_ACCEL_LAT: - case SUMO_ATTR_LCA_LOOKAHEADLEFT: - case SUMO_ATTR_LCA_SPEEDGAINRIGHT: - case SUMO_ATTR_LCA_MAXSPEEDLATSTANDING: - case SUMO_ATTR_LCA_MAXSPEEDLATFACTOR: - case SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE: - case SUMO_ATTR_LCA_OVERTAKE_RIGHT: - /* case SUMO_ATTR_LCA_EXPERIMENTAL1: */ - // - case SUMO_ATTR_LENGTH: - case SUMO_ATTR_MINGAP: - case SUMO_ATTR_MAXSPEED: - case SUMO_ATTR_SPEEDFACTOR: - case SUMO_ATTR_COLOR: - case SUMO_ATTR_VCLASS: - case SUMO_ATTR_EMISSIONCLASS: - case SUMO_ATTR_GUISHAPE: - case SUMO_ATTR_WIDTH: - case SUMO_ATTR_HEIGHT: - case SUMO_ATTR_IMGFILE: - case SUMO_ATTR_LANE_CHANGE_MODEL: - case SUMO_ATTR_CAR_FOLLOW_MODEL: - case SUMO_ATTR_PERSON_CAPACITY: - case SUMO_ATTR_CONTAINER_CAPACITY: - case SUMO_ATTR_BOARDING_DURATION: - case SUMO_ATTR_LOADING_DURATION: - case SUMO_ATTR_LATALIGNMENT: - case SUMO_ATTR_MINGAP_LAT: - case SUMO_ATTR_MAXSPEED_LAT: - case SUMO_ATTR_ACTIONSTEPLENGTH: - case SUMO_ATTR_PROB: - case SUMO_ATTR_OSGFILE: - case SUMO_ATTR_CARRIAGE_LENGTH: - case SUMO_ATTR_LOCOMOTIVE_LENGTH: - case SUMO_ATTR_CARRIAGE_GAP: - case GNE_ATTR_PARAMETERS: - // if we change the original value of a default vehicle Type, change also flag "myDefaultVehicleType" - if (myDefaultVehicleType) { - vTypeChangeAttributeForced = new GNEChange_Attribute(this, GNE_ATTR_DEFAULT_VTYPE_MODIFIED, "true"); - // force change - vTypeChangeAttributeForced->forceChange(); - undoList->changeAttribute(vTypeChangeAttributeForced); - } - vTypeChangeAttributeForced = new GNEChange_Attribute(this, key, value); - // force change - vTypeChangeAttributeForced->forceChange(); - undoList->changeAttribute(vTypeChangeAttributeForced); - break; - case GNE_ATTR_DEFAULT_VTYPE_MODIFIED: - vTypeChangeAttributeForced = new GNEChange_Attribute(this, GNE_ATTR_DEFAULT_VTYPE_MODIFIED, "true"); - // force change - vTypeChangeAttributeForced->forceChange(); - undoList->changeAttribute(vTypeChangeAttributeForced); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEVehicleType::isValid(SumoXMLAttr key, const std::string& value) { - // a empty value is always valid except for IDs - if ((key != SUMO_ATTR_ID) && value.empty()) { - return true; - } - switch (key) { - case SUMO_ATTR_ID: - // Vtypes and PTypes shares namespace - if (SUMOXMLDefinitions::isValidVehicleID(value) && - (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, value, false) == nullptr) && - (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PTYPE, value, false) == nullptr)) { - return true; - } else { - return false; - } - // CFM Attributes - case SUMO_ATTR_SIGMA: - return canParse(value) && (parse(value) >= 0) && (parse(value) <= 1); - case SUMO_ATTR_ACCEL: - case SUMO_ATTR_DECEL: - case SUMO_ATTR_APPARENTDECEL: - case SUMO_ATTR_EMERGENCYDECEL: - case SUMO_ATTR_TAU: - case SUMO_ATTR_COLLISION_MINGAP_FACTOR: - case SUMO_ATTR_TMP1: - case SUMO_ATTR_TMP2: - case SUMO_ATTR_TMP3: - case SUMO_ATTR_TMP4: - case SUMO_ATTR_TMP5: - case SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS: - case SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW: - case SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD: - case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE: - case SUMO_ATTR_CF_EIDM_T_REACTION: - case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE: - case SUMO_ATTR_CF_EIDM_C_COOLNESS: - case SUMO_ATTR_CF_EIDM_SIG_LEADER: - case SUMO_ATTR_CF_EIDM_SIG_GAP: - case SUMO_ATTR_CF_EIDM_SIG_ERROR: - case SUMO_ATTR_CF_EIDM_JERK_MAX: - case SUMO_ATTR_CF_EIDM_EPSILON_ACC: - case SUMO_ATTR_CF_EIDM_T_ACC_MAX: - case SUMO_ATTR_CF_EIDM_M_FLATNESS: - case SUMO_ATTR_CF_EIDM_M_BEGIN: - case SUMO_ATTR_CF_PWAGNER2009_TAULAST: - case SUMO_ATTR_CF_PWAGNER2009_APPROB: - case SUMO_ATTR_CF_IDMM_ADAPT_FACTOR: - case SUMO_ATTR_CF_IDMM_ADAPT_TIME: - case SUMO_ATTR_CF_WIEDEMANN_SECURITY: - case SUMO_ATTR_CF_WIEDEMANN_ESTIMATION: - case SUMO_ATTR_K: - case SUMO_ATTR_CF_KERNER_PHI: - case SUMO_ATTR_CF_IDM_DELTA: - case SUMO_ATTR_CF_IDM_STEPPING: - return canParse(value); - case SUMO_ATTR_TRAIN_TYPE: - // rail string - return SUMOXMLDefinitions::TrainTypes.hasString(value); - // JM Attributes - case SUMO_ATTR_JM_CROSSING_GAP: - return canParse(value) && (parse(value) >= 0); - case SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME: - return canParse(value) && (parse(value) >= -1); - case SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME: - return canParse(value) && (parse(value) >= -1); - case SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME: - return canParse(value) && (parse(value) >= -1); - case SUMO_ATTR_JM_DRIVE_RED_SPEED: - return canParse(value) && (parse(value) >= 0); - case SUMO_ATTR_JM_IGNORE_FOE_PROB: - return canParse(value) && (parse(value) >= 0); - case SUMO_ATTR_JM_IGNORE_FOE_SPEED: - return canParse(value) && (parse(value) >= 0); - case SUMO_ATTR_JM_SIGMA_MINOR: - return canParse(value) && (parse(value) >= 0) && (parse(value) <= 1); - case SUMO_ATTR_JM_TIMEGAP_MINOR: - return canParse(value) && (parse(value) >= 0); - case SUMO_ATTR_IMPATIENCE: - return canParse(value) && (parse(value) >= 0); - // LCM Attributes - case SUMO_ATTR_LCA_STRATEGIC_PARAM: - case SUMO_ATTR_LCA_COOPERATIVE_PARAM: - case SUMO_ATTR_LCA_SPEEDGAIN_PARAM: - case SUMO_ATTR_LCA_KEEPRIGHT_PARAM: - case SUMO_ATTR_LCA_SUBLANE_PARAM: - case SUMO_ATTR_LCA_OPPOSITE_PARAM: - case SUMO_ATTR_LCA_PUSHY: - return canParse(value); - case SUMO_ATTR_LCA_PUSHYGAP: - case SUMO_ATTR_LCA_IMPATIENCE: - case SUMO_ATTR_LCA_MAXSPEEDLATSTANDING: - case SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE: // 0 mean disabled - case SUMO_ATTR_LCA_TIME_TO_IMPATIENCE: // 0 mean disabled - case SUMO_ATTR_LCA_OVERTAKE_RIGHT: // 0 mean disabled - return canParse(value) && (parse(value) >= 0); - case SUMO_ATTR_LCA_ASSERTIVE: - case SUMO_ATTR_LCA_LOOKAHEADLEFT: - case SUMO_ATTR_LCA_SPEEDGAINRIGHT: - case SUMO_ATTR_LCA_ACCEL_LAT: - case SUMO_ATTR_LCA_MAXSPEEDLATFACTOR: - return canParse(value) && (parse(value) > 0); - /* case SUMO_ATTR_LCA_EXPERIMENTAL1: - return true; - */ - // - case SUMO_ATTR_LENGTH: - return canParse(value) && (parse(value) > 0); - case SUMO_ATTR_MINGAP: - return canParse(value) && (parse(value) >= 0); - case SUMO_ATTR_MAXSPEED: - return canParse(value) && (parse(value) >= 0); - case SUMO_ATTR_SPEEDFACTOR: - return Distribution_Parameterized::isValidDescription(value); - case SUMO_ATTR_COLOR: - if (value.empty()) { - return true; - } else { - return canParse(value); - } - case SUMO_ATTR_VCLASS: - return canParseVehicleClasses(value); - case SUMO_ATTR_EMISSIONCLASS: - // check if given value correspond to a string of PollutantsInterface::getAllClassesStr() - for (const auto& i : PollutantsInterface::getAllClassesStr()) { - if (value == i) { - return true; - } - } - return false; - case SUMO_ATTR_GUISHAPE: - if (value == "all") { - return false; - } else { - return canParseVehicleShape(value); - } - case SUMO_ATTR_WIDTH: - return canParse(value); - case SUMO_ATTR_HEIGHT: - return canParse(value); - case SUMO_ATTR_IMGFILE: - return SUMOXMLDefinitions::isValidFilename(value); - case SUMO_ATTR_LANE_CHANGE_MODEL: - return SUMOXMLDefinitions::LaneChangeModels.hasString(value); - case SUMO_ATTR_CAR_FOLLOW_MODEL: - return SUMOXMLDefinitions::CarFollowModels.hasString(value); - case SUMO_ATTR_PERSON_CAPACITY: - return canParse(value); - case SUMO_ATTR_CONTAINER_CAPACITY: - return canParse(value); - case SUMO_ATTR_BOARDING_DURATION: - return canParse(value); - case SUMO_ATTR_LOADING_DURATION: - return canParse(value); - case SUMO_ATTR_LATALIGNMENT: - return SUMOVTypeParameter::isValidLatAlignment(value); - case SUMO_ATTR_MINGAP_LAT: - return canParse(value); - case SUMO_ATTR_MAXSPEED_LAT: - return canParse(value); - case SUMO_ATTR_ACTIONSTEPLENGTH: - return canParse(value) && (parse(value) >= 0); - case SUMO_ATTR_PROB: - return canParse(value) && (parse(value) >= 0); - case SUMO_ATTR_OSGFILE: - return SUMOXMLDefinitions::isValidFilename(value); - case SUMO_ATTR_CARRIAGE_LENGTH: - return canParse(value) && (parse(value) >= -1); - case SUMO_ATTR_LOCOMOTIVE_LENGTH: - return canParse(value) && (parse(value) >= -1); - case SUMO_ATTR_CARRIAGE_GAP: - return canParse(value) && (parse(value) >= 0); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - case GNE_ATTR_DEFAULT_VTYPE_MODIFIED: - if (myDefaultVehicleType) { - return canParse(value); - } else { - return false; - } - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEVehicleType::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // nothing to enable -} - - -void -GNEVehicleType::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // nothing to disable -} - - -bool -GNEVehicleType::isAttributeEnabled(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - if ((id == DEFAULT_VTYPE_ID) || (id == DEFAULT_PEDTYPE_ID) || (id == DEFAULT_BIKETYPE_ID)) { - return false; - } else { - return true; - } - case SUMO_ATTR_LENGTH: - return wasSet(VTYPEPARS_LENGTH_SET); - case SUMO_ATTR_MINGAP: - return wasSet(VTYPEPARS_MINGAP_SET); - case SUMO_ATTR_MAXSPEED: - return wasSet(VTYPEPARS_MAXSPEED_SET); - case SUMO_ATTR_SPEEDFACTOR: - return wasSet(VTYPEPARS_SPEEDFACTOR_SET); - case SUMO_ATTR_PERSON_CAPACITY: - return wasSet(VTYPEPARS_PERSON_CAPACITY); - case SUMO_ATTR_CONTAINER_CAPACITY: - return wasSet(VTYPEPARS_CONTAINER_CAPACITY); - case SUMO_ATTR_OSGFILE: - return wasSet(VTYPEPARS_OSGFILE_SET); - case SUMO_ATTR_CARRIAGE_LENGTH: - return wasSet(VTYPEPARS_CARRIAGE_LENGTH_SET); - case SUMO_ATTR_LOCOMOTIVE_LENGTH: - return wasSet(VTYPEPARS_LOCOMOTIVE_LENGTH_SET); - case SUMO_ATTR_CARRIAGE_GAP: - return wasSet(VTYPEPARS_CARRIAGE_GAP_SET); - default: - return true; - } -} - - -std::string -GNEVehicleType::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEVehicleType::getHierarchyName() const { - return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) ; -} - - -const std::map& -GNEVehicleType::getACParametersMap() const { - return getParametersMap(); -} - - -void -GNEVehicleType::overwriteVType(GNEDemandElement* vType, const SUMOVTypeParameter newVTypeParameter, GNEUndoList* undoList) { - // open undo list and overwritte all values of default VType - undoList->begin(vType->getTagProperty().getGUIIcon(), "update default " + vType->getTagStr() + " '" + DEFAULT_VTYPE_ID + "'"); - // CFM values - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_ACCEL, "").empty()) { - vType->setAttribute(SUMO_ATTR_ACCEL, toString(newVTypeParameter.getCFParam(SUMO_ATTR_ACCEL, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_DECEL, "").empty()) { - vType->setAttribute(SUMO_ATTR_DECEL, toString(newVTypeParameter.getCFParam(SUMO_ATTR_DECEL, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_APPARENTDECEL, "").empty()) { - vType->setAttribute(SUMO_ATTR_APPARENTDECEL, toString(newVTypeParameter.getCFParam(SUMO_ATTR_APPARENTDECEL, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_EMERGENCYDECEL, "").empty()) { - vType->setAttribute(SUMO_ATTR_EMERGENCYDECEL, toString(newVTypeParameter.getCFParam(SUMO_ATTR_EMERGENCYDECEL, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_SIGMA, "").empty()) { - vType->setAttribute(SUMO_ATTR_SIGMA, toString(newVTypeParameter.getCFParam(SUMO_ATTR_SIGMA, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_TAU, "").empty()) { - vType->setAttribute(SUMO_ATTR_TAU, toString(newVTypeParameter.getCFParam(SUMO_ATTR_TAU, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_COLLISION_MINGAP_FACTOR, "").empty()) { - vType->setAttribute(SUMO_ATTR_COLLISION_MINGAP_FACTOR, toString(newVTypeParameter.getCFParam(SUMO_ATTR_COLLISION_MINGAP_FACTOR, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_TMP1, "").empty()) { - vType->setAttribute(SUMO_ATTR_TMP1, toString(newVTypeParameter.getCFParam(SUMO_ATTR_TMP1, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_TMP2, "").empty()) { - vType->setAttribute(SUMO_ATTR_TMP2, toString(newVTypeParameter.getCFParam(SUMO_ATTR_TMP2, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_TMP3, "").empty()) { - vType->setAttribute(SUMO_ATTR_TMP3, toString(newVTypeParameter.getCFParam(SUMO_ATTR_TMP3, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_TMP4, "").empty()) { - vType->setAttribute(SUMO_ATTR_TMP4, toString(newVTypeParameter.getCFParam(SUMO_ATTR_TMP4, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_TMP5, "").empty()) { - vType->setAttribute(SUMO_ATTR_TMP5, toString(newVTypeParameter.getCFParam(SUMO_ATTR_TMP5, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_T_REACTION, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_EIDM_T_REACTION, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_T_REACTION, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_C_COOLNESS, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_EIDM_C_COOLNESS, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_C_COOLNESS, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_SIG_LEADER, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_EIDM_SIG_LEADER, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_SIG_LEADER, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_SIG_GAP, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_EIDM_SIG_GAP, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_SIG_GAP, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_SIG_ERROR, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_EIDM_SIG_ERROR, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_SIG_ERROR, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_JERK_MAX, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_EIDM_JERK_MAX, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_JERK_MAX, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_EPSILON_ACC, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_EIDM_EPSILON_ACC, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_EPSILON_ACC, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_T_ACC_MAX, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_EIDM_T_ACC_MAX, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_T_ACC_MAX, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_M_FLATNESS, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_EIDM_M_FLATNESS, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_M_FLATNESS, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_M_BEGIN, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_EIDM_M_BEGIN, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_M_BEGIN, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_PWAGNER2009_TAULAST, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_PWAGNER2009_TAULAST, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_PWAGNER2009_TAULAST, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_PWAGNER2009_APPROB, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_PWAGNER2009_APPROB, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_PWAGNER2009_APPROB, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_IDMM_ADAPT_FACTOR, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_IDMM_ADAPT_FACTOR, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_IDMM_ADAPT_FACTOR, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_IDMM_ADAPT_TIME, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_IDMM_ADAPT_TIME, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_IDMM_ADAPT_TIME, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_WIEDEMANN_SECURITY, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_WIEDEMANN_SECURITY, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_WIEDEMANN_SECURITY, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_WIEDEMANN_ESTIMATION, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_WIEDEMANN_ESTIMATION, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_WIEDEMANN_ESTIMATION, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_TRAIN_TYPE, "").empty()) { - vType->setAttribute(SUMO_ATTR_TRAIN_TYPE, toString(newVTypeParameter.getCFParam(SUMO_ATTR_TRAIN_TYPE, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_K, "").empty()) { - vType->setAttribute(SUMO_ATTR_K, toString(newVTypeParameter.getCFParam(SUMO_ATTR_K, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_KERNER_PHI, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_KERNER_PHI, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_KERNER_PHI, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_IDM_DELTA, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_IDM_DELTA, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_IDM_DELTA, 0)), undoList); - } - if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_IDM_STEPPING, "").empty()) { - vType->setAttribute(SUMO_ATTR_CF_IDM_STEPPING, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_IDM_STEPPING, 0)), undoList); - } - // JM values - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_CROSSING_GAP, "").empty()) { - vType->setAttribute(SUMO_ATTR_JM_CROSSING_GAP, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_CROSSING_GAP, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME, "").empty()) { - vType->setAttribute(SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME, "").empty()) { - vType->setAttribute(SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME, "").empty()) { - vType->setAttribute(SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_DRIVE_RED_SPEED, "").empty()) { - vType->setAttribute(SUMO_ATTR_JM_DRIVE_RED_SPEED, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_DRIVE_RED_SPEED, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_IGNORE_FOE_PROB, "").empty()) { - vType->setAttribute(SUMO_ATTR_JM_IGNORE_FOE_PROB, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_IGNORE_FOE_PROB, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_IGNORE_FOE_SPEED, "").empty()) { - vType->setAttribute(SUMO_ATTR_JM_IGNORE_FOE_SPEED, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_IGNORE_FOE_SPEED, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_SIGMA_MINOR, "").empty()) { - vType->setAttribute(SUMO_ATTR_JM_SIGMA_MINOR, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_SIGMA_MINOR, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_TIMEGAP_MINOR, "").empty()) { - vType->setAttribute(SUMO_ATTR_JM_TIMEGAP_MINOR, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_TIMEGAP_MINOR, 0)), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_IMPATIENCE_SET)) { - vType->setAttribute(SUMO_ATTR_IMPATIENCE, toString(newVTypeParameter.impatience), undoList); - } - // LCM values - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_STRATEGIC_PARAM, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_STRATEGIC_PARAM, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_STRATEGIC_PARAM, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_COOPERATIVE_PARAM, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_COOPERATIVE_PARAM, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_COOPERATIVE_PARAM, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_SPEEDGAIN_PARAM, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_SPEEDGAIN_PARAM, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_SPEEDGAIN_PARAM, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_KEEPRIGHT_PARAM, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_KEEPRIGHT_PARAM, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_KEEPRIGHT_PARAM, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_SUBLANE_PARAM, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_SUBLANE_PARAM, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_SUBLANE_PARAM, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_OPPOSITE_PARAM, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_OPPOSITE_PARAM, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_OPPOSITE_PARAM, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_PUSHY, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_PUSHY, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_PUSHY, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_PUSHYGAP, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_PUSHYGAP, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_PUSHYGAP, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_ASSERTIVE, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_ASSERTIVE, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_ASSERTIVE, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_IMPATIENCE, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_IMPATIENCE, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_IMPATIENCE, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_TIME_TO_IMPATIENCE, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_TIME_TO_IMPATIENCE, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_TIME_TO_IMPATIENCE, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_ACCEL_LAT, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_ACCEL_LAT, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_ACCEL_LAT, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_LOOKAHEADLEFT, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_LOOKAHEADLEFT, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_LOOKAHEADLEFT, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_SPEEDGAINRIGHT, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_SPEEDGAINRIGHT, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_SPEEDGAINRIGHT, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_MAXSPEEDLATSTANDING, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_MAXSPEEDLATSTANDING, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_MAXSPEEDLATSTANDING, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_MAXSPEEDLATFACTOR, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_MAXSPEEDLATFACTOR, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_MAXSPEEDLATFACTOR, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_OVERTAKE_RIGHT, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_OVERTAKE_RIGHT, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_OVERTAKE_RIGHT, 0)), undoList); - } - if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_EXPERIMENTAL1, "").empty()) { - vType->setAttribute(SUMO_ATTR_LCA_EXPERIMENTAL1, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_EXPERIMENTAL1, 0)), undoList); - } - // - if (newVTypeParameter.wasSet(VTYPEPARS_LENGTH_SET)) { - vType->setAttribute(SUMO_ATTR_LENGTH, toString(newVTypeParameter.length), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_MINGAP_SET)) { - vType->setAttribute(SUMO_ATTR_MINGAP, toString(newVTypeParameter.minGap), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_MAXSPEED_SET)) { - vType->setAttribute(SUMO_ATTR_MAXSPEED, toString(newVTypeParameter.maxSpeed), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_SPEEDFACTOR_SET)) { - vType->setAttribute(SUMO_ATTR_SPEEDFACTOR, toString(newVTypeParameter.speedFactor), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_COLOR_SET)) { - vType->setAttribute(SUMO_ATTR_COLOR, toString(newVTypeParameter.color), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_EMISSIONCLASS_SET)) { - vType->setAttribute(SUMO_ATTR_EMISSIONCLASS, PollutantsInterface::getName(newVTypeParameter.emissionClass), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_SHAPE_SET)) { - vType->setAttribute(SUMO_ATTR_GUISHAPE, getVehicleShapeName(newVTypeParameter.shape), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_WIDTH_SET)) { - vType->setAttribute(SUMO_ATTR_WIDTH, toString(newVTypeParameter.width), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_HEIGHT_SET)) { - vType->setAttribute(SUMO_ATTR_HEIGHT, toString(newVTypeParameter.height), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_IMGFILE_SET)) { - vType->setAttribute(SUMO_ATTR_IMGFILE, toString(newVTypeParameter.imgFile), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_LANE_CHANGE_MODEL_SET)) { - vType->setAttribute(SUMO_ATTR_LANE_CHANGE_MODEL, SUMOXMLDefinitions::LaneChangeModels.getString(newVTypeParameter.lcModel), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_CAR_FOLLOW_MODEL)) { - vType->setAttribute(SUMO_ATTR_CAR_FOLLOW_MODEL, SUMOXMLDefinitions::CarFollowModels.getString(newVTypeParameter.cfModel), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_PERSON_CAPACITY)) { - vType->setAttribute(SUMO_ATTR_PERSON_CAPACITY, toString(newVTypeParameter.personCapacity), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_CONTAINER_CAPACITY)) { - vType->setAttribute(SUMO_ATTR_CONTAINER_CAPACITY, toString(newVTypeParameter.containerCapacity), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_BOARDING_DURATION)) { - vType->setAttribute(SUMO_ATTR_BOARDING_DURATION, toString(newVTypeParameter.boardingDuration), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_LOADING_DURATION)) { - vType->setAttribute(SUMO_ATTR_LOADING_DURATION, toString(newVTypeParameter.loadingDuration), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_LATALIGNMENT_SET)) { - if (newVTypeParameter.latAlignmentProcedure != LatAlignmentDefinition::GIVEN) { - vType->setAttribute(SUMO_ATTR_LATALIGNMENT, toString(newVTypeParameter.latAlignmentProcedure), undoList); - } else { - vType->setAttribute(SUMO_ATTR_LATALIGNMENT, toString(newVTypeParameter.latAlignmentOffset), undoList); - } - } - if (newVTypeParameter.wasSet(VTYPEPARS_MINGAP_LAT_SET)) { - vType->setAttribute(SUMO_ATTR_MINGAP_LAT, toString(newVTypeParameter.minGapLat), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_MAXSPEED_LAT_SET)) { - vType->setAttribute(SUMO_ATTR_MAXSPEED_LAT, toString(newVTypeParameter.maxSpeedLat), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_ACTIONSTEPLENGTH_SET)) { - vType->setAttribute(SUMO_ATTR_ACTIONSTEPLENGTH, toString(newVTypeParameter.actionStepLength), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_PROBABILITY_SET)) { - vType->setAttribute(SUMO_ATTR_PROB, toString(newVTypeParameter.defaultProbability), undoList); - } - if (newVTypeParameter.wasSet(VTYPEPARS_OSGFILE_SET)) { - vType->setAttribute(SUMO_ATTR_OSGFILE, toString(newVTypeParameter.osgFile), undoList); - } - if (newVTypeParameter.knowsParameter(toString(SUMO_ATTR_CARRIAGE_LENGTH))) { - vType->setAttribute(SUMO_ATTR_CARRIAGE_LENGTH, newVTypeParameter.getParameter(toString(SUMO_ATTR_CARRIAGE_LENGTH), ""), undoList); - } - if (newVTypeParameter.knowsParameter(toString(SUMO_ATTR_LOCOMOTIVE_LENGTH))) { - vType->setAttribute(SUMO_ATTR_LOCOMOTIVE_LENGTH, newVTypeParameter.getParameter(toString(SUMO_ATTR_LOCOMOTIVE_LENGTH), ""), undoList); - } - if (newVTypeParameter.knowsParameter(toString(SUMO_ATTR_CARRIAGE_GAP))) { - vType->setAttribute(SUMO_ATTR_CARRIAGE_GAP, newVTypeParameter.getParameter(toString(SUMO_ATTR_CARRIAGE_GAP), ""), undoList); - } - // parse parameters - std::string parametersStr; - // Generate an string using the following structure: "key1=value1|key2=value2|... - for (const auto& parameter : newVTypeParameter.getParametersMap()) { - parametersStr += parameter.first + "=" + parameter.second + "|"; - } - // remove the last "|" - if (!parametersStr.empty()) { - parametersStr.pop_back(); - } - if (parametersStr != vType->getAttribute(GNE_ATTR_PARAMETERS)) { - vType->setAttribute(GNE_ATTR_PARAMETERS, parametersStr, undoList); - } - // close undo list - undoList->end(); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEVehicleType::setAttribute(SumoXMLAttr key, const std::string& value) { - // obtain default values depending of vehicle class - VClassDefaultValues defaultValues(vehicleClass); - switch (key) { - case SUMO_ATTR_ID: - // update microsimID - setMicrosimID(value); - // manually change VType parameters ID - id = value; - break; - // CFM Attributes - case SUMO_ATTR_ACCEL: - case SUMO_ATTR_DECEL: - case SUMO_ATTR_APPARENTDECEL: - case SUMO_ATTR_EMERGENCYDECEL: - case SUMO_ATTR_SIGMA: - case SUMO_ATTR_TAU: - case SUMO_ATTR_COLLISION_MINGAP_FACTOR: - case SUMO_ATTR_TMP1: - case SUMO_ATTR_TMP2: - case SUMO_ATTR_TMP3: - case SUMO_ATTR_TMP4: - case SUMO_ATTR_TMP5: - case SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS: - case SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW: - case SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD: - case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE: - case SUMO_ATTR_CF_EIDM_T_REACTION: - case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE: - case SUMO_ATTR_CF_EIDM_C_COOLNESS: - case SUMO_ATTR_CF_EIDM_SIG_LEADER: - case SUMO_ATTR_CF_EIDM_SIG_GAP: - case SUMO_ATTR_CF_EIDM_SIG_ERROR: - case SUMO_ATTR_CF_EIDM_JERK_MAX: - case SUMO_ATTR_CF_EIDM_EPSILON_ACC: - case SUMO_ATTR_CF_EIDM_T_ACC_MAX: - case SUMO_ATTR_CF_EIDM_M_FLATNESS: - case SUMO_ATTR_CF_EIDM_M_BEGIN: - case SUMO_ATTR_CF_PWAGNER2009_TAULAST: - case SUMO_ATTR_CF_PWAGNER2009_APPROB: - case SUMO_ATTR_CF_IDMM_ADAPT_FACTOR: - case SUMO_ATTR_CF_IDMM_ADAPT_TIME: - case SUMO_ATTR_CF_WIEDEMANN_SECURITY: - case SUMO_ATTR_CF_WIEDEMANN_ESTIMATION: - case SUMO_ATTR_TRAIN_TYPE: - case SUMO_ATTR_K: - case SUMO_ATTR_CF_KERNER_PHI: - case SUMO_ATTR_CF_IDM_DELTA: - case SUMO_ATTR_CF_IDM_STEPPING: - // empty values means that value isn't set - if (value.empty()) { - const auto it = cfParameter.find(key); - if (it != cfParameter.end()) { - cfParameter.erase(it); - } - } else { - cfParameter[key] = value; - } - break; - // JM Attributes - case SUMO_ATTR_JM_CROSSING_GAP: - case SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME: - case SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME: - case SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME: - case SUMO_ATTR_JM_DRIVE_RED_SPEED: - case SUMO_ATTR_JM_IGNORE_FOE_PROB: - case SUMO_ATTR_JM_IGNORE_FOE_SPEED: - case SUMO_ATTR_JM_SIGMA_MINOR: - case SUMO_ATTR_JM_TIMEGAP_MINOR: - // empty values means that value isn't set - if (value.empty()) { - const auto it = jmParameter.find(key); - if (it != jmParameter.end()) { - jmParameter.erase(it); - } - } else { - jmParameter[key] = value; - } - break; - case SUMO_ATTR_IMPATIENCE: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - impatience = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_IMPATIENCE_SET; - } else { - // set default value - impatience = parse(myTagProperty.getDefaultValue(key)); - // unset parameter - parametersSet &= ~VTYPEPARS_IMPATIENCE_SET; - } - break; - // LCM Attributes - case SUMO_ATTR_LCA_STRATEGIC_PARAM: - case SUMO_ATTR_LCA_COOPERATIVE_PARAM: - case SUMO_ATTR_LCA_SPEEDGAIN_PARAM: - case SUMO_ATTR_LCA_KEEPRIGHT_PARAM: - case SUMO_ATTR_LCA_SUBLANE_PARAM: - case SUMO_ATTR_LCA_OPPOSITE_PARAM: - case SUMO_ATTR_LCA_PUSHY: - case SUMO_ATTR_LCA_PUSHYGAP: - case SUMO_ATTR_LCA_ASSERTIVE: - case SUMO_ATTR_LCA_IMPATIENCE: - case SUMO_ATTR_LCA_ACCEL_LAT: - case SUMO_ATTR_LCA_LOOKAHEADLEFT: - case SUMO_ATTR_LCA_SPEEDGAINRIGHT: - case SUMO_ATTR_LCA_MAXSPEEDLATSTANDING: - case SUMO_ATTR_LCA_MAXSPEEDLATFACTOR: - - /* case SUMO_ATTR_LCA_EXPERIMENTAL1: */ - // empty values means that value isn't set - if (value.empty()) { - const auto it = lcParameter.find(key); - if (it != lcParameter.end()) { - lcParameter.erase(it); - } - } else { - lcParameter[key] = value; - } - break; - case SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE: - case SUMO_ATTR_LCA_TIME_TO_IMPATIENCE: - case SUMO_ATTR_LCA_OVERTAKE_RIGHT: - // empty or null values means that value isn't set - if (value.empty() || (canParse(value) && (parse(value) == 0))) { - const auto it = lcParameter.find(key); - if (it != lcParameter.end()) { - lcParameter.erase(it); - } - } else { - lcParameter[key] = value; - } - break; - // - case SUMO_ATTR_LENGTH: - if (!value.empty() && (value != toString(defaultValues.length))) { - length = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_LENGTH_SET; - } else { - // set default value - length = defaultValues.length; - // unset parameter - parametersSet &= ~VTYPEPARS_LENGTH_SET; - } - break; - case SUMO_ATTR_MINGAP: - if (!value.empty() && (value != toString(defaultValues.minGap))) { - minGap = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_MINGAP_SET; - } else { - // set default value - minGap = defaultValues.minGap; - // unset parameter - parametersSet &= ~VTYPEPARS_MINGAP_SET; - } - break; - case SUMO_ATTR_MAXSPEED: - if (!value.empty() && (value != toString(defaultValues.maxSpeed))) { - maxSpeed = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_MAXSPEED_SET; - } else { - // set default value - maxSpeed = defaultValues.maxSpeed; - // unset parameter - parametersSet &= ~VTYPEPARS_MAXSPEED_SET; - } - break; - case SUMO_ATTR_SPEEDFACTOR: - if (!value.empty() && (value != toString(defaultValues.speedFactor))) { - speedFactor.parse(value, false); - // mark parameter as set - parametersSet |= VTYPEPARS_SPEEDFACTOR_SET; - } else { - // set default value - speedFactor.parse(toString(defaultValues.speedFactor), false); - // unset parameter - parametersSet &= ~VTYPEPARS_SPEEDFACTOR_SET; - } - break; - case SUMO_ATTR_COLOR: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - color = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_COLOR_SET; - } else { - // unset parameter - parametersSet &= ~VTYPEPARS_COLOR_SET; - } - break; - case SUMO_ATTR_VCLASS: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - vehicleClass = getVehicleClassID(value); - // mark parameter as set - parametersSet |= VTYPEPARS_VEHICLECLASS_SET; - } else { - // set default value - vehicleClass = getVehicleClassID(myTagProperty.getDefaultValue(key)); - // unset parameter - parametersSet &= ~VTYPEPARS_VEHICLECLASS_SET; - } - // update default values - updateDefaultVClassAttributes(defaultValues); - break; - case SUMO_ATTR_EMISSIONCLASS: - if (!value.empty() && (value != toString(defaultValues.emissionClass))) { - emissionClass = PollutantsInterface::getClassByName(value); - // mark parameter as set - parametersSet |= VTYPEPARS_EMISSIONCLASS_SET; - } else { - // set default value - emissionClass = defaultValues.emissionClass; - // unset parameter - parametersSet &= ~VTYPEPARS_EMISSIONCLASS_SET; - } - break; - case SUMO_ATTR_GUISHAPE: - if (!value.empty() && (value != toString(defaultValues.shape))) { - shape = getVehicleShapeID(value); - // mark parameter as set - parametersSet |= VTYPEPARS_SHAPE_SET; - } else { - // set default value - shape = defaultValues.shape; - // unset parameter - parametersSet &= ~VTYPEPARS_SHAPE_SET; - } - break; - case SUMO_ATTR_WIDTH: - if (!value.empty() && (value != toString(defaultValues.width))) { - width = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_WIDTH_SET; - } else { - // set default value - width = defaultValues.width; - // unset parameter - parametersSet &= ~VTYPEPARS_WIDTH_SET; - } - break; - case SUMO_ATTR_HEIGHT: - if (!value.empty() && (value != toString(defaultValues.height))) { - height = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_HEIGHT_SET; - } else { - // set default value - height = defaultValues.height; - // unset parameter - parametersSet &= ~VTYPEPARS_HEIGHT_SET; - } - break; - case SUMO_ATTR_IMGFILE: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - imgFile = value; - // mark parameter as set - parametersSet |= VTYPEPARS_IMGFILE_SET; - } else { - // set default value - imgFile = myTagProperty.getDefaultValue(key); - // unset parameter - parametersSet &= ~VTYPEPARS_IMGFILE_SET; - } - break; - case SUMO_ATTR_LANE_CHANGE_MODEL: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - lcModel = SUMOXMLDefinitions::LaneChangeModels.get(value); - // mark parameter as set - parametersSet |= VTYPEPARS_LANE_CHANGE_MODEL_SET; - } else { - // set default value - lcModel = SUMOXMLDefinitions::LaneChangeModels.get(myTagProperty.getDefaultValue(key)); - // unset parameter - parametersSet &= ~VTYPEPARS_LANE_CHANGE_MODEL_SET; - } - break; - case SUMO_ATTR_CAR_FOLLOW_MODEL: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - cfModel = SUMOXMLDefinitions::CarFollowModels.get(value); - // mark parameter as set - parametersSet |= VTYPEPARS_CAR_FOLLOW_MODEL; - } else { - // set default value - cfModel = SUMOXMLDefinitions::CarFollowModels.get(myTagProperty.getDefaultValue(key)); - // unset parameter - parametersSet &= ~VTYPEPARS_CAR_FOLLOW_MODEL; - } - break; - case SUMO_ATTR_PERSON_CAPACITY: - if (!value.empty() && (value != toString(defaultValues.personCapacity))) { - personCapacity = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_PERSON_CAPACITY; - } else { - // set default value - personCapacity = defaultValues.personCapacity; - // unset parameter - parametersSet &= ~VTYPEPARS_PERSON_CAPACITY; - } - break; - case SUMO_ATTR_CONTAINER_CAPACITY: - if (!value.empty() && (value != toString(defaultValues.containerCapacity))) { - containerCapacity = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_CONTAINER_CAPACITY; - } else { - // set default value - containerCapacity = defaultValues.containerCapacity; - // unset parameter - parametersSet &= ~VTYPEPARS_CONTAINER_CAPACITY; - } - break; - case SUMO_ATTR_BOARDING_DURATION: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - boardingDuration = string2time(value); - // mark parameter as set - parametersSet |= VTYPEPARS_BOARDING_DURATION; - } else { - // set default value - boardingDuration = string2time(myTagProperty.getDefaultValue(key)); - // unset parameter - parametersSet &= ~VTYPEPARS_BOARDING_DURATION; - } - break; - case SUMO_ATTR_LOADING_DURATION: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - loadingDuration = string2time(value); - // mark parameter as set - parametersSet |= VTYPEPARS_LOADING_DURATION; - } else { - // set default value - loadingDuration = string2time(myTagProperty.getDefaultValue(key)); - // unset parameter - parametersSet &= ~VTYPEPARS_LOADING_DURATION; - } - break; - case SUMO_ATTR_LATALIGNMENT: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - parseLatAlignment(value, latAlignmentOffset, latAlignmentProcedure); - // mark parameter as set - parametersSet |= VTYPEPARS_LATALIGNMENT_SET; - } else { - // set default value - parseLatAlignment(myTagProperty.getDefaultValue(key), latAlignmentOffset, latAlignmentProcedure); - // unset parameter - parametersSet &= ~VTYPEPARS_LATALIGNMENT_SET; - } - break; - case SUMO_ATTR_MINGAP_LAT: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - minGapLat = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_MINGAP_LAT_SET; - } else { - // set default value - minGapLat = parse(myTagProperty.getDefaultValue(key)); - // unset parameter - parametersSet &= ~VTYPEPARS_MINGAP_LAT_SET; - } - break; - case SUMO_ATTR_MAXSPEED_LAT: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - maxSpeedLat = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_MAXSPEED_LAT_SET; - } else { - // set default value - maxSpeedLat = parse(myTagProperty.getDefaultValue(key)); - // unset parameter - parametersSet &= ~VTYPEPARS_MAXSPEED_LAT_SET; - } - break; - case SUMO_ATTR_ACTIONSTEPLENGTH: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - actionStepLength = string2time(value); - // mark parameter as set - parametersSet |= VTYPEPARS_ACTIONSTEPLENGTH_SET; - } else { - // set default value - actionStepLength = string2time(myTagProperty.getDefaultValue(key)); - // unset parameter - parametersSet &= ~VTYPEPARS_ACTIONSTEPLENGTH_SET; - } - break; - case SUMO_ATTR_PROB: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - defaultProbability = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_PROBABILITY_SET; - } else { - // set default value - defaultProbability = parse(myTagProperty.getDefaultValue(key)); - // unset parameter - parametersSet &= ~VTYPEPARS_PROBABILITY_SET; - } - break; - case SUMO_ATTR_OSGFILE: - if (!value.empty() && (value != defaultValues.osgFile)) { - osgFile = value; - // mark parameter as set - parametersSet |= VTYPEPARS_OSGFILE_SET; - } else { - // set default value - osgFile = defaultValues.osgFile; - // unset parameter - parametersSet &= ~VTYPEPARS_OSGFILE_SET; - } - break; - case SUMO_ATTR_CARRIAGE_LENGTH: - if (!value.empty() && (value != toString(defaultValues.carriageLength))) { - carriageLength = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_CARRIAGE_LENGTH_SET; - // set parameter in SUMOVTypeParameter (needed for writting in XML) - SUMOVTypeParameter::setParameter(toString(key), value); - } else { - // set default value - carriageLength = defaultValues.carriageLength; - // unset parameter - parametersSet &= ~VTYPEPARS_CARRIAGE_LENGTH_SET; - // remove from params (needed for writting in XML) - SUMOVTypeParameter::unsetParameter(toString(key)); - } - break; - case SUMO_ATTR_LOCOMOTIVE_LENGTH: - if (!value.empty() && (value != toString(defaultValues.containerCapacity))) { - locomotiveLength = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_LOCOMOTIVE_LENGTH_SET; - // set parameter in SUMOVTypeParameter (needed for writting in XML) - SUMOVTypeParameter::setParameter(toString(key), value); - } else { - // set default value - locomotiveLength = defaultValues.locomotiveLength; - // unset parameter - parametersSet &= ~VTYPEPARS_LOCOMOTIVE_LENGTH_SET; - // remove from params (needed for writting in XML) - SUMOVTypeParameter::unsetParameter(toString(key)); - } - break; - case SUMO_ATTR_CARRIAGE_GAP: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - carriageGap = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_CARRIAGE_GAP_SET; - // set parameter in SUMOVTypeParameter (needed for writting in XML) - SUMOVTypeParameter::setParameter(toString(key), value); - } else { - // set default value - carriageGap = parse(myTagProperty.getDefaultValue(key)); - // unset parameter - parametersSet &= ~VTYPEPARS_CARRIAGE_GAP_SET; - // remove from params (needed for writting in XML) - SUMOVTypeParameter::unsetParameter(toString(key)); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - case GNE_ATTR_DEFAULT_VTYPE_MODIFIED: - myDefaultVehicleTypeModified = parse(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } - // check if geometry must be marked as deprecated - if (myTagProperty.hasAttribute(key) && (myTagProperty.getAttributeProperties(key).requireUpdateGeometry())) { - updateGeometry(); - } -} - - -void -GNEVehicleType::setEnabledAttribute(const int /*enabledAttributes*/) { - // -} - - -void -GNEVehicleType::setMoveShape(const GNEMoveResult& /*moveResult*/) { - // vehicleTypes cannot be moved -} - - -void -GNEVehicleType::commitMoveShape(const GNEMoveResult& /*moveResult*/, GNEUndoList* /*undoList*/) { - // vehicleTypes cannot be moved -} - - -void -GNEVehicleType::updateDefaultVClassAttributes(const VClassDefaultValues& defaultValues) { - if (!wasSet(VTYPEPARS_LENGTH_SET)) { - length = defaultValues.length; - } - if (!wasSet(VTYPEPARS_MINGAP_SET)) { - minGap = defaultValues.minGap; - } - if (!wasSet(VTYPEPARS_MAXSPEED_SET)) { - maxSpeed = defaultValues.maxSpeed; - } - if (!wasSet(VTYPEPARS_WIDTH_SET)) { - width = defaultValues.width; - } - if (!wasSet(VTYPEPARS_HEIGHT_SET)) { - height = defaultValues.height; - } - if (!wasSet(VTYPEPARS_SHAPE_SET)) { - shape = defaultValues.shape; - } - if (!wasSet(VTYPEPARS_EMISSIONCLASS_SET)) { - emissionClass = defaultValues.emissionClass; - } - if (!wasSet(VTYPEPARS_SPEEDFACTOR_SET)) { - speedFactor = defaultValues.speedFactor; - } - if (!wasSet(VTYPEPARS_PERSON_CAPACITY)) { - personCapacity = defaultValues.personCapacity; - } - if (!wasSet(VTYPEPARS_CONTAINER_CAPACITY)) { - containerCapacity = defaultValues.containerCapacity; - } - if (!wasSet(VTYPEPARS_OSGFILE_SET)) { - osgFile = defaultValues.osgFile; - } - if (!wasSet(VTYPEPARS_CARRIAGE_LENGTH_SET)) { - carriageLength = defaultValues.carriageLength; - } - if (!wasSet(VTYPEPARS_LOCOMOTIVE_LENGTH_SET)) { - locomotiveLength = defaultValues.locomotiveLength; - } -} - -/****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEVehicleType.h sumo-1.12.0/src/netedit/elements/demand/GNEVehicleType.h --- sumo-1.11.0/src/netedit/elements/demand/GNEVehicleType.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEVehicleType.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,229 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GNEVehicleType.h -/// @author Pablo Alvarez Lopez -/// @date Jan 2018 -/// -// Definition of Vehicle Types in NETEDIT -/****************************************************************************/ -#pragma once -#include -#include - -#include "GNEDemandElement.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEVehicleType - * vehicleType vehicleType used by GNECalibrators - */ -class GNEVehicleType : public GNEDemandElement, public SUMOVTypeParameter { - -public: - /// @brief constructor for default VTypes - GNEVehicleType(GNENet* net, const std::string& vTypeID, const SUMOVehicleClass& defaultVClass, SumoXMLTag tag); - - /// @brief constructor - GNEVehicleType(GNENet* net, const SUMOVTypeParameter& vTypeParameter, SumoXMLTag tag); - - /// @brief copy constructor - GNEVehicleType(GNENet* net, const std::string& vTypeID, GNEVehicleType* vTypeOriginal); - - /// @brief destructor - ~GNEVehicleType(); - - /**@brief get move operation - * @note returned GNEMoveOperation can be nullptr - */ - GNEMoveOperation* getMoveOperation(); - - /**@brief writte demand element element into a xml file - * @param[in] device device in which write parameters of demand element element - */ - void writeDemandElement(OutputDevice& device) const; - - /// @name members and functions relative to elements common to all demand elements - /// @{ - /// @brief obtain VClass related with this demand element - SUMOVehicleClass getVClass() const; - - /// @brief get color - const RGBColor& getColor() const; - - /// @} - - /// @name Functions related with geometry of element - /// @{ - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /// @brief return exaggeration asociated with this GLObject - double getExaggeration(const GUIVisualizationSettings& s) const; - - /**@brief Returns the boundary to which the view shall be centered in order to show the object - * @return The boundary the object is within - */ - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); - - /**@brief Draws the object - * @param[in] s The settings for the current view (may influence drawing) - * @see GUIGlObject::drawGL - */ - void drawGL(const GUIVisualizationSettings& s) const; - - /// @} - - /// @name inherited from GNEPathManager::PathElement - /// @{ - - /// @brief compute pathElement - void computePathElement(); - - /**@brief Draws partial object - * @param[in] s The settings for the current view (may influence drawing) - * @param[in] lane lane in which draw partial - * @param[in] segment PathManager segment (used for segment options) - * @param[in] offsetFront extra front offset (used for drawing partial gl above other elements) - */ - void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const; - - /**@brief Draws partial object (junction) - * @param[in] s The settings for the current view (may influence drawing) - * @param[in] fromLane from GNELane - * @param[in] toLane to GNELane - * @param[in] segment PathManager segment (used for segment options) - * @param[in] offsetFront extra front offset (used for drawing partial gl above other elements) - */ - void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const; - - /// @brief get first path lane - GNELane* getFirstPathLane() const; - - /// @brief get last path lane - GNELane* getLastPathLane() const; - /// @} - - /// @brief inherited from GNEAttributeCarrier - /// @{ - /* @brief method for getting the Attribute of an XML key - * @param[in] key The attribute key - * @return string with the value associated to key - */ - std::string getAttribute(SumoXMLAttr key) const; - - /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse(...) for certain attributes) - * @param[in] key The attribute key - * @return double with the value associated to key - */ - double getAttributeDouble(SumoXMLAttr key) const; - - /* @brief method for getting the Attribute of an XML key in Position format (used in person plans) - * @param[in] key The attribute key - * @return double with the value associated to key - */ - Position getAttributePosition(SumoXMLAttr key) const; - - /* @brief method for setting the attribute and letting the object perform additional changes - * @param[in] key The attribute key - * @param[in] value The new value - * @param[in] undoList The undoList on which to register changes - * @param[in] net optionally the GNENet to inform about gui updates - */ - void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList); - - /* @brief method for setting the attribute and letting the object perform additional changes - * @param[in] key The attribute key - * @param[in] value The new value - * @param[in] undoList The undoList on which to register changes - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @brief method for enable attribute - * @param[in] key The attribute key - * @param[in] undoList The undoList on which to register changes - * @note certain attributes can be only enabled, and can produce the disabling of other attributes - */ - void enableAttribute(SumoXMLAttr key, GNEUndoList* undoList); - - /* @brief method for disable attribute - * @param[in] key The attribute key - * @param[in] undoList The undoList on which to register changes - * @note certain attributes can be only enabled, and can produce the disabling of other attributes - */ - void disableAttribute(SumoXMLAttr key, GNEUndoList* undoList); - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - bool isAttributeEnabled(SumoXMLAttr key) const; - - /// @brief get PopPup ID (Used in AC Hierarchy) - std::string getPopUpID() const; - - /// @brief get Hierarchy Name (Used in AC Hierarchy) - std::string getHierarchyName() const; - /// @} - - /// @brief get parameters map - const std::map& getACParametersMap() const; - - /// @brief overwrite all values of GNEVehicleType with a SUMOVTypeParameter - static void overwriteVType(GNEDemandElement* vType, const SUMOVTypeParameter newVTypeParameter, GNEUndoList* undoList); - -protected: - /// @brief flag to check if this GNEVehicleType is a default vehicle Type (For Vehicles, Pedestrians...) - bool myDefaultVehicleType; - - /// @brief flag to check if this default GNEVehicleType was modified - bool myDefaultVehicleTypeModified; - -private: - /// @brief method for setting the attribute and nothing else - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); - - /// @brief set move shape - void setMoveShape(const GNEMoveResult& moveResult); - - /// @brief commit move shape - void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList); - - /// @brief function called after set new VClass - void updateDefaultVClassAttributes(const VClassDefaultValues& defaultValues); - - /// @brief Invalidated copy constructor. - GNEVehicleType(GNEVehicleType*) = delete; - - /// @brief Invalidated assignment operator - GNEVehicleType* operator=(GNEVehicleType*) = delete; -}; diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEVType.cpp sumo-1.12.0/src/netedit/elements/demand/GNEVType.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNEVType.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEVType.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,1899 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GNEVType.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2019 +/// +// Definition of Vehicle Types in NETEDIT +/****************************************************************************/ +#include +#include +#include +#include +#include +#include + +#include "GNEVType.h" +#include "GNEVTypeDistribution.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEVType::GNEVType(GNENet* net) : + GNEDemandElement("", net, GLO_VTYPE, SUMO_TAG_VTYPE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {}, {}, {}, {}, {}, {}, {}), +SUMOVTypeParameter(""), +myDefaultVehicleType(true), +myDefaultVehicleTypeModified(false) { + // reset default values + resetDefaultValues(); + // init Rail Visualization Parameters + initRailVisualizationParameters(); +} + + +GNEVType::GNEVType(GNENet* net, const std::string& vTypeID, const SUMOVehicleClass& defaultVClass) : + GNEDemandElement(vTypeID, net, GLO_VTYPE, SUMO_TAG_VTYPE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {}, {}, {}, {}, {}, {}, {}), +SUMOVTypeParameter(vTypeID), +myDefaultVehicleType(true), +myDefaultVehicleTypeModified(false) { + // set default vehicle class + vehicleClass = defaultVClass; + parametersSet |= VTYPEPARS_VEHICLECLASS_SET; + // init Rail Visualization Parameters + initRailVisualizationParameters(); +} + + +GNEVType::GNEVType(GNENet* net, const SUMOVTypeParameter& vTypeParameter) : + GNEDemandElement(vTypeParameter.id, net, GLO_VTYPE, SUMO_TAG_VTYPE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {}, {}, {}, {}, {}, {}, {}), +SUMOVTypeParameter(vTypeParameter), +myDefaultVehicleType(false), +myDefaultVehicleTypeModified(false) { + // init Rail Visualization Parameters + initRailVisualizationParameters(); +} + + +GNEVType::GNEVType(GNENet* net, const std::string& vTypeID, GNEVType* vTypeOriginal) : + GNEDemandElement(vTypeID, net, GLO_VTYPE, vTypeOriginal->getTagProperty().getTag(), GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {}, {}, {}, {}, {}, {}, {}), +SUMOVTypeParameter(*vTypeOriginal), +myDefaultVehicleType(false), +myDefaultVehicleTypeModified(false) { + // change manually the ID (to avoid to use the ID of vTypeOriginal) + id = vTypeID; + // init Rail Visualization Parameters + initRailVisualizationParameters(); +} + + +GNEVType::~GNEVType() {} + + +GNEMoveOperation* +GNEVType::getMoveOperation() { + return nullptr; +} + + +void +GNEVType::writeDemandElement(OutputDevice& device) const { + // only write default vehicle types if it was modified + if (myDefaultVehicleType) { + if (myDefaultVehicleTypeModified) { + write(device); + } + } else { + write(device); + } +} + + +GNEDemandElement::Problem +GNEVType::isDemandElementValid() const { + // currently vTypes don't have problems + return GNEDemandElement::Problem::OK; +} + + +std::string +GNEVType::getDemandElementProblem() const { + return ""; +} + + +void +GNEVType::fixDemandElementProblem() { + // nothing to fix +} + + +SUMOVehicleClass +GNEVType::getVClass() const { + return vehicleClass; +} + + +const RGBColor& +GNEVType::getColor() const { + return color; +} + + +void +GNEVType::updateGeometry() { + // update geometry of all childrens + for (const auto& i : getChildDemandElements()) { + i->updateGeometry(); + } +} + + +Position +GNEVType::getPositionInView() const { + return Position(); +} + + +std::string +GNEVType::getParentName() const { + return myNet->getMicrosimID(); +} + + +double +GNEVType::getExaggeration(const GUIVisualizationSettings& /*s*/) const { + return 1; +} + + +Boundary +GNEVType::getCenteringBoundary() const { + // Vehicle Types doesn't have boundaries + return Boundary(-0.1, -0.1, 0.1, 0.1); +} + + +void +GNEVType::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +void +GNEVType::drawGL(const GUIVisualizationSettings&) const { + // Vehicle Types aren't draw +} + + +void +GNEVType::computePathElement() { + // nothing to compute +} + + +void +GNEVType::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*lane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const { + // vehicleTypes don't use drawPartialGL +} + + +void +GNEVType::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*fromLane*/, const GNELane* /*toLane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const { + // vehicleTypes don't use drawPartialGL +} + + +GNELane* +GNEVType::getFirstPathLane() const { + // vehicle types don't use lanes + return nullptr; +} + + +GNELane* +GNEVType::getLastPathLane() const { + // vehicle types don't use lanes + return nullptr; +} + + +std::string +GNEVType::getAttribute(SumoXMLAttr key) const { + // obtain default values depending of vehicle class + VClassDefaultValues defaultValues(vehicleClass); + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case GNE_ATTR_VTYPE_DISTRIBUTION: + if (getParentDemandElements().empty()) { + return ""; + } else { + return getParentDemandElements().front()->getID(); + } + // CFM Attributes + case SUMO_ATTR_ACCEL: + case SUMO_ATTR_DECEL: + case SUMO_ATTR_APPARENTDECEL: + case SUMO_ATTR_EMERGENCYDECEL: + case SUMO_ATTR_SIGMA: + case SUMO_ATTR_TAU: + // this CFM has default values + return getCFParamString(key, myTagProperty.getDefaultValue(key)); + // JM Attributes + case SUMO_ATTR_JM_CROSSING_GAP: + case SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME: + case SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME: + case SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME: + case SUMO_ATTR_JM_DRIVE_RED_SPEED: + case SUMO_ATTR_JM_IGNORE_FOE_PROB: + case SUMO_ATTR_JM_IGNORE_FOE_SPEED: + case SUMO_ATTR_JM_SIGMA_MINOR: + case SUMO_ATTR_JM_TIMEGAP_MINOR: + // this JM has default values + return getJMParamString(key, myTagProperty.getDefaultValue(key)); + case SUMO_ATTR_IMPATIENCE: + if (wasSet(VTYPEPARS_IMPATIENCE_SET)) { + return toString(impatience); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_IMPATIENCE); + } + // LCM Attributes + case SUMO_ATTR_LCA_STRATEGIC_PARAM: + case SUMO_ATTR_LCA_COOPERATIVE_PARAM: + case SUMO_ATTR_LCA_SPEEDGAIN_PARAM: + case SUMO_ATTR_LCA_KEEPRIGHT_PARAM: + case SUMO_ATTR_LCA_SUBLANE_PARAM: + case SUMO_ATTR_LCA_OPPOSITE_PARAM: + case SUMO_ATTR_LCA_PUSHY: + case SUMO_ATTR_LCA_PUSHYGAP: + case SUMO_ATTR_LCA_ASSERTIVE: + case SUMO_ATTR_LCA_IMPATIENCE: + case SUMO_ATTR_LCA_TIME_TO_IMPATIENCE: + case SUMO_ATTR_LCA_ACCEL_LAT: + case SUMO_ATTR_LCA_LOOKAHEADLEFT: + case SUMO_ATTR_LCA_SPEEDGAINRIGHT: + case SUMO_ATTR_LCA_MAXSPEEDLATSTANDING: + case SUMO_ATTR_LCA_MAXSPEEDLATFACTOR: + case SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE: + case SUMO_ATTR_LCA_OVERTAKE_RIGHT: + /* case SUMO_ATTR_LCA_EXPERIMENTAL1: */ + return getLCParamString(key, myTagProperty.getDefaultValue(key)); + // + case SUMO_ATTR_COLLISION_MINGAP_FACTOR: + case SUMO_ATTR_TMP1: + case SUMO_ATTR_TMP2: + case SUMO_ATTR_TMP3: + case SUMO_ATTR_TMP4: + case SUMO_ATTR_TMP5: + case SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS: + case SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW: + case SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD: + case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE: + case SUMO_ATTR_CF_EIDM_T_REACTION: + case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE: + case SUMO_ATTR_CF_EIDM_C_COOLNESS: + case SUMO_ATTR_CF_EIDM_SIG_LEADER: + case SUMO_ATTR_CF_EIDM_SIG_GAP: + case SUMO_ATTR_CF_EIDM_SIG_ERROR: + case SUMO_ATTR_CF_EIDM_JERK_MAX: + case SUMO_ATTR_CF_EIDM_EPSILON_ACC: + case SUMO_ATTR_CF_EIDM_T_ACC_MAX: + case SUMO_ATTR_CF_EIDM_M_FLATNESS: + case SUMO_ATTR_CF_EIDM_M_BEGIN: + case SUMO_ATTR_CF_PWAGNER2009_TAULAST: + case SUMO_ATTR_CF_PWAGNER2009_APPROB: + case SUMO_ATTR_CF_IDMM_ADAPT_FACTOR: + case SUMO_ATTR_CF_IDMM_ADAPT_TIME: + case SUMO_ATTR_CF_WIEDEMANN_SECURITY: + case SUMO_ATTR_CF_WIEDEMANN_ESTIMATION: + case SUMO_ATTR_TRAIN_TYPE: + case SUMO_ATTR_K: + case SUMO_ATTR_CF_KERNER_PHI: + case SUMO_ATTR_CF_IDM_DELTA: + case SUMO_ATTR_CF_IDM_STEPPING: + return getCFParamString(key, ""); + // Mutable values + case SUMO_ATTR_LENGTH: + if (wasSet(VTYPEPARS_LENGTH_SET)) { + return toString(length); + } else { + return toString(defaultValues.length); + } + case SUMO_ATTR_MINGAP: + if (wasSet(VTYPEPARS_MINGAP_SET)) { + return toString(minGap); + } else { + return toString(defaultValues.minGap); + } + case SUMO_ATTR_MAXSPEED: + if (wasSet(VTYPEPARS_MAXSPEED_SET)) { + return toString(maxSpeed); + } else { + return toString(defaultValues.maxSpeed); + } + case SUMO_ATTR_SPEEDFACTOR: + if (wasSet(VTYPEPARS_SPEEDFACTOR_SET)) { + return toString(speedFactor); + } else { + return toString(defaultValues.speedFactor); + } + case SUMO_ATTR_PERSON_CAPACITY: + if (wasSet(VTYPEPARS_PERSON_CAPACITY)) { + return toString(personCapacity); + } else { + return toString(defaultValues.personCapacity); + } + case SUMO_ATTR_CONTAINER_CAPACITY: + if (wasSet(VTYPEPARS_CONTAINER_CAPACITY)) { + return toString(containerCapacity); + } else { + return toString(defaultValues.containerCapacity); + } + case SUMO_ATTR_OSGFILE: + if (wasSet(VTYPEPARS_OSGFILE_SET)) { + return osgFile; + } else { + return defaultValues.osgFile; + } + case SUMO_ATTR_COLOR: + if (wasSet(VTYPEPARS_COLOR_SET)) { + return toString(color); + } else { + return ""; + } + case SUMO_ATTR_VCLASS: + if (wasSet(VTYPEPARS_VEHICLECLASS_SET)) { + return toString(vehicleClass); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_VCLASS); + } + case SUMO_ATTR_EMISSIONCLASS: + if (wasSet(VTYPEPARS_EMISSIONCLASS_SET)) { + return PollutantsInterface::getName(emissionClass); + } else { + return PollutantsInterface::getName(defaultValues.emissionClass); + } + case SUMO_ATTR_GUISHAPE: + if (wasSet(VTYPEPARS_SHAPE_SET)) { + return getVehicleShapeName(shape); + } else { + return getVehicleShapeName(defaultValues.shape); + } + case SUMO_ATTR_WIDTH: + if (wasSet(VTYPEPARS_WIDTH_SET)) { + return toString(width); + } else { + return toString(defaultValues.width); + } + case SUMO_ATTR_HEIGHT: + if (wasSet(VTYPEPARS_HEIGHT_SET)) { + return toString(height); + } else { + return toString(defaultValues.height); + } + case SUMO_ATTR_IMGFILE: + if (wasSet(VTYPEPARS_IMGFILE_SET)) { + return imgFile; + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_IMGFILE); + } + case SUMO_ATTR_LANE_CHANGE_MODEL: + if (wasSet(VTYPEPARS_LANE_CHANGE_MODEL_SET)) { + return SUMOXMLDefinitions::LaneChangeModels.getString(lcModel); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_LANE_CHANGE_MODEL); + } + case SUMO_ATTR_CAR_FOLLOW_MODEL: + if (wasSet(VTYPEPARS_CAR_FOLLOW_MODEL)) { + return SUMOXMLDefinitions::CarFollowModels.getString(cfModel); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_CAR_FOLLOW_MODEL); + } + case SUMO_ATTR_BOARDING_DURATION: + if (wasSet(VTYPEPARS_BOARDING_DURATION)) { + return time2string(boardingDuration); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_BOARDING_DURATION); + } + case SUMO_ATTR_LOADING_DURATION: + if (wasSet(VTYPEPARS_LOADING_DURATION)) { + return time2string(loadingDuration); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_LOADING_DURATION); + } + case SUMO_ATTR_LATALIGNMENT: + if (wasSet(VTYPEPARS_LATALIGNMENT_SET)) { + if (latAlignmentProcedure != LatAlignmentDefinition::GIVEN) { + return toString(latAlignmentProcedure); + } else { + return toString(latAlignmentOffset); + } + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_LATALIGNMENT); + } + case SUMO_ATTR_MINGAP_LAT: + if (wasSet(VTYPEPARS_MINGAP_LAT_SET)) { + return toString(minGapLat); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_MINGAP_LAT); + } + case SUMO_ATTR_MAXSPEED_LAT: + if (wasSet(VTYPEPARS_MAXSPEED_LAT_SET)) { + return toString(maxSpeedLat); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_MAXSPEED_LAT); + } + case SUMO_ATTR_ACTIONSTEPLENGTH: + if (wasSet(VTYPEPARS_ACTIONSTEPLENGTH_SET)) { + return toString(actionStepLength); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_ACTIONSTEPLENGTH); + } + case SUMO_ATTR_PROB: + if (wasSet(VTYPEPARS_PROBABILITY_SET)) { + return toString(defaultProbability); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_PROB); + } + case SUMO_ATTR_CARRIAGE_LENGTH: + if (wasSet(VTYPEPARS_CARRIAGE_LENGTH_SET)) { + return toString(carriageLength); + } else { + return toString(defaultValues.carriageLength); + } + case SUMO_ATTR_LOCOMOTIVE_LENGTH: + if (wasSet(VTYPEPARS_LOCOMOTIVE_LENGTH_SET)) { + return toString(locomotiveLength); + } else { + return toString(defaultValues.locomotiveLength); + } + case SUMO_ATTR_CARRIAGE_GAP: + if (wasSet(VTYPEPARS_CARRIAGE_GAP_SET)) { + return toString(carriageGap); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_CARRIAGE_GAP); + } + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + // other + case GNE_ATTR_DEFAULT_VTYPE: + return toString((getID() == DEFAULT_VTYPE_ID) || + (getID() == DEFAULT_PEDTYPE_ID) || + (getID() == DEFAULT_BIKETYPE_ID)); + case GNE_ATTR_DEFAULT_VTYPE_MODIFIED: + if (myDefaultVehicleType) { + return toString(myDefaultVehicleTypeModified); + } else { + return toString(false); + } + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEVType::getAttributeDouble(SumoXMLAttr key) const { + // obtain default values depending of vehicle class + VClassDefaultValues defaultValues(vehicleClass); + switch (key) { + case SUMO_ATTR_LENGTH: + if (wasSet(VTYPEPARS_LENGTH_SET)) { + return length; + } else { + return defaultValues.length; + } + case SUMO_ATTR_MINGAP: + if (wasSet(VTYPEPARS_MINGAP_SET)) { + return minGap; + } else { + return defaultValues.minGap; + } + case SUMO_ATTR_WIDTH: + if (wasSet(VTYPEPARS_WIDTH_SET)) { + return width; + } else { + return defaultValues.width; + } + case SUMO_ATTR_HEIGHT: + if (wasSet(VTYPEPARS_HEIGHT_SET)) { + return height; + } else { + return defaultValues.height; + } + case SUMO_ATTR_MAXSPEED: + if (wasSet(VTYPEPARS_MAXSPEED_SET)) { + return maxSpeed; + } else { + return defaultValues.maxSpeed; + } + default: + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); + } +} + + +Position +GNEVType::getAttributePosition(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a Position attribute of type '" + toString(key) + "'"); +} + + +void +GNEVType::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { + GNEChange_Attribute* vTypeChangeAttributeForced = nullptr; + if (value == getAttribute(key)) { + return; //avoid needless changes, later logic relies on the fact that attributes have changed + } + switch (key) { + case SUMO_ATTR_ID: + undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); + break; + case GNE_ATTR_VTYPE_DISTRIBUTION: + editVTypeDistribution(value, undoList); + break; + // CFM Attributes + case SUMO_ATTR_ACCEL: + case SUMO_ATTR_DECEL: + case SUMO_ATTR_APPARENTDECEL: + case SUMO_ATTR_EMERGENCYDECEL: + case SUMO_ATTR_SIGMA: + case SUMO_ATTR_TAU: + case SUMO_ATTR_COLLISION_MINGAP_FACTOR: + case SUMO_ATTR_TMP1: + case SUMO_ATTR_TMP2: + case SUMO_ATTR_TMP3: + case SUMO_ATTR_TMP4: + case SUMO_ATTR_TMP5: + case SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS: + case SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW: + case SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD: + case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE: + case SUMO_ATTR_CF_EIDM_T_REACTION: + case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE: + case SUMO_ATTR_CF_EIDM_C_COOLNESS: + case SUMO_ATTR_CF_EIDM_SIG_LEADER: + case SUMO_ATTR_CF_EIDM_SIG_GAP: + case SUMO_ATTR_CF_EIDM_SIG_ERROR: + case SUMO_ATTR_CF_EIDM_JERK_MAX: + case SUMO_ATTR_CF_EIDM_EPSILON_ACC: + case SUMO_ATTR_CF_EIDM_T_ACC_MAX: + case SUMO_ATTR_CF_EIDM_M_FLATNESS: + case SUMO_ATTR_CF_EIDM_M_BEGIN: + case SUMO_ATTR_CF_PWAGNER2009_TAULAST: + case SUMO_ATTR_CF_PWAGNER2009_APPROB: + case SUMO_ATTR_CF_IDMM_ADAPT_FACTOR: + case SUMO_ATTR_CF_IDMM_ADAPT_TIME: + case SUMO_ATTR_CF_WIEDEMANN_SECURITY: + case SUMO_ATTR_CF_WIEDEMANN_ESTIMATION: + case SUMO_ATTR_TRAIN_TYPE: + case SUMO_ATTR_K: + case SUMO_ATTR_CF_KERNER_PHI: + case SUMO_ATTR_CF_IDM_DELTA: + case SUMO_ATTR_CF_IDM_STEPPING: + // JM Attributes + case SUMO_ATTR_JM_CROSSING_GAP: + case SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME: + case SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME: + case SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME: + case SUMO_ATTR_JM_DRIVE_RED_SPEED: + case SUMO_ATTR_JM_IGNORE_FOE_PROB: + case SUMO_ATTR_JM_IGNORE_FOE_SPEED: + case SUMO_ATTR_JM_SIGMA_MINOR: + case SUMO_ATTR_JM_TIMEGAP_MINOR: + case SUMO_ATTR_IMPATIENCE: + // LCM Attributes + case SUMO_ATTR_LCA_STRATEGIC_PARAM: + case SUMO_ATTR_LCA_COOPERATIVE_PARAM: + case SUMO_ATTR_LCA_SPEEDGAIN_PARAM: + case SUMO_ATTR_LCA_KEEPRIGHT_PARAM: + case SUMO_ATTR_LCA_SUBLANE_PARAM: + case SUMO_ATTR_LCA_OPPOSITE_PARAM: + case SUMO_ATTR_LCA_PUSHY: + case SUMO_ATTR_LCA_PUSHYGAP: + case SUMO_ATTR_LCA_ASSERTIVE: + case SUMO_ATTR_LCA_IMPATIENCE: + case SUMO_ATTR_LCA_TIME_TO_IMPATIENCE: + case SUMO_ATTR_LCA_ACCEL_LAT: + case SUMO_ATTR_LCA_LOOKAHEADLEFT: + case SUMO_ATTR_LCA_SPEEDGAINRIGHT: + case SUMO_ATTR_LCA_MAXSPEEDLATSTANDING: + case SUMO_ATTR_LCA_MAXSPEEDLATFACTOR: + case SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE: + case SUMO_ATTR_LCA_OVERTAKE_RIGHT: + /* case SUMO_ATTR_LCA_EXPERIMENTAL1: */ + // + case SUMO_ATTR_LENGTH: + case SUMO_ATTR_MINGAP: + case SUMO_ATTR_MAXSPEED: + case SUMO_ATTR_SPEEDFACTOR: + case SUMO_ATTR_COLOR: + case SUMO_ATTR_VCLASS: + case SUMO_ATTR_EMISSIONCLASS: + case SUMO_ATTR_GUISHAPE: + case SUMO_ATTR_WIDTH: + case SUMO_ATTR_HEIGHT: + case SUMO_ATTR_IMGFILE: + case SUMO_ATTR_LANE_CHANGE_MODEL: + case SUMO_ATTR_CAR_FOLLOW_MODEL: + case SUMO_ATTR_PERSON_CAPACITY: + case SUMO_ATTR_CONTAINER_CAPACITY: + case SUMO_ATTR_BOARDING_DURATION: + case SUMO_ATTR_LOADING_DURATION: + case SUMO_ATTR_LATALIGNMENT: + case SUMO_ATTR_MINGAP_LAT: + case SUMO_ATTR_MAXSPEED_LAT: + case SUMO_ATTR_ACTIONSTEPLENGTH: + case SUMO_ATTR_PROB: + case SUMO_ATTR_OSGFILE: + case SUMO_ATTR_CARRIAGE_LENGTH: + case SUMO_ATTR_LOCOMOTIVE_LENGTH: + case SUMO_ATTR_CARRIAGE_GAP: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + // if we change the original value of a default vehicle Type, change also flag "myDefaultVehicleType" + if (myDefaultVehicleType) { + vTypeChangeAttributeForced = new GNEChange_Attribute(this, GNE_ATTR_DEFAULT_VTYPE_MODIFIED, "true"); + // force change + vTypeChangeAttributeForced->forceChange(); + undoList->changeAttribute(vTypeChangeAttributeForced); + } + vTypeChangeAttributeForced = new GNEChange_Attribute(this, key, value); + // force change + vTypeChangeAttributeForced->forceChange(); + undoList->changeAttribute(vTypeChangeAttributeForced); + break; + case GNE_ATTR_DEFAULT_VTYPE_MODIFIED: + vTypeChangeAttributeForced = new GNEChange_Attribute(this, GNE_ATTR_DEFAULT_VTYPE_MODIFIED, "true"); + // force change + vTypeChangeAttributeForced->forceChange(); + undoList->changeAttribute(vTypeChangeAttributeForced); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEVType::isValid(SumoXMLAttr key, const std::string& value) { + // a empty value is always valid except for IDs + if ((key != SUMO_ATTR_ID) && value.empty()) { + return true; + } + switch (key) { + case SUMO_ATTR_ID: + // Vtypes and PTypes shares namespace + if (SUMOXMLDefinitions::isValidVehicleID(value) && (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, value, false) == nullptr)) { + return true; + } else { + return false; + } + case GNE_ATTR_VTYPE_DISTRIBUTION: + if (value.empty()) { + return true; + } else { + return SUMOXMLDefinitions::isValidVehicleID(value); + } + // CFM Attributes + case SUMO_ATTR_SIGMA: + return canParse(value) && (parse(value) >= 0) && (parse(value) <= 1); + case SUMO_ATTR_ACCEL: + case SUMO_ATTR_DECEL: + case SUMO_ATTR_APPARENTDECEL: + case SUMO_ATTR_EMERGENCYDECEL: + case SUMO_ATTR_TAU: + case SUMO_ATTR_COLLISION_MINGAP_FACTOR: + case SUMO_ATTR_TMP1: + case SUMO_ATTR_TMP2: + case SUMO_ATTR_TMP3: + case SUMO_ATTR_TMP4: + case SUMO_ATTR_TMP5: + case SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS: + case SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW: + case SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD: + case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE: + case SUMO_ATTR_CF_EIDM_T_REACTION: + case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE: + case SUMO_ATTR_CF_EIDM_C_COOLNESS: + case SUMO_ATTR_CF_EIDM_SIG_LEADER: + case SUMO_ATTR_CF_EIDM_SIG_GAP: + case SUMO_ATTR_CF_EIDM_SIG_ERROR: + case SUMO_ATTR_CF_EIDM_JERK_MAX: + case SUMO_ATTR_CF_EIDM_EPSILON_ACC: + case SUMO_ATTR_CF_EIDM_T_ACC_MAX: + case SUMO_ATTR_CF_EIDM_M_FLATNESS: + case SUMO_ATTR_CF_EIDM_M_BEGIN: + case SUMO_ATTR_CF_PWAGNER2009_TAULAST: + case SUMO_ATTR_CF_PWAGNER2009_APPROB: + case SUMO_ATTR_CF_IDMM_ADAPT_FACTOR: + case SUMO_ATTR_CF_IDMM_ADAPT_TIME: + case SUMO_ATTR_CF_WIEDEMANN_SECURITY: + case SUMO_ATTR_CF_WIEDEMANN_ESTIMATION: + case SUMO_ATTR_K: + case SUMO_ATTR_CF_KERNER_PHI: + case SUMO_ATTR_CF_IDM_DELTA: + case SUMO_ATTR_CF_IDM_STEPPING: + return canParse(value); + case SUMO_ATTR_TRAIN_TYPE: + // rail string + return SUMOXMLDefinitions::TrainTypes.hasString(value); + // JM Attributes + case SUMO_ATTR_JM_CROSSING_GAP: + return canParse(value) && (parse(value) >= 0); + case SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME: + return canParse(value) && (parse(value) >= -1); + case SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME: + return canParse(value) && (parse(value) >= -1); + case SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME: + return canParse(value) && (parse(value) >= -1); + case SUMO_ATTR_JM_DRIVE_RED_SPEED: + return canParse(value) && (parse(value) >= 0); + case SUMO_ATTR_JM_IGNORE_FOE_PROB: + return canParse(value) && (parse(value) >= 0); + case SUMO_ATTR_JM_IGNORE_FOE_SPEED: + return canParse(value) && (parse(value) >= 0); + case SUMO_ATTR_JM_SIGMA_MINOR: + return canParse(value) && (parse(value) >= 0) && (parse(value) <= 1); + case SUMO_ATTR_JM_TIMEGAP_MINOR: + return canParse(value) && (parse(value) >= 0); + case SUMO_ATTR_IMPATIENCE: + return canParse(value) && (parse(value) >= 0); + // LCM Attributes + case SUMO_ATTR_LCA_STRATEGIC_PARAM: + case SUMO_ATTR_LCA_COOPERATIVE_PARAM: + case SUMO_ATTR_LCA_SPEEDGAIN_PARAM: + case SUMO_ATTR_LCA_KEEPRIGHT_PARAM: + case SUMO_ATTR_LCA_SUBLANE_PARAM: + case SUMO_ATTR_LCA_OPPOSITE_PARAM: + case SUMO_ATTR_LCA_PUSHY: + return canParse(value); + case SUMO_ATTR_LCA_PUSHYGAP: + case SUMO_ATTR_LCA_IMPATIENCE: + case SUMO_ATTR_LCA_MAXSPEEDLATSTANDING: + case SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE: // 0 mean disabled + case SUMO_ATTR_LCA_TIME_TO_IMPATIENCE: // 0 mean disabled + case SUMO_ATTR_LCA_OVERTAKE_RIGHT: // 0 mean disabled + return canParse(value) && (parse(value) >= 0); + case SUMO_ATTR_LCA_ASSERTIVE: + case SUMO_ATTR_LCA_LOOKAHEADLEFT: + case SUMO_ATTR_LCA_SPEEDGAINRIGHT: + case SUMO_ATTR_LCA_ACCEL_LAT: + case SUMO_ATTR_LCA_MAXSPEEDLATFACTOR: + return canParse(value) && (parse(value) > 0); + /* case SUMO_ATTR_LCA_EXPERIMENTAL1: + return true; + */ + // + case SUMO_ATTR_LENGTH: + return canParse(value) && (parse(value) > 0); + case SUMO_ATTR_MINGAP: + return canParse(value) && (parse(value) >= 0); + case SUMO_ATTR_MAXSPEED: + return canParse(value) && (parse(value) >= 0); + case SUMO_ATTR_SPEEDFACTOR: + return Distribution_Parameterized::isValidDescription(value); + case SUMO_ATTR_COLOR: + if (value.empty()) { + return true; + } else { + return canParse(value); + } + case SUMO_ATTR_VCLASS: + return canParseVehicleClasses(value); + case SUMO_ATTR_EMISSIONCLASS: + // check if given value correspond to a string of PollutantsInterface::getAllClassesStr() + for (const auto& eClass : PollutantsInterface::getAllClassesStr()) { + if (value == eClass) { + return true; + } + } + return false; + case SUMO_ATTR_GUISHAPE: + if (value == "all") { + return false; + } else { + return canParseVehicleShape(value); + } + case SUMO_ATTR_WIDTH: + return canParse(value); + case SUMO_ATTR_HEIGHT: + return canParse(value); + case SUMO_ATTR_IMGFILE: + return SUMOXMLDefinitions::isValidFilename(value); + case SUMO_ATTR_LANE_CHANGE_MODEL: + return SUMOXMLDefinitions::LaneChangeModels.hasString(value); + case SUMO_ATTR_CAR_FOLLOW_MODEL: + return SUMOXMLDefinitions::CarFollowModels.hasString(value); + case SUMO_ATTR_PERSON_CAPACITY: + return canParse(value); + case SUMO_ATTR_CONTAINER_CAPACITY: + return canParse(value); + case SUMO_ATTR_BOARDING_DURATION: + return canParse(value); + case SUMO_ATTR_LOADING_DURATION: + return canParse(value); + case SUMO_ATTR_LATALIGNMENT: + return SUMOVTypeParameter::isValidLatAlignment(value); + case SUMO_ATTR_MINGAP_LAT: + return canParse(value); + case SUMO_ATTR_MAXSPEED_LAT: + return canParse(value); + case SUMO_ATTR_ACTIONSTEPLENGTH: + return canParse(value) && (parse(value) >= 0); + case SUMO_ATTR_PROB: + return canParse(value) && (parse(value) >= 0); + case SUMO_ATTR_OSGFILE: + return SUMOXMLDefinitions::isValidFilename(value); + case SUMO_ATTR_CARRIAGE_LENGTH: + return canParse(value) && (parse(value) >= -1); + case SUMO_ATTR_LOCOMOTIVE_LENGTH: + return canParse(value) && (parse(value) >= -1); + case SUMO_ATTR_CARRIAGE_GAP: + return canParse(value) && (parse(value) >= 0); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + case GNE_ATTR_DEFAULT_VTYPE_MODIFIED: + if (myDefaultVehicleType) { + return canParse(value); + } else { + return false; + } + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEVType::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // nothing to enable +} + + +void +GNEVType::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // nothing to disable +} + + +bool +GNEVType::isAttributeEnabled(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + if ((id == DEFAULT_VTYPE_ID) || (id == DEFAULT_PEDTYPE_ID) || (id == DEFAULT_BIKETYPE_ID)) { + return false; + } else { + return true; + } + case SUMO_ATTR_LENGTH: + return wasSet(VTYPEPARS_LENGTH_SET); + case SUMO_ATTR_MINGAP: + return wasSet(VTYPEPARS_MINGAP_SET); + case SUMO_ATTR_MAXSPEED: + return wasSet(VTYPEPARS_MAXSPEED_SET); + case SUMO_ATTR_SPEEDFACTOR: + return wasSet(VTYPEPARS_SPEEDFACTOR_SET); + case SUMO_ATTR_PERSON_CAPACITY: + return wasSet(VTYPEPARS_PERSON_CAPACITY); + case SUMO_ATTR_CONTAINER_CAPACITY: + return wasSet(VTYPEPARS_CONTAINER_CAPACITY); + case SUMO_ATTR_OSGFILE: + return wasSet(VTYPEPARS_OSGFILE_SET); + case SUMO_ATTR_CARRIAGE_LENGTH: + return wasSet(VTYPEPARS_CARRIAGE_LENGTH_SET); + case SUMO_ATTR_LOCOMOTIVE_LENGTH: + return wasSet(VTYPEPARS_LOCOMOTIVE_LENGTH_SET); + case SUMO_ATTR_CARRIAGE_GAP: + return wasSet(VTYPEPARS_CARRIAGE_GAP_SET); + default: + return true; + } +} + + +std::string +GNEVType::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEVType::getHierarchyName() const { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) ; +} + + +const std::map& +GNEVType::getACParametersMap() const { + return getParametersMap(); +} + + +void +GNEVType::overwriteVType(GNEDemandElement* vType, const SUMOVTypeParameter newVTypeParameter, GNEUndoList* undoList) { + // open undo list and overwritte all values of default VType + undoList->begin(vType->getTagProperty().getGUIIcon(), "update default " + vType->getTagStr() + " '" + DEFAULT_VTYPE_ID + "'"); + // CFM values + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_ACCEL, "").empty()) { + vType->setAttribute(SUMO_ATTR_ACCEL, toString(newVTypeParameter.getCFParam(SUMO_ATTR_ACCEL, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_DECEL, "").empty()) { + vType->setAttribute(SUMO_ATTR_DECEL, toString(newVTypeParameter.getCFParam(SUMO_ATTR_DECEL, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_APPARENTDECEL, "").empty()) { + vType->setAttribute(SUMO_ATTR_APPARENTDECEL, toString(newVTypeParameter.getCFParam(SUMO_ATTR_APPARENTDECEL, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_EMERGENCYDECEL, "").empty()) { + vType->setAttribute(SUMO_ATTR_EMERGENCYDECEL, toString(newVTypeParameter.getCFParam(SUMO_ATTR_EMERGENCYDECEL, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_SIGMA, "").empty()) { + vType->setAttribute(SUMO_ATTR_SIGMA, toString(newVTypeParameter.getCFParam(SUMO_ATTR_SIGMA, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_TAU, "").empty()) { + vType->setAttribute(SUMO_ATTR_TAU, toString(newVTypeParameter.getCFParam(SUMO_ATTR_TAU, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_COLLISION_MINGAP_FACTOR, "").empty()) { + vType->setAttribute(SUMO_ATTR_COLLISION_MINGAP_FACTOR, toString(newVTypeParameter.getCFParam(SUMO_ATTR_COLLISION_MINGAP_FACTOR, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_TMP1, "").empty()) { + vType->setAttribute(SUMO_ATTR_TMP1, toString(newVTypeParameter.getCFParam(SUMO_ATTR_TMP1, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_TMP2, "").empty()) { + vType->setAttribute(SUMO_ATTR_TMP2, toString(newVTypeParameter.getCFParam(SUMO_ATTR_TMP2, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_TMP3, "").empty()) { + vType->setAttribute(SUMO_ATTR_TMP3, toString(newVTypeParameter.getCFParam(SUMO_ATTR_TMP3, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_TMP4, "").empty()) { + vType->setAttribute(SUMO_ATTR_TMP4, toString(newVTypeParameter.getCFParam(SUMO_ATTR_TMP4, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_TMP5, "").empty()) { + vType->setAttribute(SUMO_ATTR_TMP5, toString(newVTypeParameter.getCFParam(SUMO_ATTR_TMP5, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_T_REACTION, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_EIDM_T_REACTION, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_T_REACTION, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_C_COOLNESS, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_EIDM_C_COOLNESS, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_C_COOLNESS, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_SIG_LEADER, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_EIDM_SIG_LEADER, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_SIG_LEADER, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_SIG_GAP, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_EIDM_SIG_GAP, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_SIG_GAP, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_SIG_ERROR, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_EIDM_SIG_ERROR, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_SIG_ERROR, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_JERK_MAX, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_EIDM_JERK_MAX, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_JERK_MAX, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_EPSILON_ACC, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_EIDM_EPSILON_ACC, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_EPSILON_ACC, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_T_ACC_MAX, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_EIDM_T_ACC_MAX, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_T_ACC_MAX, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_M_FLATNESS, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_EIDM_M_FLATNESS, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_M_FLATNESS, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_EIDM_M_BEGIN, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_EIDM_M_BEGIN, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_EIDM_M_BEGIN, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_PWAGNER2009_TAULAST, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_PWAGNER2009_TAULAST, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_PWAGNER2009_TAULAST, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_PWAGNER2009_APPROB, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_PWAGNER2009_APPROB, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_PWAGNER2009_APPROB, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_IDMM_ADAPT_FACTOR, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_IDMM_ADAPT_FACTOR, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_IDMM_ADAPT_FACTOR, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_IDMM_ADAPT_TIME, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_IDMM_ADAPT_TIME, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_IDMM_ADAPT_TIME, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_WIEDEMANN_SECURITY, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_WIEDEMANN_SECURITY, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_WIEDEMANN_SECURITY, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_WIEDEMANN_ESTIMATION, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_WIEDEMANN_ESTIMATION, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_WIEDEMANN_ESTIMATION, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_TRAIN_TYPE, "").empty()) { + vType->setAttribute(SUMO_ATTR_TRAIN_TYPE, toString(newVTypeParameter.getCFParam(SUMO_ATTR_TRAIN_TYPE, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_K, "").empty()) { + vType->setAttribute(SUMO_ATTR_K, toString(newVTypeParameter.getCFParam(SUMO_ATTR_K, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_KERNER_PHI, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_KERNER_PHI, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_KERNER_PHI, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_IDM_DELTA, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_IDM_DELTA, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_IDM_DELTA, 0)), undoList); + } + if (!newVTypeParameter.getCFParamString(SUMO_ATTR_CF_IDM_STEPPING, "").empty()) { + vType->setAttribute(SUMO_ATTR_CF_IDM_STEPPING, toString(newVTypeParameter.getCFParam(SUMO_ATTR_CF_IDM_STEPPING, 0)), undoList); + } + // JM values + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_CROSSING_GAP, "").empty()) { + vType->setAttribute(SUMO_ATTR_JM_CROSSING_GAP, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_CROSSING_GAP, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME, "").empty()) { + vType->setAttribute(SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME, "").empty()) { + vType->setAttribute(SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME, "").empty()) { + vType->setAttribute(SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_DRIVE_RED_SPEED, "").empty()) { + vType->setAttribute(SUMO_ATTR_JM_DRIVE_RED_SPEED, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_DRIVE_RED_SPEED, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_IGNORE_FOE_PROB, "").empty()) { + vType->setAttribute(SUMO_ATTR_JM_IGNORE_FOE_PROB, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_IGNORE_FOE_PROB, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_IGNORE_FOE_SPEED, "").empty()) { + vType->setAttribute(SUMO_ATTR_JM_IGNORE_FOE_SPEED, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_IGNORE_FOE_SPEED, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_SIGMA_MINOR, "").empty()) { + vType->setAttribute(SUMO_ATTR_JM_SIGMA_MINOR, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_SIGMA_MINOR, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_JM_TIMEGAP_MINOR, "").empty()) { + vType->setAttribute(SUMO_ATTR_JM_TIMEGAP_MINOR, toString(newVTypeParameter.getCFParam(SUMO_ATTR_JM_TIMEGAP_MINOR, 0)), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_IMPATIENCE_SET)) { + vType->setAttribute(SUMO_ATTR_IMPATIENCE, toString(newVTypeParameter.impatience), undoList); + } + // LCM values + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_STRATEGIC_PARAM, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_STRATEGIC_PARAM, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_STRATEGIC_PARAM, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_COOPERATIVE_PARAM, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_COOPERATIVE_PARAM, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_COOPERATIVE_PARAM, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_SPEEDGAIN_PARAM, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_SPEEDGAIN_PARAM, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_SPEEDGAIN_PARAM, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_KEEPRIGHT_PARAM, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_KEEPRIGHT_PARAM, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_KEEPRIGHT_PARAM, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_SUBLANE_PARAM, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_SUBLANE_PARAM, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_SUBLANE_PARAM, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_OPPOSITE_PARAM, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_OPPOSITE_PARAM, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_OPPOSITE_PARAM, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_PUSHY, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_PUSHY, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_PUSHY, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_PUSHYGAP, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_PUSHYGAP, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_PUSHYGAP, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_ASSERTIVE, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_ASSERTIVE, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_ASSERTIVE, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_IMPATIENCE, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_IMPATIENCE, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_IMPATIENCE, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_TIME_TO_IMPATIENCE, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_TIME_TO_IMPATIENCE, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_TIME_TO_IMPATIENCE, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_ACCEL_LAT, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_ACCEL_LAT, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_ACCEL_LAT, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_LOOKAHEADLEFT, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_LOOKAHEADLEFT, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_LOOKAHEADLEFT, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_SPEEDGAINRIGHT, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_SPEEDGAINRIGHT, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_SPEEDGAINRIGHT, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_MAXSPEEDLATSTANDING, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_MAXSPEEDLATSTANDING, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_MAXSPEEDLATSTANDING, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_MAXSPEEDLATFACTOR, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_MAXSPEEDLATFACTOR, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_MAXSPEEDLATFACTOR, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_OVERTAKE_RIGHT, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_OVERTAKE_RIGHT, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_OVERTAKE_RIGHT, 0)), undoList); + } + if (!newVTypeParameter.getJMParamString(SUMO_ATTR_LCA_EXPERIMENTAL1, "").empty()) { + vType->setAttribute(SUMO_ATTR_LCA_EXPERIMENTAL1, toString(newVTypeParameter.getCFParam(SUMO_ATTR_LCA_EXPERIMENTAL1, 0)), undoList); + } + // + if (newVTypeParameter.wasSet(VTYPEPARS_LENGTH_SET)) { + vType->setAttribute(SUMO_ATTR_LENGTH, toString(newVTypeParameter.length), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_MINGAP_SET)) { + vType->setAttribute(SUMO_ATTR_MINGAP, toString(newVTypeParameter.minGap), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_MAXSPEED_SET)) { + vType->setAttribute(SUMO_ATTR_MAXSPEED, toString(newVTypeParameter.maxSpeed), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_SPEEDFACTOR_SET)) { + vType->setAttribute(SUMO_ATTR_SPEEDFACTOR, toString(newVTypeParameter.speedFactor), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_COLOR_SET)) { + vType->setAttribute(SUMO_ATTR_COLOR, toString(newVTypeParameter.color), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_EMISSIONCLASS_SET)) { + vType->setAttribute(SUMO_ATTR_EMISSIONCLASS, PollutantsInterface::getName(newVTypeParameter.emissionClass), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_SHAPE_SET)) { + vType->setAttribute(SUMO_ATTR_GUISHAPE, getVehicleShapeName(newVTypeParameter.shape), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_WIDTH_SET)) { + vType->setAttribute(SUMO_ATTR_WIDTH, toString(newVTypeParameter.width), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_HEIGHT_SET)) { + vType->setAttribute(SUMO_ATTR_HEIGHT, toString(newVTypeParameter.height), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_IMGFILE_SET)) { + vType->setAttribute(SUMO_ATTR_IMGFILE, toString(newVTypeParameter.imgFile), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_LANE_CHANGE_MODEL_SET)) { + vType->setAttribute(SUMO_ATTR_LANE_CHANGE_MODEL, SUMOXMLDefinitions::LaneChangeModels.getString(newVTypeParameter.lcModel), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_CAR_FOLLOW_MODEL)) { + vType->setAttribute(SUMO_ATTR_CAR_FOLLOW_MODEL, SUMOXMLDefinitions::CarFollowModels.getString(newVTypeParameter.cfModel), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_PERSON_CAPACITY)) { + vType->setAttribute(SUMO_ATTR_PERSON_CAPACITY, toString(newVTypeParameter.personCapacity), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_CONTAINER_CAPACITY)) { + vType->setAttribute(SUMO_ATTR_CONTAINER_CAPACITY, toString(newVTypeParameter.containerCapacity), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_BOARDING_DURATION)) { + vType->setAttribute(SUMO_ATTR_BOARDING_DURATION, toString(newVTypeParameter.boardingDuration), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_LOADING_DURATION)) { + vType->setAttribute(SUMO_ATTR_LOADING_DURATION, toString(newVTypeParameter.loadingDuration), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_LATALIGNMENT_SET)) { + if (newVTypeParameter.latAlignmentProcedure != LatAlignmentDefinition::GIVEN) { + vType->setAttribute(SUMO_ATTR_LATALIGNMENT, toString(newVTypeParameter.latAlignmentProcedure), undoList); + } else { + vType->setAttribute(SUMO_ATTR_LATALIGNMENT, toString(newVTypeParameter.latAlignmentOffset), undoList); + } + } + if (newVTypeParameter.wasSet(VTYPEPARS_MINGAP_LAT_SET)) { + vType->setAttribute(SUMO_ATTR_MINGAP_LAT, toString(newVTypeParameter.minGapLat), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_MAXSPEED_LAT_SET)) { + vType->setAttribute(SUMO_ATTR_MAXSPEED_LAT, toString(newVTypeParameter.maxSpeedLat), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_ACTIONSTEPLENGTH_SET)) { + vType->setAttribute(SUMO_ATTR_ACTIONSTEPLENGTH, toString(newVTypeParameter.actionStepLength), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_PROBABILITY_SET)) { + vType->setAttribute(SUMO_ATTR_PROB, toString(newVTypeParameter.defaultProbability), undoList); + } + if (newVTypeParameter.wasSet(VTYPEPARS_OSGFILE_SET)) { + vType->setAttribute(SUMO_ATTR_OSGFILE, toString(newVTypeParameter.osgFile), undoList); + } + if (newVTypeParameter.knowsParameter(toString(SUMO_ATTR_CARRIAGE_LENGTH))) { + vType->setAttribute(SUMO_ATTR_CARRIAGE_LENGTH, newVTypeParameter.getParameter(toString(SUMO_ATTR_CARRIAGE_LENGTH), ""), undoList); + } + if (newVTypeParameter.knowsParameter(toString(SUMO_ATTR_LOCOMOTIVE_LENGTH))) { + vType->setAttribute(SUMO_ATTR_LOCOMOTIVE_LENGTH, newVTypeParameter.getParameter(toString(SUMO_ATTR_LOCOMOTIVE_LENGTH), ""), undoList); + } + if (newVTypeParameter.knowsParameter(toString(SUMO_ATTR_CARRIAGE_GAP))) { + vType->setAttribute(SUMO_ATTR_CARRIAGE_GAP, newVTypeParameter.getParameter(toString(SUMO_ATTR_CARRIAGE_GAP), ""), undoList); + } + // parse parameters + std::string parametersStr; + // Generate an string using the following structure: "key1=value1|key2=value2|... + for (const auto& parameter : newVTypeParameter.getParametersMap()) { + parametersStr += parameter.first + "=" + parameter.second + "|"; + } + // remove the last "|" + if (!parametersStr.empty()) { + parametersStr.pop_back(); + } + if (parametersStr != vType->getAttribute(GNE_ATTR_PARAMETERS)) { + vType->setAttribute(GNE_ATTR_PARAMETERS, parametersStr, undoList); + } + if (parametersStr != vType->getAttribute(GNE_ATTR_VTYPE_DISTRIBUTION)) { + vType->setAttribute(GNE_ATTR_VTYPE_DISTRIBUTION, parametersStr, undoList); + } + // close undo list + undoList->end(); +} + +// =========================================================================== +// protected +// =========================================================================== + +void +GNEVType::editVTypeDistribution(const std::string& vTypeDistributionID, GNEUndoList* undoList) { + if (vTypeDistributionID.empty()) { + // first check if previosly this vType has a vTypeDistribution + if (getParentDemandElements().size() > 0) { + // get parent vTypeDistribution + GNEDemandElement* vTypeDistribution = getParentDemandElements().front(); + // check if this is the last vType of the vTypeDistribution + if (vTypeDistribution->getChildDemandElements().size() == 1) { + // ask if remove vTypeDistribution + if (askRemoveVTypeDistribution(vTypeDistribution->getID())) { + undoList->begin(GUIIcon::VTYPEDISTRIBUTION, "remove " + toString(SUMO_TAG_VTYPE_DISTRIBUTION)); + // clear attribute + undoList->changeAttribute(new GNEChange_Attribute(this, GNE_ATTR_VTYPE_DISTRIBUTION, "")); + // remove vType Distribution + undoList->add(new GNEChange_DemandElement(vTypeDistribution, false), true); + undoList->end(); + } + } else { + // clear attribute + undoList->changeAttribute(new GNEChange_Attribute(this, GNE_ATTR_VTYPE_DISTRIBUTION, "")); + } + } + } else { + // check if vTypeDistribution exist + const auto vTypeDistribution = myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE_DISTRIBUTION, vTypeDistributionID, false); + // get current vTypeDistribution parent + const auto vTypeDistributionParent = (getParentDemandElements().size() > 0) ? getParentDemandElements().front() : nullptr; + if (vTypeDistribution) { + // add in vTypeDistribution + undoList->changeAttribute(new GNEChange_Attribute(this, GNE_ATTR_VTYPE_DISTRIBUTION, vTypeDistributionID)); + } else if (vTypeDistributionParent && (vTypeDistributionParent->getChildDemandElements().size() == 1)) { + // ask if remove vTypeDistribution + if (askRemoveVTypeDistribution(vTypeDistributionParent->getID())) { + undoList->begin(GUIIcon::VTYPEDISTRIBUTION, "add/remove " + toString(SUMO_TAG_VTYPE_DISTRIBUTION)); + // clear attribute + undoList->changeAttribute(new GNEChange_Attribute(this, GNE_ATTR_VTYPE_DISTRIBUTION, "")); + // remove old vTypeDistribution + undoList->add(new GNEChange_DemandElement(vTypeDistributionParent, false), true); + // create newTypeDistribution + undoList->add(new GNEChange_DemandElement(new GNEVTypeDistribution(myNet, vTypeDistributionID), true), true); + // set new vTypeDistribution + undoList->changeAttribute(new GNEChange_Attribute(this, GNE_ATTR_VTYPE_DISTRIBUTION, vTypeDistributionID)); + undoList->end(); + } + } else { + undoList->begin(GUIIcon::VTYPEDISTRIBUTION, "add " + toString(SUMO_TAG_VTYPE_DISTRIBUTION)); + // create newTypeDistribution + undoList->add(new GNEChange_DemandElement(new GNEVTypeDistribution(myNet, vTypeDistributionID), true), true); + // set new vTypeDistribution + undoList->changeAttribute(new GNEChange_Attribute(this, GNE_ATTR_VTYPE_DISTRIBUTION, vTypeDistributionID)); + undoList->end(); + } + } +} + + +bool +GNEVType::askAddVTypeDistribution(const std::string& vTypeDistribution) const { + // show warning in gui testing debug mode + WRITE_DEBUG("Opening FXMessageBox 'add vTypeDistribution'"); + // Ask confirmation to user + const FXuint answer = FXMessageBox::question(myNet->getViewNet()->getApp(), MBOX_YES_NO, + ("Add " + toString(SUMO_TAG_VTYPE_DISTRIBUTION) + "s").c_str(), "%s", + (toString(SUMO_TAG_VTYPE_DISTRIBUTION) + " '" + vTypeDistribution + "' doesn't exist. Create?").c_str()); + if (answer == 1) { // 1:yes, 2:no, 4:esc + WRITE_DEBUG("Closed FXMessageBox 'add vTypeDistribution' with 'yes'"); + return true; + } else { + // write warning if netedit is running in testing mode + if (answer == 2) { + WRITE_DEBUG("Closed FXMessageBox 'add vTypeDistribution' with 'No'"); + return false; + } else { + WRITE_DEBUG("Closed FXMessageBox 'add vTypeDistribution' with 'ESC'"); + return false; + } + } +} + + +bool +GNEVType::askRemoveVTypeDistribution(const std::string& vTypeDistribution) const { + // show warning in gui testing debug mode + WRITE_DEBUG("Opening FXMessageBox 'remove vTypeDistribution'"); + // Ask confirmation to user + const FXuint answer = FXMessageBox::question(myNet->getViewNet()->getApp(), MBOX_YES_NO, + ("Remove " + toString(SUMO_TAG_VTYPE_DISTRIBUTION)).c_str(), "%s", + ("Changing attribute will remove " + toString(SUMO_TAG_VTYPE_DISTRIBUTION) + " '" + vTypeDistribution + "'. Continue?").c_str()); + if (answer == 1) { // 1:yes, 2:no, 4:esc + WRITE_DEBUG("Closed FXMessageBox 'remove vTypeDistribution' with 'yes'"); + return true; + } else { + // write warning if netedit is running in testing mode + if (answer == 2) { + WRITE_DEBUG("Closed FXMessageBox 'remove vTypeDistribution' with 'No'"); + return false; + } else { + WRITE_DEBUG("Closed FXMessageBox 'remove vTypeDistribution' with 'ESC'"); + return false; + } + } +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEVType::setAttribute(SumoXMLAttr key, const std::string& value) { + // obtain default values depending of vehicle class + VClassDefaultValues defaultValues(vehicleClass); + switch (key) { + case SUMO_ATTR_ID: + // update microsimID + setMicrosimID(value); + // manually change VType parameters ID + id = value; + break; + case GNE_ATTR_VTYPE_DISTRIBUTION: + setVTypeDistributionParent(value); + break; + // CFM Attributes + case SUMO_ATTR_ACCEL: + case SUMO_ATTR_DECEL: + case SUMO_ATTR_APPARENTDECEL: + case SUMO_ATTR_EMERGENCYDECEL: + case SUMO_ATTR_SIGMA: + case SUMO_ATTR_TAU: + case SUMO_ATTR_COLLISION_MINGAP_FACTOR: + case SUMO_ATTR_TMP1: + case SUMO_ATTR_TMP2: + case SUMO_ATTR_TMP3: + case SUMO_ATTR_TMP4: + case SUMO_ATTR_TMP5: + case SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS: + case SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW: + case SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD: + case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE: + case SUMO_ATTR_CF_EIDM_T_REACTION: + case SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE: + case SUMO_ATTR_CF_EIDM_C_COOLNESS: + case SUMO_ATTR_CF_EIDM_SIG_LEADER: + case SUMO_ATTR_CF_EIDM_SIG_GAP: + case SUMO_ATTR_CF_EIDM_SIG_ERROR: + case SUMO_ATTR_CF_EIDM_JERK_MAX: + case SUMO_ATTR_CF_EIDM_EPSILON_ACC: + case SUMO_ATTR_CF_EIDM_T_ACC_MAX: + case SUMO_ATTR_CF_EIDM_M_FLATNESS: + case SUMO_ATTR_CF_EIDM_M_BEGIN: + case SUMO_ATTR_CF_PWAGNER2009_TAULAST: + case SUMO_ATTR_CF_PWAGNER2009_APPROB: + case SUMO_ATTR_CF_IDMM_ADAPT_FACTOR: + case SUMO_ATTR_CF_IDMM_ADAPT_TIME: + case SUMO_ATTR_CF_WIEDEMANN_SECURITY: + case SUMO_ATTR_CF_WIEDEMANN_ESTIMATION: + case SUMO_ATTR_TRAIN_TYPE: + case SUMO_ATTR_K: + case SUMO_ATTR_CF_KERNER_PHI: + case SUMO_ATTR_CF_IDM_DELTA: + case SUMO_ATTR_CF_IDM_STEPPING: + // empty values means that value isn't set + if (value.empty()) { + const auto it = cfParameter.find(key); + if (it != cfParameter.end()) { + cfParameter.erase(it); + } + } else { + cfParameter[key] = value; + } + break; + // JM Attributes + case SUMO_ATTR_JM_CROSSING_GAP: + case SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME: + case SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME: + case SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME: + case SUMO_ATTR_JM_DRIVE_RED_SPEED: + case SUMO_ATTR_JM_IGNORE_FOE_PROB: + case SUMO_ATTR_JM_IGNORE_FOE_SPEED: + case SUMO_ATTR_JM_SIGMA_MINOR: + case SUMO_ATTR_JM_TIMEGAP_MINOR: + // empty values means that value isn't set + if (value.empty()) { + const auto it = jmParameter.find(key); + if (it != jmParameter.end()) { + jmParameter.erase(it); + } + } else { + jmParameter[key] = value; + } + break; + case SUMO_ATTR_IMPATIENCE: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + impatience = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_IMPATIENCE_SET; + } else { + // set default value + impatience = parse(myTagProperty.getDefaultValue(key)); + // unset parameter + parametersSet &= ~VTYPEPARS_IMPATIENCE_SET; + } + break; + // LCM Attributes + case SUMO_ATTR_LCA_STRATEGIC_PARAM: + case SUMO_ATTR_LCA_COOPERATIVE_PARAM: + case SUMO_ATTR_LCA_SPEEDGAIN_PARAM: + case SUMO_ATTR_LCA_KEEPRIGHT_PARAM: + case SUMO_ATTR_LCA_SUBLANE_PARAM: + case SUMO_ATTR_LCA_OPPOSITE_PARAM: + case SUMO_ATTR_LCA_PUSHY: + case SUMO_ATTR_LCA_PUSHYGAP: + case SUMO_ATTR_LCA_ASSERTIVE: + case SUMO_ATTR_LCA_IMPATIENCE: + case SUMO_ATTR_LCA_ACCEL_LAT: + case SUMO_ATTR_LCA_LOOKAHEADLEFT: + case SUMO_ATTR_LCA_SPEEDGAINRIGHT: + case SUMO_ATTR_LCA_MAXSPEEDLATSTANDING: + case SUMO_ATTR_LCA_MAXSPEEDLATFACTOR: + + /* case SUMO_ATTR_LCA_EXPERIMENTAL1: */ + // empty values means that value isn't set + if (value.empty()) { + const auto it = lcParameter.find(key); + if (it != lcParameter.end()) { + lcParameter.erase(it); + } + } else { + lcParameter[key] = value; + } + break; + case SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE: + case SUMO_ATTR_LCA_TIME_TO_IMPATIENCE: + case SUMO_ATTR_LCA_OVERTAKE_RIGHT: + // empty or null values means that value isn't set + if (value.empty() || (canParse(value) && (parse(value) == 0))) { + const auto it = lcParameter.find(key); + if (it != lcParameter.end()) { + lcParameter.erase(it); + } + } else { + lcParameter[key] = value; + } + break; + // + case SUMO_ATTR_LENGTH: + if (!value.empty() && (value != toString(defaultValues.length))) { + length = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_LENGTH_SET; + } else { + // set default value + length = defaultValues.length; + // unset parameter + parametersSet &= ~VTYPEPARS_LENGTH_SET; + } + break; + case SUMO_ATTR_MINGAP: + if (!value.empty() && (value != toString(defaultValues.minGap))) { + minGap = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_MINGAP_SET; + } else { + // set default value + minGap = defaultValues.minGap; + // unset parameter + parametersSet &= ~VTYPEPARS_MINGAP_SET; + } + break; + case SUMO_ATTR_MAXSPEED: + if (!value.empty() && (value != toString(defaultValues.maxSpeed))) { + maxSpeed = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_MAXSPEED_SET; + } else { + // set default value + maxSpeed = defaultValues.maxSpeed; + // unset parameter + parametersSet &= ~VTYPEPARS_MAXSPEED_SET; + } + break; + case SUMO_ATTR_SPEEDFACTOR: + if (!value.empty() && (value != toString(defaultValues.speedFactor))) { + speedFactor.parse(value, false); + // mark parameter as set + parametersSet |= VTYPEPARS_SPEEDFACTOR_SET; + } else { + // set default value + speedFactor.parse(toString(defaultValues.speedFactor), false); + // unset parameter + parametersSet &= ~VTYPEPARS_SPEEDFACTOR_SET; + } + break; + case SUMO_ATTR_COLOR: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + color = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_COLOR_SET; + } else { + // unset parameter + parametersSet &= ~VTYPEPARS_COLOR_SET; + } + break; + case SUMO_ATTR_VCLASS: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + vehicleClass = getVehicleClassID(value); + // mark parameter as set + parametersSet |= VTYPEPARS_VEHICLECLASS_SET; + } else { + // set default value + vehicleClass = getVehicleClassID(myTagProperty.getDefaultValue(key)); + // unset parameter + parametersSet &= ~VTYPEPARS_VEHICLECLASS_SET; + } + // update default values + updateDefaultVClassAttributes(defaultValues); + break; + case SUMO_ATTR_EMISSIONCLASS: + if (!value.empty() && (value != toString(defaultValues.emissionClass))) { + emissionClass = PollutantsInterface::getClassByName(value); + // mark parameter as set + parametersSet |= VTYPEPARS_EMISSIONCLASS_SET; + } else { + // set default value + emissionClass = defaultValues.emissionClass; + // unset parameter + parametersSet &= ~VTYPEPARS_EMISSIONCLASS_SET; + } + break; + case SUMO_ATTR_GUISHAPE: + if (!value.empty() && (value != SumoVehicleShapeStrings.getString(defaultValues.shape))) { + shape = getVehicleShapeID(value); + // mark parameter as set + parametersSet |= VTYPEPARS_SHAPE_SET; + } else { + // set default value + shape = defaultValues.shape; + // unset parameter + parametersSet &= ~VTYPEPARS_SHAPE_SET; + } + break; + case SUMO_ATTR_WIDTH: + if (!value.empty() && (value != toString(defaultValues.width))) { + width = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_WIDTH_SET; + } else { + // set default value + width = defaultValues.width; + // unset parameter + parametersSet &= ~VTYPEPARS_WIDTH_SET; + } + break; + case SUMO_ATTR_HEIGHT: + if (!value.empty() && (value != toString(defaultValues.height))) { + height = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_HEIGHT_SET; + } else { + // set default value + height = defaultValues.height; + // unset parameter + parametersSet &= ~VTYPEPARS_HEIGHT_SET; + } + break; + case SUMO_ATTR_IMGFILE: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + imgFile = value; + // mark parameter as set + parametersSet |= VTYPEPARS_IMGFILE_SET; + } else { + // set default value + imgFile = myTagProperty.getDefaultValue(key); + // unset parameter + parametersSet &= ~VTYPEPARS_IMGFILE_SET; + } + break; + case SUMO_ATTR_LANE_CHANGE_MODEL: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + lcModel = SUMOXMLDefinitions::LaneChangeModels.get(value); + // mark parameter as set + parametersSet |= VTYPEPARS_LANE_CHANGE_MODEL_SET; + } else { + // set default value + lcModel = SUMOXMLDefinitions::LaneChangeModels.get(myTagProperty.getDefaultValue(key)); + // unset parameter + parametersSet &= ~VTYPEPARS_LANE_CHANGE_MODEL_SET; + } + break; + case SUMO_ATTR_CAR_FOLLOW_MODEL: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + cfModel = SUMOXMLDefinitions::CarFollowModels.get(value); + // mark parameter as set + parametersSet |= VTYPEPARS_CAR_FOLLOW_MODEL; + } else { + // set default value + cfModel = SUMOXMLDefinitions::CarFollowModels.get(myTagProperty.getDefaultValue(key)); + // unset parameter + parametersSet &= ~VTYPEPARS_CAR_FOLLOW_MODEL; + } + break; + case SUMO_ATTR_PERSON_CAPACITY: + if (!value.empty() && (value != toString(defaultValues.personCapacity))) { + personCapacity = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_PERSON_CAPACITY; + } else { + // set default value + personCapacity = defaultValues.personCapacity; + // unset parameter + parametersSet &= ~VTYPEPARS_PERSON_CAPACITY; + } + break; + case SUMO_ATTR_CONTAINER_CAPACITY: + if (!value.empty() && (value != toString(defaultValues.containerCapacity))) { + containerCapacity = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_CONTAINER_CAPACITY; + } else { + // set default value + containerCapacity = defaultValues.containerCapacity; + // unset parameter + parametersSet &= ~VTYPEPARS_CONTAINER_CAPACITY; + } + break; + case SUMO_ATTR_BOARDING_DURATION: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + boardingDuration = string2time(value); + // mark parameter as set + parametersSet |= VTYPEPARS_BOARDING_DURATION; + } else { + // set default value + boardingDuration = string2time(myTagProperty.getDefaultValue(key)); + // unset parameter + parametersSet &= ~VTYPEPARS_BOARDING_DURATION; + } + break; + case SUMO_ATTR_LOADING_DURATION: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + loadingDuration = string2time(value); + // mark parameter as set + parametersSet |= VTYPEPARS_LOADING_DURATION; + } else { + // set default value + loadingDuration = string2time(myTagProperty.getDefaultValue(key)); + // unset parameter + parametersSet &= ~VTYPEPARS_LOADING_DURATION; + } + break; + case SUMO_ATTR_LATALIGNMENT: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + parseLatAlignment(value, latAlignmentOffset, latAlignmentProcedure); + // mark parameter as set + parametersSet |= VTYPEPARS_LATALIGNMENT_SET; + } else { + // set default value + parseLatAlignment(myTagProperty.getDefaultValue(key), latAlignmentOffset, latAlignmentProcedure); + // unset parameter + parametersSet &= ~VTYPEPARS_LATALIGNMENT_SET; + } + break; + case SUMO_ATTR_MINGAP_LAT: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + minGapLat = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_MINGAP_LAT_SET; + } else { + // set default value + minGapLat = parse(myTagProperty.getDefaultValue(key)); + // unset parameter + parametersSet &= ~VTYPEPARS_MINGAP_LAT_SET; + } + break; + case SUMO_ATTR_MAXSPEED_LAT: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + maxSpeedLat = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_MAXSPEED_LAT_SET; + } else { + // set default value + maxSpeedLat = parse(myTagProperty.getDefaultValue(key)); + // unset parameter + parametersSet &= ~VTYPEPARS_MAXSPEED_LAT_SET; + } + break; + case SUMO_ATTR_ACTIONSTEPLENGTH: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + actionStepLength = string2time(value); + // mark parameter as set + parametersSet |= VTYPEPARS_ACTIONSTEPLENGTH_SET; + } else { + // set default value + actionStepLength = string2time(myTagProperty.getDefaultValue(key)); + // unset parameter + parametersSet &= ~VTYPEPARS_ACTIONSTEPLENGTH_SET; + } + break; + case SUMO_ATTR_PROB: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + defaultProbability = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_PROBABILITY_SET; + } else { + // set default value + defaultProbability = parse(myTagProperty.getDefaultValue(key)); + // unset parameter + parametersSet &= ~VTYPEPARS_PROBABILITY_SET; + } + break; + case SUMO_ATTR_OSGFILE: + if (!value.empty() && (value != defaultValues.osgFile)) { + osgFile = value; + // mark parameter as set + parametersSet |= VTYPEPARS_OSGFILE_SET; + } else { + // set default value + osgFile = defaultValues.osgFile; + // unset parameter + parametersSet &= ~VTYPEPARS_OSGFILE_SET; + } + break; + case SUMO_ATTR_CARRIAGE_LENGTH: + if (!value.empty() && (value != toString(defaultValues.carriageLength))) { + carriageLength = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_CARRIAGE_LENGTH_SET; + // set parameter in SUMOVTypeParameter (needed for writting in XML) + SUMOVTypeParameter::setParameter(toString(key), value); + } else { + // set default value + carriageLength = defaultValues.carriageLength; + // unset parameter + parametersSet &= ~VTYPEPARS_CARRIAGE_LENGTH_SET; + // remove from params (needed for writting in XML) + SUMOVTypeParameter::unsetParameter(toString(key)); + } + break; + case SUMO_ATTR_LOCOMOTIVE_LENGTH: + if (!value.empty() && (value != toString(defaultValues.containerCapacity))) { + locomotiveLength = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_LOCOMOTIVE_LENGTH_SET; + // set parameter in SUMOVTypeParameter (needed for writting in XML) + SUMOVTypeParameter::setParameter(toString(key), value); + } else { + // set default value + locomotiveLength = defaultValues.locomotiveLength; + // unset parameter + parametersSet &= ~VTYPEPARS_LOCOMOTIVE_LENGTH_SET; + // remove from params (needed for writting in XML) + SUMOVTypeParameter::unsetParameter(toString(key)); + } + break; + case SUMO_ATTR_CARRIAGE_GAP: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + carriageGap = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_CARRIAGE_GAP_SET; + // set parameter in SUMOVTypeParameter (needed for writting in XML) + SUMOVTypeParameter::setParameter(toString(key), value); + } else { + // set default value + carriageGap = parse(myTagProperty.getDefaultValue(key)); + // unset parameter + parametersSet &= ~VTYPEPARS_CARRIAGE_GAP_SET; + // remove from params (needed for writting in XML) + SUMOVTypeParameter::unsetParameter(toString(key)); + } + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + case GNE_ATTR_DEFAULT_VTYPE_MODIFIED: + myDefaultVehicleTypeModified = parse(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } + // check if geometry must be marked as deprecated + if (myTagProperty.hasAttribute(key) && (myTagProperty.getAttributeProperties(key).requireUpdateGeometry())) { + updateGeometry(); + } +} + + +void +GNEVType::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { + // nothing to toogle +} + + +void +GNEVType::setMoveShape(const GNEMoveResult& /*moveResult*/) { + // vehicleTypes cannot be moved +} + + +void +GNEVType::commitMoveShape(const GNEMoveResult& /*moveResult*/, GNEUndoList* /*undoList*/) { + // vehicleTypes cannot be moved +} + + +void +GNEVType::updateDefaultVClassAttributes(const VClassDefaultValues& defaultValues) { + if (!wasSet(VTYPEPARS_LENGTH_SET)) { + length = defaultValues.length; + } + if (!wasSet(VTYPEPARS_MINGAP_SET)) { + minGap = defaultValues.minGap; + } + if (!wasSet(VTYPEPARS_MAXSPEED_SET)) { + maxSpeed = defaultValues.maxSpeed; + } + if (!wasSet(VTYPEPARS_WIDTH_SET)) { + width = defaultValues.width; + } + if (!wasSet(VTYPEPARS_HEIGHT_SET)) { + height = defaultValues.height; + } + if (!wasSet(VTYPEPARS_SHAPE_SET)) { + shape = defaultValues.shape; + } + if (!wasSet(VTYPEPARS_EMISSIONCLASS_SET)) { + emissionClass = defaultValues.emissionClass; + } + if (!wasSet(VTYPEPARS_SPEEDFACTOR_SET)) { + speedFactor = defaultValues.speedFactor; + } + if (!wasSet(VTYPEPARS_PERSON_CAPACITY)) { + personCapacity = defaultValues.personCapacity; + } + if (!wasSet(VTYPEPARS_CONTAINER_CAPACITY)) { + containerCapacity = defaultValues.containerCapacity; + } + if (!wasSet(VTYPEPARS_OSGFILE_SET)) { + osgFile = defaultValues.osgFile; + } + if (!wasSet(VTYPEPARS_CARRIAGE_LENGTH_SET)) { + carriageLength = defaultValues.carriageLength; + } + if (!wasSet(VTYPEPARS_LOCOMOTIVE_LENGTH_SET)) { + locomotiveLength = defaultValues.locomotiveLength; + } +} + +/****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEVTypeDistribution.cpp sumo-1.12.0/src/netedit/elements/demand/GNEVTypeDistribution.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNEVTypeDistribution.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEVTypeDistribution.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,295 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GNEVTypeDistribution.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2022 +/// +// VehicleType distribution used in NETEDIT +/****************************************************************************/ +#include +#include +#include + +#include "GNEVTypeDistribution.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEVTypeDistribution::GNEVTypeDistribution(GNENet* net) : + GNEDemandElement("", net, GLO_VTYPE, SUMO_TAG_VTYPE_DISTRIBUTION, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {}, {}, {}, {}, {}, {}, {}) { + // reset default values + resetDefaultValues(); +} + + +GNEVTypeDistribution::GNEVTypeDistribution(GNENet* net, const std::string& vTypeID) : + GNEDemandElement(vTypeID, net, GLO_VTYPE, SUMO_TAG_VTYPE_DISTRIBUTION, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {}, {}, {}, {}, {}, {}, {}) { +} + + +GNEVTypeDistribution::~GNEVTypeDistribution() {} + + +GNEMoveOperation* +GNEVTypeDistribution::getMoveOperation() { + return nullptr; +} + + +void +GNEVTypeDistribution::writeDemandElement(OutputDevice& device) const { + device.openTag(getTagProperty().getTag()); + device.writeAttr(SUMO_ATTR_ID, getID()); + // write all vTypes + for (const auto& vType : getChildDemandElements()) { + vType->writeDemandElement(device); + } + device.closeTag(); +} + + +GNEDemandElement::Problem +GNEVTypeDistribution::isDemandElementValid() const { + // currently vTypeDistributions don't have problems + return GNEDemandElement::Problem::OK; +} + + +std::string +GNEVTypeDistribution::getDemandElementProblem() const { + return ""; +} + + +void +GNEVTypeDistribution::fixDemandElementProblem() { + // nothing to fix +} + + +SUMOVehicleClass +GNEVTypeDistribution::getVClass() const { + return SVC_IGNORING; +} + + +const RGBColor& +GNEVTypeDistribution::getColor() const { + return RGBColor::BLACK; +} + + +void +GNEVTypeDistribution::updateGeometry() { + // nothing to update +} + + +Position +GNEVTypeDistribution::getPositionInView() const { + return Position(); +} + + +std::string +GNEVTypeDistribution::getParentName() const { + return myNet->getMicrosimID(); +} + + +double +GNEVTypeDistribution::getExaggeration(const GUIVisualizationSettings& /*s*/) const { + return 1; +} + + +Boundary +GNEVTypeDistribution::getCenteringBoundary() const { + // VehicleType distribution doesn't have boundaries + return Boundary(-0.1, -0.1, 0.1, 0.1); +} + + +void +GNEVTypeDistribution::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +void +GNEVTypeDistribution::drawGL(const GUIVisualizationSettings&) const { + // Vehicle Types aren't draw +} + + +void +GNEVTypeDistribution::computePathElement() { + // nothing to compute +} + + +void +GNEVTypeDistribution::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*lane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const { + // vehicleType distributions don't use drawPartialGL +} + + +void +GNEVTypeDistribution::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*fromLane*/, const GNELane* /*toLane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const { + // vehicleType distributions don't use drawPartialGL +} + + +GNELane* +GNEVTypeDistribution::getFirstPathLane() const { + // vehicle types don't use lanes + return nullptr; +} + + +GNELane* +GNEVTypeDistribution::getLastPathLane() const { + // vehicle types don't use lanes + return nullptr; +} + + +std::string +GNEVTypeDistribution::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEVTypeDistribution::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +Position +GNEVTypeDistribution::getAttributePosition(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a Position attribute of type '" + toString(key) + "'"); +} + + +void +GNEVTypeDistribution::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { + if (value == getAttribute(key)) { + return; //avoid needless changes, later logic relies on the fact that attributes have changed + } + switch (key) { + case SUMO_ATTR_ID: + undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); + break; + + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEVTypeDistribution::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + // Vtypes and PTypes shares namespace + if (SUMOXMLDefinitions::isValidVehicleID(value) && (myNet->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, value, false) == nullptr)) { + return true; + } else { + return false; + } + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEVTypeDistribution::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // nothing to enable +} + + +void +GNEVTypeDistribution::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // nothing to disable +} + + +bool +GNEVTypeDistribution::isAttributeEnabled(SumoXMLAttr /*key*/) const { + return true; +} + + +std::string +GNEVTypeDistribution::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEVTypeDistribution::getHierarchyName() const { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) ; +} + + +const std::map& +GNEVTypeDistribution::getACParametersMap() const { + throw InvalidArgument(getTagStr() + " doesn't have parameters"); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEVTypeDistribution::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + setMicrosimID(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEVTypeDistribution::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { + // nothing to toogle +} + + +void +GNEVTypeDistribution::setMoveShape(const GNEMoveResult& /*moveResult*/) { + // vehicleType distributions cannot be moved +} + + +void +GNEVTypeDistribution::commitMoveShape(const GNEMoveResult& /*moveResult*/, GNEUndoList* /*undoList*/) { + // vehicleType distributions cannot be moved +} + +/****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEVTypeDistribution.h sumo-1.12.0/src/netedit/elements/demand/GNEVTypeDistribution.h --- sumo-1.11.0/src/netedit/elements/demand/GNEVTypeDistribution.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEVTypeDistribution.h 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,218 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GNEVTypeDistribution.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2022 +/// +// VehicleType distribution used in NETEDIT +/****************************************************************************/ +#pragma once +#include + +#include "GNEDemandElement.h" + + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNEVTypeDistribution : public GNEDemandElement { + +public: + /// @brief default constructor + GNEVTypeDistribution(GNENet* net); + + /// @brief parameter constructor + GNEVTypeDistribution(GNENet* net, const std::string& vTypeID); + + /// @brief destructor + ~GNEVTypeDistribution(); + + /**@brief get move operation + * @note returned GNEMoveOperation can be nullptr + */ + GNEMoveOperation* getMoveOperation(); + + /**@brief writte demand element element into a xml file + * @param[in] device device in which write parameters of demand element element + */ + void writeDemandElement(OutputDevice& device) const; + + /// @brief check if current demand element is valid to be writed into XML + Problem isDemandElementValid() const; + + /// @brief return a string with the current demand element problem + std::string getDemandElementProblem() const; + + /// @brief fix demand element problem + void fixDemandElementProblem(); + + /// @name members and functions relative to elements common to all demand elements + /// @{ + /// @brief obtain VClass related with this demand element + SUMOVehicleClass getVClass() const; + + /// @brief get color + const RGBColor& getColor() const; + + /// @} + + /// @name Functions related with geometry of element + /// @{ + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /// @brief return exaggeration asociated with this GLObject + double getExaggeration(const GUIVisualizationSettings& s) const; + + /**@brief Returns the boundary to which the view shall be centered in order to show the object + * @return The boundary the object is within + */ + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + + /**@brief Draws the object + * @param[in] s The settings for the current view (may influence drawing) + * @see GUIGlObject::drawGL + */ + void drawGL(const GUIVisualizationSettings& s) const; + + /// @} + + /// @name inherited from GNEPathManager::PathElement + /// @{ + + /// @brief compute pathElement + void computePathElement(); + + /**@brief Draws partial object + * @param[in] s The settings for the current view (may influence drawing) + * @param[in] lane lane in which draw partial + * @param[in] segment PathManager segment (used for segment options) + * @param[in] offsetFront extra front offset (used for drawing partial gl above other elements) + */ + void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const; + + /**@brief Draws partial object (junction) + * @param[in] s The settings for the current view (may influence drawing) + * @param[in] fromLane from GNELane + * @param[in] toLane to GNELane + * @param[in] segment PathManager segment (used for segment options) + * @param[in] offsetFront extra front offset (used for drawing partial gl above other elements) + */ + void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const; + + /// @brief get first path lane + GNELane* getFirstPathLane() const; + + /// @brief get last path lane + GNELane* getLastPathLane() const; + /// @} + + /// @brief inherited from GNEAttributeCarrier + /// @{ + /* @brief method for getting the Attribute of an XML key + * @param[in] key The attribute key + * @return string with the value associated to key + */ + std::string getAttribute(SumoXMLAttr key) const; + + /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse(...) for certain attributes) + * @param[in] key The attribute key + * @return double with the value associated to key + */ + double getAttributeDouble(SumoXMLAttr key) const; + + /* @brief method for getting the Attribute of an XML key in Position format (used in person plans) + * @param[in] key The attribute key + * @return double with the value associated to key + */ + Position getAttributePosition(SumoXMLAttr key) const; + + /* @brief method for setting the attribute and letting the object perform additional changes + * @param[in] key The attribute key + * @param[in] value The new value + * @param[in] undoList The undoList on which to register changes + * @param[in] net optionally the GNENet to inform about gui updates + */ + void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList); + + /* @brief method for setting the attribute and letting the object perform additional changes + * @param[in] key The attribute key + * @param[in] value The new value + * @param[in] undoList The undoList on which to register changes + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @brief method for enable attribute + * @param[in] key The attribute key + * @param[in] undoList The undoList on which to register changes + * @note certain attributes can be only enabled, and can produce the disabling of other attributes + */ + void enableAttribute(SumoXMLAttr key, GNEUndoList* undoList); + + /* @brief method for disable attribute + * @param[in] key The attribute key + * @param[in] undoList The undoList on which to register changes + * @note certain attributes can be only enabled, and can produce the disabling of other attributes + */ + void disableAttribute(SumoXMLAttr key, GNEUndoList* undoList); + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + bool isAttributeEnabled(SumoXMLAttr key) const; + + /// @brief get PopPup ID (Used in AC Hierarchy) + std::string getPopUpID() const; + + /// @brief get Hierarchy Name (Used in AC Hierarchy) + std::string getHierarchyName() const; + /// @} + + /// @brief get parameters map + const std::map& getACParametersMap() const; + +private: + /// @brief method for setting the attribute and nothing else + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); + + /// @brief set move shape + void setMoveShape(const GNEMoveResult& moveResult); + + /// @brief commit move shape + void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList); + + /// @brief Invalidated copy constructor. + GNEVTypeDistribution(GNEVTypeDistribution*) = delete; + + /// @brief Invalidated assignment operator + GNEVTypeDistribution* operator=(GNEVTypeDistribution*) = delete; +}; diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEVType.h sumo-1.12.0/src/netedit/elements/demand/GNEVType.h --- sumo-1.11.0/src/netedit/elements/demand/GNEVType.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEVType.h 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,247 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GNEVType.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2018 +/// +// Definition of Vehicle Types in NETEDIT +/****************************************************************************/ +#pragma once +#include +#include + +#include "GNEDemandElement.h" + + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNEVType : public GNEDemandElement, public SUMOVTypeParameter { + +public: + /// @brief default constructor + GNEVType(GNENet* net); + + /// @brief constructor for default VTypes + GNEVType(GNENet* net, const std::string& vTypeID, const SUMOVehicleClass& defaultVClass); + + /// @brief parameter constructor + GNEVType(GNENet* net, const SUMOVTypeParameter& vTypeParameter); + + /// @brief copy constructor + GNEVType(GNENet* net, const std::string& vTypeID, GNEVType* vTypeOriginal); + + /// @brief destructor + ~GNEVType(); + + /**@brief get move operation + * @note returned GNEMoveOperation can be nullptr + */ + GNEMoveOperation* getMoveOperation(); + + /**@brief writte demand element element into a xml file + * @param[in] device device in which write parameters of demand element element + */ + void writeDemandElement(OutputDevice& device) const; + + /// @brief check if current demand element is valid to be writed into XML + Problem isDemandElementValid() const; + + /// @brief return a string with the current demand element problem + std::string getDemandElementProblem() const; + + /// @brief fix demand element problem + void fixDemandElementProblem(); + + /// @name members and functions relative to elements common to all demand elements + /// @{ + /// @brief obtain VClass related with this demand element + SUMOVehicleClass getVClass() const; + + /// @brief get color + const RGBColor& getColor() const; + + /// @} + + /// @name Functions related with geometry of element + /// @{ + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /// @brief return exaggeration asociated with this GLObject + double getExaggeration(const GUIVisualizationSettings& s) const; + + /**@brief Returns the boundary to which the view shall be centered in order to show the object + * @return The boundary the object is within + */ + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + + /**@brief Draws the object + * @param[in] s The settings for the current view (may influence drawing) + * @see GUIGlObject::drawGL + */ + void drawGL(const GUIVisualizationSettings& s) const; + + /// @} + + /// @name inherited from GNEPathManager::PathElement + /// @{ + + /// @brief compute pathElement + void computePathElement(); + + /**@brief Draws partial object + * @param[in] s The settings for the current view (may influence drawing) + * @param[in] lane lane in which draw partial + * @param[in] segment PathManager segment (used for segment options) + * @param[in] offsetFront extra front offset (used for drawing partial gl above other elements) + */ + void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const; + + /**@brief Draws partial object (junction) + * @param[in] s The settings for the current view (may influence drawing) + * @param[in] fromLane from GNELane + * @param[in] toLane to GNELane + * @param[in] segment PathManager segment (used for segment options) + * @param[in] offsetFront extra front offset (used for drawing partial gl above other elements) + */ + void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const; + + /// @brief get first path lane + GNELane* getFirstPathLane() const; + + /// @brief get last path lane + GNELane* getLastPathLane() const; + /// @} + + /// @brief inherited from GNEAttributeCarrier + /// @{ + /* @brief method for getting the Attribute of an XML key + * @param[in] key The attribute key + * @return string with the value associated to key + */ + std::string getAttribute(SumoXMLAttr key) const; + + /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse(...) for certain attributes) + * @param[in] key The attribute key + * @return double with the value associated to key + */ + double getAttributeDouble(SumoXMLAttr key) const; + + /* @brief method for getting the Attribute of an XML key in Position format (used in person plans) + * @param[in] key The attribute key + * @return double with the value associated to key + */ + Position getAttributePosition(SumoXMLAttr key) const; + + /* @brief method for setting the attribute and letting the object perform additional changes + * @param[in] key The attribute key + * @param[in] value The new value + * @param[in] undoList The undoList on which to register changes + * @param[in] net optionally the GNENet to inform about gui updates + */ + void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList); + + /* @brief method for setting the attribute and letting the object perform additional changes + * @param[in] key The attribute key + * @param[in] value The new value + * @param[in] undoList The undoList on which to register changes + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @brief method for enable attribute + * @param[in] key The attribute key + * @param[in] undoList The undoList on which to register changes + * @note certain attributes can be only enabled, and can produce the disabling of other attributes + */ + void enableAttribute(SumoXMLAttr key, GNEUndoList* undoList); + + /* @brief method for disable attribute + * @param[in] key The attribute key + * @param[in] undoList The undoList on which to register changes + * @note certain attributes can be only enabled, and can produce the disabling of other attributes + */ + void disableAttribute(SumoXMLAttr key, GNEUndoList* undoList); + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + bool isAttributeEnabled(SumoXMLAttr key) const; + + /// @brief get PopPup ID (Used in AC Hierarchy) + std::string getPopUpID() const; + + /// @brief get Hierarchy Name (Used in AC Hierarchy) + std::string getHierarchyName() const; + /// @} + + /// @brief get parameters map + const std::map& getACParametersMap() const; + + /// @brief overwrite all values of GNEVType with a SUMOVTypeParameter + static void overwriteVType(GNEDemandElement* vType, const SUMOVTypeParameter newVTypeParameter, GNEUndoList* undoList); + +protected: + /// @brief flag to check if this GNEVType is a default vehicle Type (For Vehicles, Pedestrians...) + bool myDefaultVehicleType; + + /// @brief flag to check if this default GNEVType was modified + bool myDefaultVehicleTypeModified; + + /// @brief edit vType distribution + void editVTypeDistribution(const std::string& vTypeDistributionID, GNEUndoList* undoList); + + /// @brief ask if add vTypeDistribution + bool askAddVTypeDistribution(const std::string& vTypeDistribution) const; + + /// @brief ask if remove vTypeDistribution + bool askRemoveVTypeDistribution(const std::string& vTypeDistribution) const; + +private: + /// @brief method for setting the attribute and nothing else + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); + + /// @brief set move shape + void setMoveShape(const GNEMoveResult& moveResult); + + /// @brief commit move shape + void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList); + + /// @brief function called after set new VClass + void updateDefaultVClassAttributes(const VClassDefaultValues& defaultValues); + + /// @brief Invalidated copy constructor. + GNEVType(GNEVType*) = delete; + + /// @brief Invalidated assignment operator + GNEVType* operator=(GNEVType*) = delete; +}; diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEWalk.cpp sumo-1.12.0/src/netedit/elements/demand/GNEWalk.cpp --- sumo-1.11.0/src/netedit/elements/demand/GNEWalk.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEWalk.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -34,6 +34,15 @@ // method definitions // =========================================================================== +GNEWalk::GNEWalk(SumoXMLTag tag, GNENet* net) : + GNEDemandElement("", net, GLO_WALK, tag, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, +{}, {}, {}, {}, {}, {}, {}, {}), +myArrivalPosition(0) { + // reset default values + resetDefaultValues(); +} + + GNEWalk::GNEWalk(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, double arrivalPosition) : GNEDemandElement(personParent, net, GLO_WALK, GNE_TAG_WALK_EDGE, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, {}, {fromEdge, toEdge}, {}, {}, {}, {}, {personParent}, {}), @@ -62,13 +71,21 @@ } +GNEWalk::GNEWalk(GNENet* net, GNEDemandElement* personParent, GNEJunction* fromJunction, GNEJunction* toJunction, double arrivalPosition) : + GNEDemandElement(personParent, net, GLO_WALK, GNE_TAG_WALK_JUNCTIONS, GNEPathManager::PathElement::Options::DEMAND_ELEMENT, { + fromJunction, toJunction +}, {}, {}, {}, {}, {}, {personParent}, {}), +myArrivalPosition(arrivalPosition) { +} + + GNEWalk::~GNEWalk() {} GNEMoveOperation* GNEWalk::getMoveOperation() { - // avoid move person plan that ends in busStop - if (getParentAdditionals().size() > 0) { + // avoid move person plan that ends in busStop or junction + if ((getParentAdditionals().size() > 0) || (getParentJunctions().size() > 0)) { return nullptr; } // get geometry end pos @@ -127,12 +144,16 @@ // check if from attribute is enabled if (isAttributeEnabled(SUMO_ATTR_FROM)) { device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID()); + } else if (isAttributeEnabled(SUMO_ATTR_FROMJUNCTION)) { + device.writeAttr(SUMO_ATTR_FROMJUNCTION, getParentJunctions().front()->getID()); } - // write to depending if personplan ends in a busStop + // write to depending if personplan ends in a busStop, edge or junction if (getParentAdditionals().size() > 0) { device.writeAttr(SUMO_ATTR_BUS_STOP, getParentAdditionals().back()->getID()); - } else { + } else if (getParentEdges().size() > 0) { device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID()); + } else { + device.writeAttr(SUMO_ATTR_TOJUNCTION, getParentJunctions().back()->getID()); } } // avoid writte arrival positions in walk to busStop @@ -149,7 +170,7 @@ } -bool +GNEDemandElement::Problem GNEWalk::isDemandElementValid() const { return isPersonPlanValid(); } @@ -244,25 +265,36 @@ GNEWalk::drawGL(const GUIVisualizationSettings& s) const { // force draw path myNet->getPathManager()->forceDrawPath(s, this); + // special case for junction walks + if (getParentJunctions().size() > 0) { + // get person parent + const GNEDemandElement* personParent = getParentDemandElements().front(); + if ((personParent->getChildDemandElements().size() > 0) && (personParent->getChildDemandElements().front() == this)) { + personParent->drawGL(s); + } + } } void GNEWalk::computePathElement() { - // declare lane vector - std::vector lanes; - // update lanes depending of walk tag - if (myTagProperty.getTag() == GNE_TAG_WALK_EDGES) { - // calculate consecutive path using parent edges - myNet->getPathManager()->calculateConsecutivePathEdges(this, getVClass(), getParentEdges()); - } else if (myTagProperty.getTag() == GNE_TAG_WALK_ROUTE) { - // calculate consecutive path using route edges - myNet->getPathManager()->calculateConsecutivePathEdges(this, getVClass(), getParentDemandElements().back()->getParentEdges()); - } else { - // get first and last person plane - lanes = {getFirstPathLane(), getLastPathLane()}; - // calculate path - myNet->getPathManager()->calculatePathLanes(this, getVClass(), lanes); + // avoid calculate for junctions + if (getParentJunctions().empty()) { + // declare lane vector + std::vector lanes; + // update lanes depending of walk tag + if (myTagProperty.getTag() == GNE_TAG_WALK_EDGES) { + // calculate consecutive path using parent edges + myNet->getPathManager()->calculateConsecutivePathEdges(this, getVClass(), getParentEdges()); + } else if (myTagProperty.getTag() == GNE_TAG_WALK_ROUTE) { + // calculate consecutive path using route edges + myNet->getPathManager()->calculateConsecutivePathEdges(this, getVClass(), getParentDemandElements().back()->getParentEdges()); + } else if (getParentEdges().size() > 0) { + // get first and last person plane + lanes = {getFirstPathLane(), getLastPathLane()}; + // calculate path + myNet->getPathManager()->calculatePathLanes(this, getVClass(), lanes); + } } // update geometry updateGeometry(); @@ -288,6 +320,8 @@ // check if this walk is over a route if (myTagProperty.getTag() == GNE_TAG_WALK_ROUTE) { return getParentDemandElements().at(1)->getParentEdges().front()->getLaneByAllowedVClass(SVC_PEDESTRIAN); + } else if (getParentJunctions().size() > 0) { + throw ProcessError("This walk use junctions"); } else { return getParentEdges().front()->getLaneByAllowedVClass(SVC_PEDESTRIAN); } @@ -301,6 +335,8 @@ return getParentDemandElements().at(1)->getParentEdges().back()->getLaneByAllowedVClass(SVC_PEDESTRIAN); } else if (getParentAdditionals().size() > 0) { return getParentAdditionals().front()->getParentLanes().front(); + } else if (getParentJunctions().size() > 0) { + throw ProcessError("This walk use junctions"); } else { return getParentEdges().back()->getLaneByDisallowedVClass(SVC_PEDESTRIAN); } @@ -325,6 +361,10 @@ } else { return getParentEdges().back()->getID(); } + case SUMO_ATTR_FROMJUNCTION: + return getParentJunctions().front()->getID(); + case SUMO_ATTR_TOJUNCTION: + return getParentJunctions().back()->getID(); case GNE_ATTR_TO_BUSSTOP: return getParentAdditionals().back()->getID(); case SUMO_ATTR_EDGES: @@ -354,7 +394,9 @@ GNEWalk::getAttributeDouble(SumoXMLAttr key) const { switch (key) { case SUMO_ATTR_ARRIVALPOS: - if (myArrivalPosition != -1) { + if (getParentJunctions().size() > 0) { + return 0; + } else if (myArrivalPosition != -1) { return myArrivalPosition; } else { return (getLastPathLane()->getLaneShape().length() - POSITION_EPS); @@ -369,15 +411,19 @@ GNEWalk::getAttributePosition(SumoXMLAttr key) const { switch (key) { case SUMO_ATTR_ARRIVALPOS: { - // get lane shape - const PositionVector& laneShape = getLastPathLane()->getLaneShape(); - // continue depending of arrival position - if (myArrivalPosition == 0) { - return laneShape.front(); - } else if ((myArrivalPosition == -1) || (myArrivalPosition >= laneShape.length2D())) { - return laneShape.back(); + if (getParentJunctions().size() > 0) { + return getParentJunctions().back()->getPositionInView(); } else { - return laneShape.positionAtOffset2D(myArrivalPosition); + // get lane shape + const PositionVector& laneShape = getLastPathLane()->getLaneShape(); + // continue depending of arrival position + if (myArrivalPosition == 0) { + return laneShape.front(); + } else if ((myArrivalPosition == -1) || (myArrivalPosition >= laneShape.length2D())) { + return laneShape.back(); + } else { + return laneShape.positionAtOffset2D(myArrivalPosition); + } } } default: @@ -394,14 +440,16 @@ if (myTagProperty.getTag() != GNE_TAG_WALK_ROUTE) { undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); } - break; + break; + case SUMO_ATTR_FROMJUNCTION: case SUMO_ATTR_ARRIVALPOS: case GNE_ATTR_SELECTED: case GNE_ATTR_PARAMETERS: undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); break; // special case for "to" attributes - case SUMO_ATTR_TO: { + case SUMO_ATTR_TO: + case SUMO_ATTR_TOJUNCTION: { if (myTagProperty.getTag() != GNE_TAG_WALK_ROUTE) { // get next personPlan GNEDemandElement* nextPersonPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this); @@ -485,6 +533,9 @@ } else { return false; } + case SUMO_ATTR_FROMJUNCTION: + case SUMO_ATTR_TOJUNCTION: + return SUMOXMLDefinitions::isValidNetID(value) && (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr); case GNE_ATTR_TO_BUSSTOP: return (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr); case SUMO_ATTR_EDGES: @@ -534,10 +585,12 @@ bool GNEWalk::isAttributeEnabled(SumoXMLAttr key) const { - if (key == SUMO_ATTR_FROM) { - return (getParentDemandElements().at(0)->getPreviousChildDemandElement(this) == nullptr); - } else { - return true; + switch (key) { + case SUMO_ATTR_FROM: + case SUMO_ATTR_FROMJUNCTION: + return (getParentDemandElements().at(0)->getPreviousChildDemandElement(this) == nullptr); + default: + return true; } } @@ -552,6 +605,8 @@ GNEWalk::getHierarchyName() const { if (myTagProperty.getTag() == GNE_TAG_WALK_EDGE) { return "walk: " + getParentEdges().front()->getID() + " -> " + getParentEdges().back()->getID(); + } else if (myTagProperty.getTag() == GNE_TAG_WALK_JUNCTIONS) { + return "walk: " + getParentJunctions().front()->getID() + " -> " + getParentJunctions().back()->getID(); } else if (myTagProperty.getTag() == GNE_TAG_WALK_BUSSTOP) { return "walk: " + getParentEdges().front()->getID() + " -> " + getParentAdditionals().back()->getID(); } else if (myTagProperty.getTag() == GNE_TAG_WALK_EDGES) { @@ -589,6 +644,18 @@ // compute walk computePathElement(); break; + case SUMO_ATTR_FROMJUNCTION: + // change first junction + replaceFirstParentJunction(value); + // compute walk + computePathElement(); + break; + case SUMO_ATTR_TOJUNCTION: + // change last junction + replaceLastParentJunction(value); + // compute walk + computePathElement(); + break; case GNE_ATTR_TO_BUSSTOP: replaceAdditionalParent(SUMO_TAG_BUS_STOP, value); // compute walk @@ -630,8 +697,8 @@ void -GNEWalk::setEnabledAttribute(const int /*enabledAttributes*/) { - // +GNEWalk::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { + // nothing to toogle } diff -Nru sumo-1.11.0/src/netedit/elements/demand/GNEWalk.h sumo-1.12.0/src/netedit/elements/demand/GNEWalk.h --- sumo-1.11.0/src/netedit/elements/demand/GNEWalk.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/demand/GNEWalk.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ @@ -36,6 +36,9 @@ class GNEWalk : public GNEDemandElement, public Parameterised { public: + /// @brief default constructor + GNEWalk(SumoXMLTag tag, GNENet* net); + /**@brief parameter constructor for person edge->edge * @param[in] viewNet view in which this Walk is placed * @param[in] personParent person parent @@ -70,6 +73,15 @@ */ GNEWalk(GNENet* net, GNEDemandElement* personParent, GNEDemandElement* route, double arrivalPosition); + /**@brief parameter constructor for person junction->junction + * @param[in] viewNet view in which this Walk is placed + * @param[in] personParent person parent + * @param[in] fromJunction from junction + * @param[in] toJunction to junction + * @param[in] arrivalPosition arrival position on the destination junction + */ + GNEWalk(GNENet* net, GNEDemandElement* personParent, GNEJunction* fromJunction, GNEJunction* toJunction, double arrivalPosition); + /// @brief destructor ~GNEWalk(); @@ -84,7 +96,7 @@ void writeDemandElement(OutputDevice& device) const; /// @brief check if current demand element is valid to be writed into XML (by default true, can be reimplemented in children) - bool isDemandElementValid() const; + Problem isDemandElementValid() const; /// @brief return a string with the current demand element problem (by default empty, can be reimplemented in children) std::string getDemandElementProblem() const; @@ -249,8 +261,8 @@ /// @brief method for setting the attribute and nothing else void setAttribute(SumoXMLAttr key, const std::string& value); - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief set move shape void setMoveShape(const GNEMoveResult& moveResult); diff -Nru sumo-1.11.0/src/netedit/elements/GNEAttributeCarrier.cpp sumo-1.12.0/src/netedit/elements/GNEAttributeCarrier.cpp --- sumo-1.11.0/src/netedit/elements/GNEAttributeCarrier.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/GNEAttributeCarrier.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -35,13 +35,11 @@ // =========================================================================== std::map GNEAttributeCarrier::myTagProperties; -GNETagProperties GNEAttributeCarrier::dummyTagProperty; const std::string GNEAttributeCarrier::FEATURE_LOADED = "loaded"; const std::string GNEAttributeCarrier::FEATURE_GUESSED = "guessed"; const std::string GNEAttributeCarrier::FEATURE_MODIFIED = "modified"; const std::string GNEAttributeCarrier::FEATURE_APPROVED = "approved"; const size_t GNEAttributeCarrier::MAXNUMBEROFATTRIBUTES = 128; -const double GNEAttributeCarrier::INVALID_POSITION(-1000000); // =========================================================================== @@ -49,9 +47,10 @@ // =========================================================================== GNEAttributeCarrier::GNEAttributeCarrier(const SumoXMLTag tag, GNENet* net) : - myTagProperty(getTagProperties(tag)), + myTagProperty(getTagProperty(tag)), myNet(net), - mySelected(false) { + mySelected(false), + myIsTemplate(false) { } @@ -107,6 +106,19 @@ } +void +GNEAttributeCarrier::resetDefaultValues() { + for (const auto& attrProperty : myTagProperty) { + if (attrProperty.hasDefaultValue()) { + setAttribute(attrProperty.getAttr(), attrProperty.getDefaultValue()); + if (attrProperty.isActivatable()) { + toogleAttribute(attrProperty.getAttr(), attrProperty.getDefaultActivated(), -1); + } + } + } +} + + template<> int GNEAttributeCarrier::parse(const std::string& string) { return StringUtils::toInt(string); @@ -201,7 +213,7 @@ template<> SUMOVehicleShape GNEAttributeCarrier::parse(const std::string& string) { if ((string == "unknown") || (!SumoVehicleShapeStrings.hasString(string))) { - return SVS_UNKNOWN; + return SUMOVehicleShape::UNKNOWN; } else { return SumoVehicleShapeStrings.get(string); } @@ -562,12 +574,6 @@ } -const GNETagProperties& -GNEAttributeCarrier::getTagProperty() const { - return myTagProperty; -} - - FXIcon* GNEAttributeCarrier::getIcon() const { // define on first access @@ -577,22 +583,31 @@ return GUIIconSubSys::getIcon(myTagProperty.getGUIIcon()); } + +bool +GNEAttributeCarrier::isTemplate() const { + return myIsTemplate; +} + + +const GNETagProperties& +GNEAttributeCarrier::getTagProperty() const { + return myTagProperty; +} + // =========================================================================== // static methods // =========================================================================== const GNETagProperties& -GNEAttributeCarrier::getTagProperties(SumoXMLTag tag) { - if (tag == SUMO_TAG_NOTHING) { - return dummyTagProperty; - } +GNEAttributeCarrier::getTagProperty(SumoXMLTag tag) { // define on first access if (myTagProperties.size() == 0) { fillAttributeCarriers(); } // check that tag is defined if (myTagProperties.count(tag) == 0) { - throw ProcessError("Attributes for tag '" + toString(tag) + "' not defined"); + throw ProcessError("TagProperty for tag '" + toString(tag) + "' not defined"); } else { return myTagProperties.at(tag); } @@ -600,25 +615,8 @@ const std::vector -GNEAttributeCarrier::allowedAttributeProperties(const bool onlyDrawables) { - std::vector attributeProperties; - // define on first access - if (myTagProperties.size() == 0) { - fillAttributeCarriers(); - } - // fill all tags - for (const auto& tagProperty : myTagProperties) { - if (!onlyDrawables || !tagProperty.second.isNotDrawable()) { - attributeProperties.push_back(tagProperty.second); - } - } - return attributeProperties; -} - - -const std::vector > -GNEAttributeCarrier::getAllowedTagPropertiesByCategory(const int tagPropertyCategory, const bool onlyDrawables) { - std::vector > allowedTags; +GNEAttributeCarrier::getTagPropertiesByType(const int tagPropertyCategory) { + std::vector allowedTags; // define on first access if (myTagProperties.size() == 0) { fillAttributeCarriers(); @@ -626,8 +624,8 @@ if (tagPropertyCategory & GNETagProperties::NETWORKELEMENT) { // fill networkElements tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isNetworkElement() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isNetworkElement()) { + allowedTags.push_back(tagProperty.second); } } } @@ -635,8 +633,8 @@ // fill additional tags for (const auto& tagProperty : myTagProperties) { // avoid symbols (It will be implemented in #7355) - if (!tagProperty.second.isSymbol() && tagProperty.second.isAdditionalElement() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (!tagProperty.second.isSymbol() && tagProperty.second.isAdditionalElement()) { + allowedTags.push_back(tagProperty.second); } } } @@ -644,152 +642,151 @@ // fill symbol tags for (const auto& tagProperty : myTagProperties) { if (tagProperty.second.isSymbol()) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::SHAPE) { // fill shape tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isShape() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isShape()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::TAZELEMENT) { // fill taz tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isTAZElement() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isTAZElement()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::DEMANDELEMENT) { // fill demand tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isDemandElement() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isDemandElement()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::ROUTE) { // fill route tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isRoute() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isRoute()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::VEHICLE) { - // fill vehicle tags (Special case) - allowedTags.push_back(std::make_pair(myTagProperties.at(SUMO_TAG_TRIP), "trip")); - allowedTags.push_back(std::make_pair(myTagProperties.at(SUMO_TAG_VEHICLE), "vehicle (over route)")); - allowedTags.push_back(std::make_pair(myTagProperties.at(GNE_TAG_VEHICLE_WITHROUTE), "vehicle (embedded route)")); - allowedTags.push_back(std::make_pair(myTagProperties.at(SUMO_TAG_FLOW), "flow (from-to)")); - allowedTags.push_back(std::make_pair(myTagProperties.at(GNE_TAG_FLOW_ROUTE), "flow (over route)")); - allowedTags.push_back(std::make_pair(myTagProperties.at(GNE_TAG_FLOW_WITHROUTE), "flow (embedded route)")); + // fill vehicle tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isVehicle()) { + allowedTags.push_back(tagProperty.second); + } + } } if (tagPropertyCategory & GNETagProperties::STOP) { // fill stop tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isStop() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isStop()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::PERSON) { // fill person tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isPerson() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isPerson()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::PERSONPLAN) { // fill person plan tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isPersonPlan() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isPersonPlan()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::PERSONTRIP) { // fill demand tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isPersonTrip() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isPersonTrip()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::WALK) { // fill demand tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isWalk() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isWalk()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::RIDE) { // fill demand tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isRide() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isRide()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::STOPPERSON) { // fill demand tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isStopPerson() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isStopPerson()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::GENERICDATA) { // fill generic data tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isGenericData() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isGenericData()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::CONTAINER) { // fill container tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isContainer() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isContainer()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::CONTAINERPLAN) { // fill container plan tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isContainerPlan() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isContainerPlan()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::TRANSPORT) { // fill demand tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isTransportPlan() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isTransportPlan()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::TRANSHIP) { // fill demand tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isTranshipPlan() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isTranshipPlan()) { + allowedTags.push_back(tagProperty.second); } } } if (tagPropertyCategory & GNETagProperties::STOPCONTAINER) { // fill demand tags for (const auto& tagProperty : myTagProperties) { - if (tagProperty.second.isStopContainer() && (!onlyDrawables || !tagProperty.second.isNotDrawable())) { - allowedTags.push_back(std::make_pair(tagProperty.second, tagProperty.second.getTagStr())); + if (tagProperty.second.isStopContainer()) { + allowedTags.push_back(tagProperty.second); } } } @@ -801,6 +798,16 @@ // =========================================================================== void +GNEAttributeCarrier::resetAttributes() { + for (const auto& attrProperty : myTagProperty) { + if (attrProperty.hasDefaultValue()) { + setAttribute(attrProperty.getAttr(), attrProperty.getDefaultValue()); + } + } +} + + +void GNEAttributeCarrier::fillAttributeCarriers() { // fill all groups of ACs fillNetworkElements(); @@ -824,7 +831,7 @@ fillContainerStopElements(); //data fillDataElements(); - // check integrity of all Tags (function checkTagIntegrity() throw an exception if there is an inconsistency) + // check integrity of all Tags (function checkTagIntegrity() throws an exception if there is an inconsistency) for (const auto& tagProperty : myTagProperties) { tagProperty.second.checkTagIntegrity(); } @@ -851,7 +858,7 @@ GUIIcon::JUNCTION, currentTag); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of the node"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -861,55 +868,55 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE, "An optional type for the node"); attrProperty.setDiscreteValues(nodeTypes); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_SHAPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "A custom shape for that node"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_RADIUS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "Optional turning radius (for all corners) for that node in meters", "1.5"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_KEEP_CLEAR, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "Whether the junction-blocking-heuristic should be activated at this node", "1"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_RIGHT_OF_WAY, - GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE, "How to compute right of way rules at this node", SUMOXMLDefinitions::RightOfWayValues.getString(RightOfWay::DEFAULT)); attrProperty.setDiscreteValues(SUMOXMLDefinitions::RightOfWayValues.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRINGE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE, "Whether this junction is at the fringe of the network", SUMOXMLDefinitions::FringeTypeValues.getString(FringeType::DEFAULT)); attrProperty.setDiscreteValues(SUMOXMLDefinitions::FringeTypeValues.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Optional name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TLTYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE, "An optional type for the traffic light algorithm"); attrProperty.setDiscreteValues({toString(TrafficLightType::STATIC), toString(TrafficLightType::ACTUATED), toString(TrafficLightType::DELAYBASED)}); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TLLAYOUT, - GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE, "An optional layout for the traffic light plan"); attrProperty.setDiscreteValues({toString(TrafficLightLayout::DEFAULT), toString(TrafficLightLayout::OPPOSITES), @@ -918,7 +925,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TLID, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "An optional id for the traffic light program"); myTagProperties[currentTag].addAttribute(attrProperty); } @@ -928,7 +935,7 @@ myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::NETWORKELEMENT, GNETagProperties::NOTDRAWABLE | GNETagProperties::NOTSELECTABLE, - GUIIcon::TYPE, currentTag); + GUIIcon::EDGETYPE, currentTag); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, @@ -936,91 +943,59 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NUMLANES, - GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The number of lanes of the edge", toString(oc.getInt("default.lanenumber"))); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The maximum speed allowed on the edge in m/s", toString(oc.getFloat("default.speed"))); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ALLOW, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Explicitly allows the given vehicle classes (not given will be not allowed)", "all"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DISALLOW, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Explicitly disallows the given vehicle classes (not given will be allowed)"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_SPREADTYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE, "The spreadType defines how to compute the lane geometry from the edge geometry (used for visualization)", SUMOXMLDefinitions::LaneSpreadFunctions.getString(LaneSpreadFunction::RIGHT)); attrProperty.setDiscreteValues(SUMOXMLDefinitions::LaneSpreadFunctions.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PRIORITY, - GNEAttributeProperties::INT | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::INT | GNEAttributeProperties::DEFAULTVALUE, "The priority of the edge", toString(oc.getInt("default.priority"))); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "Lane width for all lanes of this edge in meters (used for visualization)", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); + /* + implement in #9725 - /* */ - - attrProperty = GNEAttributeProperties(SUMO_ATTR_ONEWAY, - GNEAttributeProperties::BOOL, - "Whether one-way traffic is mostly common for this edgeType"); - myTagProperties[currentTag].addAttribute(attrProperty); - - - attrProperty = GNEAttributeProperties(SUMO_ATTR_DISCARD, - GNEAttributeProperties::BOOL, - "Whether edges of this edgeType shall be discarded"); - myTagProperties[currentTag].addAttribute(attrProperty); - - - attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTHRESOLUTION, - GNEAttributeProperties::FLOAT, - "The resolution for interpreting custom (noisy) lane widths of this edgeType [m]"); - myTagProperties[currentTag].addAttribute(attrProperty); - - - attrProperty = GNEAttributeProperties(SUMO_ATTR_MAXWIDTH, - GNEAttributeProperties::FLOAT, - "The maximum width for lanes of this edgeType [m]"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = GNEAttributeProperties(SUMO_ATTR_MINWIDTH, - GNEAttributeProperties::FLOAT, - "The maximum width for lanes of this edgeType [m]"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = GNEAttributeProperties(SUMO_ATTR_SIDEWALKWIDTH, - GNEAttributeProperties::FLOAT, - "The width of the sidewalk that should be added as an additional lane"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = GNEAttributeProperties(SUMO_ATTR_BIKELANEWIDTH, - GNEAttributeProperties::FLOAT, - "The width of the bike lane that should be added as an additional lane"); - myTagProperties[currentTag].addAttribute(attrProperty); - - /* */ - + attrProperty = GNEAttributeProperties(SUMO_ATTR_SIDEWALKWIDTH, + GNEAttributeProperties::FLOAT, + "The width of the sidewalk that should be added as an additional lane"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_BIKELANEWIDTH, + GNEAttributeProperties::FLOAT, + "The width of the bike lane that should be added as an additional lane"); + myTagProperties[currentTag].addAttribute(attrProperty); + */ } currentTag = SUMO_TAG_LANETYPE; { @@ -1031,26 +1006,24 @@ GUIIcon::LANETYPE, currentTag); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The maximum speed allowed on the lane in m/s", toString(oc.getFloat("default.speed"))); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ALLOW, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Explicitly allows the given vehicle classes (not given will be not allowed)", "all"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DISALLOW, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Explicitly disallows the given vehicle classes (not given will be allowed)"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "Lane width for all lanes of this lane in meters (used for visualization)", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1064,7 +1037,7 @@ GUIIcon::EDGE, currentTag); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of the edge"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1079,43 +1052,41 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The maximum speed allowed on the edge in m/s", toString(oc.getFloat("default.speed"))); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PRIORITY, - GNEAttributeProperties::INT | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::INT | GNEAttributeProperties::DEFAULTVALUE, "The priority of the edge", toString(oc.getInt("default.priority"))); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NUMLANES, - GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The number of lanes of the edge", toString(oc.getInt("default.lanenumber"))); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "The name of a type within the SUMO edge type file"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ALLOW, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Explicitly allows the given vehicle classes (not given will be not allowed)", "all"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DISALLOW, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Explicitly disallows the given vehicle classes (not given will be allowed)"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_SHAPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "If the shape is given it should start and end with the positions of the from-node and to-node"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1125,58 +1096,58 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_SPREADTYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE, "The spreadType defines how to compute the lane geometry from the edge geometry (used for visualization)", SUMOXMLDefinitions::LaneSpreadFunctions.getString(LaneSpreadFunction::RIGHT)); attrProperty.setDiscreteValues(SUMOXMLDefinitions::LaneSpreadFunctions.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "street name (need not be unique, used for visualization)"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "Lane width for all lanes of this edge in meters (used for visualization)", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ENDOFFSET, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "Move the stop line back from the intersection by the given amount", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(GNE_ATTR_SHAPE_START, - GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, // virtual attribute used to define an endPoint + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, // virtual attribute used to define an endPoint "Custom position in which shape start (by default position of junction from)"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(GNE_ATTR_SHAPE_END, - GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, // virtual attribute from to define an endPoint + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, // virtual attribute from to define an endPoint "Custom position in which shape end (by default position of junction from)"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(GNE_ATTR_BIDIR, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC, // virtual attribute to check of this edge is part of a bidirectional railway (cannot be edited) + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, // virtual attribute to check of this edge is part of a bidirectional railway (cannot be edited) "Show if edge is bidireccional", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DISTANCE, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UNIQUE, "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(GNE_ATTR_STOPOFFSET, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The stop offset as positive value in meters", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(GNE_ATTR_STOPOEXCEPTION, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Specifies, for which vehicle classes the stopOffset does NOT apply.", ""); attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); @@ -1191,7 +1162,7 @@ GUIIcon::LANE, currentTag); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "ID of lane (Automatic, non editable)"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1201,79 +1172,77 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "Speed in meters per second", "13.89"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ALLOW, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Explicitly allows the given vehicle classes (not given will be not allowed)", "all"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DISALLOW, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Explicitly disallows the given vehicle classes (not given will be allowed)"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "Width in meters (used for visualization)", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ENDOFFSET, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "Move the stop line back from the intersection by the given amount", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ACCELERATION, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "Enable or disable lane as acceleration lane", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CUSTOMSHAPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, "If the shape is given it overrides the computation based on edge shape"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(GNE_ATTR_OPPOSITE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UNIQUE, "If given, this defines the opposite direction lane"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CHANGE_LEFT, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Permit changing left only for to the given vehicle classes", "all"); attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CHANGE_RIGHT, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Permit changing right only for to the given vehicle classes", "all"); attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Lane type description (optional)"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(GNE_ATTR_STOPOFFSET, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The stop offset as positive value in meters", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(GNE_ATTR_STOPOEXCEPTION, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Specifies, for which vehicle classes the stopOffset does NOT apply.", ""); attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); @@ -1288,7 +1257,7 @@ GUIIcon::CROSSING, currentTag); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The ID of Crossing"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1298,31 +1267,31 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PRIORITY, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "Whether the pedestrians have priority over the vehicles (automatically set to true at tls-controlled intersections)", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The width of the crossings", toString(OptionsCont::getOptions().getFloat("default.crossing-width"))); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TLLINKINDEX, - GNEAttributeProperties::INT | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::INT | GNEAttributeProperties::DEFAULTVALUE, "sets the tls-index for this crossing", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TLLINKINDEX2, - GNEAttributeProperties::INT | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::INT | GNEAttributeProperties::DEFAULTVALUE, "sets the opposite-direction tls-index for this crossing", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CUSTOMSHAPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "Overrids default shape of pedestrian crossing"); myTagProperties[currentTag].addAttribute(attrProperty); } @@ -1355,99 +1324,97 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PASS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "if set, vehicles which pass this (lane-2-lane) connection) will not wait", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_KEEP_CLEAR, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "if set to false, vehicles which pass this (lane-2-lane) connection) will not worry about blocking the intersection", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CONTPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "If set to a more than 0 value, an internal junction will be built at this position (in m) from the start of the internal lane for this connection", toString(NBEdge::UNSPECIFIED_CONTPOS)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_UNCONTROLLED, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set to true, This connection will not be TLS-controlled despite its node being controlled", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_VISIBILITY_DISTANCE, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "Vision distance between vehicles", toString(NBEdge::UNSPECIFIED_VISIBILITY_DISTANCE)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TLLINKINDEX, - GNEAttributeProperties::INT | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::INT | GNEAttributeProperties::DEFAULTVALUE, "sets index of this connection within the controlling trafficlight", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TLLINKINDEX2, - GNEAttributeProperties::INT | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::INT | GNEAttributeProperties::DEFAULTVALUE, "sets index for the internal junction of this connection within the controlling trafficlight", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ALLOW, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Explicitly allows the given vehicle classes (not given will be not allowed)", "all"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DISALLOW, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Explicitly disallows the given vehicle classes (not given will be allowed)"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "sets custom speed limit for the connection", toString(NBEdge::UNSPECIFIED_SPEED)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LENGTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "sets custom length for the connection", toString(NBEdge::UNSPECIFIED_LOADED_LENGTH)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CUSTOMSHAPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "sets custom shape for the connection"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CHANGE_LEFT, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Permit changing left only for to the given vehicle classes", "all"); attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CHANGE_RIGHT, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "Permit changing right only for to the given vehicle classes", "all"); attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_INDIRECT, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "if set to true, vehicles will make a turn in 2 steps", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "set a custom edge type (for applying vClass-specific speed restrictions)"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1488,7 +1455,7 @@ GUIIcon::BUSSTOP, currentTag, {}, FXRGBA(240, 255, 205, 255)); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of bus stop"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1498,47 +1465,46 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_STARTPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The begin position on the lane (the lower position on the lane) in meters"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ENDPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LINES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "Meant to be the names of the bus lines that stop at this bus stop. This is only used for visualization purposes"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PERSON_CAPACITY, - GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "Larger numbers of persons trying to enter will create an upstream jam on the sidewalk", "6"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PARKING_LENGTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE, "Optional space definition for vehicles that park at this stop", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "The RGBA color with which the busStop shall be displayed", - ""); + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUE, + "The RGBA color with which the busStop shall be displayed"); myTagProperties[currentTag].addAttribute(attrProperty); } @@ -1551,7 +1517,7 @@ GUIIcon::TRAINSTOP, currentTag, {}, FXRGBA(240, 255, 205, 255)); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of train stop"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1561,47 +1527,46 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_STARTPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The begin position on the lane (the lower position on the lane) in meters"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ENDPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LINES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "Meant to be the names of the train lines that stop at this train stop. This is only used for visualization purposes"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PERSON_CAPACITY, - GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "Larger numbers of persons trying to enter will create an upstream jam on the sidewalk", "6"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PARKING_LENGTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE, "Optional space definition for vehicles that park at this stop", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "The RGBA color with which the trainStop shall be displayed", - ""); + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUE, + "The RGBA color with which the trainStop shall be displayed"); myTagProperties[currentTag].addAttribute(attrProperty); } @@ -1619,19 +1584,19 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The position on the lane (the lower position on the lane) in meters", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LENGTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The walking length of the access in meters", "-1.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1646,7 +1611,7 @@ GUIIcon::CONTAINERSTOP, currentTag, {}, FXRGBA(240, 255, 205, 255)); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of container stop"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1656,47 +1621,46 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_STARTPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The begin position on the lane (the lower position on the lane) in meters"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ENDPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LINES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "meant to be the names of the bus lines that stop at this container stop. This is only used for visualization purposes"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CONTAINER_CAPACITY, - GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "Larger numbers of container trying to enter will create an upstream jam on the sidewalk", "6"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PARKING_LENGTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE, "Optional space definition for vehicles that park at this stop", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "The RGBA color with which the containerStop shall be displayed", - ""); + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUE, + "The RGBA color with which the containerStop shall be displayed"); myTagProperties[currentTag].addAttribute(attrProperty); } currentTag = SUMO_TAG_CHARGING_STATION; @@ -1708,7 +1672,7 @@ GUIIcon::CHARGINGSTATION, currentTag, {}, FXRGBA(240, 255, 205, 255)); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of charging station"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1718,47 +1682,47 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_STARTPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "Begin position in the specified lane"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ENDPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "End position in the specified lane"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CHARGINGPOWER, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "Charging power in W", "22000.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_EFFICIENCY, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::RANGE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::RANGE | GNEAttributeProperties::DEFAULTVALUE, "Charging efficiency [0,1]", "0.95"); attrProperty.setRange(0, 1); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CHARGEINTRANSIT, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "Enable or disable charge in transit, i.e. vehicle must or must not to stop for charging", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CHARGEDELAY, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "Time delay after the vehicles has reached / stopped on the charging station, before the energy transfer (charging) begins", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1768,11 +1732,11 @@ // set values of tag myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT | GNETagProperties::STOPPINGPLACE, - GNETagProperties::RTREE | GNETagProperties::MASKSTARTENDPOS, + GNETagProperties::MASKSTARTENDPOS, GUIIcon::PARKINGAREA, currentTag, {}, FXRGBA(240, 255, 205, 255)); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of ParkingArea"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1782,57 +1746,57 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_STARTPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The begin position on the lane (the lower position on the lane) in meters"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ENDPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The end position on the lane (the higher position on the lane) in meters, must be larger than startPos by more than 0.1m"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTPOS, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "Lane position in that vehicle must depart when leaves parkingArea"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ROADSIDE_CAPACITY, - GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, " The number of parking spaces for road-side parking", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ONROAD, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, vehicles will park on the road lane and thereby reducing capacity", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The width of the road-side parking spaces", toString(SUMO_const_laneWidth)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LENGTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The length of the road-side parking spaces. By default (endPos - startPos) / roadsideCapacity", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ANGLE, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::ANGLE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::ANGLE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The angle of the road-side parking spaces relative to the lane angle, positive means clockwise", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1843,7 +1807,7 @@ // set values of tag myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, - GNETagProperties::MASKXYZPOSITION | GNETagProperties::CHILD | GNETagProperties::REPARENT, + GNETagProperties::CHILD | GNETagProperties::REPARENT, GUIIcon::PARKINGSPACE, currentTag, {SUMO_TAG_PARKING_AREA}, FXRGBA(240, 255, 205, 255)); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, @@ -1852,27 +1816,27 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The width of the road-side parking spaces"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LENGTH, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The length of the road-side parking spaces"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ANGLE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The angle of the road-side parking spaces relative to the lane angle, positive means clockwise"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_SLOPE, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::ANGLE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::ANGLE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The slope of the road-side parking spaces", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1887,7 +1851,7 @@ GUIIcon::E1, currentTag, {}, FXRGBA(240, 238, 249, 255)); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of E1"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1902,28 +1866,28 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FREQUENCY, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "The aggregation period the values the detector collects shall be summed up", "300.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE, - GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUE, "The path to the output file"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "Space separated list of vehicle type ids to consider"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1939,7 +1903,7 @@ myTagProperties[currentTag].addDeprecatedAttribute(SUMO_ATTR_CONT); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of E2"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -1954,57 +1918,57 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LENGTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The length of the detector in meters", "10.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FREQUENCY, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "The aggregation period the values the detector collects shall be summed up", "300.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TLID, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "The traffic light that triggers aggregation when switching"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE, - GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUE, "The path to the output file"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "Space separated list of vehicle type ids to consider"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_HALTING_TIME_THRESHOLD, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting)", "1.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_HALTING_SPEED_THRESHOLD, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting) in m/s", "1.39"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_JAM_DIST_THRESHOLD, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam) in m", "10.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2020,7 +1984,7 @@ myTagProperties[currentTag].addDeprecatedAttribute(SUMO_ATTR_CONT); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of Multilane E2"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2040,51 +2004,51 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FREQUENCY, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "The aggregation period the values the detector collects shall be summed up", "300.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TLID, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "The traffic light that triggers aggregation when switching"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE, - GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUE, "The path to the output file"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "Space separated list of vehicle type ids to consider"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_HALTING_TIME_THRESHOLD, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting)", "1.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_HALTING_SPEED_THRESHOLD, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting) in m/s", "1.39"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_JAM_DIST_THRESHOLD, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam) in m", "10.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2099,45 +2063,45 @@ GUIIcon::E3, currentTag, {}, FXRGBA(240, 238, 249, 255)); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of E3"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, - GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "X-Y position of detector in editor (Only used in NETEDIT)", "0,0"); // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FREQUENCY, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "The aggregation period the values the detector collects shall be summed up", "300.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE, - GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUE, "The path to the output file"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "Space separated list of vehicle type ids to consider"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_HALTING_TIME_THRESHOLD, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting) in s", "1.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_HALTING_SPEED_THRESHOLD, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE, "The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting) in m/s", "1.39"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2161,7 +2125,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2186,7 +2150,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2201,7 +2165,7 @@ GUIIcon::E1INSTANT, currentTag, {}, FXRGBA(240, 238, 249, 255)); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of Instant Induction Loop (E1Instant)"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2216,22 +2180,22 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE, - GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUE, "The path to the output file"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "Space separated list of vehicle type ids to consider"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2248,28 +2212,28 @@ myTagProperties[currentTag].addDeprecatedAttribute(SUMO_ATTR_FILE); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of Variable Speed Signal"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, - GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "X-Y position of detector in editor (Only used in NETEDIT)", "0,0"); // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LANES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, "List of Variable Speed Sign lanes"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "Space separated list of vehicle type ids to consider (empty to affect all types)"); myTagProperties[currentTag].addAttribute(attrProperty); } @@ -2295,7 +2259,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Speed", "13.89"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2309,7 +2273,7 @@ GUIIcon::CALIBRATOR, currentTag, {}, FXRGBA(253, 255, 206, 255)); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of Calibrator"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2319,40 +2283,40 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The position of the calibrator on the specified lane", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FREQUENCY, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "The aggregation interval in which to calibrate the flows. Default is step-length", "1.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ROUTEPROBE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "The id of the routeProbe element from which to determine the route distribution for generated vehicles"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_OUTPUT, - GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUE, "The output file for writing calibrator information or NULL"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_JAM_DIST_THRESHOLD, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "A threshold value to detect and clear unexpected jamming", "0.50"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "space separated list of vehicle type ids to consider (empty to affect all types)"); myTagProperties[currentTag].addAttribute(attrProperty); } @@ -2365,7 +2329,7 @@ GUIIcon::CALIBRATOR, SUMO_TAG_CALIBRATOR, {}, FXRGBA(253, 255, 206, 255)); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of Calibrator"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2375,40 +2339,40 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The position of the calibrator on the specified lane", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FREQUENCY, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "The aggregation interval in which to calibrate the flows. Default is step-length", "1.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ROUTEPROBE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "The id of the routeProbe element from which to determine the route distribution for generated vehicles"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_OUTPUT, - GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUE, "The output file for writing calibrator information or NULL"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_JAM_DIST_THRESHOLD, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "A threshold value to detect and clear unexpected jamming", "0.50"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "space separated list of vehicle type ids to consider (empty to affect all types)"); myTagProperties[currentTag].addAttribute(attrProperty); } @@ -2420,40 +2384,43 @@ GNETagProperties::CHILD, GUIIcon::FLOW, SUMO_TAG_FLOW, {SUMO_TAG_CALIBRATOR}, FXRGBA(253, 255, 206, 255)); // set values of attributes - attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, - "The id of the vehicle type to use for this " + toString(currentTag), - DEFAULT_VTYPE_ID); - myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_ROUTE, GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, "The id of the route the vehicle shall drive along"); myTagProperties[currentTag].addAttribute(attrProperty); - // fill common vehicle attributes - fillCommonVehicleAttributes(currentTag); - attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "First " + toString(currentTag) + " departure time", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_END, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "End of departure interval", "3600"); myTagProperties[currentTag].addAttribute(attrProperty); + // fill common vehicle attributes + fillCommonVehicleAttributes(currentTag); + + // optional attributes (at least one must be defined) + attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::ACTIVATABLE, + "The id of the vehicle type to use for this " + toString(currentTag), + DEFAULT_VTYPE_ID); + myTagProperties[currentTag].addAttribute(attrProperty); + attrProperty = GNEAttributeProperties(SUMO_ATTR_VEHSPERHOUR, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::ACTIVATABLE, - "Number of " + toString(currentTag) + "s per hour, equally spaced"); + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::ACTIVATABLE, + "Number of " + toString(currentTag) + "s per hour, equally spaced", + "1800"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::ACTIVATABLE, - "Speed of " + toString(currentTag) + "s"); + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::ACTIVATABLE, + "Speed of " + toString(currentTag) + "s", + "15.0"); myTagProperties[currentTag].addAttribute(attrProperty); } currentTag = SUMO_TAG_REROUTER; @@ -2466,7 +2433,7 @@ // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of Rerouter"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2476,40 +2443,40 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, - GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "X,Y position in editor (Only used in NETEDIT)", "0,0"); // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE, - GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUE, "The path to the definition file (alternatively, the intervals may defined as children of the rerouter)"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::PROBABILITY | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::PROBABILITY | GNEAttributeProperties::DEFAULTVALUE, "The probability for vehicle rerouting (0-1)", "1.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_HALTING_TIME_THRESHOLD, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "The waiting time threshold (in s) that must be reached to activate rerouting (default -1 which disables the threshold)", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "The list of vehicle types that shall be affected by this rerouter (empty to affect all types)"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_OFF, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "Whether the router should be inactive initially (and switched on in the gui)", "0"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2531,13 +2498,13 @@ GUIIcon::REROUTERINTERVAL, currentTag, {SUMO_TAG_REROUTER}, FXRGBA(255, 213, 213, 255)); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE, "Begin", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_END, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE, "End", "3600"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2557,12 +2524,12 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ALLOW, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "allowed vehicles"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DISALLOW, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "disallowed vehicles"); myTagProperties[currentTag].addAttribute(attrProperty); } @@ -2581,12 +2548,12 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ALLOW, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "allowed vehicles"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DISALLOW, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::VCLASSES, "disallowed vehicles"); myTagProperties[currentTag].addAttribute(attrProperty); } @@ -2605,7 +2572,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE, "SUMO Probability", "1.00"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2625,13 +2592,13 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE, "SUMO Probability", "1.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_VISIBLE, - GNEAttributeProperties::BOOL | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "Enable or disable visibility for parking area reroutes", "1"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2651,7 +2618,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE, "SUMO Probability", "1.00"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2665,7 +2632,7 @@ GUIIcon::ROUTEPROBE, currentTag, {}, FXRGBA(240, 240, 240, 255)); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of RouteProbe"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2675,23 +2642,23 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FREQUENCY, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "The frequency in which to report the distribution", "3600.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE, - GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUE, "The file for generated output"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "The time at which to start generating output", "0"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2705,24 +2672,24 @@ GUIIcon::VAPORIZER, currentTag, {}, FXRGBA(240, 240, 240, 255)); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::AUTOMATICID, "Edge in which vaporizer is placed"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "Start Time", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_END, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "End Time", "3600"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); } @@ -2743,7 +2710,7 @@ GUIIcon::POLY, currentTag); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of the polygon"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2753,54 +2720,54 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUE, "The RGBA color with which the polygon shall be displayed", "red"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FILL, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "An information whether the polygon shall be filled", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LINEWIDTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The default line width for drawing an unfilled polygon", "1"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LAYER, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE, "The layer in which the polygon lies", toString(Shape::DEFAULT_LAYER)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "A typename for the polygon", toString(Shape::DEFAULT_TYPE)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_IMGFILE, - GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUE, "A bitmap to use for rendering this polygon", toString(Shape::DEFAULT_IMG_FILE)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_RELATIVEPATH, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "Enable or disable use image file as a relative path", toString(Shape::DEFAULT_RELATIVEPATH)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ANGLE, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::ANGLE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::ANGLE | GNEAttributeProperties::DEFAULTVALUE, "Angle of rendered image in degree", toString(Shape::DEFAULT_ANGLE)); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2810,11 +2777,11 @@ // set values of tag myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::SHAPE, - GNETagProperties::RTREE | GNETagProperties::MASKXYZPOSITION, + GNETagProperties::RTREE, GUIIcon::POI, currentTag); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of the " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2824,54 +2791,54 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUE, "The color with which the " + toString(currentTag) + " shall be displayed", "red"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "A typename for the " + toString(currentTag), toString(Shape::DEFAULT_TYPE)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LAYER, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE, "The layer of the " + toString(currentTag) + " for drawing and selecting", toString(Shape::DEFAULT_LAYER_POI)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "Width of rendered image in meters", toString(Shape::DEFAULT_IMG_WIDTH)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_HEIGHT, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "Height of rendered image in meters", toString(Shape::DEFAULT_IMG_HEIGHT)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_IMGFILE, - GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUE, "A bitmap to use for rendering this " + toString(currentTag), toString(Shape::DEFAULT_IMG_FILE)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_RELATIVEPATH, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "Enable or disable use image file as a relative path", toString(Shape::DEFAULT_RELATIVEPATH)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ANGLE, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::ANGLE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::ANGLE | GNEAttributeProperties::DEFAULTVALUE, "Angle of rendered image in degree", toString(Shape::DEFAULT_ANGLE)); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2885,7 +2852,7 @@ GUIIcon::POILANE, SUMO_TAG_POI); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of the " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2900,66 +2867,66 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION_LAT, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The lateral offset on the named lane at which the " + toString(currentTag) + " is located at", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUE, "The color with which the " + toString(currentTag) + " shall be displayed", "red"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "A typename for the " + toString(currentTag), toString(Shape::DEFAULT_TYPE)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LAYER, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE, "The layer of the " + toString(currentTag) + " for drawing and selecting", toString(Shape::DEFAULT_LAYER_POI)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "Width of rendered image in meters", toString(Shape::DEFAULT_IMG_WIDTH)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_HEIGHT, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "Height of rendered image in meters", toString(Shape::DEFAULT_IMG_HEIGHT)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_IMGFILE, - GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUE, "A bitmap to use for rendering this " + toString(currentTag), toString(Shape::DEFAULT_IMG_FILE)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_RELATIVEPATH, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "Enable or disable use image file as a relative path", toString(Shape::DEFAULT_RELATIVEPATH)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ANGLE, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::ANGLE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::ANGLE | GNEAttributeProperties::DEFAULTVALUE, "Angle of rendered image in degree", toString(Shape::DEFAULT_ANGLE)); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2969,11 +2936,11 @@ // set values of tag myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::SHAPE, - GNETagProperties::RTREE, + GNETagProperties::RTREE | GNETagProperties::REQUIERE_PROJ, GUIIcon::POIGEO, SUMO_TAG_POI); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of the " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); @@ -2989,54 +2956,54 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUE, "The color with which the " + toString(currentTag) + " shall be displayed", "red"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "A typename for the " + toString(currentTag), toString(Shape::DEFAULT_TYPE)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LAYER, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE, "The layer of the " + toString(currentTag) + " for drawing and selecting", toString(Shape::DEFAULT_LAYER_POI)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "Width of rendered image in meters", toString(Shape::DEFAULT_IMG_WIDTH)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_HEIGHT, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "Height of rendered image in meters", toString(Shape::DEFAULT_IMG_HEIGHT)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_IMGFILE, - GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUE, "A bitmap to use for rendering this " + toString(currentTag), toString(Shape::DEFAULT_IMG_FILE)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_RELATIVEPATH, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "Enable or disable use image file as a relative path", toString(Shape::DEFAULT_RELATIVEPATH)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ANGLE, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::ANGLE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::ANGLE | GNEAttributeProperties::DEFAULTVALUE, "Angle of rendered image in degree", toString(Shape::DEFAULT_ANGLE)); myTagProperties[currentTag].addAttribute(attrProperty); @@ -3058,34 +3025,34 @@ GUIIcon::TAZ, currentTag); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of the TAZ"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_SHAPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The shape of the TAZ"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CENTER, - GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "TAZ center"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FILL, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "An information whether the TAZ shall be filled", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUE, "The RGBA color with which the TAZ shall be displayed", "red"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Name of " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); } @@ -3104,7 +3071,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_WEIGHT, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "Depart weight associated to this Edge", "1"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -3124,7 +3091,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_WEIGHT, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "Arrival weight associated to this Edget", "1"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -3134,16 +3101,6 @@ void GNEAttributeCarrier::fillDemandElements() { - // first VClass separate between vehicles and persons - std::vector vClassesVehicles, vClassesPersons; - auto vClasses = SumoVehicleClassStrings.getStrings(); - for (const auto& i : vClasses) { - if (i == SumoVehicleClassStrings.getString(SVC_PEDESTRIAN)) { - vClassesPersons.push_back(i); - } else { - vClassesVehicles.push_back(i); - } - } // declare empty GNEAttributeProperties GNEAttributeProperties attrProperty; @@ -3158,7 +3115,7 @@ // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The id of Route"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -3168,19 +3125,18 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "This route's color", - "yellow"); + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUE, + "This route's color"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_REPEAT, - GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The number of times that the edges of this route shall be repeated", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CYCLETIME, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "When defining a repeating route with stops and those stops use the until attribute, the times will be shifted forward by 'cycleTime' on each repeat", "0"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -3200,23 +3156,36 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "This route's color", - "yellow"); + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUE, + "This route's color"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_REPEAT, - GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The number of times that the edges of this route shall be repeated", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CYCLETIME, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "When defining a repeating route with stops and those stops use the until attribute, the times will be shifted forward by 'cycleTime' on each repeat", "0"); myTagProperties[currentTag].addAttribute(attrProperty); } + currentTag = SUMO_TAG_VTYPE_DISTRIBUTION; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, + GNETagProperties::DEMANDELEMENT | GNETagProperties::VTYPE, + GNETagProperties::NOTDRAWABLE | GNETagProperties::NOTSELECTABLE | GNETagProperties::NOPARAMETERS, + GUIIcon::VTYPEDISTRIBUTION, currentTag); + + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of VehicleType distribution"); + myTagProperties[currentTag].addAttribute(attrProperty); + } currentTag = SUMO_TAG_VTYPE; { // set values of tag @@ -3231,153 +3200,158 @@ "The id of VehicleType"); myTagProperties[currentTag].addAttribute(attrProperty); + attrProperty = GNEAttributeProperties(GNE_ATTR_VTYPE_DISTRIBUTION, + GNEAttributeProperties::STRING, + "Vehicle Type Distribution"); + myTagProperties[currentTag].addAttribute(attrProperty); + attrProperty = GNEAttributeProperties(SUMO_ATTR_VCLASS, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE, "An abstract vehicle class", "passenger"); - attrProperty.setDiscreteValues(vClassesVehicles); + attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUE, "This vehicle type's color", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LENGTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE, "The vehicle's netto-length (length) [m]"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_MINGAP, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE, "Empty space after leader [m]"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_MAXSPEED, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE, "The vehicle's maximum velocity [m/s]"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEEDFACTOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::STRING | GNEAttributeProperties::EXTENDED, "The vehicles expected multiplicator for lane speed limits (or a distribution specifier)"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_EMISSIONCLASS, - GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::EXTENDED, "An abstract emission class"); attrProperty.setDiscreteValues(PollutantsInterface::getAllClassesStr()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_GUISHAPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::EXTENDED, "How this vehicle is rendered"); attrProperty.setDiscreteValues(SumoVehicleShapeStrings.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The vehicle's width [m] (only used for drawing)", "1.8"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_HEIGHT, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The vehicle's height [m] (only used for drawing)", "1.5"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_IMGFILE, - GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Image file for rendering vehicles of this type (should be grayscale to allow functional coloring)"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE_CHANGE_MODEL, - GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The model used for changing lanes", "default"); attrProperty.setDiscreteValues(SUMOXMLDefinitions::LaneChangeModels.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CAR_FOLLOW_MODEL, - GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The model used for car following", "Krauss"); attrProperty.setDiscreteValues(SUMOXMLDefinitions::CarFollowModels.getStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PERSON_CAPACITY, - GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::EXTENDED, "The number of persons (excluding an autonomous driver) the vehicle can transport"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CONTAINER_CAPACITY, - GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::EXTENDED, "The number of containers the vehicle can transport"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_BOARDING_DURATION, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The time required by a person to board the vehicle", "0.50"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LOADING_DURATION, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The time required to load a container onto the vehicle", "90.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LATALIGNMENT, - GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The preferred lateral alignment when using the sublane-model", "center"); attrProperty.setDiscreteValues(SUMOVTypeParameter::getLatAlignmentStrings()); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_MINGAP_LAT, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The minimum lateral gap at a speed difference of 50km/h when using the sublane-model", "0.12"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_MAXSPEED_LAT, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The maximum lateral speed when using the sublane-model", "1.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ACTIONSTEPLENGTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The interval length for which vehicle performs its decision logic (acceleration and lane-changing)", toString(OptionsCont::getOptions().getFloat("default.action-step-length"))); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The probability when being added to a distribution without an explicit probability", toString(DEFAULT_VEH_PROB)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_OSGFILE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "3D model file for this class", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CARRIAGE_LENGTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::EXTENDED, "Carriage lengths"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LOCOMOTIVE_LENGTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::EXTENDED, "Locomotive lengths"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CARRIAGE_GAP, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "GAP between carriages", "1"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -3391,87 +3365,116 @@ // fill VType Lane Change Model Parameters (implemented in a separated function to improve code legibility) fillLaneChangingModelAttributes(currentTag); } - currentTag = SUMO_TAG_PTYPE; +} + + +void +GNEAttributeCarrier::fillVehicleElements() { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + // fill vehicle ACs + SumoXMLTag currentTag = SUMO_TAG_TRIP; { // set values of tag myTagProperties[currentTag] = GNETagProperties(currentTag, - GNETagProperties::DEMANDELEMENT | GNETagProperties::VTYPE, - GNETagProperties::NOTDRAWABLE | GNETagProperties::NOTSELECTABLE, - GUIIcon::PTYPE, SUMO_TAG_VTYPE, {}); + GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE, + 0, + GUIIcon::TRIP, currentTag, {}, FXRGBA(240, 238, 249, 255)); + myTagProperties[currentTag].setFieldString("trip (from-to edges)"); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, - "The id of PersonType"); + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, + "The name of " + toString(currentTag) + "s that will be generated using this trip definition"); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_VCLASS, - GNEAttributeProperties::VCLASS | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "An abstract person class", - "pedestrian"); - attrProperty.setDiscreteValues(vClassesPersons); + attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The id of the " + toString(currentTag) + " type to use for this " + toString(currentTag), + DEFAULT_VTYPE_ID); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "This person type's color", - ""); + attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the edge the " + toString(currentTag) + " starts at"); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL, - "The person's width [m] (only used for drawing)"); + attrProperty = GNEAttributeProperties(SUMO_ATTR_TO, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the edge the " + toString(currentTag) + " ends at"); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_LENGTH, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL, - "The person's netto-length (length) [m]"); + attrProperty = GNEAttributeProperties(SUMO_ATTR_VIA, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::LIST, + "List of intermediate edge ids which shall be part of the " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_MINGAP, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL, - "Empty space after leader [m]"); + // add common attributes + fillCommonVehicleAttributes(currentTag); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPART, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, + "The departure time of the (first) " + toString(currentTag) + " which is generated using this " + toString(currentTag) + " definition", + "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = GNE_TAG_TRIP_JUNCTIONS; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, + GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE, + 0, + GUIIcon::TRIP_JUNCTIONS, SUMO_TAG_TRIP, {}, FXRGBA(240, 238, 249, 255)); + myTagProperties[currentTag].setFieldString("trip (from-to junctions)"); - attrProperty = GNEAttributeProperties(SUMO_ATTR_MAXSPEED, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL, - "The person's maximum velocity [m/s]"); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, + "The name of " + toString(currentTag) + "s that will be generated using this trip definition"); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "This value causes persons to violate a red light if the duration of the red phase is lower than the given threshold.", - "-1"); + attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The id of the " + toString(currentTag) + " type to use for this " + toString(currentTag), + DEFAULT_VTYPE_ID); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_IMGFILE, - GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "Image file for rendering persons of this type (should be grayscale to allow functional coloring)"); + attrProperty = GNEAttributeProperties(SUMO_ATTR_FROMJUNCTION, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the junction the " + toString(currentTag) + " starts at"); myTagProperties[currentTag].addAttribute(attrProperty); - } -} + attrProperty = GNEAttributeProperties(SUMO_ATTR_TOJUNCTION, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the junction the " + toString(currentTag) + " ends at"); + myTagProperties[currentTag].addAttribute(attrProperty); -void -GNEAttributeCarrier::fillVehicleElements() { - // declare empty GNEAttributeProperties - GNEAttributeProperties attrProperty; - // fill vehicle ACs - SumoXMLTag currentTag = SUMO_TAG_VEHICLE; + // add common attributes + fillCommonVehicleAttributes(currentTag); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPART, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, + "The departure time of the (first) " + toString(currentTag) + " which is generated using this " + toString(currentTag) + " definition", + "0.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_VEHICLE; { // set values of tag myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE, 0, - GUIIcon::VEHICLE, currentTag); + GUIIcon::VEHICLE, currentTag, {}, FXRGBA(240, 238, 249, 255)); + myTagProperties[currentTag].setFieldString("vehicle (over route)"); + // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The name of the " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The id of the vehicle type to use for this " + toString(currentTag), DEFAULT_VTYPE_ID); myTagProperties[currentTag].addAttribute(attrProperty); @@ -3482,12 +3485,12 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTEDGE, - GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUE, "The index of the edge within route the " + toString(currentTag) + " starts at"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALEDGE, - GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUE, "The index of the edge within route the " + toString(currentTag) + " ends at"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -3495,7 +3498,7 @@ fillCommonVehicleAttributes(currentTag); attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPART, - GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "The time step at which the " + toString(currentTag) + " shall enter the network", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -3506,26 +3509,28 @@ myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE, GNETagProperties::EMBEDDED_ROUTE, - GUIIcon::VEHICLE, SUMO_TAG_VEHICLE); + GUIIcon::VEHICLE, SUMO_TAG_VEHICLE, {}, FXRGBA(240, 238, 249, 255)); + myTagProperties[currentTag].setFieldString("vehicle (embedded route)"); + // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The name of the " + toString(SUMO_TAG_VEHICLE)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The id of the vehicle type to use for this " + toString(SUMO_TAG_VEHICLE), DEFAULT_VTYPE_ID); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTEDGE, - GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUE, "The index of the edge within route the " + toString(currentTag) + " starts at"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALEDGE, - GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUE, "The index of the edge within route the " + toString(currentTag) + " ends at"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -3533,168 +3538,168 @@ fillCommonVehicleAttributes(currentTag); attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPART, - GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "The time step at which the " + toString(SUMO_TAG_VEHICLE) + " shall enter the network", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); } - currentTag = GNE_TAG_FLOW_ROUTE; + currentTag = SUMO_TAG_FLOW; { // set values of tag myTagProperties[currentTag] = GNETagProperties(currentTag, - GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE, + GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE | GNETagProperties::FLOW, 0, - GUIIcon::ROUTEFLOW, SUMO_TAG_FLOW, {}); + GUIIcon::FLOW, currentTag, {}, FXRGBA(210, 233, 255, 255)); + myTagProperties[currentTag].setFieldString("flow (from-to edges)"); + // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The name of the " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The id of the " + toString(currentTag) + " type to use for this " + toString(currentTag), DEFAULT_VTYPE_ID); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_ROUTE, + attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM, GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, - "The id of the route the " + toString(currentTag) + " shall drive along"); + "The name of the edge the " + toString(currentTag) + " starts at"); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTEDGE, - GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "The index of the edge within route the " + toString(currentTag) + " starts at"); + attrProperty = GNEAttributeProperties(SUMO_ATTR_TO, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the edge the " + toString(currentTag) + " ends at"); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALEDGE, - GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "The index of the edge within route the " + toString(currentTag) + " ends at"); + attrProperty = GNEAttributeProperties(SUMO_ATTR_VIA, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::LIST, + "List of intermediate edge ids which shall be part of the " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); // add common attributes fillCommonVehicleAttributes(currentTag); // add flow attributes - fillCommonFlowAttributes(currentTag, true); + fillCommonFlowAttributes(currentTag, SUMO_ATTR_VEHSPERHOUR); } - currentTag = GNE_TAG_FLOW_WITHROUTE; + currentTag = GNE_TAG_FLOW_JUNCTIONS; { // set values of tag myTagProperties[currentTag] = GNETagProperties(currentTag, - GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE, - GNETagProperties::EMBEDDED_ROUTE, - GUIIcon::ROUTEFLOW, SUMO_TAG_FLOW); + GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE | GNETagProperties::FLOW, + 0, + GUIIcon::FLOW_JUNCTIONS, SUMO_TAG_FLOW, {}, FXRGBA(210, 233, 255, 255)); + myTagProperties[currentTag].setFieldString("flow (from-to junctions)"); + // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, - "The name of the " + toString(SUMO_TAG_FLOW)); + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, + "The name of the " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, - "The id of the " + toString(currentTag) + " type to use for this " + toString(SUMO_TAG_FLOW), + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The id of the " + toString(currentTag) + " type to use for this " + toString(currentTag), DEFAULT_VTYPE_ID); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTEDGE, - GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "The index of the edge within route the " + toString(currentTag) + " starts at"); + attrProperty = GNEAttributeProperties(SUMO_ATTR_FROMJUNCTION, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the junction the " + toString(currentTag) + " starts at"); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALEDGE, - GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "The index of the edge within route the " + toString(currentTag) + " ends at"); + attrProperty = GNEAttributeProperties(SUMO_ATTR_TOJUNCTION, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the junction the " + toString(currentTag) + " ends at"); myTagProperties[currentTag].addAttribute(attrProperty); // add common attributes fillCommonVehicleAttributes(currentTag); // add flow attributes - fillCommonFlowAttributes(currentTag, true); + fillCommonFlowAttributes(currentTag, SUMO_ATTR_VEHSPERHOUR); } - currentTag = SUMO_TAG_TRIP; + currentTag = GNE_TAG_FLOW_ROUTE; { // set values of tag myTagProperties[currentTag] = GNETagProperties(currentTag, - GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE, + GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE | GNETagProperties::FLOW, 0, - GUIIcon::TRIP, currentTag); + GUIIcon::ROUTEFLOW, SUMO_TAG_FLOW, {}, FXRGBA(210, 233, 255, 255)); + myTagProperties[currentTag].setFieldString("flow (over route)"); + // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, - "The name of " + toString(currentTag) + "s that will be generated using this trip definition"); + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, + "The name of the " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The id of the " + toString(currentTag) + " type to use for this " + toString(currentTag), DEFAULT_VTYPE_ID); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "The name of the edge the " + toString(currentTag) + " starts at"); + attrProperty = GNEAttributeProperties(SUMO_ATTR_ROUTE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The id of the route the " + toString(currentTag) + " shall drive along"); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_TO, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "The name of the edge the " + toString(currentTag) + " ends at"); + attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTEDGE, + GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUE, + "The index of the edge within route the " + toString(currentTag) + " starts at"); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_VIA, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "List of intermediate edge ids which shall be part of the " + toString(currentTag)); + attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALEDGE, + GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUE, + "The index of the edge within route the " + toString(currentTag) + " ends at"); myTagProperties[currentTag].addAttribute(attrProperty); // add common attributes fillCommonVehicleAttributes(currentTag); - attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPART, - GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC, - "The departure time of the (first) " + toString(currentTag) + " which is generated using this " + toString(currentTag) + " definition", - "0.00"); - myTagProperties[currentTag].addAttribute(attrProperty); + // add flow attributes + fillCommonFlowAttributes(currentTag, SUMO_ATTR_VEHSPERHOUR); } - currentTag = SUMO_TAG_FLOW; + currentTag = GNE_TAG_FLOW_WITHROUTE; { // set values of tag myTagProperties[currentTag] = GNETagProperties(currentTag, - GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE, - 0, - GUIIcon::FLOW, currentTag); + GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE | GNETagProperties::FLOW, + GNETagProperties::EMBEDDED_ROUTE, + GUIIcon::ROUTEFLOW, SUMO_TAG_FLOW, {}, FXRGBA(210, 233, 255, 255)); + myTagProperties[currentTag].setFieldString("flow (embedded route)"); + // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, - "The name of the " + toString(currentTag)); + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, + "The name of the " + toString(SUMO_TAG_FLOW)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::XMLOPTIONAL, - "The id of the " + toString(currentTag) + " type to use for this " + toString(currentTag), + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The id of the " + toString(currentTag) + " type to use for this " + toString(SUMO_TAG_FLOW), DEFAULT_VTYPE_ID); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "The name of the edge the " + toString(currentTag) + " starts at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = GNEAttributeProperties(SUMO_ATTR_TO, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, - "The name of the edge the " + toString(currentTag) + " ends at"); + attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTEDGE, + GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUE, + "The index of the edge within route the " + toString(currentTag) + " starts at"); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_VIA, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "List of intermediate edge ids which shall be part of the " + toString(currentTag)); + attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALEDGE, + GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::DEFAULTVALUE, + "The index of the edge within route the " + toString(currentTag) + " ends at"); myTagProperties[currentTag].addAttribute(attrProperty); // add common attributes fillCommonVehicleAttributes(currentTag); // add flow attributes - fillCommonFlowAttributes(currentTag, true); + fillCommonFlowAttributes(currentTag, SUMO_ATTR_VEHSPERHOUR); } /* currently disabled. See #5259 currentTag = SUMO_TAG_TRIP_TAZ; @@ -3738,19 +3743,19 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION_LAT, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The lateral offset on the named lane at which the vehicle must stop", ""); myTagProperties[currentTag].addAttribute(attrProperty); // fill common stop attributes - fillCommonStopAttributes(currentTag, true); + fillCommonStopAttributes(currentTag); } currentTag = SUMO_TAG_STOP_BUSSTOP; { @@ -3766,7 +3771,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); // fill common stop attributes - fillCommonStopAttributes(currentTag, true); + fillCommonStopAttributes(currentTag); } currentTag = SUMO_TAG_STOP_CONTAINERSTOP; { @@ -3782,7 +3787,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); // fill common stop attributes - fillCommonStopAttributes(currentTag, true); + fillCommonStopAttributes(currentTag); } currentTag = SUMO_TAG_STOP_CHARGINGSTATION; { @@ -3798,7 +3803,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); // fill common stop attributes - fillCommonStopAttributes(currentTag, true); + fillCommonStopAttributes(currentTag); } currentTag = SUMO_TAG_STOP_PARKINGAREA; { @@ -3814,7 +3819,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); // fill common stop attributes (no parking) - fillCommonStopAttributes(currentTag, false); + fillCommonStopAttributes(currentTag); } } @@ -3837,7 +3842,7 @@ // set specific attribute depart (note: Persons doesn't support triggered and containerTriggered values) attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPART, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The time step at which the " + toString(currentTag) + " shall enter the network", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -3847,7 +3852,7 @@ { // set values of tag myTagProperties[currentTag] = GNETagProperties(currentTag, - GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSON, + GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSON | GNETagProperties::FLOW, 0, GUIIcon::PERSONFLOW, currentTag); @@ -3855,7 +3860,7 @@ fillCommonPersonAttributes(currentTag); // add flow attributes - fillCommonFlowAttributes(currentTag, false); + fillCommonFlowAttributes(currentTag, SUMO_ATTR_PERSONSPERHOUR); } } @@ -3888,7 +3893,7 @@ fillCommonContainerAttributes(currentTag); // add flow attributes - fillCommonFlowAttributes(currentTag, false); + fillCommonFlowAttributes(currentTag, SUMO_ATTR_CONTAINERSPERHOUR); } } @@ -3917,13 +3922,13 @@ myTagProperties[currentTag].addAttribute(attrProperty); // lines attrProperty = GNEAttributeProperties(SUMO_ATTR_LINES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "list of vehicle alternatives to take for the " + toString(currentTag), ""); myTagProperties[currentTag].addAttribute(attrProperty); // arrival position attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE, "arrival position on the destination edge", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -3942,7 +3947,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); // lines attrProperty = GNEAttributeProperties(SUMO_ATTR_LINES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "list of vehicle alternatives to take for the " + toString(currentTag), ""); myTagProperties[currentTag].addAttribute(attrProperty); @@ -3979,19 +3984,19 @@ myTagProperties[currentTag].addAttribute(attrProperty); // speed attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "speed of the container for this tranship in m/s", "1.39"); myTagProperties[currentTag].addAttribute(attrProperty); // depart pos attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The position at which the " + toString(currentTag) + " shall enter the net", "0"); myTagProperties[currentTag].addAttribute(attrProperty); // arrival position attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE, "arrival position on the destination edge", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -4015,13 +4020,13 @@ myTagProperties[currentTag].addAttribute(attrProperty); // speed attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "speed of the container for this tranship in m/s", "1.39"); myTagProperties[currentTag].addAttribute(attrProperty); // depart pos attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The position at which the " + toString(currentTag) + " shall enter the net", "0"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -4040,19 +4045,19 @@ myTagProperties[currentTag].addAttribute(attrProperty); // speed attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "speed of the container for this tranship in m/s", "1.39"); myTagProperties[currentTag].addAttribute(attrProperty); // depart pos attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The position at which the " + toString(currentTag) + " shall enter the net", "0"); myTagProperties[currentTag].addAttribute(attrProperty); // arrival pos attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALPOS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE, "Arrival position on the destination edge", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -4085,25 +4090,26 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DURATION, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUE, "Minimum duration for stopping", "60"); + attrProperty.setDefaultActivated(true); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_UNTIL, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUE, "The time step at which the route continues", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ACTTYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Activity displayed for stopped container in GUI and output files ", "waiting"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -4123,19 +4129,19 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DURATION, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUE, "Minimum duration for stopping", "60"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_UNTIL, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUE, "The time step at which the route continues", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ACTTYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Activity displayed for stopped container in GUI and output files ", "waiting"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -4154,7 +4160,7 @@ myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::PERSONTRIP, GNETagProperties::CHILD, - GUIIcon::PERSONTRIP_BUSSTOP, SUMO_TAG_PERSONTRIP, {SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW}); + GUIIcon::PERSONTRIP_FROMTO, SUMO_TAG_PERSONTRIP, {SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW}, FXRGBA(240, 238, 249, 255)); // from edge attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM, GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, @@ -4167,18 +4173,18 @@ myTagProperties[currentTag].addAttribute(attrProperty); // arrival position attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALPOS, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "arrival position on the destination edge", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); // vTypes attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "List of possible vehicle types to take"); myTagProperties[currentTag].addAttribute(attrProperty); // modes attrProperty = GNEAttributeProperties(SUMO_ATTR_MODES, - GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "List of possible traffic modes. Walking is always possible regardless of this value"); myTagProperties[currentTag].addAttribute(attrProperty); } @@ -4188,7 +4194,7 @@ myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::PERSONTRIP, GNETagProperties::CHILD, - GUIIcon::PERSONTRIP_BUSSTOP, SUMO_TAG_PERSONTRIP, {SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW}); + GUIIcon::PERSONTRIP_BUSSTOP, SUMO_TAG_PERSONTRIP, {SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW}, FXRGBA(240, 238, 249, 255)); // from edge attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM, GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, @@ -4201,12 +4207,40 @@ myTagProperties[currentTag].addAttribute(attrProperty); // vTypes attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, + "List of possible vehicle types to take"); + myTagProperties[currentTag].addAttribute(attrProperty); + // modes + attrProperty = GNEAttributeProperties(SUMO_ATTR_MODES, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, + "List of possible traffic modes. Walking is always possible regardless of this value"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = GNE_TAG_PERSONTRIP_JUNCTIONS; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, + GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::PERSONTRIP, + GNETagProperties::CHILD, + GUIIcon::PERSONTRIP_JUNCTIONS, SUMO_TAG_PERSONTRIP, {SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW}, FXRGBA(240, 238, 249, 255)); + // from edge + attrProperty = GNEAttributeProperties(SUMO_ATTR_FROMJUNCTION, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the junction the " + toString(currentTag) + " starts at"); + myTagProperties[currentTag].addAttribute(attrProperty); + // to edge + attrProperty = GNEAttributeProperties(SUMO_ATTR_TOJUNCTION, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the junction the " + toString(currentTag) + " ends at"); + myTagProperties[currentTag].addAttribute(attrProperty); + // vTypes + attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "List of possible vehicle types to take"); myTagProperties[currentTag].addAttribute(attrProperty); // modes attrProperty = GNEAttributeProperties(SUMO_ATTR_MODES, - GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "List of possible traffic modes. Walking is always possible regardless of this value"); myTagProperties[currentTag].addAttribute(attrProperty); } @@ -4224,7 +4258,7 @@ myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::WALK, GNETagProperties::CHILD, - GUIIcon::WALK_BUSSTOP, SUMO_TAG_WALK, { SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW }); + GUIIcon::WALK_FROMTO, SUMO_TAG_WALK, { SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW }, FXRGBA(240, 255, 205, 255)); // from edge attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM, GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, @@ -4237,7 +4271,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); // arrival position attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALPOS, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "arrival position on the destination edge", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -4248,7 +4282,7 @@ myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::WALK, GNETagProperties::CHILD, - GUIIcon::WALK_BUSSTOP, SUMO_TAG_WALK, { SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW }); + GUIIcon::WALK_BUSSTOP, SUMO_TAG_WALK, { SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW }, FXRGBA(240, 255, 205, 255)); // from edge attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM, GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, @@ -4266,7 +4300,7 @@ myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::WALK, GNETagProperties::CHILD, - GUIIcon::WALK_EDGES, SUMO_TAG_WALK, {SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW}); + GUIIcon::WALK_EDGES, SUMO_TAG_WALK, {SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW}, FXRGBA(240, 255, 205, 255)); // edges attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGES, GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, @@ -4274,7 +4308,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); // arrival pos attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALPOS, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Arrival position on the destination edge", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -4285,7 +4319,7 @@ myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::WALK, GNETagProperties::CHILD, - GUIIcon::WALK_ROUTE, SUMO_TAG_WALK, {SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW}); + GUIIcon::WALK_ROUTE, SUMO_TAG_WALK, {SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW}, FXRGBA(240, 255, 205, 255)); // route attrProperty = GNEAttributeProperties(SUMO_ATTR_ROUTE, GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, @@ -4293,11 +4327,30 @@ myTagProperties[currentTag].addAttribute(attrProperty); // arrival pos attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALPOS, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Arrival position on the destination edge", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); } + + currentTag = GNE_TAG_WALK_JUNCTIONS; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, + GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::WALK, + GNETagProperties::CHILD, + GUIIcon::WALK_JUNCTIONS, SUMO_TAG_WALK, { SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW }, FXRGBA(240, 255, 205, 255)); + // from edge + attrProperty = GNEAttributeProperties(SUMO_ATTR_FROMJUNCTION, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the junction the " + toString(currentTag) + " starts at"); + myTagProperties[currentTag].addAttribute(attrProperty); + // to edge + attrProperty = GNEAttributeProperties(SUMO_ATTR_TOJUNCTION, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the junction the " + toString(currentTag) + " ends at"); + myTagProperties[currentTag].addAttribute(attrProperty); + } } @@ -4312,7 +4365,7 @@ myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::RIDE, GNETagProperties::CHILD, - GUIIcon::RIDE_BUSSTOP, SUMO_TAG_RIDE, { SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW }); + GUIIcon::RIDE_BUSSTOP, SUMO_TAG_RIDE, { SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW }, FXRGBA(210, 233, 255, 255)); // from edge attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM, GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, @@ -4325,13 +4378,13 @@ myTagProperties[currentTag].addAttribute(attrProperty); // arrival position attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALPOS, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "arrival position on the destination edge", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); // lines attrProperty = GNEAttributeProperties(SUMO_ATTR_LINES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "list of vehicle alternatives to take for the " + toString(currentTag), "ANY"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -4342,7 +4395,7 @@ myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::RIDE, GNETagProperties::CHILD, - GUIIcon::RIDE_BUSSTOP, SUMO_TAG_RIDE, { SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW }); + GUIIcon::RIDE_BUSSTOP, SUMO_TAG_RIDE, { SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW }, FXRGBA(210, 233, 255, 255)); // from edge attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM, GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, @@ -4355,7 +4408,7 @@ myTagProperties[currentTag].addAttribute(attrProperty); // lines attrProperty = GNEAttributeProperties(SUMO_ATTR_LINES, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "list of vehicle alternatives to take for the " + toString(currentTag), "ANY"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -4388,25 +4441,26 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, "If set, no error will be reported if element is placed behind the lane. Instead,it will be placed 0.1 meters from the lanes end or at position 0.1, if the position was negative and larger than the lanes length after multiplication with - 1", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DURATION, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUE, "Minimum duration for stopping", "60"); + attrProperty.setDefaultActivated(true); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_UNTIL, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUE, "The time step at which the route continues", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ACTTYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Activity displayed for stopped person in GUI and output files ", "waiting"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -4426,19 +4480,20 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DURATION, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUE, "Minimum duration for stopping", "60"); + attrProperty.setDefaultActivated(true); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_UNTIL, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUE, "The time step at which the route continues", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ACTTYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Activity displayed for stopped person in GUI and output files ", "waiting"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -4451,72 +4506,72 @@ // declare empty GNEAttributeProperties GNEAttributeProperties attrProperty; attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUE, "This " + toString(currentTag) + "'s color", "yellow"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTLANE, - GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The lane on which the " + toString(currentTag) + " shall be inserted", "first"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTPOS, - GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY /* GNEAttributeProperties::MULTIDISCRETE (Currently disabled) */, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY /* GNEAttributeProperties::MULTIDISCRETE (Currently disabled) */, "The position at which the " + toString(currentTag) + " shall enter the net", "base"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTSPEED, - GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL /* GNEAttributeProperties::MULTIDISCRETE (Currently disabled) */, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE /* GNEAttributeProperties::MULTIDISCRETE (Currently disabled) */, "The speed with which the " + toString(currentTag) + " shall enter the network", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALLANE, - GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY /* GNEAttributeProperties::MULTIDISCRETE (Currently disabled) */, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY /* GNEAttributeProperties::MULTIDISCRETE (Currently disabled) */, "The lane at which the " + toString(currentTag) + " shall leave the network", "current"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALPOS, - GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY /* GNEAttributeProperties::MULTIDISCRETE (Currently disabled) */, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY /* GNEAttributeProperties::MULTIDISCRETE (Currently disabled) */, "The position at which the " + toString(currentTag) + " shall leave the network", "max"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALSPEED, - GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL /* GNEAttributeProperties::MULTIDISCRETE (Currently disabled) */, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE /* GNEAttributeProperties::MULTIDISCRETE (Currently disabled) */, "The speed with which the " + toString(currentTag) + " shall leave the network", "current"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LINE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "A string specifying the id of a public transport line which can be used when specifying person rides"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PERSON_NUMBER, - GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The number of occupied seats when the " + toString(currentTag) + " is inserted", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CONTAINER_NUMBER, - GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The number of occupied container places when the " + toString(currentTag) + " is inserted", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTPOS_LAT, - GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The lateral position on the departure lane at which the " + toString(currentTag) + " shall enter the net", "center"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALPOS_LAT, - GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The lateral position on the arrival lane at which the " + toString(currentTag) + " shall arrive", "center"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -4524,42 +4579,42 @@ void -GNEAttributeCarrier::fillCommonFlowAttributes(SumoXMLTag currentTag, const bool forVehicles) { +GNEAttributeCarrier::fillCommonFlowAttributes(SumoXMLTag currentTag, SumoXMLAttr perHour) { // declare empty GNEAttributeProperties GNEAttributeProperties attrProperty; attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "First " + toString(currentTag) + " departure time", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_END, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::FLOWDEFINITION, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOWDEFINITION, "End of departure interval", "3600"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_NUMBER, - GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::FLOWDEFINITION, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOWDEFINITION, "probability for emitting a " + toString(currentTag) + " each second (not together with vehsPerHour or period)", "1800"); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(forVehicles ? SUMO_ATTR_VEHSPERHOUR : SUMO_ATTR_PERSONSPERHOUR, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::FLOWDEFINITION, + attrProperty = GNEAttributeProperties(perHour, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOWDEFINITION, "Number of " + toString(currentTag) + "s per hour, equally spaced (not together with period or probability)", "1800"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PERIOD, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::FLOWDEFINITION, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOWDEFINITION, "Insert equally spaced " + toString(currentTag) + "s at that period (not together with vehsPerHour or probability)", "2"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::FLOWDEFINITION, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::FLOWDEFINITION, "probability for emitting a " + toString(currentTag) + " each second (not together with vehsPerHour or period)", "0.5"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -4572,232 +4627,232 @@ GNEAttributeProperties attrProperty; attrProperty = GNEAttributeProperties(SUMO_ATTR_ACCEL, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The acceleration ability of vehicles of this type [m/s^2]", "2.60"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DECEL, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The deceleration ability of vehicles of this type [m/s^2]", "4.50"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_APPARENTDECEL, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The apparent deceleration of the vehicle as used by the standard model [m/s^2]", "4.50"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_EMERGENCYDECEL, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The maximal physically possible deceleration for the vehicle [m/s^2]", "4.50"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_SIGMA, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::RANGE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::RANGE | GNEAttributeProperties::DEFAULTVALUE, "Car-following model parameter", "0.50"); attrProperty.setRange(0, 1); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TAU, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "Car-following model parameter", "1.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TMP1, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "SKRAUSSX parameter 1", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TMP2, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "SKRAUSSX parameter 2", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TMP3, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "SKRAUSSX parameter 3", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TMP4, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "SKRAUSSX parameter 4", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TMP5, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "SKRAUSSX parameter 5", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_EIDM_T_LOOK_AHEAD, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "EIDM Look ahead / preview parameter [s]", "4.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_EIDM_T_REACTION, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "EIDM AP Reaction Time parameter [s]", "0.50"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_EIDM_T_PERSISTENCE_DRIVE, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "EIDM Wiener Process parameter for the Driving Error [s]", "3.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_EIDM_T_PERSISTENCE_ESTIMATE, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "EIDM Wiener Process parameter for the Estimation Error [s]", "10.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_EIDM_C_COOLNESS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::RANGE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::RANGE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "EIDM Coolness parameter of the Enhanced IDM [-]", "0.99"); attrProperty.setRange(0, 1); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_EIDM_SIG_LEADER, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "EIDM leader speed estimation error parameter [-]", "0.02"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_EIDM_SIG_GAP, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "EIDM gap estimation error parameter [-]", "0.10"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_EIDM_SIG_ERROR, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "EIDM driving error parameter [-]", "0.10"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_EIDM_JERK_MAX, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "EIDM maximal jerk parameter [m/s^3]", "3.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_EIDM_EPSILON_ACC, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "EIDM maximal negative acceleration between two Action Points (threshold) [m/s^2]", "1.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_EIDM_T_ACC_MAX, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "EIDM Time parameter untill vehicle reaches amax after startup/driveoff [s]", "1.20"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_EIDM_M_FLATNESS, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "EIDM Flatness parameter of startup/driveoff curve [-]", "2.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_EIDM_M_BEGIN, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "EIDM Shift parameter of startup/driveoff curve [-]", "0.70"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_EIDM_USEVEHDYNAMICS, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "EIDM parameter if model shall include vehicle dynamics into the acceleration calculation [0/1]", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_EIDM_MAX_VEH_PREVIEW, - GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "EIDM parameter how many vehicles are taken into the preview calculation of the driver (at least always 1!) [-]", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_PWAGNER2009_TAULAST, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Peter Wagner 2009 parameter", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_PWAGNER2009_APPROB, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Peter Wagner 2009 parameter", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_IDMM_ADAPT_FACTOR, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "IDMM parameter", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_IDMM_ADAPT_TIME, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "IDMM parameter", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_WIEDEMANN_SECURITY, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Wiedemann parameter", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_WIEDEMANN_ESTIMATION, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Wiedemann parameter", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_COLLISION_MINGAP_FACTOR, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "MinGap factor parameter", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_K, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "K parameter", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_KERNER_PHI, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Kerner Phi parameter", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_IDM_DELTA, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "IDM Delta parameter", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_IDM_STEPPING, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "IDM Stepping parameter", ""); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TRAIN_TYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Train Types", "NGT400"); attrProperty.setDiscreteValues(SUMOXMLDefinitions::TrainTypes.getStrings()); @@ -4810,61 +4865,61 @@ // declare empty GNEAttributeProperties GNEAttributeProperties attrProperty; attrProperty = GNEAttributeProperties(SUMO_ATTR_JM_CROSSING_GAP, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Minimum distance to pedestrians that are walking towards the conflict point with the ego vehicle.", "10"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The accumulated waiting time after which a vehicle will drive onto an intersection even though this might cause jamming.", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "This value causes vehicles to violate a yellow light if the duration of the yellow phase is lower than the given threshold.", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "This value causes vehicles to violate a red light if the duration of the red phase is lower than the given threshold.", "-1"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_JM_DRIVE_RED_SPEED, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "This value causes vehicles affected by jmDriveAfterRedTime to slow down when violating a red light.", "0.0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_JM_IGNORE_FOE_PROB, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "This value causes vehicles to ignore foe vehicles that have right-of-way with the given probability.", "0.0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_JM_IGNORE_FOE_SPEED, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "This value is used in conjunction with jmIgnoreFoeProb. Only vehicles with a speed below or equal to the given value may be ignored.", "0.0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_JM_SIGMA_MINOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "This value configures driving imperfection (dawdling) while passing a minor link.", "0.0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_JM_TIMEGAP_MINOR, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "This value defines the minimum time gap when passing ahead of a prioritized vehicle. ", "1"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_IMPATIENCE, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Willingess of drivers to impede vehicles with higher priority", "0.0"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -4877,116 +4932,116 @@ GNEAttributeProperties attrProperty; attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_STRATEGIC_PARAM, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The eagerness for performing strategic lane changing. Higher values result in earlier lane-changing.", "1.0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_COOPERATIVE_PARAM, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The willingness for performing cooperative lane changing. Lower values result in reduced cooperation.", "1.0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_SPEEDGAIN_PARAM, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The eagerness for performing lane changing to gain speed. Higher values result in more lane-changing.", "1.0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_KEEPRIGHT_PARAM, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The eagerness for following the obligation to keep right. Higher values result in earlier lane-changing.", "1.0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_SUBLANE_PARAM, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The eagerness for using the configured lateral alignment within the lane. Higher values result in increased willingness to sacrifice speed for alignment.", "1.0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_OPPOSITE_PARAM, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The eagerness for overtaking through the opposite-direction lane. Higher values result in more lane-changing.", "1.0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_PUSHY, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Willingness to encroach laterally on other drivers.", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_PUSHYGAP, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Minimum lateral gap when encroaching laterally on other drives (alternative way to define lcPushy)", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_ASSERTIVE, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Willingness to accept lower front and rear gaps on the target lane.", "1.0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_IMPATIENCE, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Dynamic factor for modifying lcAssertive and lcPushy.", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_TIME_TO_IMPATIENCE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Time to reach maximum impatience (of 1). Impatience grows whenever a lane-change manoeuvre is blocked.", "infinity"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_ACCEL_LAT, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Maximum lateral acceleration per second.", "1.0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_LOOKAHEADLEFT, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Factor for configuring the strategic lookahead distance when a change to the left is necessary (relative to right lookahead).", "2.0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_SPEEDGAINRIGHT, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Factor for configuring the treshold asymmetry when changing to the left or to the right for speed gain.", "0.1"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_MAXSPEEDLATSTANDING, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Upper bound on lateral speed when standing.", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_MAXSPEEDLATFACTOR, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Upper bound on lateral speed while moving computed as lcMaxSpeedLatStanding + lcMaxSpeedLatFactor * getSpeed()", "1.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "Distance to an upcoming turn on the vehicles route, below which the alignment should be dynamically adapted to match the turn direction.", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_OVERTAKE_RIGHT, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "The probability for violating rules gainst overtaking on the right.", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); /* attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_EXPERIMENTAL1, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::EXTENDED, "XXXXX", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -5000,7 +5055,7 @@ GNEAttributeProperties attrProperty; attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The name of the " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); @@ -5011,13 +5066,13 @@ myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, - GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUE, "This " + toString(currentTag) + "'s color", "yellow"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTPOS, - GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE | GNEAttributeProperties::UPDATEGEOMETRY, "The position at which the " + toString(currentTag) + " shall enter the net", "base"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -5030,12 +5085,12 @@ GNEAttributeProperties attrProperty; attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "The name of the " + toString(currentTag)); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPART, - GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUE, "The time step at which the " + toString(currentTag) + " shall enter the network", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -5043,60 +5098,49 @@ void -GNEAttributeCarrier::fillCommonStopAttributes(SumoXMLTag currentTag, const bool parking) { +GNEAttributeCarrier::fillCommonStopAttributes(SumoXMLTag currentTag) { // declare empty GNEAttributeProperties GNEAttributeProperties attrProperty; attrProperty = GNEAttributeProperties(SUMO_ATTR_DURATION, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUE, "Minimum duration for stopping", "60"); + attrProperty.setDefaultActivated(true); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_UNTIL, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUE, "The time step at which the route continues", "0.00"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_EXTENSION, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUE, "If set to a non-negative time value, then the stop duration can be extended at most by the extension value in seconds", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_TRIGGERED, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "Whether a person may end the stop", - "0"); + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUE, + "Whether a person or container or bth may end the stop", + "false"); + attrProperty.setDiscreteValues({"false", "person", "container", "join"}); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_EXPECTED, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUE, "List of persons that must board the vehicle before it may continue"); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_CONTAINER_TRIGGERED, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "Whether a container may end the stop", - "0"); + attrProperty = GNEAttributeProperties(SUMO_ATTR_PARKING, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUE, + "whether the vehicle stops on the road or beside ", + "false"); myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = GNEAttributeProperties(SUMO_ATTR_EXPECTED_CONTAINERS, - GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, - "List of containers that must be loaded onto the vehicle before it may continue"); - myTagProperties[currentTag].addAttribute(attrProperty); - - if (parking) { - attrProperty = GNEAttributeProperties(SUMO_ATTR_PARKING, - GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::XMLOPTIONAL, - "whether the vehicle stops on the road or beside ", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - attrProperty = GNEAttributeProperties(SUMO_ATTR_ACTTYPE, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Activity displayed for stopped person in GUI and output files ", "waiting"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -5104,7 +5148,7 @@ /* Attribute currently disabled. It will be implemented in #6011 attrProperty = GNEAttributeProperties(SUMO_ATTR_TRIP_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUE, "Value used for trips that uses this stop"); myTagProperties[currentTag].addAttribute(attrProperty); */ @@ -5126,7 +5170,7 @@ // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "Data set ID"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -5142,19 +5186,19 @@ // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::AUTOMATICID, "Interval ID"); myTagProperties[currentTag].addAttribute(attrProperty); // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "First " + toString(currentTag) + " departure time", "0"); myTagProperties[currentTag].addAttribute(attrProperty); attrProperty = GNEAttributeProperties(SUMO_ATTR_END, - GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUE, "End of departure interval", "3600"); myTagProperties[currentTag].addAttribute(attrProperty); @@ -5170,7 +5214,7 @@ // set values of attributes attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, - GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY | GNEAttributeProperties::AUTOMATICID, "edge ID"); myTagProperties[currentTag].addAttribute(attrProperty); } @@ -5214,239 +5258,4 @@ } } - -bool -GNEAttributeCarrier::checkParsedAttribute(const GNETagProperties& GNETagProperties, - const GNEAttributeProperties& attrProperties, const SumoXMLAttr attribute, - std::string& defaultValue, std::string& parsedAttribute, std::string& warningMessage) { - // declare a string for details about error formats - std::string errorFormat; - // set extra check for ID Values - if (attribute == SUMO_ATTR_ID) { - if (parsedAttribute.empty()) { - errorFormat = "ID cannot be empty; "; - } else if (GNETagProperties.isDetector()) { - // special case for detectors (because in this case empty spaces are allowed) - if (SUMOXMLDefinitions::isValidDetectorID(parsedAttribute) == false) { - errorFormat = "Detector ID contains invalid characters; "; - } - } else if (GNETagProperties.isDemandElement()) { - // special case for detectors (because in this case empty spaces are allowed) - if (SUMOXMLDefinitions::isValidVehicleID(parsedAttribute) == false) { - errorFormat = "Demand Element ID contains invalid characters; "; - } - } else if (SUMOXMLDefinitions::isValidAdditionalID(parsedAttribute) == false) { - errorFormat = "ID contains invalid characters; "; - } - } - // Set extra checks for int values - if (attrProperties.isInt()) { - if (canParse(parsedAttribute)) { - // obtain int value - int parsedIntAttribute = parse(parsedAttribute); - // check if attribute can be negative or zero - if (attrProperties.isPositive() && (parsedIntAttribute < 0)) { - errorFormat = "Cannot be negative; "; - } - } else if (canParse(parsedAttribute)) { - errorFormat = "Float cannot be reinterpreted as int; "; - } else { - errorFormat = "Cannot be parsed to int; "; - } - } - // Set extra checks for float(double) values - if (attrProperties.isFloat()) { - if (canParse(parsedAttribute)) { - // obtain double value - double parsedDoubleAttribute = parse(parsedAttribute); - //check if can be negative and Zero - if (attrProperties.isPositive() && (parsedDoubleAttribute < 0)) { - errorFormat = "Cannot be negative; "; - } - } else { - errorFormat = "Cannot be parsed to float; "; - } - } - // Set extra checks for bool values - if (attrProperties.isBool()) { - if (!canParse(parsedAttribute)) { - errorFormat = "Cannot be parsed to boolean; "; - } - } - // Set extra checks for position values - if (attrProperties.isposition()) { - // check if we're parsing a single position or an entire shape - if (attrProperties.isList()) { - // check if parsed attribute can be parsed to Position Vector - if (!canParse(parsedAttribute)) { - errorFormat = "List of Positions aren't neither x,y nor x,y,z; "; - } - } else if (!canParse(parsedAttribute)) { - errorFormat = "Position is neither x,y nor x,y,z; "; - } - } - // set extra check for time(double) values - if (attrProperties.isSUMOTime()) { - if (!canParse(parsedAttribute)) { - errorFormat = "Cannot be parsed to SUMOTime; "; - } - } - // set extra check for probability values - if (attrProperties.isProbability()) { - if (canParse(parsedAttribute)) { - // parse to double and check if is between [0,1] - double probability = parse(parsedAttribute); - if (probability < 0) { - errorFormat = "Probability cannot be smaller than 0; "; - } else if (probability > 1) { - errorFormat = "Probability cannot be greather than 1; "; - } - } else { - errorFormat = "Cannot be parsed to probability; "; - } - } - // set extra check for range values - if (attrProperties.hasAttrRange()) { - if (canParse(parsedAttribute)) { - // parse to double and check if is in range - double range = parse(parsedAttribute); - if (range < attrProperties.getMinimumRange()) { - errorFormat = "Float cannot be smaller than " + toString(attrProperties.getMinimumRange()) + "; "; - } else if (range > attrProperties.getMaximumRange()) { - errorFormat = "Float cannot be greather than " + toString(attrProperties.getMaximumRange()) + "; "; - } - } else { - errorFormat = "Cannot be parsed to float; "; - } - } - // set extra check for discrete values - if (attrProperties.isDiscrete()) { - // search value in the list of discretes values of attribute properties - auto finder = std::find(attrProperties.getDiscreteValues().begin(), attrProperties.getDiscreteValues().end(), parsedAttribute); - // check if attribute is valid - if (finder == attrProperties.getDiscreteValues().end()) { - errorFormat = "value is not within the set of allowed values for attribute '" + toString(attribute) + "'"; - } - } - // set extra check for color values - if (attrProperties.isColor() && !canParse(parsedAttribute)) { - errorFormat = "Invalid RGB format or named color; "; - } - // set extra check for filename values - if (attrProperties.isFilename()) { - if (SUMOXMLDefinitions::isValidFilename(parsedAttribute) == false) { - errorFormat = "Filename contains invalid characters; "; - } else if (parsedAttribute.empty() && !attrProperties.isOptional()) { - errorFormat = "Filename cannot be empty; "; - } - } - // set extra check for SVCPermissions values - if (attrProperties.isVClass()) { - if (!canParseVehicleClasses(parsedAttribute)) { - errorFormat = "List of VClasses isn't valid; "; - parsedAttribute = defaultValue; - } - } - // set extra check for RouteProbes - if ((attribute == SUMO_ATTR_ROUTEPROBE) && !SUMOXMLDefinitions::isValidAdditionalID(parsedAttribute)) { - errorFormat = "RouteProbe ID contains invalid characters; "; - } - // set extra check for list of edges - if ((attribute == SUMO_ATTR_EDGES) && parsedAttribute.empty()) { - errorFormat = "List of edges cannot be empty; "; - } - // set extra check for list of lanes - if ((attribute == SUMO_ATTR_LANES) && parsedAttribute.empty()) { - errorFormat = "List of lanes cannot be empty; "; - } - // set extra check for list of VTypes - if ((attribute == SUMO_ATTR_VTYPES) && !parsedAttribute.empty() && !SUMOXMLDefinitions::isValidListOfTypeID(parsedAttribute)) { - errorFormat = "List of vTypes contains invalid characters; "; - } - // set extra check for list of RouteProbe - if ((attribute == SUMO_ATTR_ROUTEPROBE) && !parsedAttribute.empty() && !SUMOXMLDefinitions::isValidAdditionalID(parsedAttribute)) { - errorFormat = "RouteProbe ID contains invalid characters; "; - } - // If attribute has an invalid format - if (errorFormat.size() > 0) { - // if attribute is optional and has a default value, obtain it as string. In other case, abort. - if (attrProperties.isOptional()) { - WRITE_DEBUG("Format of optional " + attrProperties.getDescription() + " attribute '" + toString(attribute) + "' of " + - warningMessage + " is invalid; " + errorFormat + "Default value will be used."); - // set default value defined in AttrProperties - parsedAttribute = attrProperties.getDefaultValue(); - } else { - WRITE_WARNING("Format of essential " + attrProperties.getDescription() + " attribute '" + toString(attribute) + "' of " + - warningMessage + " is invalid; " + errorFormat + GNETagProperties.getTagStr() + " cannot be created"); - // set default value (To avoid errors in parse(parsedAttribute)) - parsedAttribute = defaultValue; - // return false to abort creation of element - return false; - } - } - // return true to continue creation of element - return true; -} - - -bool -GNEAttributeCarrier::parseMaskedPositionAttribute(const SUMOSAXAttributes& attrs, const std::string& objectID, const GNETagProperties& GNETagProperties, - const GNEAttributeProperties& attrProperties, std::string& parsedAttribute, std::string& warningMessage) { - // if element can mask their XYPosition, then must be extracted X Y coordiantes separeted - std::string x, y, z; - bool parsedOk = true; - // give a default value to parsedAttribute to avoid problem parsing invalid positions - parsedAttribute = "0,0"; - if (attrs.hasAttribute(SUMO_ATTR_X)) { - x = attrs.get(SUMO_ATTR_X, objectID.c_str(), parsedOk, false); - // check that X attribute is valid - if (!canParse(x)) { - WRITE_WARNING("Format of essential " + attrProperties.getDescription() + " attribute '" + toString(SUMO_ATTR_X) + "' of " + - warningMessage + " is invalid; Cannot be parsed to float; " + GNETagProperties.getTagStr() + " cannot be created"); - // abort parsing (and creation) of element - return false; - } - } else { - WRITE_WARNING("Essential " + attrProperties.getDescription() + " attribute '" + toString(SUMO_ATTR_X) + "' of " + - warningMessage + " is missing; " + GNETagProperties.getTagStr() + " cannot be created"); - // abort parsing (and creation) of element - return false; - } - if (attrs.hasAttribute(SUMO_ATTR_Y)) { - y = attrs.get(SUMO_ATTR_Y, objectID.c_str(), parsedOk, false); - // check that X attribute is valid - if (!canParse(y)) { - WRITE_WARNING("Format of essential " + attrProperties.getDescription() + " attribute '" + toString(SUMO_ATTR_Y) + "' of " + - warningMessage + " is invalid; Cannot be parsed to float; " + GNETagProperties.getTagStr() + " cannot be created"); - // abort parsing (and creation) of element - return false; - } - } else { - WRITE_WARNING("Essential " + attrProperties.getDescription() + " attribute '" + toString(SUMO_ATTR_Y) + "' of " + - warningMessage + " is missing; " + GNETagProperties.getTagStr() + " cannot be created"); - // abort parsing (and creation) of element - return false; - } - // Z attribute is optional - if (attrs.hasAttribute(SUMO_ATTR_Z)) { - z = attrs.get(SUMO_ATTR_Z, objectID.c_str(), parsedOk, false); - // check that Z attribute is valid - if (!canParse(z)) { - WRITE_WARNING("Format of optional " + attrProperties.getDescription() + " attribute '" + toString(SUMO_ATTR_Z) + "' of " + - warningMessage + " is invalid; Cannot be parsed to float; " + GNETagProperties.getTagStr() + " cannot be created"); - // leave Z attribute empty - z.clear(); - } - } - // create Position attribute using parsed coordinates X, Y and, optionally, Z - if (z.empty()) { - parsedAttribute = x + "," + y; - } else { - parsedAttribute = x + "," + y + "," + z; - } - // continue creation of element - return true; -} - - /****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/GNEAttributeCarrier.h sumo-1.12.0/src/netedit/elements/GNEAttributeCarrier.h --- sumo-1.11.0/src/netedit/elements/GNEAttributeCarrier.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/GNEAttributeCarrier.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -50,6 +50,7 @@ /// @brief declare friend class friend class GNEChange_Attribute; friend class GNEChange_EnableAttribute; + friend class GNEFrameAttributeModules; public: @@ -77,7 +78,10 @@ /// @brief check if attribute carrier must be drawn using selecting color. bool drawUsingSelectColor() const; - /// @name Function related with graphics (must be implemented in all childs) + /// @brief get GNEHierarchicalElement associated with this AttributeCarrier + virtual GNEHierarchicalElement* getHierarchicalElement() = 0; + + /// @name Function related with graphics (must be implemented in all children) /// @{ /// @brief get ID (all Attribute Carriers have one) virtual const std::string& getID() const = 0; @@ -90,6 +94,9 @@ /// @} + /// @brief reset attribute carrier to their default values + void resetDefaultValues(); + /// @name Functions related with attributes (must be implemented in all children) /// @{ /* @brief method for getting the Attribute of an XML key @@ -174,60 +181,46 @@ */ std::string getAlternativeValueForDisabledAttributes(SumoXMLAttr key) const; - /// @name Certain attributes and ACs (for example, connections) can be either loaded or guessed. The following static variables are used to remark it. - /// @{ - /// @brief feature is still unchanged after being loaded (implies approval) - static const std::string FEATURE_LOADED; - - /// @brief feature has been reguessed (may still be unchanged be we can't tell (yet) - static const std::string FEATURE_GUESSED; - - /// @brief feature has been manually modified (implies approval) - static const std::string FEATURE_MODIFIED; - - /// @brief feature has been approved but not changed (i.e. after being reguessed) - static const std::string FEATURE_APPROVED; - /// @} - - /// @brief max number of attributes allowed for every tag - static const size_t MAXNUMBEROFATTRIBUTES; - - /// @brief invalid double position - static const double INVALID_POSITION; - /// @brief method for getting the attribute in the context of object selection virtual std::string getAttributeForSelection(SumoXMLAttr key) const; /// @brief get tag assigned to this object in string format const std::string& getTagStr() const; - /// @brief get Tag Property assigned to this object - const GNETagProperties& getTagProperty() const; - /// @brief get FXIcon associated to this AC FXIcon* getIcon() const; - /// @brief get Tag Properties - static const GNETagProperties& getTagProperties(SumoXMLTag tag); + /// @brief check if this AC is template + bool isTemplate() const; + + /// @brief get tagProperty associated with this Attribute Carrier + const GNETagProperties& getTagProperty() const; - /// @brief get tags of all editable element types - static const std::vector allowedAttributeProperties(const bool onlyDrawables); + /// @brief get tagProperty associated to the given tag + static const GNETagProperties& getTagProperty(SumoXMLTag tag); - /// @brief get tagProperties of all editable element types using TagProperty Type (NetworkEditMode::NETWORKELEMENT, ADDITIONALELEMENT, etc.) - static const std::vector > getAllowedTagPropertiesByCategory(const int tagPropertyCategory, const bool onlyDrawables); + /// @brief get tagProperties associated to the given GNETagProperties::TagType (NETWORKELEMENT, ADDITIONALELEMENT, VEHICLE, etc.) + static const std::vector getTagPropertiesByType(const int tagPropertyCategory); /// @brief true if a value of type T can be parsed from string template static bool canParse(const std::string& string) { try { GNEAttributeCarrier::parse(string); + } catch (EmptyData&) { + // general + return false; } catch (NumberFormatException&) { + // numbers return false; } catch (TimeFormatException&) { - return false; - } catch (EmptyData&) { + // time return false; } catch (BoolFormatException&) { + // booleans + return false; + } catch (InvalidArgument&) { + // colors return false; } return true; @@ -262,71 +255,26 @@ /// @brief check if lanes are consecutives static bool lanesConsecutives(const std::vector& lanes); - /// @brief Parse attribute from XML and show warnings if there are problems parsing it - template - static T parseAttributeFromXML(const SUMOSAXAttributes& attrs, const std::string& objectID, const SumoXMLTag tag, const SumoXMLAttr attribute, bool& abort) { - bool parsedOk = true; - // declare string values - std::string defaultValue, parsedAttribute, warningMessage; - // obtain tag properties - const auto& tagProperties = getTagProperties(tag); - // first check if attribute is deprecated - if (tagProperties.isAttributeDeprecated(attribute)) { - // show warning if deprecateda ttribute is in the SUMOSAXAttributes - if (attrs.hasAttribute(attribute)) { - WRITE_WARNING("Attribute " + toString(attribute) + "' of " + tagProperties.getTagStr() + " is deprecated and will not be loaded."); - } - // return a dummy value - return parse(""); - } - // now check if we're obtaining attribute of an object with an already parsed ID - if (objectID != "") { - warningMessage = tagProperties.getTagStr() + " with ID '" + objectID + "'"; - } else { - warningMessage = tagProperties.getTagStr(); - } - // obtain attribute properties (Only for improving efficiency) - const auto& attrProperties = tagProperties.getAttributeProperties(attribute); - // set a special default value for numerical and boolean attributes (To avoid errors parsing) - if (attrProperties.isNumerical() || attrProperties.isBool()) { - defaultValue = "0"; - } else if (attrProperties.isColor()) { - defaultValue = "black"; - } else if (attrProperties.isposition()) { - defaultValue = "0,0"; - } - // first check that attribute exists in XML - if (attrs.hasAttribute(attribute)) { - // First check if attribute can be parsed to string - parsedAttribute = attrs.get(attribute, objectID.c_str(), parsedOk, false); - // check parsed attribute - if (!checkParsedAttribute(tagProperties, attrProperties, attribute, defaultValue, parsedAttribute, warningMessage)) { - abort = true; - } - } else if (tagProperties.canMaskXYZPositions() && (attribute == SUMO_ATTR_POSITION)) { - // obtain masked position attribute - if (!parseMaskedPositionAttribute(attrs, objectID, tagProperties, attrProperties, parsedAttribute, warningMessage)) { - abort = true; - } - } else { - // if attribute is optional and has a default value, obtain it. In other case, abort. - if (attrProperties.isOptional()) { - parsedAttribute = attrProperties.getDefaultValue(); - } else { - WRITE_WARNING("Essential " + attrProperties.getDescription() + " attribute '" + toString(attribute) + "' of " + - warningMessage + " is missing; " + tagProperties.getTagStr() + " cannot be created"); - // abort parsing (and creation) of element - abort = true; - // set default value (To avoid errors in parse(parsedAttribute)) - parsedAttribute = defaultValue; - } - } - // return parsed attribute - return parse(parsedAttribute); - } + /// @name Certain attributes and ACs (for example, connections) can be either loaded or guessed. The following static variables are used to remark it. + /// @{ + /// @brief feature is still unchanged after being loaded (implies approval) + static const std::string FEATURE_LOADED; + + /// @brief feature has been reguessed (may still be unchanged be we can't tell (yet) + static const std::string FEATURE_GUESSED; + + /// @brief feature has been manually modified (implies approval) + static const std::string FEATURE_MODIFIED; + + /// @brief feature has been approved but not changed (i.e. after being reguessed) + static const std::string FEATURE_APPROVED; + /// @} + + /// @brief max number of attributes allowed for every tag + static const size_t MAXNUMBEROFATTRIBUTES; protected: - /// @brief the xml tag to which this attribute carrier corresponds + /// @brief reference to tagProperty associated with this attribute carrier const GNETagProperties& myTagProperty; /// @brief pointer to net @@ -335,15 +283,18 @@ /// @brief boolean to check if this AC is selected (instead of GUIGlObjectStorage) bool mySelected; - /// @brief dummy TagProperty used for reference some elements (for Example, dummyEdge) - static GNETagProperties dummyTagProperty; + /// @brief whether the current object is a template object (not drawn in the view) + bool myIsTemplate; private: /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0; - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - virtual void setEnabledAttribute(const int enabledAttributes) = 0; + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + virtual void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters) = 0; + + /// @brief reset attributes to their default values without undo-redo (used in GNEFrameAttributeModules) + void resetAttributes(); /// @brief fill Attribute Carriers static void fillAttributeCarriers(); @@ -400,7 +351,7 @@ static void fillCommonVehicleAttributes(SumoXMLTag currentTag); /// @brief fill common flow attributes (used by flows, routeFlows and personFlows) - static void fillCommonFlowAttributes(SumoXMLTag currentTag, const bool forVehicles); + static void fillCommonFlowAttributes(SumoXMLTag currentTag, SumoXMLAttr perHour); /// @brief fill Car Following Model of Vehicle/Person Types static void fillCarFollowingModelAttributes(SumoXMLTag currentTag); @@ -418,19 +369,11 @@ static void fillCommonContainerAttributes(SumoXMLTag currentTag); /// @brief fill stop person attributes - static void fillCommonStopAttributes(SumoXMLTag currentTag, const bool parking); + static void fillCommonStopAttributes(SumoXMLTag currentTag); /// @brief fill Data elements static void fillDataElements(); - /// @brief parse and check attribute (note: This function is only to improve legilibility) - static bool checkParsedAttribute(const GNETagProperties& tagProperties, const GNEAttributeProperties& attrProperties, const SumoXMLAttr attribute, - std::string& defaultValue, std::string& parsedAttribute, std::string& warningMessage); - - /// @brief parse and check masked (note: This function is only to improve legilibility) - static bool parseMaskedPositionAttribute(const SUMOSAXAttributes& attrs, const std::string& objectID, const GNETagProperties& tagProperties, - const GNEAttributeProperties& attrProperties, std::string& parsedAttribute, std::string& warningMessage); - /// @brief map with the tags properties static std::map myTagProperties; diff -Nru sumo-1.11.0/src/netedit/elements/GNEAttributeProperties.cpp sumo-1.12.0/src/netedit/elements/GNEAttributeProperties.cpp --- sumo-1.11.0/src/netedit/elements/GNEAttributeProperties.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/GNEAttributeProperties.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -38,6 +38,7 @@ myAttributeProperty(STRING), myDefinition(""), myDefaultValue(""), + myDefaultActivated(false), myAttrSynonym(SUMO_ATTR_NOTHING), myMinimumRange(0), myMaximumRange(0) {} @@ -50,6 +51,7 @@ myAttributeProperty(attributeProperty), myDefinition(definition), myDefaultValue(defaultValue), + myDefaultActivated(false), myAttrSynonym(SUMO_ATTR_NOTHING), myMinimumRange(0), myMaximumRange(0) { @@ -58,17 +60,9 @@ throw FormatException("Missing definition for AttributeProperty '" + toString(attribute) + "'"); } // if default value isn't empty, but attribute doesn't support default values, throw exception. - if (!defaultValue.empty() && !(attributeProperty & DEFAULTVALUESTATIC)) { + if (!defaultValue.empty() && !(attributeProperty & DEFAULTVALUE)) { throw FormatException("AttributeProperty for '" + toString(attribute) + "' doesn't support default values"); } - // default value cannot be static and mutables at the same time - if ((attributeProperty & DEFAULTVALUESTATIC) && (attributeProperty & DEFAULTVALUEMUTABLE)) { - throw FormatException("Default value for attribute '" + toString(attribute) + "' cannot be static and mutable at the same time"); - } - // Attributes that can write optionally their values in XML must have either a static or a mutable efault value - if ((attributeProperty & XMLOPTIONAL) && !((attributeProperty & DEFAULTVALUESTATIC) || (attributeProperty & DEFAULTVALUEMUTABLE))) { - throw FormatException("Attribute '" + toString(attribute) + "' requires a either static or mutable default value"); - } // Attributes cannot be flowdefinition and enabilitablet at the same time if ((attributeProperty & FLOWDEFINITION) && (attributeProperty & ACTIVATABLE)) { throw FormatException("Attribute '" + toString(attribute) + "' cannot be flowdefinition and activatable at the same time"); @@ -103,10 +97,6 @@ throw FormatException("invalid range"); } } - // check that positive attributes correspond only to a int, floats or SUMOTimes - if (isOptional() && !(hasStaticDefaultValue() || hasMutableDefaultValue())) { - throw FormatException("if attribute is optional, must have either a static or dynamic default value"); - } } @@ -115,7 +105,17 @@ if (isDiscrete()) { myDiscreteValues = discreteValues; } else { - throw FormatException("AttributeProperty doesn't support discrete values values"); + throw FormatException("AttributeProperty doesn't support discrete values"); + } +} + + +void +GNEAttributeProperties::setDefaultActivated(const bool value) { + if (isActivatable()) { + myDefaultActivated = value; + } else { + throw FormatException("AttributeProperty doesn't support default activated"); } } @@ -196,6 +196,12 @@ } +bool +GNEAttributeProperties::getDefaultActivated() const { + return myDefaultActivated; +} + + std::string GNEAttributeProperties::getDescription() const { std::string pre; @@ -217,9 +223,6 @@ if ((myAttributeProperty & DISCRETE) != 0) { pre += "discrete "; } - if ((myAttributeProperty & XMLOPTIONAL) != 0) { - pre += "optional "; - } if ((myAttributeProperty & UNIQUE) != 0) { pre += "unique "; } @@ -303,14 +306,8 @@ bool -GNEAttributeProperties::hasStaticDefaultValue() const { - return (myAttributeProperty & DEFAULTVALUESTATIC) != 0; -} - - -bool -GNEAttributeProperties::hasMutableDefaultValue() const { - return (myAttributeProperty & DEFAULTVALUEMUTABLE) != 0; +GNEAttributeProperties::hasDefaultValue() const { + return (myAttributeProperty & DEFAULTVALUE) != 0; } @@ -422,11 +419,6 @@ bool -GNEAttributeProperties::isOptional() const { - return (myAttributeProperty & XMLOPTIONAL) != 0; -} - -bool GNEAttributeProperties::isDiscrete() const { return (myAttributeProperty & DISCRETE) != 0; } @@ -457,14 +449,14 @@ bool -GNEAttributeProperties::isComplex() const { - return (myAttributeProperty & COMPLEX) != 0; +GNEAttributeProperties::isFlowDefinition() const { + return (myAttributeProperty & FLOWDEFINITION) != 0; } bool -GNEAttributeProperties::isFlowDefinition() const { - return (myAttributeProperty & FLOWDEFINITION) != 0; +GNEAttributeProperties::hasAutomaticID() const { + return (myAttributeProperty & AUTOMATICID) != 0; } /****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/GNEAttributeProperties.h sumo-1.12.0/src/netedit/elements/GNEAttributeProperties.h --- sumo-1.11.0/src/netedit/elements/GNEAttributeProperties.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/GNEAttributeProperties.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -45,33 +45,31 @@ /// @brief struct with the tag Properties enum AttrProperty { - INT = 1 << 0, // Attribute is an integer (Including Zero) - FLOAT = 1 << 1, // Attribute is a float - SUMOTIME = 1 << 2, // Attribute is a SUMOTime - BOOL = 1 << 3, // Attribute is boolean (0/1, true/false) - STRING = 1 << 4, // Attribute is a string - POSITION = 1 << 5, // Attribute is a position defined by doubles (x,y or x,y,z) - COLOR = 1 << 6, // Attribute is a color defined by a specifically word (Red, green) or by a special format (XXX,YYY,ZZZ) - VCLASS = 1 << 7, // Attribute is a VClass (passenger, bus, motorcicle...) - POSITIVE = 1 << 8, // Attribute is positive (Including Zero) - UNIQUE = 1 << 9, // Attribute is unique (cannot be edited in a selection of similar elements (ID, Position...) - FILENAME = 1 << 10, // Attribute is a filename (string that cannot contains certain characters) - DISCRETE = 1 << 11, // Attribute is discrete (only certain values are allowed) - PROBABILITY = 1 << 12, // Attribute is probability (only allowed values between 0 and 1, including both) - ANGLE = 1 << 13, // Attribute is an angle (only takes values between 0 and 360, including both, another value will be automatically reduced - LIST = 1 << 14, // Attribute is a list of other elements separated by spaces - SECUENCIAL = 1 << 15, // Attribute is a special sequence of elements (for example: secuencial lanes in Multi Lane E2 detectors) - XMLOPTIONAL = 1 << 16, // Attribute will not be written in XML file if current value is the same of his default Static/Mutable value - DEFAULTVALUESTATIC = 1 << 17, // Attribute owns a static default value - DEFAULTVALUEMUTABLE = 1 << 18, // Attribute owns a mutable default value (Default value depends of value of other attribute) - VCLASSES = 1 << 19, // Attribute is a combination of VClasses (allow/disallow) - SYNONYM = 1 << 20, // Attribute will be written with a different name in der XML - RANGE = 1 << 21, // Attribute only accept a range of elements (example: Probability [0,1]) - EXTENDED = 1 << 22, // Attribute is extended (in Frame will not be shown, but is editable in a Dialog, see VType attributes) - UPDATEGEOMETRY = 1 << 23, // Attribute require update geometry at the end of function setAttribute(...) - ACTIVATABLE = 1 << 24, // Attribute can be switch on/off using a checkbox in frame - COMPLEX = 1 << 25, // Attribute is complex: Require a special function to check if the given value is valid - FLOWDEFINITION = 1 << 26, // Attribute is part of a flow definition (Number, vehsPerHour...) + INT = 1 << 0, // Attribute is an integer (Including Zero) + FLOAT = 1 << 1, // Attribute is a float + SUMOTIME = 1 << 2, // Attribute is a SUMOTime + BOOL = 1 << 3, // Attribute is boolean (0/1, true/false) + STRING = 1 << 4, // Attribute is a string + POSITION = 1 << 5, // Attribute is a position defined by doubles (x,y or x,y,z) + COLOR = 1 << 6, // Attribute is a color defined by a specifically word (Red, green) or by a special format (XXX,YYY,ZZZ) + VCLASS = 1 << 7, // Attribute is a VClass (passenger, bus, motorcicle...) + POSITIVE = 1 << 8, // Attribute is positive (Including Zero) + UNIQUE = 1 << 9, // Attribute is unique (cannot be edited in a selection of similar elements (ID, Position...) + FILENAME = 1 << 10, // Attribute is a filename (string that cannot contains certain characters) + DISCRETE = 1 << 11, // Attribute is discrete (only certain values are allowed) + PROBABILITY = 1 << 12, // Attribute is probability (only allowed values between 0 and 1, including both) + ANGLE = 1 << 13, // Attribute is an angle (only takes values between 0 and 360, including both, another value will be automatically reduced + LIST = 1 << 14, // Attribute is a list of other elements separated by spaces + SECUENCIAL = 1 << 15, // Attribute is a special sequence of elements (for example: secuencial lanes in Multi Lane E2 detectors) + DEFAULTVALUE = 1 << 16, // Attribute owns a static default value + VCLASSES = 1 << 17, // Attribute is a combination of VClasses (allow/disallow) + SYNONYM = 1 << 18, // Attribute will be written with a different name in der XML + RANGE = 1 << 19, // Attribute only accept a range of elements (example: Probability [0,1]) + EXTENDED = 1 << 20, // Attribute is extended (in Frame will not be shown, but is editable in a Dialog, see VType attributes) + UPDATEGEOMETRY = 1 << 21, // Attribute require update geometry at the end of function setAttribute(...) + ACTIVATABLE = 1 << 22, // Attribute can be switch on/off using a checkbox in frame + FLOWDEFINITION = 1 << 23, // Attribute is part of a flow definition (Number, vehsPerHour...) + AUTOMATICID = 1 << 24, // Attribute id can generate their own ID (used by additionals, vehicles, etc...) }; /// @brief default constructor @@ -89,6 +87,9 @@ /// @brief set discrete values void setDiscreteValues(const std::vector& discreteValues); + /// @brief set default activated value + void setDefaultActivated(const bool value); + /// @brief set synonim void setSynonym(const SumoXMLAttr synonym); @@ -116,6 +117,9 @@ /// @brief get default value const std::string& getDefaultValue() const; + /// @brief get default active value + bool getDefaultActivated() const; + /// @brief return a description of attribute std::string getDescription() const; @@ -131,11 +135,8 @@ /// @brief get maximum range double getMaximumRange() const; - /// @brief return true if attribute owns a static default value - bool hasStaticDefaultValue() const; - - /// @brief return true if attribute owns a mutable default value - bool hasMutableDefaultValue() const; + /// @brief return true if attribute owns a default value + bool hasDefaultValue() const; /// @brief return true if Attr correspond to an element that will be written in XML with another name bool hasAttrSynonym() const; @@ -191,9 +192,6 @@ /// @brief return true if atribute is unique bool isUnique() const; - /// @brief return true if atribute is optional (it will be written in XML only if his value is different of default value) - bool isOptional() const; - /// @brief return true if atribute is discrete bool isDiscrete() const; @@ -209,12 +207,12 @@ /// @brief return true if atribute is activatable bool isActivatable() const; - /// @brief return true if atribute is complex - bool isComplex() const; - /// @brief return true if atribute is part of a flow definition bool isFlowDefinition() const; + /// @brief return true if attribute ID can generate an automatic ID + bool hasAutomaticID() const; + private: /// @brief XML Attribute SumoXMLAttr myAttribute; @@ -234,6 +232,9 @@ /// @brief default value (by default empty) std::string myDefaultValue; + /// @brief default activated (by default false) + bool myDefaultActivated; + /// @brief discrete values that can take this Attribute (by default empty) std::vector myDiscreteValues; diff -Nru sumo-1.11.0/src/netedit/elements/GNECandidateElement.cpp sumo-1.12.0/src/netedit/elements/GNECandidateElement.cpp --- sumo-1.11.0/src/netedit/elements/GNECandidateElement.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/GNECandidateElement.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/elements/GNECandidateElement.h sumo-1.12.0/src/netedit/elements/GNECandidateElement.h --- sumo-1.11.0/src/netedit/elements/GNECandidateElement.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/GNECandidateElement.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/elements/GNEGeneralHandler.cpp sumo-1.12.0/src/netedit/elements/GNEGeneralHandler.cpp --- sumo-1.11.0/src/netedit/elements/GNEGeneralHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/GNEGeneralHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -44,19 +44,73 @@ void GNEGeneralHandler::beginTag(SumoXMLTag tag, const SUMOSAXAttributes& attrs) { - // parse additional elements - myAdditionalHandler.beginParseAttributes(tag, attrs); - // parse demand elements - myDemandHandler.beginParseAttributes(tag, attrs); + switch (tag) { + case SUMO_TAG_PARAM: + case SUMO_TAG_INTERVAL: + if (myQueue.size() > 0) { + // try to parse additional or demand element depending of last inserted tag + if (myQueue.back().additional && myAdditionalHandler.beginParseAttributes(tag, attrs)) { + myQueue.push_back(TagType(tag, true, false)); + } else if (myQueue.back().demand && myDemandHandler.beginParseAttributes(tag, attrs)) { + myQueue.push_back(TagType(tag, false, true)); + } else { + myQueue.push_back(TagType(tag, false, false)); + } + } else { + myQueue.push_back(TagType(tag, false, false)); + } + break; + case SUMO_TAG_FLOW: + if (myQueue.size() > 0) { + // try to parse additional or demand element depending of last inserted tag + if (myQueue.back().additional && myAdditionalHandler.beginParseAttributes(tag, attrs)) { + myQueue.push_back(TagType(tag, true, false)); + } else if (myDemandHandler.beginParseAttributes(tag, attrs)) { + myQueue.push_back(TagType(tag, false, true)); + } else { + myQueue.push_back(TagType(tag, false, false)); + } + } else { + myQueue.push_back(TagType(tag, false, false)); + } + break; + default: + // try to parse additional or demand element + if (myAdditionalHandler.beginParseAttributes(tag, attrs)) { + myQueue.push_back(TagType(tag, true, false)); + } else if (myDemandHandler.beginParseAttributes(tag, attrs)) { + myQueue.push_back(TagType(tag, false, true)); + } else { + myQueue.push_back(TagType(tag, false, false)); + } + break; + } + // maximum 10 tagTypes + if (myQueue.size() > 10) { + myQueue.pop_front(); + } } void GNEGeneralHandler::endTag() { - // end parse additional elements - myAdditionalHandler.endParseAttributes(); - // end parse demand elements - myDemandHandler.endParseAttributes(); + // check tagType + if (myQueue.back().additional) { + // end parse additional elements + myAdditionalHandler.endParseAttributes(); + } else if (myQueue.back().demand) { + // end parse demand elements + myDemandHandler.endParseAttributes(); + } else { + WRITE_ERROR(toString(myQueue.back().tag) + " cannot be processed either with additional handler nor with demand handler"); + } +} + + +GNEGeneralHandler::TagType::TagType(SumoXMLTag tag_, const bool additional_, const bool demand_) : + tag(tag_), + additional(additional_), + demand(demand_) { } /****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/GNEGeneralHandler.h sumo-1.12.0/src/netedit/elements/GNEGeneralHandler.h --- sumo-1.11.0/src/netedit/elements/GNEGeneralHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/GNEGeneralHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -52,6 +52,24 @@ ~GNEGeneralHandler(); private: + /// @brief tagType + struct TagType { + /// @brief constructor + TagType(SumoXMLTag tag, const bool additional, const bool demand); + + /// @brief tag related with this TagType + const SumoXMLTag tag; + + /// @brief tagType is additional + const bool additional; + + /// @brief tagType is demand + const bool demand; + }; + + /// @brief queue with the inserted tags + std::list myQueue; + /// @brief additional handler GNEAdditionalHandler myAdditionalHandler; diff -Nru sumo-1.11.0/src/netedit/elements/GNEHierarchicalContainer.cpp sumo-1.12.0/src/netedit/elements/GNEHierarchicalContainer.cpp --- sumo-1.11.0/src/netedit/elements/GNEHierarchicalContainer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/GNEHierarchicalContainer.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/elements/GNEHierarchicalContainer.h sumo-1.12.0/src/netedit/elements/GNEHierarchicalContainer.h --- sumo-1.11.0/src/netedit/elements/GNEHierarchicalContainer.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/GNEHierarchicalContainer.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/elements/GNEHierarchicalElement.cpp sumo-1.12.0/src/netedit/elements/GNEHierarchicalElement.cpp --- sumo-1.11.0/src/netedit/elements/GNEHierarchicalElement.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/GNEHierarchicalElement.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/elements/GNEHierarchicalElement.h sumo-1.12.0/src/netedit/elements/GNEHierarchicalElement.h --- sumo-1.11.0/src/netedit/elements/GNEHierarchicalElement.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/GNEHierarchicalElement.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -66,6 +66,11 @@ /// @brief Destructor ~GNEHierarchicalElement(); + /// @brief get GNEHierarchicalElement associated with this AttributeCarrier + GNEHierarchicalElement* getHierarchicalElement() { + return this; + } + /// @name Functions related with geometry of element /// @{ /// @brief update pre-computed geometry information diff -Nru sumo-1.11.0/src/netedit/elements/GNETagProperties.cpp sumo-1.12.0/src/netedit/elements/GNETagProperties.cpp --- sumo-1.11.0/src/netedit/elements/GNETagProperties.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/GNETagProperties.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -46,7 +46,7 @@ } -GNETagProperties::GNETagProperties(const SumoXMLTag tag, int tagType, int tagProperty, GUIIcon icon, const SumoXMLTag XMLTag, +GNETagProperties::GNETagProperties(const SumoXMLTag tag, const int tagType, const int tagProperty, const GUIIcon icon, const SumoXMLTag XMLTag, const std::vector parentTags, const unsigned int backgroundColor) : myTag(tag), myTagStr(toString(tag)), @@ -55,6 +55,7 @@ myIcon(icon), myXMLTag(XMLTag), myParentTags(parentTags), + myFieldString(toString(tag)), myBackgroundColor(backgroundColor) { } @@ -136,7 +137,7 @@ // iterate over attribute properties for (const auto& attributeProperty : myAttributeProperties) { if (attributeProperty.getAttr() == attr) { - if (!attributeProperty.hasStaticDefaultValue()) { + if (!attributeProperty.hasDefaultValue()) { throw ProcessError("attribute '" + attributeProperty.getAttrStr() + "' doesn't have a default value"); } else { return attributeProperty.getDefaultValue(); @@ -180,6 +181,18 @@ } +const std::string& +GNETagProperties::getFieldString() const { + return myFieldString; +} + + +void +GNETagProperties::setFieldString(const std::string& fieldString) { + myFieldString = fieldString; +} + + unsigned int GNETagProperties::getBackGroundColor() const { return myBackgroundColor; @@ -326,6 +339,12 @@ bool +GNETagProperties::isFlow() const { + return (myTagType & FLOW) != 0; +} + + +bool GNETagProperties::isPerson() const { return (myTagType & PERSON) != 0; } @@ -416,8 +435,8 @@ bool -GNETagProperties::isNotDrawable() const { - return (myTagProperty & NOTDRAWABLE) != 0; +GNETagProperties::isDrawable() const { + return (myTagProperty & NOTDRAWABLE) == 0; } @@ -484,12 +503,6 @@ bool -GNETagProperties::canMaskXYZPositions() const { - return (myTagProperty & MASKXYZPOSITION) != 0; -} - - -bool GNETagProperties::canCenterCameraAfterCreation() const { return (myTagProperty & CENTERAFTERCREATION) != 0; } @@ -501,6 +514,12 @@ } +bool +GNETagProperties::requireProj() const { + return (myTagProperty & REQUIERE_PROJ) != 0; +} + + bool GNETagProperties::isAttributeDeprecated(SumoXMLAttr attr) const { return (std::find(myDeprecatedAttributes.begin(), myDeprecatedAttributes.end(), attr) != myDeprecatedAttributes.end()); diff -Nru sumo-1.11.0/src/netedit/elements/GNETagProperties.h sumo-1.12.0/src/netedit/elements/GNETagProperties.h --- sumo-1.11.0/src/netedit/elements/GNETagProperties.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/GNETagProperties.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -51,28 +51,29 @@ STOPPINGPLACE = 1 << 6, // StoppingPlaces (BusStops, ChargingStations...) DETECTOR = 1 << 7, // Detectors (E1, E2...) // sub demand elements - VTYPE = 1 << 8, // Vehicle types (vType and pTye) - VEHICLE = 1 << 9, // Vehicles (Vehicles, trips, flows, and routeFlows) + VTYPE = 1 << 8, // Vehicle types (vType and vTypeDistribution) + VEHICLE = 1 << 9, // Vehicles (Vehicles, trips, flows...) ROUTE = 1 << 10, // Routes and embedded routes STOP = 1 << 11, // Stops + FLOW = 1 << 12, // Flows // persons - PERSON = 1 << 12, // Persons (Persons and personFlows) - PERSONPLAN = 1 << 13, // Person plans (Walks, rides, personTrips and stopPersons) - PERSONTRIP = 1 << 14, // Person Trips - WALK = 1 << 15, // Walks - RIDE = 1 << 16, // Rides - STOPPERSON = 1 << 17, // Person stops + PERSON = 1 << 13, // Persons (Persons and personFlows) + PERSONPLAN = 1 << 14, // Person plans (Walks, rides, personTrips and stopPersons) + PERSONTRIP = 1 << 15, // Person Trips + WALK = 1 << 16, // Walks + RIDE = 1 << 17, // Rides + STOPPERSON = 1 << 18, // Person stops // containers - CONTAINER = 1 << 18, // Containers (Containers and personFlows) - CONTAINERPLAN = 1 << 19, // Container plans (tranship and transport) - TRANSPORT = 1 << 20, // Transport - TRANSHIP = 1 << 21, // Tranship - STOPCONTAINER = 1 << 22, // Container stops + CONTAINER = 1 << 19, // Containers (Containers and personFlows) + CONTAINERPLAN = 1 << 20, // Container plans (tranship and transport) + TRANSPORT = 1 << 21, // Transport + TRANSHIP = 1 << 22, // Tranship + STOPCONTAINER = 1 << 23, // Container stops // sub data elements - GENERICDATA = 1 << 23, // Generic data (GNEEdgeData, GNELaneData...) + GENERICDATA = 1 << 24, // Generic data (GNEEdgeData, GNELaneData...) // other - SYMBOL = 1 << 24, // Symbol elements (VSSSymbols, RerouterSymbols...) - INTERNALLANE = 1 << 25, // Internal Lane + SYMBOL = 1 << 25, // Symbol elements (VSSSymbols, RerouterSymbols...) + INTERNALLANE = 1 << 26, // Internal Lane }; enum TagProperty { @@ -85,19 +86,19 @@ REPARENT = 1 << 6, // Element can be reparent NOTSELECTABLE = 1 << 7, // Element cannot be selected MASKSTARTENDPOS = 1 << 8, // Element mask attributes StartPos and EndPos as "length" (Only used in the appropiate GNEFrame) - MASKXYZPOSITION = 1 << 9, // Element mask attributes X, Y and Z as "Position" - WRITECHILDRENSEPARATE = 1 << 10, // Element writes their children in a separated filename - NOPARAMETERS = 1 << 11, // Element doesn't accept parameters "key1=value1|key2=value2|...|keyN=valueN" (by default all tags supports parameters) - RTREE = 1 << 12, // Element is placed in RTREE - CENTERAFTERCREATION = 1 << 13, // Camera is moved after element creation - EMBEDDED_ROUTE = 1 << 14, // Element has an embedded route + WRITECHILDRENSEPARATE = 1 << 9, // Element writes their children in a separated filename + NOPARAMETERS = 1 << 10, // Element doesn't accept parameters "key1=value1|key2=value2|...|keyN=valueN" (by default all tags supports parameters) + RTREE = 1 << 11, // Element is placed in RTREE + CENTERAFTERCREATION = 1 << 12, // Camera is moved after element creation + EMBEDDED_ROUTE = 1 << 13, // Element has an embedded route + REQUIERE_PROJ = 1 << 14, // Element requiere a geo-projection defined in network }; /// @brief default constructor GNETagProperties(); /// @brief parameter constructor - GNETagProperties(const SumoXMLTag tag, int tagType, int tagProperty, GUIIcon icon, const SumoXMLTag XMLTag, + GNETagProperties(const SumoXMLTag tag, const int tagType, const int tagProperty, const GUIIcon icon, const SumoXMLTag XMLTag, const std::vector parentTags = {}, const unsigned int backgroundColor = FXRGBA(255, 255, 255, 255)); /// @brief destructor @@ -121,6 +122,12 @@ /// @brief add deprecated Attribute void addDeprecatedAttribute(SumoXMLAttr attr); + /// @brief get field string (by default tag in string format) + const std::string& getFieldString() const; + + /// @brief set field that will be drawn in TextFields/ComboBox/etc, + void setFieldString(const std::string& fieldString); + /// @brief get background color unsigned int getBackGroundColor() const; @@ -190,6 +197,9 @@ /// @brief return true if tag correspond to a stop element bool isStop() const; + /// @brief return true if tag correspond to a flow element + bool isFlow() const; + /// @brief return true if tag correspond to a person element bool isPerson() const; @@ -235,8 +245,8 @@ /// @brief return true if tag correspond to a internal lane bool isInternalLane() const; - /// @brief return true if tag correspond to a non drawable element - bool isNotDrawable() const; + /// @brief return true if tag correspond to a drawable element + bool isDrawable() const; /// @brief return true if tag correspond to a selectable element bool isSelectable() const; @@ -268,15 +278,15 @@ /// @brief return true if tag correspond to an element that can mask the attributes "start" and "end" position as attribute "length" bool canMaskStartEndPos() const; - /// @brief return true if tag correspond to an element that can mask the attributes "X", "Y" and "Z" position as attribute "Position" - bool canMaskXYZPositions() const; - /// @brief return true if tag correspond to an element that center camera after creation bool canCenterCameraAfterCreation() const; /// @brief return true if tag correspond to an element that owns a embebbed route bool embebbedRoute() const; + /// @brief return true if tag correspond to an element that requires a geo projection + bool requireProj() const; + /// @brief return true if attribute of this tag is deprecated bool isAttributeDeprecated(SumoXMLAttr attr) const; @@ -308,6 +318,9 @@ /// @brief List with the deprecated Attributes std::vector myDeprecatedAttributes; + /// @brief field string + std::string myFieldString; + /// @brief background color (used in labels and textFields, by default white) unsigned int myBackgroundColor; diff -Nru sumo-1.11.0/src/netedit/elements/network/CMakeLists.txt sumo-1.12.0/src/netedit/elements/network/CMakeLists.txt --- sumo-1.11.0/src/netedit/elements/network/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -5,6 +5,10 @@ GNEEdge.cpp GNELane.h GNELane.cpp + GNEEdgeTemplate.h + GNEEdgeTemplate.cpp + GNELaneTemplate.h + GNELaneTemplate.cpp GNEInternalLane.h GNEInternalLane.cpp GNEConnection.h diff -Nru sumo-1.11.0/src/netedit/elements/network/GNEConnection.cpp sumo-1.12.0/src/netedit/elements/network/GNEConnection.cpp --- sumo-1.11.0/src/netedit/elements/network/GNEConnection.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNEConnection.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -418,7 +418,7 @@ // Pop layer matrix GLHelper::popMatrix(); // check if edge value has to be shown - if (s.edgeValue.show) { + if (s.edgeValue.show(this)) { NBEdge::Connection& nbCon = getNBEdgeConnection(); std::string value = nbCon.getParameter(s.edgeParam, ""); if (value != "") { diff -Nru sumo-1.11.0/src/netedit/elements/network/GNEConnection.h sumo-1.12.0/src/netedit/elements/network/GNEConnection.h --- sumo-1.11.0/src/netedit/elements/network/GNEConnection.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNEConnection.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/src/netedit/elements/network/GNECrossing.cpp sumo-1.12.0/src/netedit/elements/network/GNECrossing.cpp --- sumo-1.11.0/src/netedit/elements/network/GNECrossing.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNECrossing.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -35,35 +35,44 @@ // =========================================================================== // method definitions // =========================================================================== + +GNECrossing::GNECrossing(GNENet* net) : + GNENetworkElement(net, "", GLO_CROSSING, SUMO_TAG_CROSSING, +{}, {}, {}, {}, {}, {}, {}, {}), +myParentJunction(nullptr), +myTemplateNBCrossing(new NBNode::Crossing(nullptr, {}, 0, false, 0, 0, {})) { + // reset default values + resetDefaultValues(); +} + GNECrossing::GNECrossing(GNEJunction* parentJunction, std::vector crossingEdges) : - GNENetworkElement(parentJunction->getNet(), parentJunction->getNBNode()->getCrossing(crossingEdges)->id, - GLO_CROSSING, SUMO_TAG_CROSSING, + GNENetworkElement(parentJunction->getNet(), parentJunction->getNBNode()->getCrossing(crossingEdges)->id, GLO_CROSSING, SUMO_TAG_CROSSING, {}, {}, {}, {}, {}, {}, {}, {}), myParentJunction(parentJunction), -myCrossingEdges(crossingEdges) { +myCrossingEdges(crossingEdges), +myTemplateNBCrossing(nullptr) { // update centering boundary without updating grid updateCenteringBoundary(false); } -GNECrossing::~GNECrossing() {} +GNECrossing::~GNECrossing() { + if (myTemplateNBCrossing) { + delete myTemplateNBCrossing; + } +} const PositionVector& GNECrossing::getCrossingShape() const { - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); - if (crossing) { - return (crossing->customShape.size() > 0) ? crossing->customShape : crossing->shape; - } else { - throw ProcessError("Crossing doesn't exist"); - } + const auto crossing = getNBCrossing(); + return (crossing->customShape.size() > 0) ? crossing->customShape : crossing->shape; } void GNECrossing::updateGeometry() { - // rebuild crossing and walking areas form node parent - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + const auto crossing = getNBCrossing(); // update crossing geometry myCrossingGeometry.updateGeometry(crossing->customShape.size() > 0 ? crossing->customShape : crossing->shape); } @@ -129,7 +138,11 @@ NBNode::Crossing* GNECrossing::getNBCrossing() const { - return myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + if (myTemplateNBCrossing) { + return myTemplateNBCrossing; + } else { + return myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + } } @@ -159,7 +172,7 @@ // continue depending of drawCrossing flag if (drawCrossing) { // get NBCrossing - const auto NBCrossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + const auto NBCrossing = getNBCrossing(); // draw crossing checking whether it is not too small if isn't being drawn for selecting const double selectionScale = isAttributeCarrierSelected() ? s.selectorFrameScale : 1; // set default values @@ -242,7 +255,7 @@ GLHelper::popName(); } // link indices must be drawn in all edit modes if isn't being drawn for selecting - if (s.drawLinkTLIndex.show && !s.drawForRectangleSelection) { + if (s.drawLinkTLIndex.show(myParentJunction) && !s.drawForRectangleSelection) { drawTLSLinkNo(s, NBCrossing); } // draw lock icon @@ -315,7 +328,7 @@ void GNECrossing::updateCenteringBoundary(const bool /*updateGrid*/) { - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + const auto crossing = getNBCrossing(); if (crossing) { if (crossing->customShape.size() > 0) { myBoundary = crossing->customShape.getBoxBoundary(); @@ -335,7 +348,7 @@ std::string GNECrossing::getAttribute(SumoXMLAttr key) const { - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges, (key != SUMO_ATTR_ID)); + const auto crossing = getNBCrossing(); switch (key) { case SUMO_ATTR_ID: // get attribute requires a special case @@ -398,7 +411,7 @@ return false; case SUMO_ATTR_TLLINKINDEX: case SUMO_ATTR_TLLINKINDEX2: - return (myParentJunction->getNBNode()->getCrossing(myCrossingEdges)->tlID != ""); + return (getNBCrossing()->tlID != ""); default: return true; } @@ -413,7 +426,7 @@ bool GNECrossing::isValid(SumoXMLAttr key, const std::string& value) { - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + const auto crossing = getNBCrossing(); switch (key) { case SUMO_ATTR_ID: return false; @@ -466,13 +479,13 @@ const std::map& GNECrossing::getACParametersMap() const { - return myParentJunction->getNBNode()->getCrossing(myCrossingEdges)->getParametersMap(); + return getNBCrossing()->getParametersMap(); } bool GNECrossing::checkEdgeBelong(GNEEdge* edge) const { - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + const auto crossing = getNBCrossing(); if (std::find(crossing->edges.begin(), crossing->edges.end(), edge->getNBEdge()) != crossing->edges.end()) { return true; } else { @@ -497,7 +510,7 @@ void GNECrossing::setAttribute(SumoXMLAttr key, const std::string& value) { - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + const auto crossing = getNBCrossing(); switch (key) { case SUMO_ATTR_ID: throw InvalidArgument("Modifying attribute '" + toString(key) + "' of " + getTagStr() + " isn't allowed"); @@ -522,7 +535,9 @@ // Change width an refresh element crossing->customWidth = parse(value); // update boundary - updateCenteringBoundary(false); + if (myParentJunction) { + updateCenteringBoundary(false); + } break; case SUMO_ATTR_PRIORITY: crossing->priority = parse(value); @@ -541,7 +556,9 @@ // set custom shape crossing->customShape = parse(value); // update boundary - updateCenteringBoundary(false); + if (myParentJunction) { + updateCenteringBoundary(false); + } break; } case GNE_ATTR_SELECTED: @@ -558,7 +575,7 @@ throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); } // Crossing are a special case and we need ot update geometry of junction instead of crossing - if ((key != SUMO_ATTR_ID) && (key != GNE_ATTR_PARAMETERS) && (key != GNE_ATTR_SELECTED)) { + if (myParentJunction && (key != SUMO_ATTR_ID) && (key != GNE_ATTR_PARAMETERS) && (key != GNE_ATTR_SELECTED)) { myParentJunction->updateGeometry(); } // invalidate path calculator @@ -569,7 +586,7 @@ void GNECrossing::setMoveShape(const GNEMoveResult& moveResult) { // set custom shape - myParentJunction->getNBNode()->getCrossing(myCrossingEdges)->customShape = moveResult.shapeToUpdate; + getNBCrossing()->customShape = moveResult.shapeToUpdate; // update geometry updateGeometry(); } diff -Nru sumo-1.11.0/src/netedit/elements/network/GNECrossing.h sumo-1.12.0/src/netedit/elements/network/GNECrossing.h --- sumo-1.11.0/src/netedit/elements/network/GNECrossing.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNECrossing.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -40,7 +40,10 @@ * editor (hence inheritance from FXDelegator) */ class GNECrossing : public GNENetworkElement { + public: + /// @brief default constructor + GNECrossing(GNENet* net); /**@brief Constructor * @param[in] parentJunction GNEJunction in which this crossing is placed @@ -158,6 +161,9 @@ /// @brief crossing geometry GUIGeometry myCrossingGeometry; + /// @brief template NBCrossing + NBNode::Crossing* myTemplateNBCrossing; + private: /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) void setAttribute(SumoXMLAttr key, const std::string& value); diff -Nru sumo-1.11.0/src/netedit/elements/network/GNEEdge.cpp sumo-1.12.0/src/netedit/elements/network/GNEEdge.cpp --- sumo-1.11.0/src/netedit/elements/network/GNEEdge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNEEdge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,9 @@ #include "GNEEdge.h" #include "GNEEdgeType.h" #include "GNELaneType.h" +#include "GNEEdgeTemplate.h" +#include "GNELaneTemplate.h" + //#define DEBUG_SMOOTH_GEOM //#define DEBUGCOND(obj) (true) @@ -332,6 +336,12 @@ // add lane boundaries for (const auto& lane : myLanes) { myBoundary.add(lane->getCenteringBoundary()); + // add parkingArea boundaris + for (const auto& additional : lane->getChildAdditionals()) { + if (additional->getTagProperty().getTag() == SUMO_TAG_PARKING_AREA) { + myBoundary.add(additional->getCenteringBoundary()); + } + } } // ensure that geometry points are selectable even if the lane geometry is strange for (const Position& pos : myNBEdge->getGeometry()) { @@ -433,10 +443,10 @@ int index = geom.indexOfClosest(clickPos, true); if (geom[index].distanceSquaredTo2D(clickPos) < SNAP_RADIUS_SQUARED) { // split at existing geometry point - return geom[index]; + return myNet->getViewNet()->snapToActiveGrid(geom[index]); } else { // split straight between the next two points - return geom.positionAtOffset(geom.nearest_offset_to_point2D(clickPos)); + return myNet->getViewNet()->snapToActiveGrid(geom.positionAtOffset(geom.nearest_offset_to_point2D(clickPos))); } } @@ -606,12 +616,15 @@ for (const auto& connection : myGNEConnections) { // decrease reference connection->decRef(); + // remove it from network + myNet->removeGLObjectFromGrid(connection); + // and from AttributeCarreirs + if (myNet->getAttributeCarriers()->getConnections().count(connection) > 0) { + myNet->getAttributeCarriers()->deleteConnection(connection); + } // delete GNEConnection if is unreferenced if (connection->unreferenced()) { - // remove it from network - myNet->removeGLObjectFromGrid(connection); - // and from AttributeCarreirs - myNet->getAttributeCarriers()->deleteConnection(connection); + // show extra information for tests WRITE_DEBUG("Deleting unreferenced " + connection->getTagStr() + " '" + connection->getID() + "' in rebuildGNEConnections()"); delete connection; @@ -635,7 +648,9 @@ // remove it from network myNet->removeGLObjectFromGrid(connection); // and from AttributeCarreirs - myNet->getAttributeCarriers()->deleteConnection(connection); + if (myNet->getAttributeCarriers()->getConnections().count(connection) > 0) { + myNet->getAttributeCarriers()->deleteConnection(connection); + } // Delete GNEConnectionToErase if is unreferenced if (connection->unreferenced()) { // show extra information for tests @@ -683,32 +698,32 @@ void -GNEEdge::copyTemplate(const GNEInspectorFrame::TemplateEditor::EdgeTemplate& edgeTemplate, GNEUndoList* undoList) { +GNEEdge::copyTemplate(const GNEEdgeTemplate* edgeTemplate, GNEUndoList* undoList) { // copy edge-specific attributes - setAttribute(SUMO_ATTR_NUMLANES, edgeTemplate.edgeParameters.at(SUMO_ATTR_NUMLANES), undoList); - setAttribute(SUMO_ATTR_TYPE, edgeTemplate.edgeParameters.at(SUMO_ATTR_TYPE), undoList); - setAttribute(SUMO_ATTR_PRIORITY, edgeTemplate.edgeParameters.at(SUMO_ATTR_PRIORITY), undoList); - setAttribute(SUMO_ATTR_SPREADTYPE, edgeTemplate.edgeParameters.at(SUMO_ATTR_SPREADTYPE), undoList); - setAttribute(GNE_ATTR_STOPOFFSET, edgeTemplate.edgeParameters.at(GNE_ATTR_STOPOFFSET), undoList); - setAttribute(GNE_ATTR_STOPOEXCEPTION, edgeTemplate.edgeParameters.at(GNE_ATTR_STOPOEXCEPTION), undoList); + setAttribute(SUMO_ATTR_NUMLANES, edgeTemplate->getAttribute(SUMO_ATTR_NUMLANES), undoList); + setAttribute(SUMO_ATTR_TYPE, edgeTemplate->getAttribute(SUMO_ATTR_TYPE), undoList); + setAttribute(SUMO_ATTR_PRIORITY, edgeTemplate->getAttribute(SUMO_ATTR_PRIORITY), undoList); + setAttribute(SUMO_ATTR_SPREADTYPE, edgeTemplate->getAttribute(SUMO_ATTR_SPREADTYPE), undoList); + setAttribute(GNE_ATTR_STOPOFFSET, edgeTemplate->getAttribute(GNE_ATTR_STOPOFFSET), undoList); + setAttribute(GNE_ATTR_STOPOEXCEPTION, edgeTemplate->getAttribute(GNE_ATTR_STOPOEXCEPTION), undoList); // copy raw values for lane-specific attributes - if (isValid(SUMO_ATTR_SPEED, edgeTemplate.edgeParameters.at(SUMO_ATTR_SPEED))) { - setAttribute(SUMO_ATTR_SPEED, edgeTemplate.edgeParameters.at(SUMO_ATTR_SPEED), undoList); + if (isValid(SUMO_ATTR_SPEED, edgeTemplate->getAttribute(SUMO_ATTR_SPEED))) { + setAttribute(SUMO_ATTR_SPEED, edgeTemplate->getAttribute(SUMO_ATTR_SPEED), undoList); } - if (isValid(SUMO_ATTR_WIDTH, edgeTemplate.edgeParameters.at(SUMO_ATTR_WIDTH))) { - setAttribute(SUMO_ATTR_WIDTH, edgeTemplate.edgeParameters.at(SUMO_ATTR_WIDTH), undoList); + if (isValid(SUMO_ATTR_WIDTH, edgeTemplate->getAttribute(SUMO_ATTR_WIDTH))) { + setAttribute(SUMO_ATTR_WIDTH, edgeTemplate->getAttribute(SUMO_ATTR_WIDTH), undoList); } - if (isValid(SUMO_ATTR_ENDOFFSET, edgeTemplate.edgeParameters.at(SUMO_ATTR_ENDOFFSET))) { - setAttribute(SUMO_ATTR_ENDOFFSET, edgeTemplate.edgeParameters.at(SUMO_ATTR_ENDOFFSET), undoList); + if (isValid(SUMO_ATTR_ENDOFFSET, edgeTemplate->getAttribute(SUMO_ATTR_ENDOFFSET))) { + setAttribute(SUMO_ATTR_ENDOFFSET, edgeTemplate->getAttribute(SUMO_ATTR_ENDOFFSET), undoList); } // copy lane attributes as well for (int i = 0; i < (int)myLanes.size(); i++) { - myLanes[i]->setAttribute(SUMO_ATTR_ALLOW, edgeTemplate.laneParameters.at(i).at(SUMO_ATTR_ALLOW), undoList); - myLanes[i]->setAttribute(SUMO_ATTR_SPEED, edgeTemplate.laneParameters.at(i).at(SUMO_ATTR_SPEED), undoList); - myLanes[i]->setAttribute(SUMO_ATTR_WIDTH, edgeTemplate.laneParameters.at(i).at(SUMO_ATTR_WIDTH), undoList); - myLanes[i]->setAttribute(SUMO_ATTR_ENDOFFSET, edgeTemplate.laneParameters.at(i).at(SUMO_ATTR_ENDOFFSET), undoList); - myLanes[i]->setAttribute(GNE_ATTR_STOPOFFSET, edgeTemplate.laneParameters.at(i).at(GNE_ATTR_STOPOFFSET), undoList); - myLanes[i]->setAttribute(GNE_ATTR_STOPOEXCEPTION, edgeTemplate.laneParameters.at(i).at(GNE_ATTR_STOPOEXCEPTION), undoList); + myLanes[i]->setAttribute(SUMO_ATTR_ALLOW, edgeTemplate->getLaneTemplates().at(i)->getAttribute(SUMO_ATTR_ALLOW), undoList); + myLanes[i]->setAttribute(SUMO_ATTR_SPEED, edgeTemplate->getLaneTemplates().at(i)->getAttribute(SUMO_ATTR_SPEED), undoList); + myLanes[i]->setAttribute(SUMO_ATTR_WIDTH, edgeTemplate->getLaneTemplates().at(i)->getAttribute(SUMO_ATTR_WIDTH), undoList); + myLanes[i]->setAttribute(SUMO_ATTR_ENDOFFSET, edgeTemplate->getLaneTemplates().at(i)->getAttribute(SUMO_ATTR_ENDOFFSET), undoList); + myLanes[i]->setAttribute(GNE_ATTR_STOPOFFSET, edgeTemplate->getLaneTemplates().at(i)->getAttribute(GNE_ATTR_STOPOFFSET), undoList); + myLanes[i]->setAttribute(GNE_ATTR_STOPOEXCEPTION, edgeTemplate->getLaneTemplates().at(i)->getAttribute(GNE_ATTR_STOPOEXCEPTION), undoList); } } @@ -733,17 +748,21 @@ setAttribute(GNE_ATTR_PARAMETERS, edgeType->getAttribute(GNE_ATTR_PARAMETERS), undoList); // copy lane attributes as well for (int i = 0; i < (int)myLanes.size(); i++) { + // now copy custom lane values if (edgeType->getLaneTypes().at(i)->getAttribute(SUMO_ATTR_SPEED).size() > 0) { - myLanes[i]->setAttribute(SUMO_ATTR_SPEED, edgeType->getLaneTypes().at(i)->getAttribute(SUMO_ATTR_SPEED), undoList); + myLanes[i]->setAttribute(SUMO_ATTR_SPEED, edgeType->getLaneTypes().at(i)->getAttribute(SUMO_ATTR_SPEED), undoList); } if (edgeType->getLaneTypes().at(i)->getAttribute(SUMO_ATTR_ALLOW).size() > 0) { - myLanes[i]->setAttribute(SUMO_ATTR_ALLOW, edgeType->getLaneTypes().at(i)->getAttribute(SUMO_ATTR_ALLOW), undoList); + myLanes[i]->setAttribute(SUMO_ATTR_ALLOW, edgeType->getLaneTypes().at(i)->getAttribute(SUMO_ATTR_ALLOW), undoList); + } + if (edgeType->getLaneTypes().at(i)->getAttribute(SUMO_ATTR_DISALLOW).size() > 0) { + myLanes[i]->setAttribute(SUMO_ATTR_DISALLOW, edgeType->getLaneTypes().at(i)->getAttribute(SUMO_ATTR_DISALLOW), undoList); } if (edgeType->getLaneTypes().at(i)->getAttribute(SUMO_ATTR_WIDTH).size() > 0) { - myLanes[i]->setAttribute(SUMO_ATTR_WIDTH, edgeType->getLaneTypes().at(i)->getAttribute(SUMO_ATTR_WIDTH), undoList); + myLanes[i]->setAttribute(SUMO_ATTR_WIDTH, edgeType->getLaneTypes().at(i)->getAttribute(SUMO_ATTR_WIDTH), undoList); } if (edgeType->getLaneTypes().at(i)->getAttribute(GNE_ATTR_PARAMETERS).size() > 0) { - myLanes[i]->setAttribute(GNE_ATTR_PARAMETERS, edgeType->getLaneTypes().at(i)->getAttribute(GNE_ATTR_PARAMETERS), undoList); + myLanes[i]->setAttribute(GNE_ATTR_PARAMETERS, edgeType->getLaneTypes().at(i)->getAttribute(GNE_ATTR_PARAMETERS), undoList); } } } @@ -873,6 +892,10 @@ void GNEEdge::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { + // get template editor + GNEInspectorFrame::TemplateEditor* templateEditor = myNet->getViewNet()->getViewParent()->getInspectorFrame()->getTemplateEditor(); + // check if we have to update template + const bool updateTemplate = templateEditor->getEdgeTemplate() ? (templateEditor->getEdgeTemplate()->getID() == getID()) : false; switch (key) { case SUMO_ATTR_WIDTH: case SUMO_ATTR_ENDOFFSET: @@ -967,6 +990,10 @@ default: throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); } + // update template + if (updateTemplate) { + templateEditor->setEdgeTemplate(this); + } } @@ -1464,13 +1491,25 @@ GNEEdge::setAttribute(SumoXMLAttr key, const std::string& value) { // get template editor GNEInspectorFrame::TemplateEditor* templateEditor = myNet->getViewNet()->getViewParent()->getInspectorFrame()->getTemplateEditor(); - // get edge parameters - const auto edgeParameters = templateEditor->getEdgeTemplate().edgeParameters; // check if we have to update template - const bool updateTemplate = edgeParameters.empty() ? false : (edgeParameters.at(SUMO_ATTR_ID) == getID()); + const bool updateTemplate = templateEditor->getEdgeTemplate() ? (templateEditor->getEdgeTemplate()->getID() == getID()) : false; switch (key) { case SUMO_ATTR_ID: myNet->getAttributeCarriers()->updateEdgeID(this, value); + // enable save demand elements if there are stops + for (const auto& stop : getChildDemandElements()) { + if (stop->getTagProperty().isStop() || stop->getTagProperty().isStopPerson()) { + myNet->requireSaveDemandElements(true); + } + } + // also for lanes + for (const auto& lane : myLanes) { + for (const auto& stop : lane->getChildDemandElements()) { + if (stop->getTagProperty().isStop() || stop->getTagProperty().isStopPerson()) { + myNet->requireSaveDemandElements(true); + } + } + } break; case SUMO_ATTR_FROM: myNet->changeEdgeEndpoints(this, value, getToJunction()->getID()); @@ -1607,7 +1646,7 @@ } // update template if (updateTemplate) { - templateEditor->updateEdgeTemplate(this); + templateEditor->setEdgeTemplate(this); } // invalidate path calculator myNet->getPathManager()->getPathCalculator()->invalidatePathCalculator(); @@ -1866,8 +1905,10 @@ } // remove it from network myNet->removeGLObjectFromGrid(connection); - // and from AttributeCarreirs - myNet->getAttributeCarriers()->deleteConnection(connection); + // check if remove it from Attribute Carriers + if (myNet->getAttributeCarriers()->getConnections().count(connection) > 0) { + myNet->getAttributeCarriers()->deleteConnection(connection); + } if (connection->unreferenced()) { // show extra information for tests WRITE_DEBUG("Deleting unreferenced " + connection->getTagStr() + " '" + connection->getID() + "' in removeConnection()"); @@ -2126,10 +2167,10 @@ // check if we can draw it if (!s.drawForPositionSelection && !s.drawForRectangleSelection) { // draw the name and/or the street name - const bool drawStreetName = s.streetName.show && (myNBEdge->getStreetName() != ""); + const bool drawStreetName = s.streetName.show(this) && (myNBEdge->getStreetName() != ""); const bool spreadSuperposed = s.spreadSuperposed && myLanes.back()->drawAsRailway(s) && myNBEdge->isBidiRail(); // check conditions - if (s.edgeName.show || drawStreetName || s.edgeValue.show) { + if (s.edgeName.show(this) || drawStreetName || s.edgeValue.show(this)) { // get first and last lanes const GNELane* firstLane = myLanes[0]; const GNELane* lastLane = myLanes[myLanes.size() - 1]; @@ -2152,7 +2193,7 @@ drawAngle -= 180; } // draw edge name - if (s.edgeName.show) { + if (s.edgeName.show(this)) { drawName(drawPosition, s.scale, s.edgeName, drawAngle); } // draw street name @@ -2160,7 +2201,7 @@ GLHelper::drawTextSettings(s.streetName, myNBEdge->getStreetName(), drawPosition, s.scale, drawAngle); } // draw edge values - if (s.edgeValue.show) { + if (s.edgeValue.show(this)) { // get current scheme const int activeScheme = s.laneColorer.getActive(); // calculate value depending of active scheme diff -Nru sumo-1.11.0/src/netedit/elements/network/GNEEdge.h sumo-1.12.0/src/netedit/elements/network/GNEEdge.h --- sumo-1.11.0/src/netedit/elements/network/GNEEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNEEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -23,7 +23,6 @@ #include #include -#include #include #include @@ -40,6 +39,7 @@ class GNERouteProbe; class GNECrossing; class GNEEdgeType; +class GNEEdgeTemplate; // =========================================================================== // class definitions @@ -224,7 +224,7 @@ void remakeGNEConnections(); /// @brief copy edge attributes from edgetemplate - void copyTemplate(const GNEInspectorFrame::TemplateEditor::EdgeTemplate& edgeTemplate, GNEUndoList* undoList); + void copyTemplate(const GNEEdgeTemplate* edgeTemplate, GNEUndoList* undoList); /// @brief copy edge attributes from edgeType void copyEdgeType(const GNEEdgeType* edgeType, GNEUndoList* undoList); diff -Nru sumo-1.11.0/src/netedit/elements/network/GNEEdgeTemplate.cpp sumo-1.12.0/src/netedit/elements/network/GNEEdgeTemplate.cpp --- sumo-1.11.0/src/netedit/elements/network/GNEEdgeTemplate.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNEEdgeTemplate.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,161 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GNEEdgeTemplate.cpp +/// @author Pablo Alvarez Lopez +/// @date Dec 2021 +/// +// Template for edges +/****************************************************************************/ +#include + +#include + +#include "GNEEdgeTemplate.h" +#include "GNELaneTemplate.h" + +// =========================================================================== +// members methods +// =========================================================================== + +GNEEdgeTemplate::GNEEdgeTemplate(const GNEEdge* edge) : + GNEAttributeCarrier(SUMO_TAG_EDGE, edge->getNet()), + myEdge(edge) { + // update lane templates + updateLaneTemplates(); +} + + +GNEEdgeTemplate::~GNEEdgeTemplate() { + for (const auto& laneTemplate : myLaneTemplates) { + delete laneTemplate; + } +} + + +GNEHierarchicalElement* +GNEEdgeTemplate::getHierarchicalElement() { + return nullptr; +} + + +const std::vector& +GNEEdgeTemplate::getLaneTemplates() const { + return myLaneTemplates; +} + + +void +GNEEdgeTemplate::updateLaneTemplates() { + // first remove all laneTemplates + for (const auto& laneTemplate : myLaneTemplates) { + delete laneTemplate; + } + // now set new laneTemplates + for (const auto& lane : myEdge->getLanes()) { + myLaneTemplates.push_back(new GNELaneTemplate(lane)); + } +} + + +const std::string& +GNEEdgeTemplate::getID() const { + return myEdge->getID(); +} + + +GUIGlObject* +GNEEdgeTemplate::getGUIGlObject() { + return nullptr; +} + + +void +GNEEdgeTemplate::updateGeometry() { + throw InvalidArgument("cannot be called in templates"); +} + + +std::string +GNEEdgeTemplate::getAttribute(SumoXMLAttr key) const { + return myEdge->getAttribute(key); +} + + +void +GNEEdgeTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/, GNEUndoList* /*undoList*/) { + throw InvalidArgument("cannot be called in templates"); +} + + +bool +GNEEdgeTemplate::isValid(SumoXMLAttr /*key*/, const std::string& /*value*/) { + throw InvalidArgument("cannot be called in templates"); +} + +void +GNEEdgeTemplate::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + throw InvalidArgument("cannot be called in templates"); +} + + +void +GNEEdgeTemplate::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + throw InvalidArgument("cannot be called in templates"); +} + + +bool +GNEEdgeTemplate::isAttributeEnabled(SumoXMLAttr /*key*/) const { + return false; +} + + +bool +GNEEdgeTemplate::isAttributeComputed(SumoXMLAttr /*key*/) const { + return false; +} + + +std::string +GNEEdgeTemplate::getPopUpID() const { + return myEdge->getPopUpID(); +} + + +std::string +GNEEdgeTemplate::getHierarchyName() const { + return myEdge->getHierarchyName(); +} + + +const std::map& +GNEEdgeTemplate::getACParametersMap() const { + return myEdge->getACParametersMap(); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEEdgeTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/) { + throw InvalidArgument("cannot be called in templates"); +} + +void +GNEEdgeTemplate::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { + throw InvalidArgument("cannot be called in templates"); +} + +/****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/network/GNEEdgeTemplate.h sumo-1.12.0/src/netedit/elements/network/GNEEdgeTemplate.h --- sumo-1.11.0/src/netedit/elements/network/GNEEdgeTemplate.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNEEdgeTemplate.h 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,140 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GNEEdgeTemplate.h +/// @author Pablo Alvarez Lopez +/// @date Dec 2021 +/// +// Template for edges +/****************************************************************************/ +#pragma once +#include + +#include + +// =========================================================================== +// class declarations +// =========================================================================== +class GNEEdge; +class GNELaneTemplate; + +// =========================================================================== +// class definitions +// =========================================================================== +class GNEEdgeTemplate : public GNEAttributeCarrier { + +public: + /// @brief Constructor + GNEEdgeTemplate(const GNEEdge* edge); + + /// @brief Destructor. + ~GNEEdgeTemplate(); + + /// @brief get GNEHierarchicalElement associated with this AttributeCarrier + GNEHierarchicalElement* getHierarchicalElement(); + + /// @brief get vector with the lane templates of this edge + const std::vector& getLaneTemplates() const; + + /// @brief update lane templates + void updateLaneTemplates(); + + /// @name Function related with graphics + /// @{ + /// @brief get ID (all Attribute Carriers have one) + const std::string& getID() const; + + /// @brief get GUIGlObject associated with this AttributeCarrier + GUIGlObject* getGUIGlObject(); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @} + + /// @name Functions related with attributes + /// @{ + /* @brief method for getting the Attribute of an XML key + * @param[in] key The attribute key + * @return string with the value associated to key + */ + std::string getAttribute(SumoXMLAttr key) const; + + /* @brief method for setting the attribute and letting the object perform additional changes + * @param[in] key The attribute key + * @param[in] value The new value + * @param[in] undoList The undoList on which to register changes + */ + void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList); + + /* @brief method for check if new value for certain attribute is valid + * @param[in] key The attribute key + * @param[in] value The new value + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @brief method for enable attribute + * @param[in] key The attribute key + * @param[in] undoList The undoList on which to register changes + * @note certain attributes can be only enabled, and can produce the disabling of other attributes + */ + void enableAttribute(SumoXMLAttr key, GNEUndoList* undoList); + + /* @brief method for disable attribute + * @param[in] key The attribute key + * @param[in] undoList The undoList on which to register changes + * @note certain attributes can be only enabled, and can produce the disabling of other attributes + */ + void disableAttribute(SumoXMLAttr key, GNEUndoList* undoList); + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + bool isAttributeEnabled(SumoXMLAttr key) const; + + /* @brief method for check if the value for certain attribute is computed (for example, due a network recomputing) + * @param[in] key The attribute key + */ + bool isAttributeComputed(SumoXMLAttr key) const; + + /// @brief get PopPup ID (Used in AC Hierarchy) + std::string getPopUpID() const; + + /// @brief get Hierarchy Name (Used in AC Hierarchy) + std::string getHierarchyName() const; + + /// @} + + /// @brief get parameters map + const std::map& getACParametersMap() const; + +protected: + /// @brief pointer to original edge + const GNEEdge* myEdge; + + /// @brief vector with the lane templates of this edge + std::vector myLaneTemplates; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); + + /// @brief invalidated copy constructor + GNEEdgeTemplate(const GNEEdgeTemplate& s) = delete; + + /// @brief invalidated assignment operator + GNEEdgeTemplate& operator=(const GNEEdgeTemplate& s) = delete; +}; diff -Nru sumo-1.11.0/src/netedit/elements/network/GNEEdgeType.cpp sumo-1.12.0/src/netedit/elements/network/GNEEdgeType.cpp --- sumo-1.11.0/src/netedit/elements/network/GNEEdgeType.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNEEdgeType.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -24,12 +24,12 @@ #include #include #include -#include -#include #include #include "GNEEdgeType.h" #include "GNELaneType.h" +#include "GNEEdgeTemplate.h" +#include "GNELaneTemplate.h" // =========================================================================== @@ -39,9 +39,14 @@ GNEEdgeType::GNEEdgeType(GNECreateEdgeFrame* createEdgeFrame) : GNENetworkElement(createEdgeFrame->getViewNet()->getNet(), "", GLO_EDGE, SUMO_TAG_TYPE, {}, {}, {}, {}, {}, {}, {}, {}) { // create laneType - GNELaneType* laneType = new GNELaneType(this); - laneType->incRef("GNEEdgeType::GNEEdgeType(Default)"); - myLaneTypes.push_back(laneType); + myLaneTypes.push_back(new GNELaneType(this)); +} + + +GNEEdgeType::GNEEdgeType(const GNEEdgeType* edgeType) : + GNENetworkElement(edgeType->getNet(), edgeType->getID(), GLO_EDGE, SUMO_TAG_TYPE, {}, {}, {}, {}, {}, {}, {}, {}), + Parameterised(edgeType->getParametersMap()), +NBTypeCont::EdgeTypeDefinition(edgeType) { } @@ -49,7 +54,6 @@ GNENetworkElement(net, net->getAttributeCarriers()->generateEdgeTypeID(), GLO_EDGE, SUMO_TAG_TYPE, {}, {}, {}, {}, {}, {}, {}, {}) { // create laneType GNELaneType* laneType = new GNELaneType(this); - laneType->incRef("GNEEdgeType::GNEEdgeType"); myLaneTypes.push_back(laneType); } @@ -59,7 +63,6 @@ // create laneTypes for (const auto& laneTypeDef : edgeType->laneTypeDefinitions) { GNELaneType* laneType = new GNELaneType(this, laneTypeDef); - laneType->incRef("GNEEdgeType::GNEEdgeType(parameters)"); myLaneTypes.push_back(laneType); } // copy parameters @@ -81,13 +84,38 @@ } +void +GNEEdgeType::copyTemplate(const GNEEdgeTemplate* edgeTemplate) { + // copy all edge attributes + setAttribute(SUMO_ATTR_NUMLANES, edgeTemplate->getAttribute(SUMO_ATTR_NUMLANES)); + setAttribute(SUMO_ATTR_SPEED, edgeTemplate->getAttribute(SUMO_ATTR_SPEED)); + setAttribute(SUMO_ATTR_ALLOW, edgeTemplate->getAttribute(SUMO_ATTR_ALLOW)); + setAttribute(SUMO_ATTR_DISALLOW, edgeTemplate->getAttribute(SUMO_ATTR_DISALLOW)); + setAttribute(SUMO_ATTR_SPREADTYPE, edgeTemplate->getAttribute(SUMO_ATTR_SPREADTYPE)); + if (canParse(edgeTemplate->getAttribute(SUMO_ATTR_WIDTH))) { + setAttribute(SUMO_ATTR_WIDTH, edgeTemplate->getAttribute(SUMO_ATTR_WIDTH)); + } + setAttribute(SUMO_ATTR_PRIORITY, edgeTemplate->getAttribute(SUMO_ATTR_PRIORITY)); + setAttribute(GNE_ATTR_PARAMETERS, edgeTemplate->getAttribute(GNE_ATTR_PARAMETERS)); + // copy lane attributes + for (int i = 0; i < (int)edgeTemplate->getLaneTemplates().size(); i++) { + if (canParse(edgeTemplate->getLaneTemplates().at(i)->getAttribute(SUMO_ATTR_SPEED))) { + myLaneTypes.at(i)->setAttribute(SUMO_ATTR_SPEED, edgeTemplate->getLaneTemplates().at(i)->getAttribute(SUMO_ATTR_SPEED)); + } + myLaneTypes.at(i)->setAttribute(SUMO_ATTR_ALLOW, edgeTemplate->getLaneTemplates().at(i)->getAttribute(SUMO_ATTR_ALLOW)); + myLaneTypes.at(i)->setAttribute(SUMO_ATTR_DISALLOW, edgeTemplate->getLaneTemplates().at(i)->getAttribute(SUMO_ATTR_DISALLOW)); + if (canParse(edgeTemplate->getLaneTemplates().at(i)->getAttribute(SUMO_ATTR_WIDTH))) { + myLaneTypes.at(i)->setAttribute(SUMO_ATTR_WIDTH, edgeTemplate->getLaneTemplates().at(i)->getAttribute(SUMO_ATTR_WIDTH)); + } + myLaneTypes.at(i)->setAttribute(GNE_ATTR_PARAMETERS, edgeTemplate->getLaneTemplates().at(i)->getAttribute(GNE_ATTR_PARAMETERS)); + } +} + + GNEEdgeType::~GNEEdgeType() { // delete laneTypes for (const auto& laneType : myLaneTypes) { - laneType->decRef("GNEEdgeType::~GNEEdgeType"); - if (laneType->unreferenced()) { - delete laneType; - } + delete laneType; } } @@ -110,66 +138,17 @@ void -GNEEdgeType::addLaneType(GNELaneType* laneType, const int position) { - if (std::find(myLaneTypes.begin(), myLaneTypes.end(), laneType) != myLaneTypes.end()) { - throw ProcessError("GNELaneType already inserted"); - } else { - if (position < 0 || position > (int)myLaneTypes.size()) { - throw ProcessError("invalid position"); - } else if (position == (int)myLaneTypes.size()) { - myLaneTypes.push_back(laneType); - } else { - myLaneTypes[position] = laneType; - } - } -} - - -void -GNEEdgeType::addLaneType(GNEUndoList* undoList) { - // get options - const OptionsCont& oc = OptionsCont::getOptions(); - // create new laneType - GNELaneType* laneType = new GNELaneType(this); - // begin undoList - undoList->begin(GUIIcon::EDGE, "add laneType"); - // add lane - undoList->add(new GNEChange_LaneType(laneType, (int)myLaneTypes.size(), true), true); - // set default parameters - laneType->setAttribute(SUMO_ATTR_SPEED, toString(oc.getFloat("default.speed")), undoList); - laneType->setAttribute(SUMO_ATTR_DISALLOW, oc.getString("default.disallow"), undoList); - laneType->setAttribute(SUMO_ATTR_WIDTH, toString(NBEdge::UNSPECIFIED_WIDTH), undoList); - laneType->setAttribute(GNE_ATTR_PARAMETERS, "", undoList); - // end undoList - undoList->end(); +GNEEdgeType::addLaneType(GNELaneType* laneType) { + myLaneTypes.push_back(laneType); } void -GNEEdgeType::removeLaneType(GNELaneType* laneType) { - auto it = std::find(myLaneTypes.begin(), myLaneTypes.end(), laneType); - if (it == myLaneTypes.end()) { - throw ProcessError("GNELaneType wasn't inserted"); +GNEEdgeType::removeLaneType(const int index) { + if (index < (int)myLaneTypes.size()) { + myLaneTypes.erase(myLaneTypes.begin() + index); } else { - myLaneTypes.erase(it); - } -} - - -void -GNEEdgeType::removeLaneType(const int index, GNEUndoList* undoList) { - // first check if index is correct - if ((myLaneTypes.size() > 1) && (index < (int)myLaneTypes.size())) { - // begin undoList - undoList->begin(GUIIcon::EDGE, "remove laneType"); - // copy laneType values - for (int i = index; i < ((int)myLaneTypes.size() - 1); i++) { - myLaneTypes.at(i)->copyLaneType(myLaneTypes.at(i + 1), undoList); - } - // remove last lane - undoList->add(new GNEChange_LaneType(myLaneTypes.back(), ((int)myLaneTypes.size() - 1), false), true); - // end undoList - undoList->end(); + throw ProcessError("Invalid index"); } } @@ -238,13 +217,17 @@ return toString(speed); } case SUMO_ATTR_ALLOW: - if (attrs.count(SUMO_ATTR_DISALLOW) == 0) { + if ((permissions == SVCAll) || (permissions == -1)) { return "all"; + } else if (permissions == 0) { + return ""; } else { return getVehicleClassNames(permissions); } case SUMO_ATTR_DISALLOW: - if (attrs.count(SUMO_ATTR_DISALLOW) == 0) { + if (permissions == 0) { + return "all"; + } else if ((permissions == SVCAll) || (permissions == -1)) { return ""; } else { return getVehicleClassNames(invertPermissions(permissions)); @@ -288,23 +271,8 @@ void -GNEEdgeType::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { - switch (key) { - case SUMO_ATTR_ID: - case SUMO_ATTR_NUMLANES: - case SUMO_ATTR_SPEED: - case SUMO_ATTR_ALLOW: - case SUMO_ATTR_DISALLOW: - case SUMO_ATTR_SPREADTYPE: - case SUMO_ATTR_DISCARD: - case SUMO_ATTR_WIDTH: - case SUMO_ATTR_PRIORITY: - case GNE_ATTR_PARAMETERS: - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } +GNEEdgeType::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/, GNEUndoList* /*undoList*/) { + throw InvalidArgument("EdgeType attributes cannot be edited here"); } @@ -347,20 +315,8 @@ bool -GNEEdgeType::isAttributeEnabled(SumoXMLAttr key) const { - switch (key) { - // non editable attributes - case SUMO_ATTR_ONEWAY: - case SUMO_ATTR_DISCARD: - case SUMO_ATTR_WIDTHRESOLUTION: - case SUMO_ATTR_MAXWIDTH: - case SUMO_ATTR_MINWIDTH: - case SUMO_ATTR_SIDEWALKWIDTH: - case SUMO_ATTR_BIKELANEWIDTH: - return false; - default: - return true; - } +GNEEdgeType::isAttributeEnabled(SumoXMLAttr /*key*/) const { + return true; } @@ -382,11 +338,26 @@ void GNEEdgeType::setAttribute(SumoXMLAttr key, const std::string& value) { switch (key) { - case SUMO_ATTR_ID: + case SUMO_ATTR_ID: { + // update comboBox + myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->getEdgeTypeSelector()->updateIDinComboBox(getID(), value); + // update ID myNet->getAttributeCarriers()->updateEdgeTypeID(this, value); break; - case SUMO_ATTR_NUMLANES: - throw InvalidArgument("Modifying attribute '" + toString(key) + "' of " + getTagStr() + " isn't allowed"); + } + case SUMO_ATTR_NUMLANES: { + const int numLanes = parse(value); + // add new lanes + while (numLanes > (int)myLaneTypes.size()) { + myLaneTypes.push_back(new GNELaneType(this)); + } + // remove extra lanes + while (numLanes < (int)myLaneTypes.size()) { + delete myLaneTypes.back(); + myLaneTypes.pop_back(); + } + break; + } case SUMO_ATTR_SPEED: if (value.empty()) { attrs.erase(key); @@ -396,19 +367,33 @@ } break; case SUMO_ATTR_ALLOW: - if (value.empty()) { + // parse permissions + permissions = parseVehicleClasses(value); + // check attrs + if ((permissions == SVCAll) || (permissions == -1)) { + attrs.insert(SUMO_ATTR_ALLOW); + attrs.erase(SUMO_ATTR_DISALLOW); + } else if (permissions == 0) { attrs.erase(SUMO_ATTR_ALLOW); + attrs.insert(SUMO_ATTR_DISALLOW); } else { attrs.insert(SUMO_ATTR_ALLOW); - permissions = parseVehicleClasses(value); + attrs.insert(SUMO_ATTR_DISALLOW); } break; case SUMO_ATTR_DISALLOW: - if (value.empty()) { + // parse invert permissions + permissions = invertPermissions(parseVehicleClasses(value)); + // check attrs + if ((permissions == SVCAll) || (permissions == -1)) { + attrs.insert(SUMO_ATTR_ALLOW); attrs.erase(SUMO_ATTR_DISALLOW); + } else if (permissions == 0) { + attrs.erase(SUMO_ATTR_ALLOW); + attrs.insert(SUMO_ATTR_DISALLOW); } else { + attrs.insert(SUMO_ATTR_ALLOW); attrs.insert(SUMO_ATTR_DISALLOW); - permissions = invertPermissions(parseVehicleClasses(value)); } break; case SUMO_ATTR_SPREADTYPE: @@ -446,7 +431,8 @@ } // update edge selector if (myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->shown()) { - myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->getEdgeTypeSelector()->refreshEdgeTypeSelector(); + myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->getEdgeTypeAttributes()->refreshAttributesCreator(); + myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->getLaneTypeSelector()->refreshLaneTypeSelector(); } } diff -Nru sumo-1.11.0/src/netedit/elements/network/GNEEdgeType.h sumo-1.12.0/src/netedit/elements/network/GNEEdgeType.h --- sumo-1.11.0/src/netedit/elements/network/GNEEdgeType.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNEEdgeType.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -29,6 +29,7 @@ // =========================================================================== class GNELaneType; +class GNEEdgeTemplate; class GNECreateEdgeFrame; // =========================================================================== @@ -46,6 +47,9 @@ */ GNEEdgeType(GNECreateEdgeFrame* createEdgeFrame); + /// @brief copy constructor (this doesn't create new lanes) + GNEEdgeType(const GNEEdgeType* edgeType); + /**@brief Constructor * @param[in] net The net to inform about gui updates */ @@ -62,6 +66,9 @@ /// @brief Destructor. ~GNEEdgeType(); + /// @brief copy edge template + void copyTemplate(const GNEEdgeTemplate* edgeTemplate); + /// @brief get laneTypes const std::vector& getLaneTypes() const; @@ -69,16 +76,10 @@ int getLaneTypeIndex(const GNELaneType* laneType) const; /// @brief add laneType - void addLaneType(GNELaneType* laneType, const int position); - - /// @brief add laneType (in back and undoList) - void addLaneType(GNEUndoList* undoList); + void addLaneType(GNELaneType* laneType); /// @brief remove laneType - void removeLaneType(GNELaneType* laneType); - - /// @brief remove laneType (using index and undoList) - void removeLaneType(const int index, GNEUndoList* undoList); + void removeLaneType(const int index); /// @name Functions related with geometry of element /// @{ diff -Nru sumo-1.11.0/src/netedit/elements/network/GNEInternalLane.cpp sumo-1.12.0/src/netedit/elements/network/GNEInternalLane.cpp --- sumo-1.11.0/src/netedit/elements/network/GNEInternalLane.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNEInternalLane.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/elements/network/GNEInternalLane.h sumo-1.12.0/src/netedit/elements/network/GNEInternalLane.h --- sumo-1.11.0/src/netedit/elements/network/GNEInternalLane.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNEInternalLane.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/elements/network/GNEJunction.cpp sumo-1.12.0/src/netedit/elements/network/GNEJunction.cpp --- sumo-1.11.0/src/netedit/elements/network/GNEJunction.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNEJunction.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -369,6 +369,11 @@ // force draw bubbles if we enabled option in checkbox of viewNet drawBubble = true; } + if ((myNBNode->getShape().area() < 4) && (mySourceCandidate || myTargetCandidate || + mySpecialCandidate | myPossibleCandidate || myConflictedCandidate)) { + // force draw if this junction is a candidate + drawBubble = true; + } // only continue if exaggeration is greather than 0 if (junctionExaggeration > 0) { // push junction name @@ -493,7 +498,7 @@ // draw name and ID if (!s.drawForRectangleSelection) { drawName(myNBNode->getPosition(), s.scale, s.junctionID); - if (s.junctionName.show && myNBNode->getName() != "") { + if (s.junctionName.show(this) && myNBNode->getName() != "") { GLHelper::drawTextSettings(s.junctionName, myNBNode->getName(), myNBNode->getPosition(), s.scale, s.angle); } } @@ -1587,6 +1592,26 @@ if (myNet->getViewNet()->getEditModes().isCurrentSupermodeData()) { color = s.junctionColorer.getScheme().getColor(6); } + // special color for source candidate junction + if (mySourceCandidate) { + color = s.candidateColorSettings.source; + } + // special color for target candidate junction + if (myTargetCandidate) { + color = s.candidateColorSettings.target; + } + // special color for special candidate junction + if (mySpecialCandidate) { + color = s.candidateColorSettings.special; + } + // special color for possible candidate junction + if (myPossibleCandidate) { + color = s.candidateColorSettings.possible; + } + // special color for conflicted candidate junction + if (myConflictedCandidate) { + color = s.candidateColorSettings.conflict; + } // return color return color; } diff -Nru sumo-1.11.0/src/netedit/elements/network/GNEJunction.h sumo-1.12.0/src/netedit/elements/network/GNEJunction.h --- sumo-1.11.0/src/netedit/elements/network/GNEJunction.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNEJunction.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -20,10 +20,12 @@ /****************************************************************************/ #pragma once #include -#include "GNENetworkElement.h" +#include #include +#include "GNENetworkElement.h" + // =========================================================================== // class declarations // =========================================================================== @@ -43,7 +45,7 @@ * is computed using the junction's position to which an offset of 1m to each * side is added. */ -class GNEJunction : public GNENetworkElement { +class GNEJunction : public GNENetworkElement, public GNECandidateElement { /// @brief Declare friend class friend class GNEChange_TLS; diff -Nru sumo-1.11.0/src/netedit/elements/network/GNELane.cpp sumo-1.12.0/src/netedit/elements/network/GNELane.cpp --- sumo-1.11.0/src/netedit/elements/network/GNELane.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNELane.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -37,6 +38,7 @@ #include "GNELane.h" #include "GNEInternalLane.h" #include "GNEConnection.h" +#include "GNEEdgeTemplate.h" // =========================================================================== // FOX callback mapping @@ -127,7 +129,11 @@ const PositionVector& GNELane::getLaneShape() const { - return myParentEdge->getNBEdge()->getLaneShape(myIndex); + if (myParentEdge->getNBEdge()->getLaneStruct(myIndex).customShape.size() > 0) { + return myParentEdge->getNBEdge()->getLaneStruct(myIndex).customShape; + } else { + return myParentEdge->getNBEdge()->getLaneShape(myIndex); + } } @@ -148,18 +154,15 @@ // Clear texture containers myLaneRestrictedTexturePositions.clear(); myLaneRestrictedTextureRotations.clear(); - //double length = myParentEdge->getLength(); // @todo see ticket #448 - // may be different from length + // get lane shape and extend if is too short + auto laneShape = getLaneShape(); + if (laneShape.length2D() < 1) { + laneShape.extrapolate2D(1 - laneShape.length2D()); + } // Obtain lane shape of NBEdge - myLaneGeometry.updateGeometry(myParentEdge->getNBEdge()->getLaneShape(myIndex)); + myLaneGeometry.updateGeometry(laneShape); // update connections myLane2laneConnections.updateLane2laneConnection(); - // update dotted lane geometry - /* - if (myNet->getViewNet()) { - myDottedLaneGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), this); - } - */ // update shapes parents associated with this lane for (const auto& shape : getParentShapes()) { shape->updateGeometry(); @@ -239,21 +242,47 @@ GNEMoveOperation* GNELane::getMoveOperation() { - // currently Lane shapes cannot be edited - return nullptr; + // edit depending if shape is being edited + if (isShapeEdited()) { + // calculate move shape operation + return calculateMoveShapeOperation(getLaneShape(), myNet->getViewNet()->getPositionInformation(), + myNet->getViewNet()->getVisualisationSettings().neteditSizeSettings.laneGeometryPointRadius, true); + } else { + return nullptr; + } } void -GNELane::removeGeometryPoint(const Position /*clickedPosition*/, GNEUndoList* /*undoList*/) { - // currently unused +GNELane::removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList) { + // edit depending if shape is being edited + if (isShapeEdited()) { + // get original shape + PositionVector shape = getLaneShape(); + // check shape size + if (shape.size() > 2) { + // obtain index + int index = shape.indexOfClosest(clickedPosition); + // get snap radius + const double snap_radius = myNet->getViewNet()->getVisualisationSettings().neteditSizeSettings.laneGeometryPointRadius; + // check if we have to create a new index + if ((index != -1) && shape[index].distanceSquaredTo2D(clickedPosition) < (snap_radius * snap_radius)) { + // remove geometry point + shape.erase(shape.begin() + index); + // commit new shape + undoList->begin(GUIIcon::CROSSING, "remove geometry point of " + getTagStr()); + undoList->changeAttribute(new GNEChange_Attribute(this, SUMO_ATTR_CUSTOMSHAPE, toString(shape))); + undoList->end(); + } + } + } } void GNELane::drawLinkNo(const GUIVisualizationSettings& s) const { // first check that drawLinkJunctionIndex must be drawn - if (s.drawLinkJunctionIndex.show) { + if (s.drawLinkJunctionIndex.show(myParentEdge->getToJunction())) { // get connections const std::vector& cons = myParentEdge->getNBEdge()->getConnectionsFromLane(myIndex); // get number of links @@ -290,7 +319,7 @@ void GNELane::drawTLSLinkNo(const GUIVisualizationSettings& s) const { // first check that drawLinkTLIndex must be drawn - if (s.drawLinkTLIndex.show) { + if (s.drawLinkTLIndex.show(myParentEdge->getToJunction())) { // get connections const std::vector& cons = myParentEdge->getNBEdge()->getConnectionsFromLane(myIndex); // get numer of links @@ -350,6 +379,10 @@ glTranslated(end.x(), end.y(), 0); // rotate glRotated(rot, 0, 0, 1); + const double width = myParentEdge->getNBEdge()->getLaneWidth(myIndex); + if (width < SUMO_const_laneWidth) { + glScaled(width / SUMO_const_laneWidth, 1, 1); + } // get destiny node const NBNode* dest = myParentEdge->getNBEdge()->myTo; // draw all links iterating over connections @@ -478,6 +511,8 @@ // translate to front (note: Special case) if (myNet->getViewNet()->getFrontAttributeCarrier() == myParentEdge) { glTranslated(0, 0, GLO_DOTTEDCONTOUR_FRONT); + } else if (myLaneGeometry.getShape().length2D() <= (s.neteditSizeSettings.junctionBubbleRadius * 2)) { + myNet->getViewNet()->drawTranslateFrontAttributeCarrier(this, GLO_JUNCTION + 0.5); } else { myNet->getViewNet()->drawTranslateFrontAttributeCarrier(this, GLO_LANE); } @@ -539,6 +574,26 @@ } // Pop layer matrix GLHelper::popMatrix(); + // if shape is being edited, draw point and green line + if (myShapeEdited) { + // psuh shape edited matrix + GLHelper::pushMatrix(); + // translate + myNet->getViewNet()->drawTranslateFrontAttributeCarrier(this, GLO_JUNCTION + 1); + // set selected edge color + GLHelper::setColor(s.colorSettings.editShapeColor); + // draw again to show the selected edge + GUIGeometry::drawLaneGeometry(s, myNet->getViewNet()->getPositionInformation(), myLaneGeometry.getShape(), myLaneGeometry.getShapeRotations(), myLaneGeometry.getShapeLengths(), {}, 0.25); + // move front + glTranslated(0, 0, 1); + // color + const RGBColor darkerColor = s.colorSettings.editShapeColor.changedBrightness(-32); + // draw geometry points + GUIGeometry::drawGeometryPoints(s, myNet->getViewNet()->getPositionInformation(), myLaneGeometry.getShape(), darkerColor, RGBColor::BLACK, + s.neteditSizeSettings.laneGeometryPointRadius, 1, myNet->getViewNet()->getNetworkViewOptions().editingElevation(), true); + // Pop shape edited matrix + GLHelper::popMatrix(); + } // Pop lane Name GLHelper::popName(); // Pop edge Name @@ -579,10 +634,8 @@ } // draw child additional for (const auto& additional : getChildAdditionals()) { - if (!additional->getTagProperty().isPlacedInRTree()) { - // check that ParkingAreas aren't draw two times - additional->drawGL(s); - } + // check that ParkingAreas aren't draw two times + additional->drawGL(s); } // draw child demand elements for (const auto& demandElement : getChildDemandElements()) { @@ -596,53 +649,32 @@ void GNELane::drawMarkings(const GUIVisualizationSettings& s, const double exaggeration, const bool drawRailway) const { if (s.laneShowBorders && (exaggeration == 1) && !drawRailway) { - // get half lane width const double myHalfLaneWidth = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / 2; - const int lefthand = s.lefthand ? -1 : 1; - // push matrix GLHelper::pushMatrix(); - // move top glTranslated(0, 0, 0.1); // optionally draw inverse markings + bool haveChangeProhibitions = false; if (myIndex > 0 && (myParentEdge->getNBEdge()->getPermissions(myIndex - 1) & myParentEdge->getNBEdge()->getPermissions(myIndex)) != 0) { - // calculate marking witdhs - const double markinWidthA = (myHalfLaneWidth + SUMO_const_laneMarkWidth) * exaggeration * lefthand; - const double markinWidthB = (myHalfLaneWidth - SUMO_const_laneMarkWidth) * exaggeration * lefthand; - // iterate over lane shape - for (int i = 0; i < (int) myLaneGeometry.getShape().size() - 1; ++i) { - // push matrix - GLHelper::pushMatrix(); - // move to gemetry point - glTranslated(myLaneGeometry.getShape()[i].x(), myLaneGeometry.getShape()[i].y(), 0.1); - // rotate - glRotated(myLaneGeometry.getShapeRotations()[i], 0, 0, 1); - // calculate subLengths - for (double subLengths = 0; subLengths < myLaneGeometry.getShapeLengths()[i]; subLengths += 6) { - // calculate lenght - const double length = MIN2((double)3, myLaneGeometry.getShapeLengths()[i] - subLengths); - // draw rectangle - glBegin(GL_QUADS); - glVertex2d(-markinWidthA, -subLengths); - glVertex2d(-markinWidthA, -subLengths - length); - glVertex2d(-markinWidthB, -subLengths - length); - glVertex2d(-markinWidthB, -subLengths); - glEnd(); - } - // pop matrix - GLHelper::popMatrix(); - } + const bool cl = myParentEdge->getNBEdge()->allowsChangingLeft(myIndex - 1, SVC_PASSENGER); + const bool cr = myParentEdge->getNBEdge()->allowsChangingRight(myIndex, SVC_PASSENGER); + GLHelper::drawInverseMarkings(myLaneGeometry.getShape(), myLaneGeometry.getShapeRotations(), myLaneGeometry.getShapeLengths(), + 3, 6, myHalfLaneWidth, cl, cr, s.lefthand, exaggeration); + haveChangeProhibitions = !(cl && cr); } - // pop matrix GLHelper::popMatrix(); - // push background matrix GLHelper::pushMatrix(); - // move back - glTranslated(0, 0, -0.1); + if (haveChangeProhibitions) { + // highlightchange prohibitions + glTranslated(0, 0, -0.05); + GLHelper::setColor(RGBColor::ORANGE); + const double offset = myHalfLaneWidth * exaggeration * (s.lefthand ? -1 : 1); + GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myLaneGeometry, (myHalfLaneWidth * 0.5) * exaggeration, offset); + glTranslated(0, 0, +0.05); + } // draw white boundings and white markings + glTranslated(0, 0, -0.1); GLHelper::setColor(RGBColor::WHITE); - // draw geometry GUIGeometry::drawGeometry(s, myNet->getViewNet()->getPositionInformation(), myLaneGeometry, (myHalfLaneWidth + SUMO_const_laneMarkWidth) * exaggeration); - // pop background matrix GLHelper::popMatrix(); } } @@ -1007,7 +1039,12 @@ void GNELane::setAttribute(SumoXMLAttr key, const std::string& value) { + // get parent edge NBEdge* edge = myParentEdge->getNBEdge(); + // get template editor + GNEInspectorFrame::TemplateEditor* templateEditor = myNet->getViewNet()->getViewParent()->getInspectorFrame()->getTemplateEditor(); + // check if we have to update template + const bool updateTemplate = templateEditor->getEdgeTemplate() ? (templateEditor->getEdgeTemplate()->getID() == myParentEdge->getID()) : false; switch (key) { case SUMO_ATTR_ID: case SUMO_ATTR_INDEX: @@ -1090,20 +1127,30 @@ default: throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); } + // update template + if (updateTemplate) { + templateEditor->setEdgeTemplate(myParentEdge); + } // invalidate path calculator myNet->getPathManager()->getPathCalculator()->invalidatePathCalculator(); } void -GNELane::setMoveShape(const GNEMoveResult& /*moveResult*/) { - // currently unused +GNELane::setMoveShape(const GNEMoveResult& moveResult) { + // set custom shape + myParentEdge->getNBEdge()->getLaneStruct(myIndex).customShape = moveResult.shapeToUpdate; + // update geometry + updateGeometry(); } void -GNELane::commitMoveShape(const GNEMoveResult& /*moveResult*/, GNEUndoList* /*undoList*/) { - // currently unused +GNELane::commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) { + // commit new shape + undoList->begin(GUIIcon::LANE, "moving " + toString(SUMO_ATTR_CUSTOMSHAPE) + " of " + getTagStr()); + undoList->changeAttribute(new GNEChange_Attribute(this, SUMO_ATTR_CUSTOMSHAPE, toString(moveResult.shapeToUpdate))); + undoList->end(); } @@ -1666,7 +1713,7 @@ GNELane::getLengthGeometryFactor() const { // factor should not be 0 if (myParentEdge->getNBEdge()->getFinalLength() > 0) { - return MAX2(POSITION_EPS, (myParentEdge->getNBEdge()->getLaneShape(myIndex).length() / myParentEdge->getNBEdge()->getFinalLength())); + return MAX2(POSITION_EPS, (getLaneShape().length() / myParentEdge->getNBEdge()->getFinalLength())); } else { return POSITION_EPS; }; @@ -1761,6 +1808,7 @@ new FXMenuCascade(ret, "lane operations", nullptr, laneOperations); } GUIDesigns::buildFXMenuCommand(laneOperations, "Duplicate lane", nullptr, &parent, MID_GNE_LANE_DUPLICATE); + GUIDesigns::buildFXMenuCommand(ret, "Set custom lane shape", nullptr, &parent, MID_GNE_LANE_EDIT_SHAPE); FXMenuCommand* resetCustomShape = GUIDesigns::buildFXMenuCommand(laneOperations, "reset custom shape", nullptr, &parent, MID_GNE_LANE_RESET_CUSTOMSHAPE); if (!differentLaneShapes) { resetCustomShape->disable(); @@ -1843,11 +1891,5 @@ } } - -void -removeGeometryPoint(const Position /*clickedPosition*/, GNEUndoList* /*undoList*/) { - // currently unused -} - /****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/network/GNELane.h sumo-1.12.0/src/netedit/elements/network/GNELane.h --- sumo-1.11.0/src/netedit/elements/network/GNELane.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNELane.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/elements/network/GNELaneTemplate.cpp sumo-1.12.0/src/netedit/elements/network/GNELaneTemplate.cpp --- sumo-1.11.0/src/netedit/elements/network/GNELaneTemplate.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNELaneTemplate.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,136 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GNELaneTemplate.cpp +/// @author Pablo Alvarez Lopez +/// @date Dec 2021 +/// +// Template for lanes +/****************************************************************************/ +#include + +#include + +#include "GNELaneTemplate.h" + +// =========================================================================== +// members methods +// =========================================================================== + +GNELaneTemplate::GNELaneTemplate(const GNELane* lane) : + GNEAttributeCarrier(SUMO_TAG_LANE, lane->getNet()), + myLane(lane) { +} + + +GNELaneTemplate::~GNELaneTemplate() { +} + + +GNEHierarchicalElement* +GNELaneTemplate::getHierarchicalElement() { + return nullptr; +} + + +const std::string& +GNELaneTemplate::getID() const { + return myLane->getID(); +} + + +GUIGlObject* +GNELaneTemplate::getGUIGlObject() { + return nullptr; +} + + +void +GNELaneTemplate::updateGeometry() { + throw InvalidArgument("cannot be called in templates"); +} + + +std::string +GNELaneTemplate::getAttribute(SumoXMLAttr key) const { + return myLane->getAttribute(key); +} + + +void +GNELaneTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/, GNEUndoList* /*undoList*/) { + throw InvalidArgument("cannot be called in templates"); +} + + +bool +GNELaneTemplate::isValid(SumoXMLAttr /*key*/, const std::string& /*value*/) { + throw InvalidArgument("cannot be called in templates"); +} + +void +GNELaneTemplate::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + throw InvalidArgument("cannot be called in templates"); +} + + +void +GNELaneTemplate::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + throw InvalidArgument("cannot be called in templates"); +} + + +bool +GNELaneTemplate::isAttributeEnabled(SumoXMLAttr /*key*/) const { + return false; +} + + +bool +GNELaneTemplate::isAttributeComputed(SumoXMLAttr /*key*/) const { + return false; +} + + +std::string +GNELaneTemplate::getPopUpID() const { + return myLane->getPopUpID(); +} + + +std::string +GNELaneTemplate::getHierarchyName() const { + return myLane->getHierarchyName(); +} + + +const std::map& +GNELaneTemplate::getACParametersMap() const { + return myLane->getACParametersMap(); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNELaneTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/) { + throw InvalidArgument("cannot be called in templates"); +} + +void +GNELaneTemplate::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { + throw InvalidArgument("cannot be called in templates"); +} + +/****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/network/GNELaneTemplate.h sumo-1.12.0/src/netedit/elements/network/GNELaneTemplate.h --- sumo-1.11.0/src/netedit/elements/network/GNELaneTemplate.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNELaneTemplate.h 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,125 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GNELaneTemplate.h +/// @author Pablo Alvarez Lopez +/// @date Dec 2021 +/// +// Template for lanes +/****************************************************************************/ +#pragma once +#include + +#include + +// =========================================================================== +// class definitions +// =========================================================================== +class GNELaneTemplate : public GNEAttributeCarrier { + +public: + /// @brief Constructor + GNELaneTemplate(const GNELane* lane); + + /// @brief Destructor. + ~GNELaneTemplate(); + + /// @brief get GNEHierarchicalElement associated with this AttributeCarrier + GNEHierarchicalElement* getHierarchicalElement(); + + /// @name Function related with graphics + /// @{ + /// @brief get ID (all Attribute Carriers have one) + const std::string& getID() const; + + /// @brief get GUIGlObject associated with this AttributeCarrier + GUIGlObject* getGUIGlObject(); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @} + + /// @name Functions related with attributes + /// @{ + /* @brief method for getting the Attribute of an XML key + * @param[in] key The attribute key + * @return string with the value associated to key + */ + std::string getAttribute(SumoXMLAttr key) const; + + /* @brief method for setting the attribute and letting the object perform additional changes + * @param[in] key The attribute key + * @param[in] value The new value + * @param[in] undoList The undoList on which to register changes + */ + void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList); + + /* @brief method for check if new value for certain attribute is valid + * @param[in] key The attribute key + * @param[in] value The new value + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @brief method for enable attribute + * @param[in] key The attribute key + * @param[in] undoList The undoList on which to register changes + * @note certain attributes can be only enabled, and can produce the disabling of other attributes + */ + void enableAttribute(SumoXMLAttr key, GNEUndoList* undoList); + + /* @brief method for disable attribute + * @param[in] key The attribute key + * @param[in] undoList The undoList on which to register changes + * @note certain attributes can be only enabled, and can produce the disabling of other attributes + */ + void disableAttribute(SumoXMLAttr key, GNEUndoList* undoList); + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + bool isAttributeEnabled(SumoXMLAttr key) const; + + /* @brief method for check if the value for certain attribute is computed (for example, due a network recomputing) + * @param[in] key The attribute key + */ + bool isAttributeComputed(SumoXMLAttr key) const; + + /// @brief get PopPup ID (Used in AC Hierarchy) + std::string getPopUpID() const; + + /// @brief get Hierarchy Name (Used in AC Hierarchy) + std::string getHierarchyName() const; + + /// @} + + /// @brief get parameters map + const std::map& getACParametersMap() const; + +protected: + /// @brief pointer to original lane + const GNELane* myLane; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); + + /// @brief invalidated copy constructor + GNELaneTemplate(const GNELaneTemplate& s) = delete; + + /// @brief invalidated assignment operator + GNELaneTemplate& operator=(const GNELaneTemplate& s) = delete; +}; diff -Nru sumo-1.11.0/src/netedit/elements/network/GNELaneType.cpp sumo-1.12.0/src/netedit/elements/network/GNELaneType.cpp --- sumo-1.11.0/src/netedit/elements/network/GNELaneType.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNELaneType.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -20,9 +20,10 @@ #include #include -#include -#include -#include +#include +#include +#include + #include "GNELaneType.h" #include "GNEEdgeType.h" @@ -32,21 +33,16 @@ // members methods // =========================================================================== -GNELaneType::GNELaneType(GNEEdgeType* edgeTypeParent): +GNELaneType::GNELaneType(GNEEdgeType* edgeTypeParent) : GNENetworkElement(edgeTypeParent->getNet(), "", GLO_LANE, SUMO_TAG_LANETYPE, {}, {}, {}, {}, {}, {}, {}, {}), myEdgeTypeParent(edgeTypeParent) { } -GNELaneType::GNELaneType(GNEEdgeType* edgeTypeParent, const NBTypeCont::LaneTypeDefinition& laneType): +GNELaneType::GNELaneType(GNEEdgeType* edgeTypeParent, const NBTypeCont::LaneTypeDefinition& laneType) : GNENetworkElement(edgeTypeParent->getNet(), "", GLO_LANE, SUMO_TAG_LANETYPE, {}, {}, {}, {}, {}, {}, {}, {}), +NBTypeCont::LaneTypeDefinition(laneType), myEdgeTypeParent(edgeTypeParent) { - // copy parameters - speed = laneType.speed; - permissions = laneType.permissions; - width = laneType.width; - restrictions = laneType.restrictions; - attrs = laneType.attrs; } @@ -126,7 +122,7 @@ GNELaneType::getAttribute(SumoXMLAttr key) const { switch (key) { case SUMO_ATTR_ID: - return myEdgeTypeParent->getID() + toString(myEdgeTypeParent->getLaneTypeIndex(this)); + return "lane: " + toString(myEdgeTypeParent->getLaneTypeIndex(this)); case SUMO_ATTR_SPEED: if (attrs.count(key) == 0) { return ""; @@ -134,13 +130,17 @@ return toString(speed); } case SUMO_ATTR_ALLOW: - if (attrs.count(SUMO_ATTR_DISALLOW) == 0) { + if ((permissions == SVCAll) || (permissions == -1)) { + return "all"; + } else if (permissions == 0) { return ""; } else { return getVehicleClassNames(permissions); } case SUMO_ATTR_DISALLOW: - if (attrs.count(SUMO_ATTR_DISALLOW) == 0) { + if (permissions == 0) { + return "all"; + } else if ((permissions == SVCAll) || (permissions == -1)) { return ""; } else { return getVehicleClassNames(invertPermissions(permissions)); @@ -160,20 +160,8 @@ void -GNELaneType::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { - switch (key) { - case SUMO_ATTR_ID: - throw InvalidArgument("Modifying attribute '" + toString(key) + "' of " + getTagStr() + " isn't allowed"); - case SUMO_ATTR_SPEED: - case SUMO_ATTR_ALLOW: - case SUMO_ATTR_DISALLOW: - case SUMO_ATTR_WIDTH: - case GNE_ATTR_PARAMETERS: - undoList->changeAttribute(new GNEChange_Attribute(this, key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } +GNELaneType::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/, GNEUndoList* /*undoList*/) { + throw InvalidArgument("laneType attributes cannot be edited here"); } @@ -232,19 +220,33 @@ } break; case SUMO_ATTR_ALLOW: - if (value.empty()) { + // parse permissions + permissions = parseVehicleClasses(value); + // check attrs + if ((permissions == SVCAll) || (permissions == -1)) { + attrs.insert(SUMO_ATTR_ALLOW); attrs.erase(SUMO_ATTR_DISALLOW); + } else if (permissions == 0) { + attrs.erase(SUMO_ATTR_ALLOW); + attrs.insert(SUMO_ATTR_DISALLOW); } else { + attrs.insert(SUMO_ATTR_ALLOW); attrs.insert(SUMO_ATTR_DISALLOW); - permissions = parseVehicleClasses(value); } break; case SUMO_ATTR_DISALLOW: - if (value.empty()) { + // parse invert permissions + permissions = invertPermissions(parseVehicleClasses(value)); + // check attrs + if ((permissions == SVCAll) || (permissions == -1)) { + attrs.insert(SUMO_ATTR_ALLOW); attrs.erase(SUMO_ATTR_DISALLOW); + } else if (permissions == 0) { + attrs.erase(SUMO_ATTR_ALLOW); + attrs.insert(SUMO_ATTR_DISALLOW); } else { + attrs.insert(SUMO_ATTR_ALLOW); attrs.insert(SUMO_ATTR_DISALLOW); - permissions = invertPermissions(parseVehicleClasses(value)); } break; case SUMO_ATTR_WIDTH: @@ -261,6 +263,10 @@ default: throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); } + // update edge selector + if (myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->shown()) { + myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->getLaneTypeAttributes()->refreshAttributesCreator(); + } } diff -Nru sumo-1.11.0/src/netedit/elements/network/GNELaneType.h sumo-1.12.0/src/netedit/elements/network/GNELaneType.h --- sumo-1.11.0/src/netedit/elements/network/GNELaneType.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNELaneType.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -19,6 +19,7 @@ /****************************************************************************/ #pragma once #include + #include "GNENetworkElement.h" #include @@ -33,16 +34,12 @@ public: /// @brief GNECreateEdgeFrame need access to setAttribute friend class GNECreateEdgeFrame; + friend class GNEEdgeType; - /**@brief Constructor - * @param[in] edgeTypeParent GNEEdgeType parent - */ + /// @brief Constructor GNELaneType(GNEEdgeType* edgeTypeParent); - /**@brief Constructor - * @param[in] edgeTypeParent GNEEdgeType parent - * @param[in] laneType laneType Definition - */ + /// @brief Copy constructor GNELaneType(GNEEdgeType* edgeTypeParent, const NBTypeCont::LaneTypeDefinition& laneType); /// @brief Destructor. diff -Nru sumo-1.11.0/src/netedit/elements/network/GNENetworkElement.cpp sumo-1.12.0/src/netedit/elements/network/GNENetworkElement.cpp --- sumo-1.11.0/src/netedit/elements/network/GNENetworkElement.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNENetworkElement.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -132,9 +132,8 @@ void -GNENetworkElement::setEnabledAttribute(const int /*enabledAttributes*/) { - // +GNENetworkElement::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) { + throw InvalidArgument("Nothing to enable"); } - /****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/elements/network/GNENetworkElement.h sumo-1.12.0/src/netedit/elements/network/GNENetworkElement.h --- sumo-1.11.0/src/netedit/elements/network/GNENetworkElement.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNENetworkElement.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -193,8 +193,8 @@ /// @brief set attribute after validation virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0; - /// @brief method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute) - void setEnabledAttribute(const int enabledAttributes); + /// @brief method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute) + void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters); /// @brief Invalidated copy constructor. GNENetworkElement(const GNENetworkElement&) = delete; diff -Nru sumo-1.11.0/src/netedit/elements/network/GNEProhibition.cpp sumo-1.12.0/src/netedit/elements/network/GNEProhibition.cpp --- sumo-1.11.0/src/netedit/elements/network/GNEProhibition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNEProhibition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/elements/network/GNEProhibition.h sumo-1.12.0/src/netedit/elements/network/GNEProhibition.h --- sumo-1.11.0/src/netedit/elements/network/GNEProhibition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/elements/network/GNEProhibition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/frames/CMakeLists.txt sumo-1.12.0/src/netedit/frames/CMakeLists.txt --- sumo-1.11.0/src/netedit/frames/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -6,10 +6,10 @@ set(netedit_frames_SRCS GNEFrame.h GNEFrame.cpp - GNEFrameModuls.h - GNEFrameModuls.cpp - GNEFrameAttributesModuls.h - GNEFrameAttributesModuls.cpp + GNEFrameModules.h + GNEFrameModules.cpp + GNEFrameAttributeModules.h + GNEFrameAttributeModules.cpp ) add_library(netedit_frames STATIC ${netedit_frames_SRCS}) diff -Nru sumo-1.11.0/src/netedit/frames/common/GNEDeleteFrame.cpp sumo-1.12.0/src/netedit/frames/common/GNEDeleteFrame.cpp --- sumo-1.11.0/src/netedit/frames/common/GNEDeleteFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/common/GNEDeleteFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -41,17 +41,17 @@ }; // Object implementation -FXIMPLEMENT(GNEDeleteFrame::DeleteOptions, FXGroupBox, DeleteOptionsMap, ARRAYNUMBER(DeleteOptionsMap)) +FXIMPLEMENT(GNEDeleteFrame::DeleteOptions, FXGroupBoxModule, DeleteOptionsMap, ARRAYNUMBER(DeleteOptionsMap)) // --------------------------------------------------------------------------- // GNEDeleteFrame::DeleteOptions - methods // --------------------------------------------------------------------------- GNEDeleteFrame::DeleteOptions::DeleteOptions(GNEDeleteFrame* deleteFrameParent) : - FXGroupBox(deleteFrameParent->myContentFrame, "Options", GUIDesignGroupBoxFrame), + FXGroupBoxModule(deleteFrameParent->myContentFrame, "Options"), myDeleteFrameParent(deleteFrameParent) { // Create checkbox for enable/disable delete only geomtery point(by default, disabled) - myDeleteOnlyGeometryPoints = new FXCheckButton(this, "Delete geometry points", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + myDeleteOnlyGeometryPoints = new FXCheckButton(getCollapsableFrame(), "Delete geometry points", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); myDeleteOnlyGeometryPoints->setCheck(FALSE); } @@ -76,21 +76,21 @@ // --------------------------------------------------------------------------- GNEDeleteFrame::ProtectElements::ProtectElements(GNEDeleteFrame* deleteFrameParent) : - FXGroupBox(deleteFrameParent->myContentFrame, "Protect Elements", GUIDesignGroupBoxFrame) { + FXGroupBoxModule(deleteFrameParent->myContentFrame, "Protect Elements") { // Create checkbox for enable/disable delete only geomtery point(by default, disabled) - myProtectAdditionals = new FXCheckButton(this, "Protect additional elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + myProtectAdditionals = new FXCheckButton(getCollapsableFrame(), "Protect additional elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); myProtectAdditionals->setCheck(TRUE); // Create checkbox for enable/disable delete only geomtery point(by default, disabled) - myProtectTAZs = new FXCheckButton(this, "Protect TAZ elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + myProtectTAZs = new FXCheckButton(getCollapsableFrame(), "Protect TAZ elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); myProtectTAZs->setCheck(TRUE); // Create checkbox for enable/disable delete only geomtery point(by default, disabled) - myProtectShapes = new FXCheckButton(this, "Protect shape elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + myProtectShapes = new FXCheckButton(getCollapsableFrame(), "Protect shape elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); myProtectShapes->setCheck(TRUE); // Create checkbox for enable/disable delete only geomtery point(by default, disabled) - myProtectDemandElements = new FXCheckButton(this, "Protect demand elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + myProtectDemandElements = new FXCheckButton(getCollapsableFrame(), "Protect demand elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); myProtectDemandElements->setCheck(TRUE); // Create checkbox for enable/disable delete only geomtery point(by default, disabled) - myProtectGenericDatas = new FXCheckButton(this, "Protect data elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + myProtectGenericDatas = new FXCheckButton(getCollapsableFrame(), "Protect data elements", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); myProtectGenericDatas->setCheck(TRUE); } diff -Nru sumo-1.11.0/src/netedit/frames/common/GNEDeleteFrame.h sumo-1.12.0/src/netedit/frames/common/GNEDeleteFrame.h --- sumo-1.11.0/src/netedit/frames/common/GNEDeleteFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/common/GNEDeleteFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -37,7 +37,7 @@ // class DeleteOptions // =========================================================================== - class DeleteOptions : protected FXGroupBox { + class DeleteOptions : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEDeleteFrame::DeleteOptions) @@ -74,7 +74,7 @@ // class ProtectElements // =========================================================================== - class ProtectElements : protected FXGroupBox { + class ProtectElements : public FXGroupBoxModule { public: /// @brief constructor diff -Nru sumo-1.11.0/src/netedit/frames/common/GNEElementSet.cpp sumo-1.12.0/src/netedit/frames/common/GNEElementSet.cpp --- sumo-1.11.0/src/netedit/frames/common/GNEElementSet.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/common/GNEElementSet.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -37,7 +37,7 @@ }; // Object implementation -FXIMPLEMENT(GNEElementSet, FXGroupBox, GNEElementSetMap, ARRAYNUMBER(GNEElementSetMap)) +FXIMPLEMENT(GNEElementSet, FXGroupBoxModule, GNEElementSetMap, ARRAYNUMBER(GNEElementSetMap)) // =========================================================================== // method definitions @@ -45,13 +45,13 @@ GNEElementSet::GNEElementSet(GNESelectorFrame* selectorFrameParent, Supermode supermode, SumoXMLTag defaultTag, SumoXMLAttr defaultAttr, const std::string& defaultValue) : - FXGroupBox(selectorFrameParent->getContentFrame(), "Element Set", GUIDesignGroupBoxFrame), + FXGroupBoxModule(selectorFrameParent->getContentFrame(), "Element Set"), mySelectorFrameParent(selectorFrameParent), myMatchAttribute(nullptr), myMatchGenericDataAttribute(nullptr), myCurrentSet(Type::INVALID) { // Create MatchTagBox for tags and fill it - mySetComboBox = new MFXIconComboBox(this, GUIDesignComboBoxNCol, this, MID_CHOOSEN_ELEMENTS, GUIDesignComboBox); + mySetComboBox = new MFXIconComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_CHOOSEN_ELEMENTS, GUIDesignComboBox); // continue depending of supermode if (supermode == Supermode::NETWORK) { // append elements diff -Nru sumo-1.11.0/src/netedit/frames/common/GNEElementSet.h sumo-1.12.0/src/netedit/frames/common/GNEElementSet.h --- sumo-1.11.0/src/netedit/frames/common/GNEElementSet.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/common/GNEElementSet.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -33,7 +33,7 @@ // class definitions // =========================================================================== -class GNEElementSet : protected FXGroupBox { +class GNEElementSet : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEElementSet) diff -Nru sumo-1.11.0/src/netedit/frames/common/GNEInspectorFrame.cpp sumo-1.12.0/src/netedit/frames/common/GNEInspectorFrame.cpp --- sumo-1.11.0/src/netedit/frames/common/GNEInspectorFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/common/GNEInspectorFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -66,9 +67,9 @@ FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR, GNEInspectorFrame::TemplateEditor::onCmdClearTemplate), }; -FXDEFMAP(GNEInspectorFrame::ParametersEditorInspector) ParametersEditorInspectorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_OPEN_PARAMETERS_DIALOG, GNEInspectorFrame::ParametersEditorInspector::onCmdEditParameters), - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEInspectorFrame::ParametersEditorInspector::onCmdSetParameters) +FXDEFMAP(GNEInspectorFrame::ParametersEditor) ParametersEditorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_OPEN_PARAMETERS_DIALOG, GNEInspectorFrame::ParametersEditor::onCmdEditParameters), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEInspectorFrame::ParametersEditor::onCmdSetParameters) }; FXDEFMAP(GNEInspectorFrame::AdditionalDialog) AdditionalDialogMap[] = { @@ -77,11 +78,11 @@ // Object implementation FXIMPLEMENT(GNEInspectorFrame, FXVerticalFrame, GNEInspectorFrameMap, ARRAYNUMBER(GNEInspectorFrameMap)) -FXIMPLEMENT(GNEInspectorFrame::NeteditAttributesEditor, FXGroupBox, NeteditAttributesEditorMap, ARRAYNUMBER(NeteditAttributesEditorMap)) -FXIMPLEMENT(GNEInspectorFrame::GEOAttributesEditor, FXGroupBox, GEOAttributesEditorMap, ARRAYNUMBER(GEOAttributesEditorMap)) -FXIMPLEMENT(GNEInspectorFrame::TemplateEditor, FXGroupBox, TemplateEditorMap, ARRAYNUMBER(TemplateEditorMap)) -FXIMPLEMENT(GNEInspectorFrame::ParametersEditorInspector, FXGroupBox, ParametersEditorInspectorMap, ARRAYNUMBER(ParametersEditorInspectorMap)) -FXIMPLEMENT(GNEInspectorFrame::AdditionalDialog, FXGroupBox, AdditionalDialogMap, ARRAYNUMBER(AdditionalDialogMap)) +FXIMPLEMENT(GNEInspectorFrame::NeteditAttributesEditor, FXGroupBoxModule, NeteditAttributesEditorMap, ARRAYNUMBER(NeteditAttributesEditorMap)) +FXIMPLEMENT(GNEInspectorFrame::GEOAttributesEditor, FXGroupBoxModule, GEOAttributesEditorMap, ARRAYNUMBER(GEOAttributesEditorMap)) +FXIMPLEMENT(GNEInspectorFrame::TemplateEditor, FXGroupBoxModule, TemplateEditorMap, ARRAYNUMBER(TemplateEditorMap)) +FXIMPLEMENT(GNEInspectorFrame::ParametersEditor, FXGroupBoxModule, ParametersEditorMap, ARRAYNUMBER(ParametersEditorMap)) +FXIMPLEMENT(GNEInspectorFrame::AdditionalDialog, FXGroupBoxModule, AdditionalDialogMap, ARRAYNUMBER(AdditionalDialogMap)) // =========================================================================== @@ -93,24 +94,24 @@ // --------------------------------------------------------------------------- GNEInspectorFrame::NeteditAttributesEditor::NeteditAttributesEditor(GNEInspectorFrame* inspectorFrameParent) : - FXGroupBox(inspectorFrameParent->myContentFrame, "Netedit attributes", GUIDesignGroupBoxFrame), + FXGroupBoxModule(inspectorFrameParent->myContentFrame, "Netedit attributes"), myInspectorFrameParent(inspectorFrameParent) { // Create mark as front element button - myMarkFrontElementButton = new FXButton(this, "Mark as front element", GUIIconSubSys::getIcon(GUIIcon::FRONTELEMENT), this, MID_GNE_MARKFRONTELEMENT, GUIDesignButton); + myMarkFrontElementButton = new FXButton(getCollapsableFrame(), "Mark as front element", GUIIconSubSys::getIcon(GUIIcon::FRONTELEMENT), this, MID_GNE_MARKFRONTELEMENT, GUIDesignButton); // Create elements for parent additional - myHorizontalFrameParentAdditional = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myHorizontalFrameParentAdditional = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); myLabelParentAdditional = new FXLabel(myHorizontalFrameParentAdditional, "Block move", nullptr, GUIDesignLabelAttribute); myTextFieldParentAdditional = new FXTextField(myHorizontalFrameParentAdditional, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // Create elements for close shape - myHorizontalFrameCloseShape = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myHorizontalFrameCloseShape = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); myLabelCloseShape = new FXLabel(myHorizontalFrameCloseShape, "Close shape", nullptr, GUIDesignLabelAttribute); myCheckBoxCloseShape = new FXCheckButton(myHorizontalFrameCloseShape, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); // Create help button - myHelpButton = new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); + myHelpButton = new FXButton(getCollapsableFrame(), "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); } @@ -179,7 +180,7 @@ myTextFieldParentAdditional->setText(toString(parents).c_str()); } // disable all editable elements if we're in demand mode and inspected AC isn't a demand element - if (GNEFrameAttributesModuls::isSupermodeValid(myInspectorFrameParent->getViewNet(), myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front()) == false) { + if (GNEFrameAttributeModules::isSupermodeValid(myInspectorFrameParent->getViewNet(), myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front()) == false) { myTextFieldParentAdditional->disable(); myCheckBoxCloseShape->disable(); } @@ -296,7 +297,7 @@ long GNEInspectorFrame::NeteditAttributesEditor::onCmdNeteditAttributeHelp(FXObject*, FXSelector, void*) { // Create dialog box - FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(this, "Netedit Attributes Help", GUIDesignDialogBox); + FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(getCollapsableFrame(), "Netedit Attributes Help", GUIDesignDialogBox); additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL)); // set help text std::ostringstream help; @@ -335,21 +336,21 @@ // --------------------------------------------------------------------------- GNEInspectorFrame::GEOAttributesEditor::GEOAttributesEditor(GNEInspectorFrame* inspectorFrameParent) : - FXGroupBox(inspectorFrameParent->myContentFrame, "GEO Attributes", GUIDesignGroupBoxFrame), + FXGroupBoxModule(inspectorFrameParent->myContentFrame, "GEO Attributes"), myInspectorFrameParent(inspectorFrameParent) { // Create Frame for GEOAttribute - myGEOAttributeFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myGEOAttributeFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); myGEOAttributeLabel = new FXLabel(myGEOAttributeFrame, "Undefined GEO Attribute", nullptr, GUIDesignLabelAttribute); myGEOAttributeTextField = new FXTextField(myGEOAttributeFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // Create Frame for use GEO - myUseGEOFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myUseGEOFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); myUseGEOLabel = new FXLabel(myUseGEOFrame, toString(SUMO_ATTR_GEO).c_str(), nullptr, GUIDesignLabelAttribute); myUseGEOCheckButton = new FXCheckButton(myUseGEOFrame, "false", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); // Create help button - myHelpButton = new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); + myHelpButton = new FXButton(getCollapsableFrame(), "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); } @@ -404,7 +405,7 @@ } } // disable all editable elements if we're in demand mode and inspected AC isn't a demand element - if (GNEFrameAttributesModuls::isSupermodeValid(myInspectorFrameParent->getViewNet(), myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()) == false) { + if (GNEFrameAttributeModules::isSupermodeValid(myInspectorFrameParent->getViewNet(), myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()) == false) { myGEOAttributeTextField->disable(); myUseGEOCheckButton->disable(); } @@ -477,7 +478,7 @@ long GNEInspectorFrame::GEOAttributesEditor::onCmdGEOAttributeHelp(FXObject*, FXSelector, void*) { - FXDialogBox* helpDialog = new FXDialogBox(this, "GEO attributes Help", GUIDesignDialogBox); + FXDialogBox* helpDialog = new FXDialogBox(getCollapsableFrame(), "GEO attributes Help", GUIDesignDialogBox); std::ostringstream help; help << " SUMO uses the World Geodetic System 84 (WGS84/UTM).\n" @@ -495,59 +496,19 @@ } // --------------------------------------------------------------------------- -// GNEInspectorFrame::TemplateEditor::EdgeTemplate - methods -// --------------------------------------------------------------------------- - -GNEInspectorFrame::TemplateEditor::EdgeTemplate::EdgeTemplate() { -} - - -GNEInspectorFrame::TemplateEditor::EdgeTemplate::EdgeTemplate(const GNEEdge* edge) { - // copy ID - edgeParameters[SUMO_ATTR_ID] = edge->getAttribute(SUMO_ATTR_ID); - // copy edge-specific attributes - edgeParameters[SUMO_ATTR_NUMLANES] = edge->getAttribute(SUMO_ATTR_NUMLANES); - edgeParameters[SUMO_ATTR_TYPE] = edge->getAttribute(SUMO_ATTR_TYPE); - edgeParameters[SUMO_ATTR_PRIORITY] = edge->getAttribute(SUMO_ATTR_PRIORITY); - edgeParameters[SUMO_ATTR_SPREADTYPE] = edge->getAttribute(SUMO_ATTR_SPREADTYPE); - edgeParameters[GNE_ATTR_STOPOFFSET] = edge->getAttribute(GNE_ATTR_STOPOFFSET); - edgeParameters[GNE_ATTR_STOPOEXCEPTION] = edge->getAttribute(GNE_ATTR_STOPOEXCEPTION); - edgeParameters[GNE_ATTR_PARAMETERS] = edge->getAttribute(GNE_ATTR_PARAMETERS); - // copy raw values for lane-specific attributes - edgeParameters[SUMO_ATTR_ALLOW] = edge->getAttribute(SUMO_ATTR_ALLOW); - edgeParameters[SUMO_ATTR_DISALLOW] = edge->getAttribute(SUMO_ATTR_DISALLOW); // only used in GNECreateEdgeFrame - edgeParameters[SUMO_ATTR_SPEED] = edge->getAttribute(SUMO_ATTR_SPEED); - edgeParameters[SUMO_ATTR_WIDTH] = edge->getAttribute(SUMO_ATTR_WIDTH); - edgeParameters[SUMO_ATTR_ENDOFFSET] = edge->getAttribute(SUMO_ATTR_ENDOFFSET); - // copy lane attributes as well - for (int i = 0; i < (int)edge->getLanes().size(); i++) { - std::map laneParameter; - laneParameter[SUMO_ATTR_ALLOW] = edge->getLanes().at(i)->getAttribute(SUMO_ATTR_ALLOW); - laneParameter[SUMO_ATTR_DISALLOW] = edge->getLanes().at(i)->getAttribute(SUMO_ATTR_DISALLOW); // only used in GNECreateEdgeFrame - laneParameter[SUMO_ATTR_SPEED] = edge->getLanes().at(i)->getAttribute(SUMO_ATTR_SPEED); - laneParameter[SUMO_ATTR_WIDTH] = edge->getLanes().at(i)->getAttribute(SUMO_ATTR_WIDTH); - laneParameter[SUMO_ATTR_ENDOFFSET] = edge->getLanes().at(i)->getAttribute(SUMO_ATTR_ENDOFFSET); - laneParameter[GNE_ATTR_STOPOFFSET] = edge->getLanes().at(i)->getAttribute(GNE_ATTR_STOPOFFSET); - laneParameter[GNE_ATTR_STOPOEXCEPTION] = edge->getLanes().at(i)->getAttribute(GNE_ATTR_STOPOEXCEPTION); - laneParameter[GNE_ATTR_PARAMETERS] = edge->getLanes().at(i)->getAttribute(GNE_ATTR_PARAMETERS); - laneParameters.push_back(laneParameter); - } -} - -// --------------------------------------------------------------------------- // GNEInspectorFrame::TemplateEditor - methods // --------------------------------------------------------------------------- GNEInspectorFrame::TemplateEditor::TemplateEditor(GNEInspectorFrame* inspectorFrameParent) : - FXGroupBox(inspectorFrameParent->myContentFrame, "Templates", GUIDesignGroupBoxFrame), + FXGroupBoxModule(inspectorFrameParent->myContentFrame, "Templates"), myInspectorFrameParent(inspectorFrameParent), - myHasEdgeTemplate(false) { + myEdgeTemplate(nullptr) { // Create set template button - mySetTemplateButton = new FXButton(this, "Set as Template\t\t", nullptr, this, MID_HOTKEY_SHIFT_F1_TEMPLATE_SET, GUIDesignButton); + mySetTemplateButton = new FXButton(getCollapsableFrame(), "Set as Template\t\t", nullptr, this, MID_HOTKEY_SHIFT_F1_TEMPLATE_SET, GUIDesignButton); // Create copy template button - myCopyTemplateButton = new FXButton(this, "", nullptr, this, MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY, GUIDesignButton); + myCopyTemplateButton = new FXButton(getCollapsableFrame(), "", nullptr, this, MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY, GUIDesignButton); // Create copy template button - myClearTemplateButton = new FXButton(this, "clear Edge Template", nullptr, this, MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR, GUIDesignButton); + myClearTemplateButton = new FXButton(getCollapsableFrame(), "clear Edge Template", nullptr, this, MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR, GUIDesignButton); } @@ -580,22 +541,25 @@ } -bool -GNEInspectorFrame::TemplateEditor::hasTemplate() const { - return myHasEdgeTemplate; -} - - -const GNEInspectorFrame::TemplateEditor::EdgeTemplate& +GNEEdgeTemplate* GNEInspectorFrame::TemplateEditor::getEdgeTemplate() const { return myEdgeTemplate; } void -GNEInspectorFrame::TemplateEditor::updateEdgeTemplate(const GNEEdge* edge) { +GNEInspectorFrame::TemplateEditor::setEdgeTemplate(const GNEEdge* edge) { + // delete previous template edge + if (myEdgeTemplate) { + delete myEdgeTemplate; + myEdgeTemplate = nullptr; + } // update edge template - myEdgeTemplate = TemplateEditor::EdgeTemplate(edge); + if (edge) { + myEdgeTemplate = new GNEEdgeTemplate(edge); + // use template by default + myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getViewParent()->getCreateEdgeFrame()->setUseEdgeTemplate(); + } } @@ -645,7 +609,7 @@ long GNEInspectorFrame::TemplateEditor::onCmdCopyTemplate(FXObject*, FXSelector, void*) { // first check - if (myHasEdgeTemplate) { + if (myEdgeTemplate) { // begin copy template myInspectorFrameParent->myViewNet->getUndoList()->begin(GUIIcon::EDGE, "copy edge template"); // iterate over inspected ACs @@ -666,8 +630,8 @@ long GNEInspectorFrame::TemplateEditor::onCmdClearTemplate(FXObject*, FXSelector, void*) { - // change flag - myHasEdgeTemplate = false; + // set null edge + setEdgeTemplate(nullptr); // update buttons updateButtons(); return 1; @@ -675,25 +639,16 @@ void -GNEInspectorFrame::TemplateEditor::setEdgeTemplate(GNEEdge* edgeTemplate) { - // change flag - myHasEdgeTemplate = true; - // set edge template - myEdgeTemplate = GNEInspectorFrame::TemplateEditor::EdgeTemplate(edgeTemplate); - // use template by default - myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getViewParent()->getCreateEdgeFrame()->setUseEdgeTemplate(); -} - - -void GNEInspectorFrame::TemplateEditor::updateButtons() { // enable or disable clear buttons depending of myEdgeTemplate - if (myHasEdgeTemplate) { + if (myEdgeTemplate) { + // get inspected ACs + const auto& ACs = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers(); // update caption of copy button - if (myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) { - myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate.edgeParameters.at(SUMO_ATTR_ID) + "' into edge '" + myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getID() + "'").c_str()); + if (ACs.size() == 1) { + myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate->getID() + "' into edge '" + ACs.front()->getID() + "'").c_str()); } else { - myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate.edgeParameters.at(SUMO_ATTR_ID) + "' into " + toString(myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) + " selected edges").c_str()); + myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate->getID() + "' into " + toString(ACs.size()) + " selected edges").c_str()); } // enable set and clear buttons myCopyTemplateButton->enable(); @@ -708,28 +663,28 @@ } // --------------------------------------------------------------------------- -// GNEFrameAttributesModuls::ParametersEditorInspector - methods +// GNEFrameAttributeModules::ParametersEditor - methods // --------------------------------------------------------------------------- -GNEInspectorFrame::ParametersEditorInspector::ParametersEditorInspector(GNEInspectorFrame* inspectorFrameParent) : - FXGroupBox(inspectorFrameParent->myContentFrame, "Parameters", GUIDesignGroupBoxFrame), +GNEInspectorFrame::ParametersEditor::ParametersEditor(GNEInspectorFrame* inspectorFrameParent) : + FXGroupBoxModule(inspectorFrameParent->myContentFrame, "Parameters"), myInspectorFrameParent(inspectorFrameParent) { // create textfield and buttons - myTextFieldParameters = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - myButtonEditParameters = new FXButton(this, "Edit parameters", nullptr, this, MID_GNE_OPEN_PARAMETERS_DIALOG, GUIDesignButton); + myTextFieldParameters = new FXTextField(getCollapsableFrame(), GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + myButtonEditParameters = new FXButton(getCollapsableFrame(), "Edit parameters", nullptr, this, MID_GNE_OPEN_PARAMETERS_DIALOG, GUIDesignButton); } -GNEInspectorFrame::ParametersEditorInspector::~ParametersEditorInspector() {} +GNEInspectorFrame::ParametersEditor::~ParametersEditor() {} void -GNEInspectorFrame::ParametersEditorInspector::showParametersEditorInspector() { +GNEInspectorFrame::ParametersEditor::showParametersEditor() { // firt check if there is if ((myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) && myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().hasParameters()) { - // refresh ParametersEditorInspector - refreshParametersEditorInspector(); + // refresh ParametersEditor + refreshParametersEditor(); // show groupbox show(); } else { @@ -739,14 +694,14 @@ void -GNEInspectorFrame::ParametersEditorInspector::hideParametersEditorInspector() { +GNEInspectorFrame::ParametersEditor::hideParametersEditor() { // hide groupbox hide(); } void -GNEInspectorFrame::ParametersEditorInspector::refreshParametersEditorInspector() { +GNEInspectorFrame::ParametersEditor::refreshParametersEditor() { // get front AC const GNEAttributeCarrier* frontAC = myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0 ? myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front() : nullptr; // continue depending of frontAC @@ -769,7 +724,7 @@ // reset color myTextFieldParameters->setTextColor(FXRGB(0, 0, 0)); // disable myTextFieldParameters if Tag correspond to an network element but we're in demand mode (or vice versa), disable all elements - if (GNEFrameAttributesModuls::isSupermodeValid(myInspectorFrameParent->myViewNet, frontAC)) { + if (GNEFrameAttributeModules::isSupermodeValid(myInspectorFrameParent->myViewNet, frontAC)) { myTextFieldParameters->enable(); myButtonEditParameters->enable(); } else { @@ -781,13 +736,13 @@ GNEInspectorFrame* -GNEInspectorFrame::ParametersEditorInspector::getInspectorFrameParent() const { +GNEInspectorFrame::ParametersEditor::getInspectorFrameParent() const { return myInspectorFrameParent; } long -GNEInspectorFrame::ParametersEditorInspector::onCmdEditParameters(FXObject*, FXSelector, void*) { +GNEInspectorFrame::ParametersEditor::onCmdEditParameters(FXObject*, FXSelector, void*) { // get front AC const GNEAttributeCarrier* frontAC = myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0 ? myInspectorFrameParent->getViewNet()->getInspectedAttributeCarriers().front() : nullptr; // continue depending of frontAC @@ -802,7 +757,7 @@ // update frame parent after attribute sucesfully set myInspectorFrameParent->attributeUpdated(); // Refresh parameter EditorInspector - refreshParametersEditorInspector(); + refreshParametersEditor(); } else { // write debug information WRITE_DEBUG("Cancel multiple parameters dialog"); @@ -816,7 +771,7 @@ // update frame parent after attribute sucesfully set myInspectorFrameParent->attributeUpdated(); // Refresh parameter EditorInspector - refreshParametersEditorInspector(); + refreshParametersEditor(); } else { // write debug information WRITE_DEBUG("Cancel single parameters dialog"); @@ -828,7 +783,7 @@ long -GNEInspectorFrame::ParametersEditorInspector::onCmdSetParameters(FXObject*, FXSelector, void*) { +GNEInspectorFrame::ParametersEditor::onCmdSetParameters(FXObject*, FXSelector, void*) { const auto& ACs = myInspectorFrameParent->myAttributesEditor->getFrameParent()->getViewNet()->getInspectedAttributeCarriers(); // get front AC GNEAttributeCarrier* frontAC = ACs.size() > 0 ? ACs.front() : nullptr; @@ -871,10 +826,10 @@ // --------------------------------------------------------------------------- GNEInspectorFrame::AdditionalDialog::AdditionalDialog(GNEInspectorFrame* inspectorFrameParent) : - FXGroupBox(inspectorFrameParent->myContentFrame, "Additional dialog", GUIDesignGroupBoxFrame), + FXGroupBoxModule(inspectorFrameParent->myContentFrame, "Additional dialog"), myInspectorFrameParent(inspectorFrameParent) { // Create mark as front element button - myOpenAdditionalDialog = new FXButton(this, "Additional dialog", nullptr, this, MID_OPEN_ADDITIONAL_DIALOG, GUIDesignButton); + myOpenAdditionalDialog = new FXButton(getCollapsableFrame(), "Additional dialog", nullptr, this, MID_OPEN_ADDITIONAL_DIALOG, GUIDesignButton); } @@ -964,16 +919,16 @@ myBackButton->hide(); // Create Overlapped Inspection modul - myOverlappedInspection = new GNEFrameModuls::OverlappedInspection(this); + myOverlappedInspection = new GNEFrameModules::OverlappedInspection(this); // Create Attributes Editor modul - myAttributesEditor = new GNEFrameAttributesModuls::AttributesEditor(this); + myAttributesEditor = new GNEFrameAttributeModules::AttributesEditor(this); // Create GEO Parameters Editor modul myGEOAttributesEditor = new GEOAttributesEditor(this); // create parameters Editor modul - myParametersEditorInspector = new ParametersEditorInspector(this); + myParametersEditor = new ParametersEditor(this); // create additional dialog myAdditionalDialog = new AdditionalDialog(this); @@ -985,7 +940,7 @@ myTemplateEditor = new TemplateEditor(this); // Create HierarchicalElementTree modul - myHierarchicalElementTree = new GNEFrameModuls::HierarchicalElementTree(this); + myHierarchicalElementTree = new GNEFrameModules::HierarchicalElementTree(this); } @@ -1147,10 +1102,10 @@ myHeaderLeftFrame->hide(); myBackButton->hide(); // Hide all elements - myAttributesEditor->hideAttributesEditorModul(); + myAttributesEditor->hideAttributesEditorModule(); myNeteditAttributesEditor->hideNeteditAttributesEditor(); myGEOAttributesEditor->hideGEOAttributesEditor(); - myParametersEditorInspector->hideParametersEditorInspector(); + myParametersEditor->hideParametersEditor(); myAdditionalDialog->hideAdditionalDialog(); myTemplateEditor->hideTemplateEditor(); myHierarchicalElementTree->hideHierarchicalElementTree(); @@ -1191,7 +1146,7 @@ getFrameHeaderLabel()->setText(headerString.c_str()); // Show attributes editor - myAttributesEditor->showAttributeEditorModul(true, false); + myAttributesEditor->showAttributeEditorModule(true, false); // show netedit attributes editor if we're inspecting elements with Netedit Attributes myNeteditAttributesEditor->showNeteditAttributesEditor(); @@ -1200,7 +1155,7 @@ myGEOAttributesEditor->showGEOAttributesEditor(); // show parameters editor - myParametersEditorInspector->showParametersEditorInspector(); + myParametersEditor->showParametersEditor(); // show additional dialog myAdditionalDialog->showAdditionalDialog(); @@ -1259,7 +1214,7 @@ } -GNEFrameAttributesModuls::AttributesEditor* +GNEFrameAttributeModules::AttributesEditor* GNEInspectorFrame::getAttributesEditor() const { return myAttributesEditor; } @@ -1277,13 +1232,13 @@ } -GNEFrameModuls::OverlappedInspection* +GNEFrameModules::OverlappedInspection* GNEInspectorFrame::getOverlappedInspection() const { return myOverlappedInspection; } -GNEFrameModuls::HierarchicalElementTree* +GNEFrameModules::HierarchicalElementTree* GNEInspectorFrame::getHierarchicalElementTree() const { return myHierarchicalElementTree; } @@ -1310,7 +1265,7 @@ // refresh Attribute Editor myAttributesEditor->refreshAttributeEditor(false, false); // refresh parametersEditor - myParametersEditorInspector->refreshParametersEditorInspector(); + myParametersEditor->refreshParametersEditor(); // refresh AC Hierarchy myHierarchicalElementTree->refreshHierarchicalElementTree(); } diff -Nru sumo-1.11.0/src/netedit/frames/common/GNEInspectorFrame.h sumo-1.12.0/src/netedit/frames/common/GNEInspectorFrame.h --- sumo-1.11.0/src/netedit/frames/common/GNEInspectorFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/common/GNEInspectorFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -24,6 +24,11 @@ #include // =========================================================================== +// class declaration +// =========================================================================== +class GNEEdgeTemplate; + +// =========================================================================== // class definitions // =========================================================================== /** @@ -39,7 +44,7 @@ // class NeteditAttributesEditor // =========================================================================== - class NeteditAttributesEditor : private FXGroupBox { + class NeteditAttributesEditor : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEInspectorFrame::NeteditAttributesEditor) @@ -108,7 +113,7 @@ // class GEOAttributesEditor // =========================================================================== - class GEOAttributesEditor : private FXGroupBox { + class GEOAttributesEditor : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEInspectorFrame::GEOAttributesEditor) @@ -172,26 +177,11 @@ // class TemplateEditor // =========================================================================== - class TemplateEditor : private FXGroupBox { + class TemplateEditor : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEInspectorFrame::TemplateEditor) public: - /// @brief edgeTemplate - struct EdgeTemplate { - /// @brief default constructor - EdgeTemplate(); - - /// @brief constructor - EdgeTemplate(const GNEEdge* edge); - - /// @brief edge parameters - std::map edgeParameters; - - /// @brief lane parameters - std::vector > laneParameters; - }; - /// @brief constructor TemplateEditor(GNEInspectorFrame* inspectorFrameParent); @@ -204,14 +194,11 @@ /// @brief hide template editor void hideTemplateEditor(); - /// @brief there is a template - bool hasTemplate() const; + /// @brief get edge template (to copy attributes from) + GNEEdgeTemplate* getEdgeTemplate() const; - /// @brief get the template edge (to copy attributes from) - const TemplateEditor::EdgeTemplate& getEdgeTemplate() const; - - /// @brief update edge template - void updateEdgeTemplate(const GNEEdge* edge); + /// @brief set edge template + void setEdgeTemplate(const GNEEdge* edge); /// @brief set template (used by shortcut) void setTemplate(); @@ -238,9 +225,6 @@ /// @brief FOX need this FOX_CONSTRUCTOR(TemplateEditor) - /// @brief seh the template edge (we assume shared responsibility via reference counting) - void setEdgeTemplate(GNEEdge* edgeTemplate); - /// @brief update buttons void updateButtons(); @@ -257,36 +241,33 @@ /// @brief clear template button FXButton* myClearTemplateButton; - /// @brief flag for edge template - bool myHasEdgeTemplate; - - /// @brief map with edge template - TemplateEditor::EdgeTemplate myEdgeTemplate; + /// @brief edge Template + GNEEdgeTemplate* myEdgeTemplate; }; // =========================================================================== - // class ParametersEditorInspector + // class ParametersEditor // =========================================================================== - class ParametersEditorInspector : private FXGroupBox { + class ParametersEditor : public FXGroupBoxModule { /// @brief FOX-declaration - FXDECLARE(GNEInspectorFrame::ParametersEditorInspector) + FXDECLARE(GNEInspectorFrame::ParametersEditor) public: /// @brief constructor - ParametersEditorInspector(GNEInspectorFrame* inspectorFrameParent); + ParametersEditor(GNEInspectorFrame* inspectorFrameParent); /// @brief destructor - ~ParametersEditorInspector(); + ~ParametersEditor(); /// @brief show netedit attributes EditorInspector - void showParametersEditorInspector(); + void showParametersEditor(); /// @brief hide netedit attributes EditorInspector - void hideParametersEditorInspector(); + void hideParametersEditor(); /// @brief refresh netedit attributes - void refreshParametersEditorInspector(); + void refreshParametersEditor(); /// @brief get inspector frame parent GNEInspectorFrame* getInspectorFrameParent() const; @@ -302,7 +283,7 @@ protected: /// @brief FOX need this - FOX_CONSTRUCTOR(ParametersEditorInspector) + FOX_CONSTRUCTOR(ParametersEditor) private: /// @brief current GNEInspectorFrame parent @@ -319,7 +300,7 @@ // class AdditionalDialog // =========================================================================== - class AdditionalDialog : private FXGroupBox { + class AdditionalDialog : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEInspectorFrame::AdditionalDialog) @@ -406,7 +387,7 @@ void clearInspectedAC(); /// @brief get AttributesEditor - GNEFrameAttributesModuls::AttributesEditor* getAttributesEditor() const; + GNEFrameAttributeModules::AttributesEditor* getAttributesEditor() const; /// @brief get Netedit Attributes editor GNEInspectorFrame::NeteditAttributesEditor* getNeteditAttributesEditor() const; @@ -415,10 +396,10 @@ TemplateEditor* getTemplateEditor() const; /// @brief get OverlappedInspection modul - GNEFrameModuls::OverlappedInspection* getOverlappedInspection() const; + GNEFrameModules::OverlappedInspection* getOverlappedInspection() const; /// @brief get HierarchicalElementTree modul - GNEFrameModuls::HierarchicalElementTree* getHierarchicalElementTree() const; + GNEFrameModules::HierarchicalElementTree* getHierarchicalElementTree() const; /// @name FOX-callbacks /// @{ @@ -445,10 +426,10 @@ private: /// @brief Overlapped Inspection - GNEFrameModuls::OverlappedInspection* myOverlappedInspection; + GNEFrameModules::OverlappedInspection* myOverlappedInspection; /// @brief Attribute editor - GNEFrameAttributesModuls::AttributesEditor* myAttributesEditor; + GNEFrameAttributeModules::AttributesEditor* myAttributesEditor; /// @brief Netedit Attributes editor NeteditAttributesEditor* myNeteditAttributesEditor; @@ -457,7 +438,7 @@ GEOAttributesEditor* myGEOAttributesEditor; /// @brief Parameters editor inspector - ParametersEditorInspector* myParametersEditorInspector; + ParametersEditor* myParametersEditor; /// @brief Additional dialog AdditionalDialog* myAdditionalDialog; @@ -466,7 +447,7 @@ TemplateEditor* myTemplateEditor; /// @brief Attribute Carrier Hierarchy - GNEFrameModuls::HierarchicalElementTree* myHierarchicalElementTree; + GNEFrameModules::HierarchicalElementTree* myHierarchicalElementTree; /// @brief Back Button FXButton* myBackButton; diff -Nru sumo-1.11.0/src/netedit/frames/common/GNEMatchAttribute.cpp sumo-1.12.0/src/netedit/frames/common/GNEMatchAttribute.cpp --- sumo-1.11.0/src/netedit/frames/common/GNEMatchAttribute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/common/GNEMatchAttribute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -19,6 +19,7 @@ /****************************************************************************/ #include +#include #include #include @@ -37,27 +38,27 @@ }; // Object implementation -FXIMPLEMENT(GNEMatchAttribute, FXGroupBox, GNEMatchAttributeMap, ARRAYNUMBER(GNEMatchAttributeMap)) +FXIMPLEMENT(GNEMatchAttribute, FXGroupBoxModule, GNEMatchAttributeMap, ARRAYNUMBER(GNEMatchAttributeMap)) // =========================================================================== // method definitions // =========================================================================== GNEMatchAttribute::GNEMatchAttribute(GNEElementSet* elementSet, SumoXMLTag defaultTag, SumoXMLAttr defaultAttr, const std::string& defaultValue) : - FXGroupBox(elementSet->getSelectorFrameParent()->getContentFrame(), "Match Attribute", GUIDesignGroupBoxFrame), + FXGroupBoxModule(elementSet->getSelectorFrameParent()->getContentFrame(), "Match Attribute"), myElementSet(elementSet), myCurrentTag(defaultTag), myCurrentAttribute(defaultAttr) { // Create MFXIconComboBox for tags - myMatchTagComboBox = new MFXIconComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SELECTTAG, GUIDesignComboBox); + myMatchTagComboBox = new MFXIconComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SELECTTAG, GUIDesignComboBox); // Create FXComboBox for Attributes - myMatchAttrComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SELECTATTRIBUTE, GUIDesignComboBox); + myMatchAttrComboBox = new FXComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SELECTATTRIBUTE, GUIDesignComboBox); // Create TextField for Match string - myMatchString = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_PROCESSSTRING, GUIDesignTextField); + myMatchString = new FXTextField(getCollapsableFrame(), GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_PROCESSSTRING, GUIDesignTextField); // create button - myMatchStringButton = new FXButton(this, "Apply selection", nullptr, this, MID_GNE_SELECTORFRAME_PROCESSSTRING, GUIDesignButton); + myMatchStringButton = new FXButton(getCollapsableFrame(), "Apply selection", nullptr, this, MID_GNE_SELECTORFRAME_PROCESSSTRING, GUIDesignButton); // Create help button - new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); + new FXButton(getCollapsableFrame(), "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); // Set default value for Match string myMatchString->setText(defaultValue.c_str()); } @@ -92,30 +93,36 @@ void GNEMatchAttribute::showMatchAttribute(const GNEElementSet::Type type) { + // declare flag for proj + const bool proj = (GeoConvHelper::getFinal().getProjString() != "!"); // get tags for the given element set + std::vector tagPropertiesStrings; if (type == (GNEElementSet::Type::NETWORK)) { - myTagPropertiesString = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::TagType::NETWORKELEMENT, true); + tagPropertiesStrings = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::TagType::NETWORKELEMENT); } else if (type == GNEElementSet::Type::ADDITIONAL) { - myTagPropertiesString = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::TagType::ADDITIONALELEMENT, true); + tagPropertiesStrings = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::TagType::ADDITIONALELEMENT); } else if (type == GNEElementSet::Type::SHAPE) { - myTagPropertiesString = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::TagType::SHAPE, true); + tagPropertiesStrings = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::TagType::SHAPE); } else if (type == GNEElementSet::Type::TAZ) { - myTagPropertiesString = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::TagType::TAZELEMENT, true); + tagPropertiesStrings = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::TagType::TAZELEMENT); } else if (type == GNEElementSet::Type::DEMAND) { - myTagPropertiesString = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::TagType::DEMANDELEMENT | GNETagProperties::TagType::STOP, true); + tagPropertiesStrings = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::TagType::DEMANDELEMENT | GNETagProperties::TagType::STOP); } else if (type == GNEElementSet::Type::DATA) { - myTagPropertiesString = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::TagType::GENERICDATA, true); + tagPropertiesStrings = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::TagType::GENERICDATA); } else { throw ProcessError("Unkown set"); } + // now filter to allow only drawables and proj + myTagPropertiesString.clear(); + for (const auto& tagProperty : tagPropertiesStrings) { + if (tagProperty.isDrawable() && (!tagProperty.requireProj() || proj)) { + myTagPropertiesString.push_back(tagProperty); + } + } // update tag updateTag(); // update attribute updateAttribute(); - - - // @ToDo: Here can be placed a button to set the default value - // show groupbox show(); } @@ -136,9 +143,9 @@ myMatchTagComboBox->setTextColor(FXRGB(255, 0, 0)); // iterate over tags for (const auto& tagString : myTagPropertiesString) { - if (tagString.second == myMatchTagComboBox->getText().text()) { + if (tagString.getFieldString() == myMatchTagComboBox->getText().text()) { // set valid tag - myCurrentTag = tagString.first.getTag(); + myCurrentTag = tagString.getTag(); // set valid color myMatchTagComboBox->setTextColor(FXRGB(0, 0, 0)); } @@ -152,9 +159,9 @@ long GNEMatchAttribute::onCmdSelMBAttribute(FXObject*, FXSelector, void*) { // first obtain a copy of item attributes vinculated with current tag - auto tagPropertiesCopy = GNEAttributeCarrier::getTagProperties(myCurrentTag); + auto tagPropertiesCopy = GNEAttributeCarrier::getTagProperty(myCurrentTag); // obtain tag property (only for improve code legibility) - const auto& tagValue = GNEAttributeCarrier::getTagProperties(myCurrentTag); + const auto& tagValue = GNEAttributeCarrier::getTagProperty(myCurrentTag); // add an extra AttributeValues to allow select ACs using as criterium "parameters" GNEAttributeProperties extraAttrProperty; extraAttrProperty = GNEAttributeProperties(GNE_ATTR_PARAMETERS, @@ -165,7 +172,7 @@ if (tagValue.canCloseShape()) { // add an extra AttributeValues to allow select ACs using as criterium "close shape" extraAttrProperty = GNEAttributeProperties(GNE_ATTR_CLOSE_SHAPE, - GNEAttributeProperties::AttrProperty::BOOL | GNEAttributeProperties::AttrProperty::DEFAULTVALUESTATIC, + GNEAttributeProperties::AttrProperty::BOOL | GNEAttributeProperties::AttrProperty::DEFAULTVALUE, "Close shape", "true"); tagPropertiesCopy.addAttribute(extraAttrProperty); @@ -203,7 +210,7 @@ GNEMatchAttribute::onCmdSelMBString(FXObject*, FXSelector, void*) { // obtain expresion std::string expr(myMatchString->getText().text()); - const auto& tagValue = GNEAttributeCarrier::getTagProperties(myCurrentTag); + const auto& tagValue = GNEAttributeCarrier::getTagProperty(myCurrentTag); bool valid = true; if (expr == "") { // the empty expression matches all objects @@ -256,7 +263,7 @@ long GNEMatchAttribute::onCmdHelp(FXObject*, FXSelector, void*) { // Create dialog box - FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(this, "Netedit Parameters Help", GUIDesignDialogBox); + FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(getCollapsableFrame(), "Netedit Parameters Help", GUIDesignDialogBox); additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL)); // set help text std::ostringstream help; @@ -317,9 +324,9 @@ // itreate over myTagPropertiesString for (int i = 0; i < (int)myTagPropertiesString.size(); i++) { // add tag in combo Box - myMatchTagComboBox->appendIconItem(myTagPropertiesString.at(i).second.c_str(), GUIIconSubSys::getIcon(myTagPropertiesString.at(i).first.getGUIIcon())); + myMatchTagComboBox->appendIconItem(myTagPropertiesString.at(i).getFieldString().c_str(), GUIIconSubSys::getIcon(myTagPropertiesString.at(i).getGUIIcon())); // check tag index - if (myTagPropertiesString.at(i).first.getTag() == myCurrentTag) { + if (myTagPropertiesString.at(i).getTag() == myCurrentTag) { tagIndex = i; } } @@ -328,7 +335,7 @@ // check tagIndex if (tagIndex == -1) { myMatchTagComboBox->setCurrentItem(0); - myCurrentTag = myTagPropertiesString.front().first.getTag(); + myCurrentTag = myTagPropertiesString.front().getTag(); } else { myMatchTagComboBox->setCurrentItem(tagIndex); } @@ -340,7 +347,7 @@ // first check if tag is valid if (myCurrentTag != SUMO_TAG_NOTHING) { // now continue with attributes - const auto& tagProperty = GNEAttributeCarrier::getTagProperties(myCurrentTag); + const auto& tagProperty = GNEAttributeCarrier::getTagProperty(myCurrentTag); // set color and enable items myMatchAttrComboBox->enable(); myMatchAttrComboBox->setTextColor(FXRGB(0, 0, 0)); diff -Nru sumo-1.11.0/src/netedit/frames/common/GNEMatchAttribute.h sumo-1.12.0/src/netedit/frames/common/GNEMatchAttribute.h --- sumo-1.11.0/src/netedit/frames/common/GNEMatchAttribute.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/common/GNEMatchAttribute.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -27,7 +27,7 @@ // class definitions // =========================================================================== -class GNEMatchAttribute : protected FXGroupBox { +class GNEMatchAttribute : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEMatchAttribute) @@ -107,8 +107,8 @@ /// @brief match string button FXButton* myMatchStringButton; - /// @brief vector with tagProperties and strings - std::vector > myTagPropertiesString; + /// @brief vector with tagProperties + std::vector myTagPropertiesString; /// @brief Invalidated copy constructor. GNEMatchAttribute(const GNEMatchAttribute&) = delete; diff -Nru sumo-1.11.0/src/netedit/frames/common/GNEMatchGenericDataAttribute.cpp sumo-1.12.0/src/netedit/frames/common/GNEMatchGenericDataAttribute.cpp --- sumo-1.11.0/src/netedit/frames/common/GNEMatchGenericDataAttribute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/common/GNEMatchGenericDataAttribute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -43,14 +43,14 @@ }; // Object implementation -FXIMPLEMENT(GNEMatchGenericDataAttribute, FXGroupBox, GNEMatchGenericDataAttributeMap, ARRAYNUMBER(GNEMatchGenericDataAttributeMap)) +FXIMPLEMENT(GNEMatchGenericDataAttribute, FXGroupBoxModule, GNEMatchGenericDataAttributeMap, ARRAYNUMBER(GNEMatchGenericDataAttributeMap)) // =========================================================================== // method definitions // =========================================================================== GNEMatchGenericDataAttribute::GNEMatchGenericDataAttribute(GNEElementSet* elementSet, SumoXMLTag defaultTag, SumoXMLAttr defaultAttr, const std::string& defaultValue) : - FXGroupBox(elementSet->getSelectorFrameParent()->getContentFrame(), "Match GenericData Attribute", GUIDesignGroupBoxFrame), + FXGroupBoxModule(elementSet->getSelectorFrameParent()->getContentFrame(), "Match GenericData Attribute"), myElementSet(elementSet), myIntervalSelector(nullptr), myBegin(nullptr), @@ -61,20 +61,20 @@ myCurrentAttribute(toString(defaultAttr)), myMatchGenericDataString(nullptr) { // Create MFXIconComboBox for interval - new FXLabel(this, "Interval [begin, end]", nullptr, GUIDesignLabelThick); - myIntervalSelector = new MFXIconComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SETINTERVAL, GUIDesignComboBoxStaticExtended); + new FXLabel(getCollapsableFrame(), "Interval [begin, end]", nullptr, GUIDesignLabelThick); + myIntervalSelector = new MFXIconComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SETINTERVAL, GUIDesignComboBoxStaticExtended); // Create textfield for begin and end - FXHorizontalFrame* myHorizontalFrameBeginEnd = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* myHorizontalFrameBeginEnd = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); myBegin = new FXTextField(myHorizontalFrameBeginEnd, GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_SETBEGIN, GUIDesignTextField); myEnd = new FXTextField(myHorizontalFrameBeginEnd, GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_SETEND, GUIDesignTextField); // Create MFXIconComboBox for generic datas - myMatchGenericDataTagComboBox = new MFXIconComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SELECTTAG, GUIDesignComboBox); + myMatchGenericDataTagComboBox = new MFXIconComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SELECTTAG, GUIDesignComboBox); // Create listBox for Attributes - myMatchGenericDataAttrComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SELECTATTRIBUTE, GUIDesignComboBox); + myMatchGenericDataAttrComboBox = new FXComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SELECTATTRIBUTE, GUIDesignComboBox); // Create TextField for MatchGenericData string - myMatchGenericDataString = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_PROCESSSTRING, GUIDesignTextField); + myMatchGenericDataString = new FXTextField(getCollapsableFrame(), GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_PROCESSSTRING, GUIDesignTextField); // Create help button - new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); + new FXButton(getCollapsableFrame(), "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); // Fill list of sub-items (first element will be "edge") enableMatchGenericDataAttribute(); // Set speed of edge as default attribute @@ -129,10 +129,12 @@ myEnd->setText(toString(myIntervals.begin()->first.second).c_str()); myEnd->setTextColor(FXRGB(0, 0, 0)); // get generic datas - const auto genericDataTags = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::TagType::GENERICDATA, true); - // fill combo box + const auto genericDataTags = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::TagType::GENERICDATA); + // fill combo box (only with drawable elements) for (const auto& genericDataTag : genericDataTags) { - myMatchGenericDataTagComboBox->appendIconItem(genericDataTag.second.c_str(), GUIIconSubSys::getIcon(genericDataTag.first.getGUIIcon())); + if (genericDataTag.isDrawable()) { + myMatchGenericDataTagComboBox->appendIconItem(genericDataTag.getFieldString().c_str(), GUIIconSubSys::getIcon(genericDataTag.getGUIIcon())); + } } // set first item as current item myMatchGenericDataTagComboBox->setCurrentItem(0); @@ -161,7 +163,7 @@ void GNEMatchGenericDataAttribute::showMatchGenericDataAttribute() { - // just show Modul + // just show Module show(); } @@ -249,11 +251,11 @@ // First check what type of elementes is being selected myCurrentTag = SUMO_TAG_NOTHING; // get generic data tags - const auto listOfTags = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::TagType::GENERICDATA, true); + const auto listOfTags = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::TagType::GENERICDATA); // fill myMatchGenericDataTagComboBox for (const auto& genericDataTag : listOfTags) { - if (genericDataTag.second == myMatchGenericDataTagComboBox->getText().text()) { - myCurrentTag = genericDataTag.first.getTag(); + if (genericDataTag.isDrawable() && (genericDataTag.getFieldString() == myMatchGenericDataTagComboBox->getText().text())) { + myCurrentTag = genericDataTag.getTag(); } } // check that typed-by-user value is correct @@ -374,7 +376,7 @@ long GNEMatchGenericDataAttribute::onCmdHelp(FXObject*, FXSelector, void*) { // Create dialog box - FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(this, "Netedit Parameters Help", GUIDesignDialogBox); + FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(getCollapsableFrame(), "Netedit Parameters Help", GUIDesignDialogBox); additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL)); // set help text std::ostringstream help; diff -Nru sumo-1.11.0/src/netedit/frames/common/GNEMatchGenericDataAttribute.h sumo-1.12.0/src/netedit/frames/common/GNEMatchGenericDataAttribute.h --- sumo-1.11.0/src/netedit/frames/common/GNEMatchGenericDataAttribute.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/common/GNEMatchGenericDataAttribute.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -27,7 +27,7 @@ // class definitions // =========================================================================== -class GNEMatchGenericDataAttribute : protected FXGroupBox { +class GNEMatchGenericDataAttribute : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEMatchGenericDataAttribute) diff -Nru sumo-1.11.0/src/netedit/frames/common/GNEMoveFrame.cpp sumo-1.12.0/src/netedit/frames/common/GNEMoveFrame.cpp --- sumo-1.11.0/src/netedit/frames/common/GNEMoveFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/common/GNEMoveFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -48,9 +48,9 @@ // Object implementation -FXIMPLEMENT(GNEMoveFrame::ChangeZInSelection, FXGroupBox, ChangeZInSelectionMap, ARRAYNUMBER(ChangeZInSelectionMap)) -FXIMPLEMENT(GNEMoveFrame::ShiftEdgeSelectedGeometry, FXGroupBox, ShiftEdgeGeometryMap, ARRAYNUMBER(ShiftEdgeGeometryMap)) -FXIMPLEMENT(GNEMoveFrame::ShiftShapeGeometry, FXGroupBox, ShiftShapeGeometryMap, ARRAYNUMBER(ShiftShapeGeometryMap)) +FXIMPLEMENT(GNEMoveFrame::ChangeZInSelection, FXGroupBoxModule, ChangeZInSelectionMap, ARRAYNUMBER(ChangeZInSelectionMap)) +FXIMPLEMENT(GNEMoveFrame::ShiftEdgeSelectedGeometry, FXGroupBoxModule, ShiftEdgeGeometryMap, ARRAYNUMBER(ShiftEdgeGeometryMap)) +FXIMPLEMENT(GNEMoveFrame::ShiftShapeGeometry, FXGroupBoxModule, ShiftShapeGeometryMap, ARRAYNUMBER(ShiftShapeGeometryMap)) // =========================================================================== // method definitions @@ -61,9 +61,9 @@ // --------------------------------------------------------------------------- GNEMoveFrame::CommonModeOptions::CommonModeOptions(GNEMoveFrame* moveFrameParent) : - FXGroupBox(moveFrameParent->myContentFrame, "Common move options", GUIDesignGroupBoxFrame) { + FXGroupBoxModule(moveFrameParent->myContentFrame, "Common move options") { // Create checkbox for enable/disable move whole polygons - myAllowChangeLanes = new FXCheckButton(this, "Allow change Lane", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + myAllowChangeLanes = new FXCheckButton(getCollapsableFrame(), "Allow change Lane", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); myAllowChangeLanes->setCheck(FALSE); } @@ -81,10 +81,10 @@ // --------------------------------------------------------------------------- GNEMoveFrame::NetworkModeOptions::NetworkModeOptions(GNEMoveFrame* moveFrameParent) : - FXGroupBox(moveFrameParent->myContentFrame, "Network move options", GUIDesignGroupBoxFrame), + FXGroupBoxModule(moveFrameParent->myContentFrame, "Network move options"), myMoveFrameParent(moveFrameParent) { // Create checkbox for enable/disable move whole polygons - myMoveWholePolygons = new FXCheckButton(this, "Move whole polygons", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + myMoveWholePolygons = new FXCheckButton(getCollapsableFrame(), "Move whole polygons", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); myMoveWholePolygons->setCheck(FALSE); } @@ -120,10 +120,10 @@ // --------------------------------------------------------------------------- GNEMoveFrame::DemandModeOptions::DemandModeOptions(GNEMoveFrame* moveFrameParent) : - FXGroupBox(moveFrameParent->myContentFrame, "Demand move options", GUIDesignGroupBoxFrame), + FXGroupBoxModule(moveFrameParent->myContentFrame, "Demand move options"), myMoveFrameParent(moveFrameParent) { // Create checkbox for enable/disable move whole polygons - myLeaveStopPersonsConnected = new FXCheckButton(this, "Leave stopPersons connected", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + myLeaveStopPersonsConnected = new FXCheckButton(getCollapsableFrame(), "Leave stopPersons connected", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); myLeaveStopPersonsConnected->setCheck(FALSE); } @@ -159,16 +159,16 @@ // --------------------------------------------------------------------------- GNEMoveFrame::ShiftEdgeSelectedGeometry::ShiftEdgeSelectedGeometry(GNEMoveFrame* moveFrameParent) : - FXGroupBox(moveFrameParent->myContentFrame, "Shift selected edges geometry", GUIDesignGroupBoxFrame), + FXGroupBoxModule(moveFrameParent->myContentFrame, "Shift selected edges geometry"), myMoveFrameParent(moveFrameParent) { // create horizontal frame - FXHorizontalFrame* myZValueFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* myZValueFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); // create elements for Z value new FXLabel(myZValueFrame, "Shift value", 0, GUIDesignLabelAttribute); myShiftValueTextField = new FXTextField(myZValueFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldReal); myShiftValueTextField->setText("0"); // create apply button - myApplyZValue = new FXButton(this, "Apply shift value\t\tShift edge geometry orthogonally to driving direction for all selected edges", + myApplyZValue = new FXButton(getCollapsableFrame(), "Apply shift value\t\tShift edge geometry orthogonally to driving direction for all selected edges", GUIIconSubSys::getIcon(GUIIcon::MODEMOVE), this, MID_GNE_APPLY, GUIDesignButton); } @@ -239,26 +239,26 @@ // --------------------------------------------------------------------------- GNEMoveFrame::ChangeZInSelection::ChangeZInSelection(GNEMoveFrame* moveFrameParent) : - FXGroupBox(moveFrameParent->myContentFrame, "Change Z in selection", GUIDesignGroupBoxFrame), + FXGroupBoxModule(moveFrameParent->myContentFrame, "Change Z in selection"), myMoveFrameParent(moveFrameParent) { // create horizontal frame - FXHorizontalFrame* myZValueFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* myZValueFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); // create elements for Z value new FXLabel(myZValueFrame, "Z value", 0, GUIDesignLabelAttribute); myZValueTextField = new FXTextField(myZValueFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldReal); myZValueTextField->setText("0"); // Create all options buttons - myAbsoluteValue = new FXRadioButton(this, "Absolute value\t\tSet Z value as absolute", + myAbsoluteValue = new FXRadioButton(getCollapsableFrame(), "Absolute value\t\tSet Z value as absolute", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - myRelativeValue = new FXRadioButton(this, "Relative value\t\tSet Z value as relative", + myRelativeValue = new FXRadioButton(getCollapsableFrame(), "Relative value\t\tSet Z value as relative", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); // create apply button - myApplyButton = new FXButton(this, "Apply Z value\t\tApply Z value to all selected junctions", + myApplyButton = new FXButton(getCollapsableFrame(), "Apply Z value\t\tApply Z value to all selected junctions", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), this, MID_GNE_APPLY, GUIDesignButton); // set absolute value as default myAbsoluteValue->setCheck(true); // set info label - myInfoLabel = new FXLabel(this, "", nullptr, GUIDesignLabelFrameInformation); + myInfoLabel = new FXLabel(getCollapsableFrame(), "", nullptr, GUIDesignLabelFrameInformation); } @@ -506,16 +506,16 @@ // --------------------------------------------------------------------------- GNEMoveFrame::ShiftShapeGeometry::ShiftShapeGeometry(GNEMoveFrame* moveFrameParent) : - FXGroupBox(moveFrameParent->myContentFrame, "Shift shape geometry", GUIDesignGroupBoxFrame), + FXGroupBoxModule(moveFrameParent->myContentFrame, "Shift shape geometry"), myMoveFrameParent(moveFrameParent) { // create horizontal frame - FXHorizontalFrame* horizontalFrameX = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* horizontalFrameX = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); // create elements for Z value new FXLabel(horizontalFrameX, "X value", 0, GUIDesignLabelAttribute); myShiftValueXTextField = new FXTextField(horizontalFrameX, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldReal); myShiftValueXTextField->setText("0"); // create horizontal frame - FXHorizontalFrame* horizontalFrameY = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* horizontalFrameY = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); // create elements for Z value new FXLabel(horizontalFrameY, "Y value", 0, GUIDesignLabelAttribute); myShiftValueYTextField = new FXTextField(horizontalFrameY, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldReal); diff -Nru sumo-1.11.0/src/netedit/frames/common/GNEMoveFrame.h sumo-1.12.0/src/netedit/frames/common/GNEMoveFrame.h --- sumo-1.11.0/src/netedit/frames/common/GNEMoveFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/common/GNEMoveFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -37,7 +37,7 @@ // class CommonModeOptions // =========================================================================== - class CommonModeOptions : protected FXGroupBox { + class CommonModeOptions : public FXGroupBoxModule { public: /// @brief constructor @@ -58,7 +58,7 @@ // class NetworkModeOptions // =========================================================================== - class NetworkModeOptions : protected FXGroupBox { + class NetworkModeOptions : public FXGroupBoxModule { public: /// @brief constructor @@ -88,7 +88,7 @@ // class DemandMoveOptions // =========================================================================== - class DemandModeOptions : protected FXGroupBox { + class DemandModeOptions : public FXGroupBoxModule { public: /// @brief constructor @@ -118,7 +118,7 @@ // class ShiftEdgeSelectedGeometry // =========================================================================== - class ShiftEdgeSelectedGeometry : protected FXGroupBox { + class ShiftEdgeSelectedGeometry : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEMoveFrame::ShiftEdgeSelectedGeometry) @@ -164,7 +164,7 @@ // class ChangeZInSelection // =========================================================================== - class ChangeZInSelection : protected FXGroupBox { + class ChangeZInSelection : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEMoveFrame::ChangeZInSelection) @@ -225,7 +225,7 @@ // class ShiftShapeGeometry // =========================================================================== - class ShiftShapeGeometry : protected FXGroupBox { + class ShiftShapeGeometry : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEMoveFrame::ShiftShapeGeometry) diff -Nru sumo-1.11.0/src/netedit/frames/common/GNESelectorFrame.cpp sumo-1.12.0/src/netedit/frames/common/GNESelectorFrame.cpp --- sumo-1.11.0/src/netedit/frames/common/GNESelectorFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/common/GNESelectorFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -43,7 +43,7 @@ }; FXDEFMAP(GNESelectorFrame::VisualScaling) VisualScalingMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_SELECTSCALE, GNESelectorFrame::VisualScaling::onCmdScaleSelection) + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_SELECTSCALE, GNESelectorFrame::VisualScaling::onCmdScaleSelection) }; FXDEFMAP(GNESelectorFrame::SelectionOperation) SelectionOperationMap[] = { @@ -54,10 +54,17 @@ FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_DELETE, GNESelectorFrame::SelectionOperation::onCmdDelete) }; +FXDEFMAP(GNESelectorFrame::SelectionHierarchy) SelectionHierarchyMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECT, GNESelectorFrame::SelectionHierarchy::onCmdSelectItem), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_PARENTS, GNESelectorFrame::SelectionHierarchy::onCmdParents), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_CHILDREN, GNESelectorFrame::SelectionHierarchy::onCmdChildren), +}; + // Object implementation -FXIMPLEMENT(GNESelectorFrame::ModificationMode, FXGroupBox, ModificationModeMap, ARRAYNUMBER(ModificationModeMap)) -FXIMPLEMENT(GNESelectorFrame::VisualScaling, FXGroupBox, VisualScalingMap, ARRAYNUMBER(VisualScalingMap)) -FXIMPLEMENT(GNESelectorFrame::SelectionOperation, FXGroupBox, SelectionOperationMap, ARRAYNUMBER(SelectionOperationMap)) +FXIMPLEMENT(GNESelectorFrame::ModificationMode, FXGroupBoxModule, ModificationModeMap, ARRAYNUMBER(ModificationModeMap)) +FXIMPLEMENT(GNESelectorFrame::VisualScaling, FXGroupBoxModule, VisualScalingMap, ARRAYNUMBER(VisualScalingMap)) +FXIMPLEMENT(GNESelectorFrame::SelectionOperation, FXGroupBoxModule, SelectionOperationMap, ARRAYNUMBER(SelectionOperationMap)) +FXIMPLEMENT(GNESelectorFrame::SelectionHierarchy, FXGroupBoxModule, SelectionHierarchyMap, ARRAYNUMBER(SelectionHierarchyMap)) // =========================================================================== // method definitions @@ -68,10 +75,10 @@ // --------------------------------------------------------------------------- GNESelectorFrame::SelectionInformation::SelectionInformation(GNESelectorFrame* selectorFrameParent) : - FXGroupBox(selectorFrameParent->myContentFrame, "Selection information", GUIDesignGroupBoxFrame), + FXGroupBoxModule(selectorFrameParent->myContentFrame, "Selection information"), mySelectorFrameParent(selectorFrameParent) { // information label - myInformationLabel = new FXLabel(this, "", nullptr, GUIDesignLabelFrameInformation); + myInformationLabel = new FXLabel(getCollapsableFrame(), "", nullptr, GUIDesignLabelFrameInformation); } @@ -136,16 +143,16 @@ // --------------------------------------------------------------------------- GNESelectorFrame::ModificationMode::ModificationMode(GNESelectorFrame* selectorFrameParent) : - FXGroupBox(selectorFrameParent->myContentFrame, "Modification Mode", GUIDesignGroupBoxFrame), + FXGroupBoxModule(selectorFrameParent->myContentFrame, "Modification Mode"), myModificationModeType(Operation::ADD) { // Create all options buttons - myAddRadioButton = new FXRadioButton(this, "add\t\tSelected objects are added to the previous selection", + myAddRadioButton = new FXRadioButton(getCollapsableFrame(), "add\t\tSelected objects are added to the previous selection", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - myRemoveRadioButton = new FXRadioButton(this, "remove\t\tSelected objects are removed from the previous selection", + myRemoveRadioButton = new FXRadioButton(getCollapsableFrame(), "remove\t\tSelected objects are removed from the previous selection", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - myKeepRadioButton = new FXRadioButton(this, "keep\t\tRestrict previous selection by the current selection", + myKeepRadioButton = new FXRadioButton(getCollapsableFrame(), "keep\t\tRestrict previous selection by the current selection", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - myReplaceRadioButton = new FXRadioButton(this, "replace\t\tReplace previous selection by the current selection", + myReplaceRadioButton = new FXRadioButton(getCollapsableFrame(), "replace\t\tReplace previous selection by the current selection", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); myAddRadioButton->setCheck(true); } @@ -200,10 +207,10 @@ // --------------------------------------------------------------------------- GNESelectorFrame::VisualScaling::VisualScaling(GNESelectorFrame* selectorFrameParent) : - FXGroupBox(selectorFrameParent->myContentFrame, "Visual Scaling", GUIDesignGroupBoxFrame), + FXGroupBoxModule(selectorFrameParent->myContentFrame, "Visual Scaling"), mySelectorFrameParent(selectorFrameParent) { // Create spin button and configure it - mySelectionScaling = new FXRealSpinner(this, 7, this, MID_GNE_SELECTORFRAME_SELECTSCALE, GUIDesignSpinDial); + mySelectionScaling = new FXRealSpinner(getCollapsableFrame(), 7, this, MID_GNE_SELECTORFRAME_SELECTSCALE, GUIDesignSpinDial); //mySelectionScaling->setNumberFormat(1); //mySelectionScaling->setIncrements(0.1, .5, 1); mySelectionScaling->setIncrement(0.5); @@ -225,15 +232,15 @@ } // --------------------------------------------------------------------------- -// ModificationMode::SelectionOperation - methods +// ModificationMode::SelectionHierarchy - methods // --------------------------------------------------------------------------- GNESelectorFrame::SelectionOperation::SelectionOperation(GNESelectorFrame* selectorFrameParent) : - FXGroupBox(selectorFrameParent->myContentFrame, "Operations for selections", GUIDesignGroupBoxFrame), + FXGroupBoxModule(selectorFrameParent->myContentFrame, "Selection operations"), mySelectorFrameParent(selectorFrameParent) { // tabular buttons, see GNETLSEditorFrame - FXHorizontalFrame* selectionButtons = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* selectionButtons = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); FXVerticalFrame* col1 = new FXVerticalFrame(selectionButtons, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); // left button columm FXVerticalFrame* col2 = new FXVerticalFrame(selectionButtons, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); // right button column @@ -256,7 +263,7 @@ long GNESelectorFrame::SelectionOperation::onCmdLoad(FXObject*, FXSelector, void*) { // get the new file name - FXFileDialog opendialog(this, "Open List of Selected Items"); + FXFileDialog opendialog(getCollapsableFrame(), "Open List of Selected Items"); opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG)); opendialog.setSelectMode(SELECTFILE_EXISTING); opendialog.setPatternList("Selection files (*.txt)\nAll files (*)"); @@ -330,7 +337,7 @@ // write warning if netedit is running in testing mode WRITE_DEBUG("Opening FXMessageBox 'error storing selection'"); // open message box error - FXMessageBox::error(this, MBOX_OK, "Storing Selection failed", "%s", e.what()); + FXMessageBox::error(getCollapsableFrame(), MBOX_OK, "Storing Selection failed", "%s", e.what()); // write warning if netedit is running in testing mode WRITE_DEBUG("Closed FXMessageBox 'error storing selection' with 'OK'"); } @@ -514,7 +521,7 @@ if (ignoreLocking || !locks.isObjectLocked(GLO_ADDITIONALELEMENT, false)) { for (const auto& additionalTag : ACs->getAdditionals()) { // first check if additional is selectable - if (GNEAttributeCarrier::getTagProperties(additionalTag.first).isSelectable()) { + if (GNEAttributeCarrier::getTagProperty(additionalTag.first).isSelectable()) { for (const auto& additional : additionalTag.second) { if (onlyCount) { return true; @@ -966,26 +973,270 @@ bool GNESelectorFrame::SelectionOperation::askContinueIfLock() const { - WRITE_DEBUG("Opening FXMessageBox 'merge junctions'"); + WRITE_DEBUG("Opening FXMessageBox 'confirm selection operation'"); // open question box const FXuint answer = FXMessageBox::question(mySelectorFrameParent->getViewNet()->getApp(), MBOX_YES_NO, "Confirm selection operation", "There are locked elements in currentselection.\nApply operation to locked elements?"); 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 'merge junctions' with 'No'"); + WRITE_DEBUG("Closed FXMessageBox 'confirm selection operation' with 'No'"); } else if (answer == 4) { - WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'ESC'"); + WRITE_DEBUG("Closed FXMessageBox 'confirm selection operation' with 'ESC'"); } return false; } else { // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'merge junctions' with 'Yes'"); + WRITE_DEBUG("Closed FXMessageBox 'confirm selection operation' with 'Yes'"); return true; } } // --------------------------------------------------------------------------- +// ModificationMode::SelectionHierarchy - methods +// --------------------------------------------------------------------------- + +GNESelectorFrame::SelectionHierarchy::SelectionHierarchy(GNESelectorFrame* selectorFrameParent) : + FXGroupBoxModule(selectorFrameParent->myContentFrame, "Hierarchy operations"), + mySelectorFrameParent(selectorFrameParent), + myCurrentSelectedParent(Selection::ALL), + myCurrentSelectedChild(Selection::ALL) { + // create label for parents + new FXLabel(getCollapsableFrame(), "Select parents", nullptr, GUIDesignLabelThickCenter); + // Create FXComboBox for parent comboBox + myParentsComboBox = new FXComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_SELECT, GUIDesignComboBox); + // create parent buttons + FXHorizontalFrame* parentButtons = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + // Create "select" Button + mySelectParentsButton = new FXButton(parentButtons, "Select", GUIIconSubSys::getIcon(GUIIcon::SELECT), this, MID_GNE_SELECTORFRAME_PARENTS, GUIDesignButton); + // Create "unselect" Button + myUnselectParentsButton = new FXButton(parentButtons, "Unselect", GUIIconSubSys::getIcon(GUIIcon::UNSELECT), this, MID_GNE_SELECTORFRAME_PARENTS, GUIDesignButton); + // create label for parents + new FXLabel(getCollapsableFrame(), "Select children", nullptr, GUIDesignLabelThickCenter); + // Create FXComboBox for parent comboBox + myChildrenComboBox = new FXComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_SELECT, GUIDesignComboBox); + // create children buttons + FXHorizontalFrame* childrenButtons = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + // Create "select" Button + mySelectChildrenButton = new FXButton(childrenButtons, "Select", GUIIconSubSys::getIcon(GUIIcon::SELECT), this, MID_GNE_SELECTORFRAME_CHILDREN, GUIDesignButton); + // Create "unselect" Button + myUnselectChildrenButton = new FXButton(childrenButtons, "Unselect", GUIIconSubSys::getIcon(GUIIcon::UNSELECT), this, MID_GNE_SELECTORFRAME_CHILDREN, GUIDesignButton); + // fill comboBoxes + for (const auto& item : myItems) { + myParentsComboBox->appendItem(item.second.c_str()); + myChildrenComboBox->appendItem(item.second.c_str()); + } + myParentsComboBox->setNumVisible(5); + myChildrenComboBox->setNumVisible(5); +} + + +GNESelectorFrame::SelectionHierarchy::~SelectionHierarchy() {} + + +long +GNESelectorFrame::SelectionHierarchy::onCmdSelectItem(FXObject* obj, FXSelector, void*) { + if (obj == myParentsComboBox) { + for (const auto& item : myItems) { + if (item.second == myParentsComboBox->getText().text()) { + // enable buttons + mySelectParentsButton->enable(); + myUnselectParentsButton->enable(); + // change text color + myParentsComboBox->setTextColor(FXRGB(0, 0, 0)); + // set current selected parent + myCurrentSelectedParent = item.first; + return 1; + } + } + // item not found + myCurrentSelectedParent = Selection::NOTHING; + // disable buttons + mySelectParentsButton->disable(); + myUnselectParentsButton->disable(); + myParentsComboBox->setTextColor(FXRGB(255, 0, 0)); + return 1; + } else if (obj == myChildrenComboBox) { + for (const auto& item : myItems) { + if (item.second == myChildrenComboBox->getText().text()) { + // enable buttons + mySelectChildrenButton->enable(); + myUnselectChildrenButton->enable(); + // change text color + myChildrenComboBox->setTextColor(FXRGB(0, 0, 0)); + // set current selected parent + myCurrentSelectedChild = item.first; + return 1; + } + } + // item not found + myCurrentSelectedChild = Selection::NOTHING; + // disable buttons + mySelectChildrenButton->disable(); + myUnselectChildrenButton->disable(); + myChildrenComboBox->setTextColor(FXRGB(255, 0, 0)); + return 1; + } + return 0; +} + + +long +GNESelectorFrame::SelectionHierarchy::onCmdParents(FXObject* obj, FXSelector, void*) { + // get selected elements + const auto selectedACs = mySelectorFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(true); + // check if there is selected ACs + if ((selectedACs.size() > 0) && (myCurrentSelectedParent != Selection::NOTHING)) { + // vector of hierarchical elements to select + std::vector HEToSelect; + for (const auto& selectedAC : selectedACs) { + // get hierarchical element + const auto HE = selectedAC->getHierarchicalElement(); + // junctions + if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::JUNCTION)) { + HEToSelect.insert(HEToSelect.end(), HE->getParentJunctions().begin(), HE->getParentJunctions().end()); + } + // edges + if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::EDGE)) { + if (selectedAC->getTagProperty().getTag() == SUMO_TAG_LANE) { + // special case for lanes + HEToSelect.push_back(dynamic_cast(selectedAC)->getParentEdge()); + } else { + HEToSelect.insert(HEToSelect.end(), HE->getParentEdges().begin(), HE->getParentEdges().end()); + } + } + // lanes + if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::LANE)) { + HEToSelect.insert(HEToSelect.end(), HE->getParentLanes().begin(), HE->getParentLanes().end()); + } + // additional + if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::ADDITIONAL)) { + HEToSelect.insert(HEToSelect.end(), HE->getParentAdditionals().begin(), HE->getParentAdditionals().end()); + } + // shape + if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::SHAPE)) { + HEToSelect.insert(HEToSelect.end(), HE->getParentShapes().begin(), HE->getParentShapes().end()); + } + // demand + if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::DEMAND)) { + HEToSelect.insert(HEToSelect.end(), HE->getParentDemandElements().begin(), HE->getParentDemandElements().end()); + } + // data + if ((myCurrentSelectedParent == Selection::ALL) || (myCurrentSelectedParent == Selection::DATA)) { + HEToSelect.insert(HEToSelect.end(), HE->getParentGenericDatas().begin(), HE->getParentGenericDatas().end()); + } + } + // select HE + if (HEToSelect.size() > 0) { + for (const auto& HE : HEToSelect) { + if (obj == mySelectParentsButton) { + HE->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->getViewNet()->getUndoList()); + } else { + HE->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->getViewNet()->getUndoList()); + } + } + } + // update information label + mySelectorFrameParent->mySelectionInformation->updateInformationLabel(); + // update viewNet + mySelectorFrameParent->getViewNet()->update(); + } + return 1; +} + + +long +GNESelectorFrame::SelectionHierarchy::onCmdChildren(FXObject* obj, FXSelector, void*) { + // get selected elements + const auto selectedACs = mySelectorFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(true); + // check if there is selected ACs + if ((selectedACs.size() > 0) && (myCurrentSelectedChild != Selection::NOTHING)) { + // vector of hierarchical elements to select + std::vector HEToSelect; + for (const auto& selectedAC : selectedACs) { + // get hierarchical element + const auto HE = selectedAC->getHierarchicalElement(); + // junctions + if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::JUNCTION)) { + if (selectedAC->getTagProperty().getTag() == SUMO_TAG_JUNCTION) { + // special case for junction + const auto junction = dynamic_cast(selectedAC); + // insert edges + HEToSelect.insert(HEToSelect.end(), junction->getGNEIncomingEdges().begin(), junction->getGNEIncomingEdges().end()); + HEToSelect.insert(HEToSelect.end(), junction->getGNEOutgoingEdges().begin(), junction->getGNEOutgoingEdges().end()); + } else { + HEToSelect.insert(HEToSelect.end(), HE->getChildJunctions().begin(), HE->getChildJunctions().end()); + } + } + // edges + if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::EDGE)) { + if (selectedAC->getTagProperty().getTag() == SUMO_TAG_EDGE) { + // special case for edges + const auto edge = dynamic_cast(selectedAC); + // insert lanes + HEToSelect.insert(HEToSelect.end(), edge->getLanes().begin(), edge->getLanes().end()); + } else { + HEToSelect.insert(HEToSelect.end(), HE->getChildEdges().begin(), HE->getChildEdges().end()); + } + } + // lanes + if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::LANE)) { + HEToSelect.insert(HEToSelect.end(), HE->getChildLanes().begin(), HE->getChildLanes().end()); + } + // additional + if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::ADDITIONAL)) { + // avoid insert symbols + for (const auto& additionalChild : HE->getChildAdditionals()) { + if (!additionalChild->getTagProperty().isSymbol()) { + HEToSelect.push_back(additionalChild); + } + } + } + // shape + if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::SHAPE)) { + HEToSelect.insert(HEToSelect.end(), HE->getChildShapes().begin(), HE->getChildShapes().end()); + } + // demand + if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::DEMAND)) { + HEToSelect.insert(HEToSelect.end(), HE->getChildDemandElements().begin(), HE->getChildDemandElements().end()); + } + // data + if ((myCurrentSelectedChild == Selection::ALL) || (myCurrentSelectedChild == Selection::DATA)) { + HEToSelect.insert(HEToSelect.end(), HE->getChildGenericDatas().begin(), HE->getChildGenericDatas().end()); + } + } + // select HE + if (HEToSelect.size() > 0) { + for (const auto& HE : HEToSelect) { + if (obj == mySelectChildrenButton) { + HE->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->getViewNet()->getUndoList()); + } else { + HE->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->getViewNet()->getUndoList()); + } + } + } + // update information label + mySelectorFrameParent->mySelectionInformation->updateInformationLabel(); + // update viewNet + mySelectorFrameParent->getViewNet()->update(); + } + return 1; +} + +// --------------------------------------------------------------------------- +// GNECrossingFrame::Legend - methods +// --------------------------------------------------------------------------- + +GNESelectorFrame::Information::Information(GNESelectorFrame* selectorFrameParent) : + FXGroupBoxModule(selectorFrameParent->myContentFrame, "Information") { + // Create Selection Hint + new FXLabel(getCollapsableFrame(), " - Hold for \n rectangle selection.\n - Press to\n delete selected objects.", nullptr, GUIDesignLabelFrameInformation); +} + + +GNESelectorFrame::Information::~Information() {} + +// --------------------------------------------------------------------------- // GNESelectorFrame - methods // --------------------------------------------------------------------------- @@ -1003,11 +1254,10 @@ myVisualScaling = new VisualScaling(this); // create SelectionOperation modul mySelectionOperation = new SelectionOperation(this); - // Create groupbox for information about selections - FXGroupBox* selectionHintGroupBox = new FXGroupBox(myContentFrame, "Information", GUIDesignGroupBoxFrame); - // Create Selection Hint - new FXLabel(selectionHintGroupBox, " - Hold for \n rectangle selection.\n - Press to\n delete selected objects.", nullptr, GUIDesignLabelFrameInformation); - + // create SelectionHierarchy modul + mySelectionHierarchy = new SelectionHierarchy(this); + // create Information modul + myInformation = new Information(this); } @@ -1147,7 +1397,7 @@ // first retrieve all ACs using ACTag const auto allACbyTag = myViewNet->getNet()->getAttributeCarriers()->retrieveAttributeCarriers(ACTag); // get Tag value - const auto& tagValue = GNEAttributeCarrier::getTagProperties(ACTag); + const auto& tagValue = GNEAttributeCarrier::getTagProperty(ACTag); // iterate over all ACs for (const auto& AC : allACbyTag) { if (expr == "" && compOp == '@') { @@ -1270,7 +1520,7 @@ GNESelectorFrame::ModificationMode* -GNESelectorFrame::getModificationModeModul() const { +GNESelectorFrame::getModificationModeModule() const { return myModificationMode; } diff -Nru sumo-1.11.0/src/netedit/frames/common/GNESelectorFrame.h sumo-1.12.0/src/netedit/frames/common/GNESelectorFrame.h --- sumo-1.11.0/src/netedit/frames/common/GNESelectorFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/common/GNESelectorFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -47,7 +47,7 @@ // class SelectionInformation // =========================================================================== - class SelectionInformation : protected FXGroupBox { + class SelectionInformation : public FXGroupBoxModule { public: /// @brief constructor @@ -84,7 +84,7 @@ // class ModificationMode // =========================================================================== - class ModificationMode : protected FXGroupBox { + class ModificationMode : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNESelectorFrame::ModificationMode) @@ -145,7 +145,7 @@ // class VisualScaling // =========================================================================== - class VisualScaling : protected FXGroupBox { + class VisualScaling : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNESelectorFrame::VisualScaling) @@ -186,7 +186,7 @@ // class SelectionOperation // =========================================================================== - class SelectionOperation : protected FXGroupBox { + class SelectionOperation : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNESelectorFrame::SelectionOperation) @@ -255,6 +255,113 @@ SelectionOperation& operator=(const SelectionOperation&) = delete; }; + // =========================================================================== + // class SelectionHierarchy + // =========================================================================== + + class SelectionHierarchy : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNESelectorFrame::SelectionHierarchy) + + public: + /// @brief constructor + SelectionHierarchy(GNESelectorFrame* selectorFrameParent); + + /// @brief destructor + ~SelectionHierarchy(); + + /// @name FOX-callbacks + /// @{ + + /// @brief called when user select an item in comboBox + long onCmdSelectItem(FXObject* obj, FXSelector, void*); + + /// @brief called when user press select/unselect parents button + long onCmdParents(FXObject* obj, FXSelector, void*); + + /// @brief called when user press select/unselect children button + long onCmdChildren(FXObject* obj, FXSelector, void*); + + /// @} + + protected: + /// @brief FOX need this + FOX_CONSTRUCTOR(SelectionHierarchy) + + private: + /// @brief enum used in comboBox + enum class Selection { + ALL, + JUNCTION, + EDGE, + LANE, + ADDITIONAL, + SHAPE, + DEMAND, + DATA, + NOTHING, + }; + + /// @brief pointer to Selector Frame Parent + GNESelectorFrame* mySelectorFrameParent; + + /// @brief comboBox for parents + FXComboBox* myParentsComboBox = nullptr; + + /// @brief comboBox for children + FXComboBox* myChildrenComboBox = nullptr; + + /// @brief select parents button + FXButton* mySelectParentsButton = nullptr; + + /// @brief unselect parents button + FXButton* myUnselectParentsButton = nullptr; + + /// @brief select children button + FXButton* mySelectChildrenButton = nullptr; + + /// @brief unselect parents button + FXButton* myUnselectChildrenButton = nullptr; + + // @brief items + const std::vector > myItems = { + std::make_pair(Selection::ALL, "all"), + std::make_pair(Selection::JUNCTION, "junction"), + std::make_pair(Selection::EDGE, "edge"), + std::make_pair(Selection::LANE, "lane"), + std::make_pair(Selection::ADDITIONAL, "additionalElements"), + std::make_pair(Selection::SHAPE, "shapeElements"), + std::make_pair(Selection::DEMAND, "demandElements"), + std::make_pair(Selection::DATA, "dataElements") + }; + + /// @brief current selected parent + Selection myCurrentSelectedParent; + + /// @brief current selected child + Selection myCurrentSelectedChild; + + /// @brief Invalidated copy constructor. + SelectionHierarchy(const SelectionHierarchy&) = delete; + + /// @brief Invalidated assignment operator. + SelectionHierarchy& operator=(const SelectionHierarchy&) = delete; + }; + + // =========================================================================== + // class Legend + // =========================================================================== + + class Information : public FXGroupBoxModule { + + public: + /// @brief constructor + Information(GNESelectorFrame* selectorFrameParent); + + /// @brief destructor + ~Information(); + }; + /**@brief Constructor * @brief parent FXHorizontalFrame in which this GNEFrame is placed * @brief viewNet viewNet that uses this GNEFrame @@ -299,32 +406,38 @@ FXVerticalFrame* getContentFrame() const; /// @brief get modification mode modul - ModificationMode* getModificationModeModul() const; + ModificationMode* getModificationModeModule() const; /// @brief getmodul for selection information SelectionInformation* getSelectionInformation() const; private: /// @brief modul for selection information - SelectionInformation* mySelectionInformation; + GNESelectorFrame::SelectionInformation* mySelectionInformation = nullptr; /// @brief modul for change modification mode - ModificationMode* myModificationMode; + GNESelectorFrame::ModificationMode* myModificationMode = nullptr; /// @brief moduls for select network element set - GNEElementSet* myNetworkElementSet; + GNEElementSet* myNetworkElementSet = nullptr; /// @brief moduls for select demand element set - GNEElementSet* myDemandElementSet; + GNEElementSet* myDemandElementSet = nullptr; /// @brief moduls for select data element set - GNEElementSet* myDataElementSet; + GNEElementSet* myDataElementSet = nullptr; /// @brief modul for visual scaling - VisualScaling* myVisualScaling; + GNESelectorFrame::VisualScaling* myVisualScaling = nullptr; /// @brief modul for selection operations - SelectionOperation* mySelectionOperation; + GNESelectorFrame::SelectionOperation* mySelectionOperation = nullptr; + + /// @brief modul for selection hierarchy + GNESelectorFrame::SelectionHierarchy* mySelectionHierarchy = nullptr; + + /// @brief information modul + GNESelectorFrame::Information* myInformation = nullptr; /// @brief Invalidated copy constructor. GNESelectorFrame(const GNESelectorFrame&) = delete; diff -Nru sumo-1.11.0/src/netedit/frames/data/GNEEdgeDataFrame.cpp sumo-1.12.0/src/netedit/frames/data/GNEEdgeDataFrame.cpp --- sumo-1.11.0/src/netedit/frames/data/GNEEdgeDataFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/data/GNEEdgeDataFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -61,7 +61,7 @@ CommonXMLStructure::SumoBaseObject* genericDataBaseObject = new CommonXMLStructure::SumoBaseObject(intervalBaseObject); // finally create edgeData GNEDataHandler dataHandler(myViewNet->getNet(), "", true); - dataHandler.buildEdgeData(genericDataBaseObject, objectsUnderCursor.getEdgeFront()->getID(), myParametersEditorCreator->getParametersMap()); + dataHandler.buildEdgeData(genericDataBaseObject, objectsUnderCursor.getEdgeFront()->getID(), myGenericDataAttributes->getParametersMap()); // delete intervalBaseObject (and genericDataBaseObject) delete intervalBaseObject; // edgeData created, then return true diff -Nru sumo-1.11.0/src/netedit/frames/data/GNEEdgeDataFrame.h sumo-1.12.0/src/netedit/frames/data/GNEEdgeDataFrame.h --- sumo-1.11.0/src/netedit/frames/data/GNEEdgeDataFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/data/GNEEdgeDataFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/frames/data/GNEEdgeRelDataFrame.cpp sumo-1.12.0/src/netedit/frames/data/GNEEdgeRelDataFrame.cpp --- sumo-1.11.0/src/netedit/frames/data/GNEEdgeRelDataFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/data/GNEEdgeRelDataFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -64,7 +64,7 @@ CommonXMLStructure::SumoBaseObject* edgeRelationData = new CommonXMLStructure::SumoBaseObject(dataIntervalObject); // create EdgeRelationData dataHandler.buildEdgeRelationData(edgeRelationData, myPathCreator->getSelectedEdges().front()->getID(), - myPathCreator->getSelectedEdges().back()->getID(), myParametersEditorCreator->getParametersMap()); + myPathCreator->getSelectedEdges().back()->getID(), myGenericDataAttributes->getParametersMap()); // abort path creation myPathCreator->abortPathCreation(); delete dataIntervalObject; diff -Nru sumo-1.11.0/src/netedit/frames/data/GNEEdgeRelDataFrame.h sumo-1.12.0/src/netedit/frames/data/GNEEdgeRelDataFrame.h --- sumo-1.11.0/src/netedit/frames/data/GNEEdgeRelDataFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/data/GNEEdgeRelDataFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/frames/data/GNEGenericDataFrame.cpp sumo-1.12.0/src/netedit/frames/data/GNEGenericDataFrame.cpp --- sumo-1.11.0/src/netedit/frames/data/GNEGenericDataFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/data/GNEGenericDataFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -53,9 +53,9 @@ }; // Object implementation -FXIMPLEMENT(GNEGenericDataFrame::DataSetSelector, FXGroupBox, DataSetSelectorMap, ARRAYNUMBER(DataSetSelectorMap)) -FXIMPLEMENT(GNEGenericDataFrame::IntervalSelector, FXGroupBox, IntervalSelectorMap, ARRAYNUMBER(IntervalSelectorMap)) -FXIMPLEMENT(GNEGenericDataFrame::AttributeSelector, FXGroupBox, AttributeSelectorMap, ARRAYNUMBER(AttributeSelectorMap)) +FXIMPLEMENT(GNEGenericDataFrame::DataSetSelector, FXGroupBoxModule, DataSetSelectorMap, ARRAYNUMBER(DataSetSelectorMap)) +FXIMPLEMENT(GNEGenericDataFrame::IntervalSelector, FXGroupBoxModule, IntervalSelectorMap, ARRAYNUMBER(IntervalSelectorMap)) +FXIMPLEMENT(GNEGenericDataFrame::AttributeSelector, FXGroupBoxModule, AttributeSelectorMap, ARRAYNUMBER(AttributeSelectorMap)) // =========================================================================== // method definitions @@ -66,21 +66,21 @@ // --------------------------------------------------------------------------- GNEGenericDataFrame::DataSetSelector::DataSetSelector(GNEGenericDataFrame* genericDataFrameParent) : - FXGroupBox(genericDataFrameParent->myContentFrame, "DataSet", GUIDesignGroupBoxFrame), + FXGroupBoxModule(genericDataFrameParent->myContentFrame, "DataSet"), myGenericDataFrameParent(genericDataFrameParent) { // create check button for new data set - myNewDataSetCheckButton = new FXCheckButton(this, "Create new dataSet", this, MID_GNE_SELECT, GUIDesignCheckButton); + myNewDataSetCheckButton = new FXCheckButton(getCollapsableFrame(), "Create new dataSet", this, MID_GNE_SELECT, GUIDesignCheckButton); // Create FXComboBox - myDataSetsComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_DATASET_SELECTED, GUIDesignComboBox); + myDataSetsComboBox = new FXComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_DATASET_SELECTED, GUIDesignComboBox); // create new id label - myHorizontalFrameNewID = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myHorizontalFrameNewID = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); new FXLabel(myHorizontalFrameNewID, "new dataSet ID", nullptr, GUIDesignLabelAttribute); // create new id textField myNewDataSetIDTextField = new FXTextField(myHorizontalFrameNewID, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // hide horizontal frame myHorizontalFrameNewID->hide(); // create dataSet button - myCreateDataSetButton = new FXButton(this, "Create dataSet", GUIIconSubSys::getIcon(GUIIcon::DATASET), this, MID_GNE_CREATE, GUIDesignButton); + myCreateDataSetButton = new FXButton(getCollapsableFrame(), "Create dataSet", GUIIconSubSys::getIcon(GUIIcon::DATASET), this, MID_GNE_CREATE, GUIDesignButton); myCreateDataSetButton->hide(); // refresh interval selector refreshDataSetSelector(nullptr); @@ -195,12 +195,12 @@ // --------------------------------------------------------------------------- GNEGenericDataFrame::IntervalSelector::IntervalSelector(GNEGenericDataFrame* genericDataFrameParent) : - FXGroupBox(genericDataFrameParent->myContentFrame, "Interval", GUIDesignGroupBoxFrame), + FXGroupBoxModule(genericDataFrameParent->myContentFrame, "Interval"), myGenericDataFrameParent(genericDataFrameParent) { // create check button for new interval - myNewIntervalCheckButton = new FXCheckButton(this, "Create new interval", this, MID_GNE_SELECT, GUIDesignCheckButton); + myNewIntervalCheckButton = new FXCheckButton(getCollapsableFrame(), "Create new interval", this, MID_GNE_SELECT, GUIDesignCheckButton); // create begin label - myHorizontalFrameBegin = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myHorizontalFrameBegin = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); new FXLabel(myHorizontalFrameBegin, toString(SUMO_ATTR_BEGIN).c_str(), nullptr, GUIDesignLabelAttribute); // create begin TextField myBeginTextField = new FXTextField(myHorizontalFrameBegin, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); @@ -208,7 +208,7 @@ // hide horizontal frame begin myHorizontalFrameBegin->hide(); // create end label - myHorizontalFrameEnd = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myHorizontalFrameEnd = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); new FXLabel(myHorizontalFrameEnd, toString(SUMO_ATTR_END).c_str(), nullptr, GUIDesignLabelAttribute); // create end textfield myEndTextField = new FXTextField(myHorizontalFrameEnd, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); @@ -216,10 +216,10 @@ // hide horizontal frame end myHorizontalFrameEnd->hide(); // create interval button - myCreateIntervalButton = new FXButton(this, "create interval", GUIIconSubSys::getIcon(GUIIcon::DATAINTERVAL), this, MID_GNE_CREATE, GUIDesignButton); + myCreateIntervalButton = new FXButton(getCollapsableFrame(), "create interval", GUIIconSubSys::getIcon(GUIIcon::DATAINTERVAL), this, MID_GNE_CREATE, GUIDesignButton); myCreateIntervalButton->hide(); // Create three list - myIntervalsTreelist = new FXTreeList(this, this, MID_GNE_DATAINTERVAL_SELECTED, GUIDesignTreeListFrame); + myIntervalsTreelist = new FXTreeList(getCollapsableFrame(), this, MID_GNE_DATAINTERVAL_SELECTED, GUIDesignTreeListFrame); // refresh interval selector refreshIntervalSelector(); // IntervalSelector is always shown @@ -389,14 +389,14 @@ // --------------------------------------------------------------------------- GNEGenericDataFrame::AttributeSelector::AttributeSelector(GNEGenericDataFrame* genericDataFrameParent, SumoXMLTag tag) : - FXGroupBox(genericDataFrameParent->myContentFrame, "Data attributes", GUIDesignGroupBoxFrame), + FXGroupBoxModule(genericDataFrameParent->myContentFrame, "Data attributes"), myGenericDataFrameParent(genericDataFrameParent), myMinMaxLabel(nullptr), myGenericDataTag(tag) { // Create FXComboBox - myAttributesComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SELECT, GUIDesignComboBox); + myAttributesComboBox = new FXComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_SELECT, GUIDesignComboBox); // build rainbow - myMinMaxLabel = GNEFrameModuls::buildRainbow(this); + myMinMaxLabel = GNEFrameModules::buildRainbow(this); // refresh interval selector refreshAttributeSelector(); // AttributeSelector is always shown @@ -512,7 +512,7 @@ } -GNEFrameModuls::PathCreator* +GNEFrameModules::PathCreator* GNEGenericDataFrame::getPathCreator() const { return myPathCreator; } @@ -530,7 +530,7 @@ myDataSetSelector->refreshDataSetSelector(nullptr); // check if there is an edge path creator if (myPathCreator) { - myPathCreator->showPathCreatorModul(myGenericDataTag, false, false); + myPathCreator->showPathCreatorModule(myGenericDataTag, false, false); } // show frame GNEFrame::show(); @@ -555,7 +555,7 @@ myDataSetSelector(nullptr), myIntervalSelector(nullptr), myAttributeSelector(nullptr), - myParametersEditorCreator(nullptr), + myGenericDataAttributes(nullptr), myPathCreator(nullptr), myGenericDataTag(tag) { // create DataSetSelector @@ -565,10 +565,10 @@ // create AttributeSelector modul myAttributeSelector = new AttributeSelector(this, tag); // create parameter editor modul - myParametersEditorCreator = new GNEFrameAttributesModuls::ParametersEditorCreator(this); + myGenericDataAttributes = new GNEFrameAttributeModules::GenericDataAttributes(this); // create PathCreator modul if (pathCreator) { - myPathCreator = new GNEFrameModuls::PathCreator(this); + myPathCreator = new GNEFrameModules::PathCreator(this); } } diff -Nru sumo-1.11.0/src/netedit/frames/data/GNEGenericDataFrame.h sumo-1.12.0/src/netedit/frames/data/GNEGenericDataFrame.h --- sumo-1.11.0/src/netedit/frames/data/GNEGenericDataFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/data/GNEGenericDataFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -44,7 +44,7 @@ // class DataSetSelector // =========================================================================== - class DataSetSelector : protected FXGroupBox { + class DataSetSelector : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEGenericDataFrame::DataSetSelector) @@ -104,7 +104,7 @@ // class IntervalSelector // =========================================================================== - class IntervalSelector : protected FXGroupBox { + class IntervalSelector : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEGenericDataFrame::IntervalSelector) @@ -176,7 +176,7 @@ // class AttributeSelector // =========================================================================== - class AttributeSelector : protected FXGroupBox { + class AttributeSelector : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEGenericDataFrame::AttributeSelector) @@ -231,7 +231,7 @@ const AttributeSelector* getAttributeSelector() const; /// @brief get PathCreator modul - GNEFrameModuls::PathCreator* getPathCreator() const; + GNEFrameModules::PathCreator* getPathCreator() const; /// @bried get element type of this data frame SumoXMLTag getTag() const; @@ -270,10 +270,10 @@ AttributeSelector* myAttributeSelector; /// @brief parameters editor creator - GNEFrameAttributesModuls::ParametersEditorCreator* myParametersEditorCreator; + GNEFrameAttributeModules::GenericDataAttributes* myGenericDataAttributes; /// @brief edge path creator (used for Walks, rides and trips) - GNEFrameModuls::PathCreator* myPathCreator; + GNEFrameModules::PathCreator* myPathCreator; /// @brief generic data tag SumoXMLTag myGenericDataTag; diff -Nru sumo-1.11.0/src/netedit/frames/data/GNETAZRelDataFrame.cpp sumo-1.12.0/src/netedit/frames/data/GNETAZRelDataFrame.cpp --- sumo-1.11.0/src/netedit/frames/data/GNETAZRelDataFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/data/GNETAZRelDataFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -37,24 +37,24 @@ // GNETAZRelDataFrame::TAZRelLegend - methods // --------------------------------------------------------------------------- -GNETAZRelDataFrame::TAZRelLegend::TAZRelLegend(GNETAZRelDataFrame* TAZRelDataFrame) : - FXGroupBox(TAZRelDataFrame->myContentFrame, "Legend", GUIDesignGroupBoxFrame), +GNETAZRelDataFrame::Legend::Legend(GNETAZRelDataFrame* TAZRelDataFrame) : + FXGroupBoxModule(TAZRelDataFrame->myContentFrame, "Information"), myFromTAZLabel(nullptr), myToTAZLabel(nullptr) { // create from TAZ label - myFromTAZLabel = new FXLabel(this, "From TAZ", 0, GUIDesignLabelLeft); + myFromTAZLabel = new FXLabel(getCollapsableFrame(), "From TAZ", 0, GUIDesignLabelLeft); myFromTAZLabel->setBackColor(MFXUtils::getFXColor(RGBColor::GREEN)); // create to TAZ Label - myToTAZLabel = new FXLabel(this, "To TAZ", 0, GUIDesignLabelLeft); + myToTAZLabel = new FXLabel(getCollapsableFrame(), "To TAZ", 0, GUIDesignLabelLeft); myToTAZLabel->setBackColor(MFXUtils::getFXColor(RGBColor::MAGENTA)); } -GNETAZRelDataFrame::TAZRelLegend::~TAZRelLegend() {} +GNETAZRelDataFrame::Legend::~Legend() {} void -GNETAZRelDataFrame::TAZRelLegend::setLabels(const GNETAZElement* fromTAZ, const GNETAZElement* toTAZ) { +GNETAZRelDataFrame::Legend::setLabels(const GNETAZElement* fromTAZ, const GNETAZElement* toTAZ) { // from TAZ if (fromTAZ) { myFromTAZLabel->setText(("From TAZ: " + fromTAZ->getID()).c_str()); @@ -77,9 +77,9 @@ GNEGenericDataFrame(horizontalFrameParent, viewNet, SUMO_TAG_TAZREL, false), myFirstTAZ(nullptr), mySecondTAZ(nullptr), - myTAZRelLegend(nullptr) { + myLegend(nullptr) { // create legend - myTAZRelLegend = new TAZRelLegend(this); + myLegend = new Legend(this); } @@ -95,12 +95,12 @@ return false; } else { mySecondTAZ = objectsUnderCursor.getTAZElementFront(); - myTAZRelLegend->setLabels(myFirstTAZ, mySecondTAZ); + myLegend->setLabels(myFirstTAZ, mySecondTAZ); return true; } } else if (objectsUnderCursor.getTAZElementFront()) { myFirstTAZ = objectsUnderCursor.getTAZElementFront(); - myTAZRelLegend->setLabels(myFirstTAZ, mySecondTAZ); + myLegend->setLabels(myFirstTAZ, mySecondTAZ); return true; } else { return false; @@ -129,12 +129,12 @@ // create TAZRelData CommonXMLStructure::SumoBaseObject* TAZRelData = new CommonXMLStructure::SumoBaseObject(dataIntervalObject); // finally create TAZRelationData - dataHandler.buildTAZRelationData(TAZRelData, myFirstTAZ->getID(), mySecondTAZ->getID(), myParametersEditorCreator->getParametersMap()); + dataHandler.buildTAZRelationData(TAZRelData, myFirstTAZ->getID(), mySecondTAZ->getID(), myGenericDataAttributes->getParametersMap()); delete dataIntervalObject; // reset both TAZs myFirstTAZ = nullptr; mySecondTAZ = nullptr; - myTAZRelLegend->setLabels(myFirstTAZ, mySecondTAZ); + myLegend->setLabels(myFirstTAZ, mySecondTAZ); } } } @@ -156,7 +156,7 @@ GNETAZRelDataFrame::clearTAZSelection() { myFirstTAZ = nullptr; mySecondTAZ = nullptr; - myTAZRelLegend->setLabels(myFirstTAZ, mySecondTAZ); + myLegend->setLabels(myFirstTAZ, mySecondTAZ); } /****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/frames/data/GNETAZRelDataFrame.h sumo-1.12.0/src/netedit/frames/data/GNETAZRelDataFrame.h --- sumo-1.11.0/src/netedit/frames/data/GNETAZRelDataFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/data/GNETAZRelDataFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -34,17 +34,17 @@ public: // =========================================================================== - // class TAZRelLegend + // class Legend // =========================================================================== - class TAZRelLegend : protected FXGroupBox { + class Legend : public FXGroupBoxModule { public: /// @brief constructor - TAZRelLegend(GNETAZRelDataFrame* TAZRelDataFrame); + Legend(GNETAZRelDataFrame* TAZRelDataFrame); /// @brief destructor - ~TAZRelLegend(); + ~Legend(); /// @brief set labels void setLabels(const GNETAZElement* fromTAZ, const GNETAZElement* toTAZ); @@ -89,7 +89,7 @@ GNETAZElement* mySecondTAZ; /// @brief TAZRel legend - TAZRelLegend* myTAZRelLegend; + GNETAZRelDataFrame::Legend* myLegend; private: /// @brief Invalidated copy constructor. diff -Nru sumo-1.11.0/src/netedit/frames/demand/CMakeLists.txt sumo-1.12.0/src/netedit/frames/demand/CMakeLists.txt --- sumo-1.11.0/src/netedit/frames/demand/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -13,10 +13,8 @@ GNEContainerPlanFrame.cpp GNEVehicleFrame.h GNEVehicleFrame.cpp - GNEVehicleTypeFrame.h - GNEVehicleTypeFrame.cpp - GNEPersonTypeFrame.h - GNEPersonTypeFrame.cpp + GNETypeFrame.h + GNETypeFrame.cpp ) add_library(netedit_frames_demand STATIC ${netedit_frames_demand_SRCS}) diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEContainerFrame.cpp sumo-1.12.0/src/netedit/frames/demand/GNEContainerFrame.cpp --- sumo-1.11.0/src/netedit/frames/demand/GNEContainerFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEContainerFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -42,31 +42,28 @@ myContainerBaseObject(new CommonXMLStructure::SumoBaseObject(nullptr)) { // create tag Selector modul for containers - myContainerTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::CONTAINER); + myContainerTagSelector = new GNEFrameModules::TagSelector(this, GNETagProperties::TagType::CONTAINER, SUMO_TAG_CONTAINER); - // create container types selector modul - myPTypeSelector = new GNEFrameModuls::DemandElementSelector(this, SUMO_TAG_PTYPE); + // create container types selector modul and set DEFAULT_CONTAINERTYPE_ID as default element + myTypeSelector = new GNEFrameModules::DemandElementSelector(this, SUMO_TAG_VTYPE, viewNet->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_CONTAINERTYPE_ID)); // create container attributes - myContainerAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + myContainerAttributes = new GNEFrameAttributeModules::AttributesCreator(this); // create tag Selector modul for container plans - myContainerPlanTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::CONTAINERPLAN); + myContainerPlanTagSelector = new GNEFrameModules::TagSelector(this, GNETagProperties::TagType::CONTAINERPLAN, GNE_TAG_TRANSPORT_EDGE); // create container plan attributes - myContainerPlanAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + myContainerPlanAttributes = new GNEFrameAttributeModules::AttributesCreator(this); // Create Netedit parameter - myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); + myNeteditAttributes = new GNEFrameAttributeModules::NeteditAttributes(this); - // create PathCreator Modul - myPathCreator = new GNEFrameModuls::PathCreator(this); + // create PathCreator Module + myPathCreator = new GNEFrameModules::PathCreator(this); // limit path creator to pedestrians myPathCreator->setVClass(SVC_PEDESTRIAN); - - // set Container as default vehicle - myContainerTagSelector->setCurrentTag(SUMO_TAG_CONTAINER); } @@ -77,12 +74,13 @@ void GNEContainerFrame::show() { - // refresh item selector - myContainerTagSelector->refreshTagProperties(); - myPTypeSelector->refreshDemandElementSelector(); - myContainerPlanTagSelector->refreshTagProperties(); + // refresh tag selector + myContainerTagSelector->refreshTagSelector(); + myTypeSelector->refreshDemandElementSelector(); + myContainerPlanTagSelector->refreshTagSelector(); // update VClass of myPathCreator - if (myContainerPlanTagSelector->getCurrentTagProperties().isRide()) { + if (myContainerPlanTagSelector->getCurrentTemplateAC() && + myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty().isTransportPlan()) { myPathCreator->setVClass(SVC_PASSENGER); } else { myPathCreator->setVClass(SVC_PEDESTRIAN); @@ -110,20 +108,19 @@ return false; } // obtain tags (only for improve code legibility) - SumoXMLTag containerTag = myContainerTagSelector->getCurrentTagProperties().getTag(); SumoXMLTag clickedACTag = objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag(); // first check that current selected container is valid - if (containerTag == SUMO_TAG_NOTHING) { + if (myContainerTagSelector->getCurrentTemplateAC() == nullptr) { myViewNet->setStatusBarText("Current selected container isn't valid."); return false; } // now check that pType is valid - if (myPTypeSelector->getCurrentDemandElement() == nullptr) { + if (myTypeSelector->getCurrentDemandElement() == nullptr) { myViewNet->setStatusBarText("Current selected container type isn't valid."); return false; } // finally check that container plan selected is valid - if (myContainerPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_NOTHING) { + if (myContainerPlanTagSelector->getCurrentTemplateAC() == nullptr) { myViewNet->setStatusBarText("Current selected container plan isn't valid."); return false; } @@ -140,7 +137,7 @@ } -GNEFrameModuls::PathCreator* +GNEFrameModules::PathCreator* GNEContainerFrame::getPathCreator() const { return myPathCreator; } @@ -152,97 +149,103 @@ void GNEContainerFrame::tagSelected() { // first check if container is valid - if (myContainerTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + if (myContainerTagSelector->getCurrentTemplateAC()) { // show PType selector and container plan selector - myPTypeSelector->showDemandElementSelector(); + myTypeSelector->showDemandElementSelector(); // check if current container type selected is valid - if (myPTypeSelector->getCurrentDemandElement()) { + if (myTypeSelector->getCurrentDemandElement()) { // show container attributes depending of myContainerPlanTagSelector - if (myContainerPlanTagSelector->getCurrentTagProperties().isStopContainer()) { - myContainerAttributes->showAttributesCreatorModul(myContainerTagSelector->getCurrentTagProperties(), {SUMO_ATTR_DEPARTPOS}); + if (myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty().isStopContainer()) { + myContainerAttributes->showAttributesCreatorModule(myContainerTagSelector->getCurrentTemplateAC(), {SUMO_ATTR_DEPARTPOS}); } else { - myContainerAttributes->showAttributesCreatorModul(myContainerTagSelector->getCurrentTagProperties(), {}); + myContainerAttributes->showAttributesCreatorModule(myContainerTagSelector->getCurrentTemplateAC(), {}); } // show container plan tag selector myContainerPlanTagSelector->showTagSelector(); // now check if container plan selected is valid - if (myContainerPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + if (myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() != SUMO_TAG_NOTHING) { // update VClass of myPathCreator depending if container is a ride - if (myContainerPlanTagSelector->getCurrentTagProperties().isRide()) { + if (myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty().isRide()) { myPathCreator->setVClass(SVC_PASSENGER); } else { myPathCreator->setVClass(SVC_PEDESTRIAN); } // show container plan attributes - myContainerPlanAttributes->showAttributesCreatorModul(myContainerPlanTagSelector->getCurrentTagProperties(), {}); + myContainerPlanAttributes->showAttributesCreatorModule(myContainerPlanTagSelector->getCurrentTemplateAC(), {}); // show Netedit attributes modul - myNeteditAttributes->showNeteditAttributesModul(myContainerPlanTagSelector->getCurrentTagProperties()); + myNeteditAttributes->showNeteditAttributesModule(myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty()); // show edge path creator modul - myPathCreator->showPathCreatorModul(myContainerPlanTagSelector->getCurrentTagProperties().getTag(), false, false); + myPathCreator->showPathCreatorModule(myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(), false, false); } else { // hide modules - myContainerPlanAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myPathCreator->hidePathCreatorModul(); + myContainerPlanAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); + myPathCreator->hidePathCreatorModule(); } } else { // hide modules myContainerPlanTagSelector->hideTagSelector(); - myContainerAttributes->hideAttributesCreatorModul(); - myContainerPlanAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myPathCreator->hidePathCreatorModul(); + myContainerAttributes->hideAttributesCreatorModule(); + myContainerPlanAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); + myPathCreator->hidePathCreatorModule(); } } else { // hide all moduls if container isn't valid - myPTypeSelector->hideDemandElementSelector(); + myTypeSelector->hideDemandElementSelector(); myContainerPlanTagSelector->hideTagSelector(); - myContainerAttributes->hideAttributesCreatorModul(); - myContainerPlanAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myPathCreator->hidePathCreatorModul(); + myContainerAttributes->hideAttributesCreatorModule(); + myContainerPlanAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); + myPathCreator->hidePathCreatorModule(); } } void GNEContainerFrame::demandElementSelected() { - if (myPTypeSelector->getCurrentDemandElement()) { + if (myTypeSelector->getCurrentDemandElement()) { // show container attributes depending of myContainerPlanTagSelector - if (myContainerPlanTagSelector->getCurrentTagProperties().isStopContainer()) { - myContainerAttributes->showAttributesCreatorModul(myContainerTagSelector->getCurrentTagProperties(), {SUMO_ATTR_DEPARTPOS}); + if (myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty().isStopContainer()) { + myContainerAttributes->showAttributesCreatorModule(myContainerTagSelector->getCurrentTemplateAC(), {SUMO_ATTR_DEPARTPOS}); } else { - myContainerAttributes->showAttributesCreatorModul(myContainerTagSelector->getCurrentTagProperties(), {}); + myContainerAttributes->showAttributesCreatorModule(myContainerTagSelector->getCurrentTemplateAC(), {}); } // show container plan tag selector myContainerPlanTagSelector->showTagSelector(); // now check if container plan selected is valid - if (myContainerPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + if (myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() != SUMO_TAG_NOTHING) { // update VClass of myPathCreator depending if container is a ride - if (myContainerPlanTagSelector->getCurrentTagProperties().isRide()) { + if (myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty().isRide()) { myPathCreator->setVClass(SVC_PASSENGER); } else { myPathCreator->setVClass(SVC_PEDESTRIAN); } // show container plan attributes - myContainerPlanAttributes->showAttributesCreatorModul(myContainerPlanTagSelector->getCurrentTagProperties(), {}); + myContainerPlanAttributes->showAttributesCreatorModule(myContainerPlanTagSelector->getCurrentTemplateAC(), {}); // show Netedit attributes modul - myNeteditAttributes->showNeteditAttributesModul(myContainerPlanTagSelector->getCurrentTagProperties()); + myNeteditAttributes->showNeteditAttributesModule(myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty()); // show edge path creator modul - myPathCreator->showPathCreatorModul(myContainerPlanTagSelector->getCurrentTagProperties().getTag(), false, false); + myPathCreator->showPathCreatorModule(myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(), false, false); + // show warning if we have selected a vType oriented to persons or vehicles + if (myTypeSelector->getCurrentDemandElement()->getVClass() == SVC_PEDESTRIAN) { + WRITE_WARNING("Current selected vType is oriented to persons"); + } else if (myTypeSelector->getCurrentDemandElement()->getVClass() != SVC_IGNORING) { + WRITE_WARNING("Current selected vType is oriented to vehicles"); + } } else { // hide modules - myContainerPlanAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myPathCreator->hidePathCreatorModul(); + myContainerPlanAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); + myPathCreator->hidePathCreatorModule(); } } else { // hide modules myContainerPlanTagSelector->hideTagSelector(); - myContainerAttributes->hideAttributesCreatorModul(); - myContainerPlanAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myPathCreator->hidePathCreatorModul(); + myContainerAttributes->hideAttributesCreatorModule(); + myContainerPlanAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); + myPathCreator->hidePathCreatorModule(); } } @@ -253,7 +256,7 @@ if (!myContainerAttributes->areValuesValid()) { myViewNet->setStatusBarText("Invalid container parameters."); } else if (!myContainerPlanAttributes->areValuesValid()) { - myViewNet->setStatusBarText("Invalid " + myContainerPlanTagSelector->getCurrentTagProperties().getTagStr() + " parameters."); + myViewNet->setStatusBarText("Invalid " + myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTagStr() + " parameters."); } else { /* // begin undo-redo operation @@ -288,7 +291,7 @@ GNEDemandElement* GNEContainerFrame::buildContainer() { // obtain container tag (only for improve code legibility) - SumoXMLTag containerTag = myContainerTagSelector->getCurrentTagProperties().getTag(); + SumoXMLTag containerTag = myContainerTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(); // Declare map to keep attributes from myContainerAttributes myContainerAttributes->getAttributesAndValues(myContainerBaseObject, false); // Check if ID has to be generated @@ -296,7 +299,7 @@ myContainerBaseObject->addStringAttribute(SUMO_ATTR_ID, myViewNet->getNet()->getAttributeCarriers()->generateDemandElementID(containerTag)); } // add pType parameter - myContainerBaseObject->addStringAttribute(SUMO_ATTR_TYPE, myPTypeSelector->getCurrentDemandElement()->getID()); + myContainerBaseObject->addStringAttribute(SUMO_ATTR_TYPE, myTypeSelector->getCurrentDemandElement()->getID()); // check if we're creating a container or containerFlow if (containerTag == SUMO_TAG_CONTAINER) { // Add parameter departure @@ -337,8 +340,8 @@ } } // refresh container and containerPlan attributes - myContainerAttributes->refreshRows(); - myContainerPlanAttributes->refreshRows(); + myContainerAttributes->refreshAttributesCreator(); + myContainerPlanAttributes->refreshAttributesCreator(); // return created container return myViewNet->getNet()->getAttributeCarriers()->retrieveDemandElement(containerTag, myContainerBaseObject->getStringAttribute(SUMO_ATTR_ID)); } diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEContainerFrame.h sumo-1.12.0/src/netedit/frames/demand/GNEContainerFrame.h --- sumo-1.11.0/src/netedit/frames/demand/GNEContainerFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEContainerFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -55,7 +55,7 @@ bool addContainer(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed& mouseButtonKeyPressed); /// @brief get PathCreator modul - GNEFrameModuls::PathCreator* getPathCreator() const; + GNEFrameModules::PathCreator* getPathCreator() const; protected: /// @brief Tag selected in TagSelector @@ -75,25 +75,25 @@ CommonXMLStructure::SumoBaseObject* myContainerBaseObject; /// @brief container tag selector (used to select diffent kind of containers) - GNEFrameModuls::TagSelector* myContainerTagSelector; + GNEFrameModules::TagSelector* myContainerTagSelector; /// @brief Container Type selectors - GNEFrameModuls::DemandElementSelector* myPTypeSelector; + GNEFrameModules::DemandElementSelector* myTypeSelector; /// @brief container plan selector (used to select diffent kind of container plan) - GNEFrameModuls::TagSelector* myContainerPlanTagSelector; + GNEFrameModules::TagSelector* myContainerPlanTagSelector; /// @brief internal vehicle attributes - GNEFrameAttributesModuls::AttributesCreator* myContainerAttributes; + GNEFrameAttributeModules::AttributesCreator* myContainerAttributes; /// @brief internal container plan attributes - GNEFrameAttributesModuls::AttributesCreator* myContainerPlanAttributes; + GNEFrameAttributeModules::AttributesCreator* myContainerPlanAttributes; /// @brief Netedit parameter - GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; + GNEFrameAttributeModules::NeteditAttributes* myNeteditAttributes; /// @brief edge path creator (used for Walks, rides and trips) - GNEFrameModuls::PathCreator* myPathCreator; + GNEFrameModules::PathCreator* myPathCreator; /// @brief build container and return it (note: function includes a call to begin(...), but NOT a call to end(...)) GNEDemandElement* buildContainer(); diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEContainerPlanFrame.cpp sumo-1.12.0/src/netedit/frames/demand/GNEContainerPlanFrame.cpp --- sumo-1.11.0/src/netedit/frames/demand/GNEContainerPlanFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEContainerPlanFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -39,22 +39,19 @@ myRouteHandler("", viewNet->getNet(), true) { // create container types selector modul - myContainerSelector = new GNEFrameModuls::DemandElementSelector(this, {GNETagProperties::TagType::CONTAINER}); + myContainerSelector = new GNEFrameModules::DemandElementSelector(this, {GNETagProperties::TagType::CONTAINER}); // Create tag selector for container plan - myContainerPlanTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::CONTAINERPLAN); + myContainerPlanTagSelector = new GNEFrameModules::TagSelector(this, GNETagProperties::TagType::CONTAINERPLAN, GNE_TAG_TRANSPORT_EDGE); // Create container parameters - myContainerPlanAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + myContainerPlanAttributes = new GNEFrameAttributeModules::AttributesCreator(this); - // create myPathCreator Modul - myPathCreator = new GNEFrameModuls::PathCreator(this); + // create myPathCreator Module + myPathCreator = new GNEFrameModules::PathCreator(this); // Create HierarchicalElementTree modul - myContainerHierarchy = new GNEFrameModuls::HierarchicalElementTree(this); - - // set ContainerPlan tag type in tag selector - myContainerPlanTagSelector->setCurrentTagType(GNETagProperties::TagType::CONTAINERPLAN); + myContainerHierarchy = new GNEFrameModules::HierarchicalElementTree(this); } @@ -70,8 +67,8 @@ if ((containers.size() > 0) || (containerFlows.size() > 0)) { // show container selector myContainerSelector->showDemandElementSelector(); - // refresh container plan tag selector - myContainerPlanTagSelector->refreshTagProperties(); + // refresh tag selector + myContainerPlanTagSelector->refreshTagSelector(); // set first container as demand element (this will call demandElementSelected() function) if (containers.size() > 0) { myContainerSelector->setDemandElement(*containers.begin()); @@ -82,8 +79,8 @@ // hide all moduls except helpCreation myContainerSelector->hideDemandElementSelector(); myContainerPlanTagSelector->hideTagSelector(); - myContainerPlanAttributes->hideAttributesCreatorModul(); - myPathCreator->hidePathCreatorModul(); + myContainerPlanAttributes->hideAttributesCreatorModule(); + myPathCreator->hidePathCreatorModule(); myContainerHierarchy->hideHierarchicalElementTree(); } // show frame @@ -110,12 +107,12 @@ return false; } // finally check that container plan selected is valid - if (myContainerPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_NOTHING) { + if (myContainerPlanTagSelector->getCurrentTemplateAC() == nullptr) { myViewNet->setStatusBarText("Current selected container plan isn't valid."); return false; } // Obtain current container plan tag (only for improve code legibility) - SumoXMLTag containerPlanTag = myContainerPlanTagSelector->getCurrentTagProperties().getTag(); + SumoXMLTag containerPlanTag = myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(); // declare flags for requirements const bool requireContainerStop = ((containerPlanTag == GNE_TAG_TRANSPORT_CONTAINERSTOP) || (containerPlanTag == GNE_TAG_TRANSHIP_CONTAINERSTOP) || (containerPlanTag == GNE_TAG_STOPCONTAINER_CONTAINERSTOP)); @@ -132,7 +129,7 @@ } -GNEFrameModuls::PathCreator* +GNEFrameModules::PathCreator* GNEContainerPlanFrame::getPathCreator() const { return myPathCreator; } @@ -144,29 +141,29 @@ void GNEContainerPlanFrame::tagSelected() { // first check if container is valid - if (myContainerPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + if (myContainerPlanTagSelector->getCurrentTemplateAC()) { // Obtain current container plan tag (only for improve code legibility) - SumoXMLTag containerPlanTag = myContainerPlanTagSelector->getCurrentTagProperties().getTag(); + SumoXMLTag containerPlanTag = myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(); // show container attributes - myContainerPlanAttributes->showAttributesCreatorModul(myContainerPlanTagSelector->getCurrentTagProperties(), {}); + myContainerPlanAttributes->showAttributesCreatorModule(myContainerPlanTagSelector->getCurrentTemplateAC(), {}); // get previous container plan GNEEdge* previousEdge = myContainerSelector->getContainerPlanPreviousEdge(); // set path creator mode depending if previousEdge exist if (previousEdge) { // set path creator mode - myPathCreator->showPathCreatorModul(containerPlanTag, true, false); + myPathCreator->showPathCreatorModule(containerPlanTag, true, false); // add previous edge myPathCreator->addEdge(previousEdge, false, false); } else { // set path creator mode - myPathCreator->showPathCreatorModul(containerPlanTag, false, false); + myPathCreator->showPathCreatorModule(containerPlanTag, false, false); } // show container hierarchy myContainerHierarchy->showHierarchicalElementTree(myContainerSelector->getCurrentDemandElement()); } else { // hide moduls if tag selecte isn't valid - myContainerPlanAttributes->hideAttributesCreatorModul(); - myPathCreator->hidePathCreatorModul(); + myContainerPlanAttributes->hideAttributesCreatorModule(); + myPathCreator->hidePathCreatorModule(); myContainerHierarchy->hideHierarchicalElementTree(); } } @@ -179,19 +176,19 @@ // show container plan tag selector myContainerPlanTagSelector->showTagSelector(); // now check if container plan selected is valid - if (myContainerPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + if (myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() != SUMO_TAG_NOTHING) { // call tag selected tagSelected(); } else { - myContainerPlanAttributes->hideAttributesCreatorModul(); - myPathCreator->hidePathCreatorModul(); + myContainerPlanAttributes->hideAttributesCreatorModule(); + myPathCreator->hidePathCreatorModule(); myContainerHierarchy->hideHierarchicalElementTree(); } } else { // hide moduls if container selected isn't valid myContainerPlanTagSelector->hideTagSelector(); - myContainerPlanAttributes->hideAttributesCreatorModul(); - myPathCreator->hidePathCreatorModul(); + myContainerPlanAttributes->hideAttributesCreatorModule(); + myPathCreator->hidePathCreatorModule(); myContainerHierarchy->hideHierarchicalElementTree(); } } @@ -201,11 +198,11 @@ GNEContainerPlanFrame::createPath() { // first check that all attributes are valid if (!myContainerPlanAttributes->areValuesValid()) { - myViewNet->setStatusBarText("Invalid " + myContainerPlanTagSelector->getCurrentTagProperties().getTagStr() + " parameters."); + myViewNet->setStatusBarText("Invalid " + myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTagStr() + " parameters."); } else { // check if container plan can be created if (myRouteHandler.buildContainerPlan( - myContainerPlanTagSelector->getCurrentTagProperties().getTag(), + myContainerPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(), myContainerSelector->getCurrentDemandElement(), myContainerPlanAttributes, myPathCreator)) { @@ -216,7 +213,7 @@ // refresh using tagSelected tagSelected(); // refresh containerPlan attributes - myContainerPlanAttributes->refreshRows(); + myContainerPlanAttributes->refreshAttributesCreator(); } } } diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEContainerPlanFrame.h sumo-1.12.0/src/netedit/frames/demand/GNEContainerPlanFrame.h --- sumo-1.11.0/src/netedit/frames/demand/GNEContainerPlanFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEContainerPlanFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -55,7 +55,7 @@ bool addContainerPlanElement(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed& mouseButtonKeyPressed); /// @brief get path creator modul - GNEFrameModuls::PathCreator* getPathCreator() const; + GNEFrameModules::PathCreator* getPathCreator() const; protected: /// @brief Tag selected in TagSelector @@ -72,17 +72,17 @@ GNERouteHandler myRouteHandler; /// @brief Container selectors - GNEFrameModuls::DemandElementSelector* myContainerSelector; + GNEFrameModules::DemandElementSelector* myContainerSelector; /// @brief containerPlan selector - GNEFrameModuls::TagSelector* myContainerPlanTagSelector; + GNEFrameModules::TagSelector* myContainerPlanTagSelector; /// @brief internal vehicle attributes - GNEFrameAttributesModuls::AttributesCreator* myContainerPlanAttributes; + GNEFrameAttributeModules::AttributesCreator* myContainerPlanAttributes; /// @brief Path Creator - GNEFrameModuls::PathCreator* myPathCreator; + GNEFrameModules::PathCreator* myPathCreator; /// @brief Container Hierarchy - GNEFrameModuls::HierarchicalElementTree* myContainerHierarchy; + GNEFrameModules::HierarchicalElementTree* myContainerHierarchy; }; diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEPersonFrame.cpp sumo-1.12.0/src/netedit/frames/demand/GNEPersonFrame.cpp --- sumo-1.11.0/src/netedit/frames/demand/GNEPersonFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEPersonFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -42,33 +42,28 @@ myPersonBaseObject(new CommonXMLStructure::SumoBaseObject(nullptr)) { // create tag Selector modul for persons - myPersonTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::PERSON); + myPersonTagSelector = new GNEFrameModules::TagSelector(this, GNETagProperties::TagType::PERSON, SUMO_TAG_PERSON); - // create person types selector modul - myPTypeSelector = new GNEFrameModuls::DemandElementSelector(this, SUMO_TAG_PTYPE); + // create person types selector modul and set DEFAULT_PEDTYPE_ID as default element + myTypeSelector = new GNEFrameModules::DemandElementSelector(this, SUMO_TAG_VTYPE, viewNet->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_PEDTYPE_ID)); // create person attributes - myPersonAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + myPersonAttributes = new GNEFrameAttributeModules::AttributesCreator(this); // create tag Selector modul for person plans - myPersonPlanTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::PERSONPLAN); + myPersonPlanTagSelector = new GNEFrameModules::TagSelector(this, GNETagProperties::TagType::PERSONPLAN, GNE_TAG_PERSONTRIP_EDGE); // create person plan attributes - myPersonPlanAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + myPersonPlanAttributes = new GNEFrameAttributeModules::AttributesCreator(this); // Create Netedit parameter - myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); + myNeteditAttributes = new GNEFrameAttributeModules::NeteditAttributes(this); - // create PathCreator Modul - myPathCreator = new GNEFrameModuls::PathCreator(this); + // create PathCreator Module + myPathCreator = new GNEFrameModules::PathCreator(this); // limit path creator to pedestrians myPathCreator->setVClass(SVC_PEDESTRIAN); - - // set Person as default vehicle - myPersonTagSelector->setCurrentTag(SUMO_TAG_PERSON); - myPersonPlanTagSelector->setCurrentTag(GNE_TAG_PERSONTRIP_EDGE); - myPersonPlanTagSelector->onCmdSelectTagType(0, 0, 0); } @@ -79,12 +74,13 @@ void GNEPersonFrame::show() { - // refresh item selector - myPersonTagSelector->refreshTagProperties(); - myPTypeSelector->refreshDemandElementSelector(); - myPersonPlanTagSelector->refreshTagProperties(); + // refresh tag selector + myPersonTagSelector->refreshTagSelector(); + myTypeSelector->refreshDemandElementSelector(); + myPersonPlanTagSelector->refreshTagSelector(); // update VClass of myPathCreator - if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { + if (myPersonPlanTagSelector->getCurrentTemplateAC() && + myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().isRide()) { myPathCreator->setVClass(SVC_PASSENGER); } else { myPathCreator->setVClass(SVC_PEDESTRIAN); @@ -112,7 +108,7 @@ return false; } // obtain tags (only for improve code legibility) - SumoXMLTag personTag = myPersonTagSelector->getCurrentTagProperties().getTag(); + SumoXMLTag personTag = myPersonTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(); SumoXMLTag clickedACTag = objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag(); // first check that current selected person is valid if (personTag == SUMO_TAG_NOTHING) { @@ -120,12 +116,12 @@ return false; } // now check that pType is valid - if (myPTypeSelector->getCurrentDemandElement() == nullptr) { + if (myTypeSelector->getCurrentDemandElement() == nullptr) { myViewNet->setStatusBarText("Current selected person type isn't valid."); return false; } // finally check that person plan selected is valid - if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_NOTHING) { + if (myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() == SUMO_TAG_NOTHING) { myViewNet->setStatusBarText("Current selected person plan isn't valid."); return false; } @@ -133,32 +129,34 @@ if (clickedACTag == SUMO_TAG_LANE) { const bool result = myPathCreator->addEdge(objectsUnderCursor.getEdgeFront(), mouseButtonKeyPressed.shiftKeyPressed(), mouseButtonKeyPressed.controlKeyPressed()); // if we're creating a stop, create it immediately - if (result && myPersonPlanTagSelector->getCurrentTagProperties().isStopPerson()) { + if (result && myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().isStopPerson()) { createPath(); } return result; } else if (clickedACTag == SUMO_TAG_BUS_STOP) { const bool result = myPathCreator->addStoppingPlace(objectsUnderCursor.getAdditionalFront(), mouseButtonKeyPressed.shiftKeyPressed(), mouseButtonKeyPressed.controlKeyPressed()); // if we're creating a stop, create it immediately - if (result && myPersonPlanTagSelector->getCurrentTagProperties().isStopPerson()) { + if (result && myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().isStopPerson()) { createPath(); } return result; } else if (clickedACTag == SUMO_TAG_ROUTE) { const bool result = myPathCreator->addRoute(objectsUnderCursor.getDemandElementFront(), mouseButtonKeyPressed.shiftKeyPressed(), mouseButtonKeyPressed.controlKeyPressed()); // if we're creating a walk route, create it immediately - if (result && (myPersonPlanTagSelector->getCurrentTagProperties().getTag() == GNE_TAG_WALK_ROUTE)) { + if (result && (myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() == GNE_TAG_WALK_ROUTE)) { createPath(); myPathCreator->removeRoute(); } return result; + } else if (clickedACTag == SUMO_TAG_JUNCTION) { + return myPathCreator->addJunction(objectsUnderCursor.getJunctionFront(), mouseButtonKeyPressed.shiftKeyPressed(), mouseButtonKeyPressed.controlKeyPressed()); } else { return false; } } -GNEFrameModuls::PathCreator* +GNEFrameModules::PathCreator* GNEPersonFrame::getPathCreator() const { return myPathCreator; } @@ -170,103 +168,109 @@ void GNEPersonFrame::tagSelected() { // first check if person is valid - if (myPersonTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + if (myPersonTagSelector->getCurrentTemplateAC()) { // show PType selector and person plan selector - myPTypeSelector->showDemandElementSelector(); + myTypeSelector->showDemandElementSelector(); // check if current person type selected is valid - if (myPTypeSelector->getCurrentDemandElement()) { + if (myTypeSelector->getCurrentDemandElement()) { // show person attributes depending of myPersonPlanTagSelector - if (myPersonPlanTagSelector->getCurrentTagProperties().isStopPerson()) { - myPersonAttributes->showAttributesCreatorModul(myPersonTagSelector->getCurrentTagProperties(), {SUMO_ATTR_DEPARTPOS}); + if (myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().isStopPerson()) { + myPersonAttributes->showAttributesCreatorModule(myPersonTagSelector->getCurrentTemplateAC(), {SUMO_ATTR_DEPARTPOS}); } else { - myPersonAttributes->showAttributesCreatorModul(myPersonTagSelector->getCurrentTagProperties(), {}); + myPersonAttributes->showAttributesCreatorModule(myPersonTagSelector->getCurrentTemplateAC(), {}); } // show person plan tag selector myPersonPlanTagSelector->showTagSelector(); // now check if person plan selected is valid - if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + if (myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() != SUMO_TAG_NOTHING) { // show person plan attributes - myPersonPlanAttributes->showAttributesCreatorModul(myPersonPlanTagSelector->getCurrentTagProperties(), {}); + myPersonPlanAttributes->showAttributesCreatorModule(myPersonPlanTagSelector->getCurrentTemplateAC(), {}); // show Netedit attributes modul - myNeteditAttributes->showNeteditAttributesModul(myPersonPlanTagSelector->getCurrentTagProperties()); + myNeteditAttributes->showNeteditAttributesModule(myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty()); // show path creator depending of tag - if (myPersonPlanTagSelector->getCurrentTagProperties().isStopPerson() || - (myPersonPlanTagSelector->getCurrentTagProperties().getTag() == GNE_TAG_WALK_ROUTE)) { - myPathCreator->hidePathCreatorModul(); + if (myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().isStopPerson() || + (myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() == GNE_TAG_WALK_ROUTE)) { + myPathCreator->hidePathCreatorModule(); } else { // update VClass of myPathCreator depending if person is a ride - if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { + if (myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().isRide()) { myPathCreator->setVClass(SVC_PASSENGER); } else { myPathCreator->setVClass(SVC_PEDESTRIAN); } // show edge path creator modul - myPathCreator->showPathCreatorModul(myPersonPlanTagSelector->getCurrentTagProperties().getTag(), false, false); + myPathCreator->showPathCreatorModule(myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(), false, false); } } else { // hide modules - myPersonPlanAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myPathCreator->hidePathCreatorModul(); + myPersonPlanAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); + myPathCreator->hidePathCreatorModule(); } } else { // hide modules myPersonPlanTagSelector->hideTagSelector(); - myPersonAttributes->hideAttributesCreatorModul(); - myPersonPlanAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myPathCreator->hidePathCreatorModul(); + myPersonAttributes->hideAttributesCreatorModule(); + myPersonPlanAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); + myPathCreator->hidePathCreatorModule(); } } else { // hide all moduls if person isn't valid - myPTypeSelector->hideDemandElementSelector(); + myTypeSelector->hideDemandElementSelector(); myPersonPlanTagSelector->hideTagSelector(); - myPersonAttributes->hideAttributesCreatorModul(); - myPersonPlanAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myPathCreator->hidePathCreatorModul(); + myPersonAttributes->hideAttributesCreatorModule(); + myPersonPlanAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); + myPathCreator->hidePathCreatorModule(); } } void GNEPersonFrame::demandElementSelected() { - if (myPTypeSelector->getCurrentDemandElement()) { + if (myTypeSelector->getCurrentDemandElement()) { // show person attributes depending of myPersonPlanTagSelector - if (myPersonPlanTagSelector->getCurrentTagProperties().isStopPerson()) { - myPersonAttributes->showAttributesCreatorModul(myPersonTagSelector->getCurrentTagProperties(), {SUMO_ATTR_DEPARTPOS}); + if (myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().isStopPerson()) { + myPersonAttributes->showAttributesCreatorModule(myPersonTagSelector->getCurrentTemplateAC(), {SUMO_ATTR_DEPARTPOS}); } else { - myPersonAttributes->showAttributesCreatorModul(myPersonTagSelector->getCurrentTagProperties(), {}); + myPersonAttributes->showAttributesCreatorModule(myPersonTagSelector->getCurrentTemplateAC(), {}); } // show person plan tag selector myPersonPlanTagSelector->showTagSelector(); // now check if person plan selected is valid - if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + if (myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() != SUMO_TAG_NOTHING) { // update VClass of myPathCreator depending if person is a ride - if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { + if (myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().isRide()) { myPathCreator->setVClass(SVC_PASSENGER); } else { myPathCreator->setVClass(SVC_PEDESTRIAN); } // show person plan attributes - myPersonPlanAttributes->showAttributesCreatorModul(myPersonPlanTagSelector->getCurrentTagProperties(), {}); + myPersonPlanAttributes->showAttributesCreatorModule(myPersonPlanTagSelector->getCurrentTemplateAC(), {}); // show Netedit attributes modul - myNeteditAttributes->showNeteditAttributesModul(myPersonPlanTagSelector->getCurrentTagProperties()); + myNeteditAttributes->showNeteditAttributesModule(myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty()); // show edge path creator modul - myPathCreator->showPathCreatorModul(myPersonPlanTagSelector->getCurrentTagProperties().getTag(), false, false); + myPathCreator->showPathCreatorModule(myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(), false, false); + // show warning if we have selected a vType oriented to containers or vehicles + if (myTypeSelector->getCurrentDemandElement()->getVClass() == SVC_IGNORING) { + WRITE_WARNING("Current selected vType is oriented to containers"); + } else if (myTypeSelector->getCurrentDemandElement()->getVClass() != SVC_PEDESTRIAN) { + WRITE_WARNING("Current selected vType is oriented to vehicles"); + } } else { // hide modules - myPersonPlanAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myPathCreator->hidePathCreatorModul(); + myPersonPlanAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); + myPathCreator->hidePathCreatorModule(); } } else { // hide modules myPersonPlanTagSelector->hideTagSelector(); - myPersonAttributes->hideAttributesCreatorModul(); - myPersonPlanAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myPathCreator->hidePathCreatorModul(); + myPersonAttributes->hideAttributesCreatorModule(); + myPersonPlanAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); + myPathCreator->hidePathCreatorModule(); } } @@ -277,23 +281,25 @@ if (!myPersonAttributes->areValuesValid()) { myViewNet->setStatusBarText("Invalid person parameters."); } else if (!myPersonPlanAttributes->areValuesValid()) { - myViewNet->setStatusBarText("Invalid " + myPersonPlanTagSelector->getCurrentTagProperties().getTagStr() + " parameters."); + myViewNet->setStatusBarText("Invalid " + myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTagStr() + " parameters."); } else { // begin undo-redo operation - myViewNet->getUndoList()->begin(myPersonTagSelector->getCurrentTagProperties().getGUIIcon(), "create " + myPersonTagSelector->getCurrentTagProperties().getTagStr() + " and " + myPersonPlanTagSelector->getCurrentTagProperties().getTagStr()); + myViewNet->getUndoList()->begin(myPersonTagSelector->getCurrentTemplateAC()->getTagProperty().getGUIIcon(), "create " + + myPersonTagSelector->getCurrentTemplateAC()->getTagProperty().getTagStr() + " and " + + myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTagStr()); // create person GNEDemandElement* person = buildPerson(); // check if person and person plan can be created if (myRouteHandler.buildPersonPlan( - myPersonPlanTagSelector->getCurrentTagProperties().getTag(), + myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(), person, myPersonPlanAttributes, myPathCreator, true)) { // end undo-redo operation myViewNet->getUndoList()->end(); // abort path creation myPathCreator->abortPathCreation(); // refresh person and personPlan attributes - myPersonAttributes->refreshRows(); - myPersonPlanAttributes->refreshRows(); + myPersonAttributes->refreshAttributesCreator(); + myPersonPlanAttributes->refreshAttributesCreator(); // compute person person->computePathElement(); // enable show all person plans @@ -314,7 +320,7 @@ // first person base object myPersonBaseObject->clear(); // obtain person tag (only for improve code legibility) - SumoXMLTag personTag = myPersonTagSelector->getCurrentTagProperties().getTag(); + SumoXMLTag personTag = myPersonTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(); // set tag myPersonBaseObject->setTag(personTag); // get attribute ad values @@ -324,7 +330,7 @@ myPersonBaseObject->addStringAttribute(SUMO_ATTR_ID, myViewNet->getNet()->getAttributeCarriers()->generateDemandElementID(personTag)); } // add pType parameter - myPersonBaseObject->addStringAttribute(SUMO_ATTR_TYPE, myPTypeSelector->getCurrentDemandElement()->getID()); + myPersonBaseObject->addStringAttribute(SUMO_ATTR_TYPE, myTypeSelector->getCurrentDemandElement()->getID()); // check if we're creating a person or personFlow if (personTag == SUMO_TAG_PERSON) { // Add parameter departure @@ -365,8 +371,8 @@ } } // refresh person and personPlan attributes - myPersonAttributes->refreshRows(); - myPersonPlanAttributes->refreshRows(); + myPersonAttributes->refreshAttributesCreator(); + myPersonPlanAttributes->refreshAttributesCreator(); // return created person return myViewNet->getNet()->getAttributeCarriers()->retrieveDemandElement(personTag, myPersonBaseObject->getStringAttribute(SUMO_ATTR_ID)); } diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEPersonFrame.h sumo-1.12.0/src/netedit/frames/demand/GNEPersonFrame.h --- sumo-1.11.0/src/netedit/frames/demand/GNEPersonFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEPersonFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -55,7 +55,7 @@ bool addPerson(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed& mouseButtonKeyPressed); /// @brief get PathCreator modul - GNEFrameModuls::PathCreator* getPathCreator() const; + GNEFrameModules::PathCreator* getPathCreator() const; protected: /// @brief Tag selected in TagSelector @@ -75,25 +75,25 @@ CommonXMLStructure::SumoBaseObject* myPersonBaseObject; /// @brief person tag selector (used to select diffent kind of persons) - GNEFrameModuls::TagSelector* myPersonTagSelector; + GNEFrameModules::TagSelector* myPersonTagSelector; /// @brief Person Type selectors - GNEFrameModuls::DemandElementSelector* myPTypeSelector; + GNEFrameModules::DemandElementSelector* myTypeSelector; /// @brief person plan selector (used to select diffent kind of person plan) - GNEFrameModuls::TagSelector* myPersonPlanTagSelector; + GNEFrameModules::TagSelector* myPersonPlanTagSelector; /// @brief internal vehicle attributes - GNEFrameAttributesModuls::AttributesCreator* myPersonAttributes; + GNEFrameAttributeModules::AttributesCreator* myPersonAttributes; /// @brief internal person plan attributes - GNEFrameAttributesModuls::AttributesCreator* myPersonPlanAttributes; + GNEFrameAttributeModules::AttributesCreator* myPersonPlanAttributes; /// @brief Netedit parameter - GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; + GNEFrameAttributeModules::NeteditAttributes* myNeteditAttributes; /// @brief edge path creator (used for Walks, rides and trips) - GNEFrameModuls::PathCreator* myPathCreator; + GNEFrameModules::PathCreator* myPathCreator; /// @brief build person and return it (note: function includes a call to begin(...), but NOT a call to end(...)) GNEDemandElement* buildPerson(); diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEPersonPlanFrame.cpp sumo-1.12.0/src/netedit/frames/demand/GNEPersonPlanFrame.cpp --- sumo-1.11.0/src/netedit/frames/demand/GNEPersonPlanFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEPersonPlanFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -39,23 +39,19 @@ myRouteHandler("", viewNet->getNet(), true) { // create person types selector modul - myPersonSelector = new GNEFrameModuls::DemandElementSelector(this, {GNETagProperties::TagType::PERSON}); + myPersonSelector = new GNEFrameModules::DemandElementSelector(this, {GNETagProperties::TagType::PERSON}); // Create tag selector for person plan - myPersonPlanTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::PERSONPLAN); + myPersonPlanTagSelector = new GNEFrameModules::TagSelector(this, GNETagProperties::TagType::PERSONPLAN, GNE_TAG_PERSONTRIP_EDGE); // Create person parameters - myPersonPlanAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + myPersonPlanAttributes = new GNEFrameAttributeModules::AttributesCreator(this); - // create myPathCreator Modul - myPathCreator = new GNEFrameModuls::PathCreator(this); + // create myPathCreator Module + myPathCreator = new GNEFrameModules::PathCreator(this); // Create HierarchicalElementTree modul - myPersonHierarchy = new GNEFrameModuls::HierarchicalElementTree(this); - - // set PersonPlan tag type in tag selector - myPersonPlanTagSelector->setCurrentTagType(GNETagProperties::TagType::PERSONTRIP); - myPersonPlanTagSelector->onCmdSelectTagType(0, 0, 0); + myPersonHierarchy = new GNEFrameModules::HierarchicalElementTree(this); } @@ -71,8 +67,8 @@ if ((persons.size() > 0) || (personFlows.size() > 0)) { // show person selector myPersonSelector->showDemandElementSelector(); - // refresh person plan tag selector - myPersonPlanTagSelector->refreshTagProperties(); + // refresh tag selector + myPersonPlanTagSelector->refreshTagSelector(); // set first person as demand element (this will call demandElementSelected() function) if (persons.size() > 0) { myPersonSelector->setDemandElement(*persons.begin()); @@ -83,8 +79,8 @@ // hide all moduls except helpCreation myPersonSelector->hideDemandElementSelector(); myPersonPlanTagSelector->hideTagSelector(); - myPersonPlanAttributes->hideAttributesCreatorModul(); - myPathCreator->hidePathCreatorModul(); + myPersonPlanAttributes->hideAttributesCreatorModule(); + myPathCreator->hidePathCreatorModule(); myPersonHierarchy->hideHierarchicalElementTree(); } // show frame @@ -111,12 +107,12 @@ return false; } // finally check that person plan selected is valid - if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_NOTHING) { + if (myPersonPlanTagSelector->getCurrentTemplateAC() == nullptr) { myViewNet->setStatusBarText("Current selected person plan isn't valid."); return false; } // Obtain current person plan tag (only for improve code legibility) - SumoXMLTag personPlanTag = myPersonPlanTagSelector->getCurrentTagProperties().getTag(); + SumoXMLTag personPlanTag = myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(); // declare flags for requirements const bool requireBusStop = ((personPlanTag == GNE_TAG_PERSONTRIP_BUSSTOP) || (personPlanTag == GNE_TAG_WALK_BUSSTOP) || (personPlanTag == GNE_TAG_RIDE_BUSSTOP) || (personPlanTag == GNE_TAG_STOPPERSON_BUSSTOP)); @@ -141,7 +137,7 @@ } -GNEFrameModuls::PathCreator* +GNEFrameModules::PathCreator* GNEPersonPlanFrame::getPathCreator() const { return myPathCreator; } @@ -153,19 +149,19 @@ void GNEPersonPlanFrame::tagSelected() { // first check if person is valid - if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + if (myPersonPlanTagSelector->getCurrentTemplateAC()) { // Obtain current person plan tag (only for improve code legibility) - SumoXMLTag personPlanTag = myPersonPlanTagSelector->getCurrentTagProperties().getTag(); + SumoXMLTag personPlanTag = myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(); // show person attributes - myPersonPlanAttributes->showAttributesCreatorModul(myPersonPlanTagSelector->getCurrentTagProperties(), {}); + myPersonPlanAttributes->showAttributesCreatorModule(myPersonPlanTagSelector->getCurrentTemplateAC(), {}); // get previous person plan GNEEdge* previousEdge = myPersonSelector->getPersonPlanPreviousEdge(); // show path creator depending of tag - if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() == GNE_TAG_WALK_ROUTE) { - myPathCreator->hidePathCreatorModul(); + if (myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() == GNE_TAG_WALK_ROUTE) { + myPathCreator->hidePathCreatorModule(); } else { // update VClass of myPathCreator depending if person is a ride - if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { + if (myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().isRide()) { myPathCreator->setVClass(SVC_PASSENGER); } else { myPathCreator->setVClass(SVC_PEDESTRIAN); @@ -173,20 +169,20 @@ // set path creator mode depending if previousEdge exist if (previousEdge) { // set path creator mode - myPathCreator->showPathCreatorModul(personPlanTag, true, false); + myPathCreator->showPathCreatorModule(personPlanTag, true, false); // add previous edge myPathCreator->addEdge(previousEdge, false, false); } else { // set path creator mode - myPathCreator->showPathCreatorModul(personPlanTag, false, false); + myPathCreator->showPathCreatorModule(personPlanTag, false, false); } } // show person hierarchy myPersonHierarchy->showHierarchicalElementTree(myPersonSelector->getCurrentDemandElement()); } else { // hide moduls if tag selecte isn't valid - myPersonPlanAttributes->hideAttributesCreatorModul(); - myPathCreator->hidePathCreatorModul(); + myPersonPlanAttributes->hideAttributesCreatorModule(); + myPathCreator->hidePathCreatorModule(); myPersonHierarchy->hideHierarchicalElementTree(); } } @@ -199,19 +195,19 @@ // show person plan tag selector myPersonPlanTagSelector->showTagSelector(); // now check if person plan selected is valid - if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + if (myPersonPlanTagSelector->getCurrentTemplateAC()) { // call tag selected tagSelected(); } else { - myPersonPlanAttributes->hideAttributesCreatorModul(); - myPathCreator->hidePathCreatorModul(); + myPersonPlanAttributes->hideAttributesCreatorModule(); + myPathCreator->hidePathCreatorModule(); myPersonHierarchy->hideHierarchicalElementTree(); } } else { // hide moduls if person selected isn't valid myPersonPlanTagSelector->hideTagSelector(); - myPersonPlanAttributes->hideAttributesCreatorModul(); - myPathCreator->hidePathCreatorModul(); + myPersonPlanAttributes->hideAttributesCreatorModule(); + myPathCreator->hidePathCreatorModule(); myPersonHierarchy->hideHierarchicalElementTree(); } } @@ -221,11 +217,11 @@ GNEPersonPlanFrame::createPath() { // first check that all attributes are valid if (!myPersonPlanAttributes->areValuesValid()) { - myViewNet->setStatusBarText("Invalid " + myPersonPlanTagSelector->getCurrentTagProperties().getTagStr() + " parameters."); + myViewNet->setStatusBarText("Invalid " + myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTagStr() + " parameters."); } else { // check if person plan can be created if (myRouteHandler.buildPersonPlan( - myPersonPlanTagSelector->getCurrentTagProperties().getTag(), + myPersonPlanTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(), myPersonSelector->getCurrentDemandElement(), myPersonPlanAttributes, myPathCreator, false)) { // refresh HierarchicalElementTree @@ -235,7 +231,7 @@ // refresh using tagSelected tagSelected(); // refresh personPlan attributes - myPersonPlanAttributes->refreshRows(); + myPersonPlanAttributes->refreshAttributesCreator(); } } } diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEPersonPlanFrame.h sumo-1.12.0/src/netedit/frames/demand/GNEPersonPlanFrame.h --- sumo-1.11.0/src/netedit/frames/demand/GNEPersonPlanFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEPersonPlanFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -56,7 +56,7 @@ bool addPersonPlanElement(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed& mouseButtonKeyPressed); /// @brief get path creator modul - GNEFrameModuls::PathCreator* getPathCreator() const; + GNEFrameModules::PathCreator* getPathCreator() const; protected: /// @brief Tag selected in TagSelector @@ -73,17 +73,17 @@ GNERouteHandler myRouteHandler; /// @brief Person selectors - GNEFrameModuls::DemandElementSelector* myPersonSelector; + GNEFrameModules::DemandElementSelector* myPersonSelector; /// @brief personPlan selector - GNEFrameModuls::TagSelector* myPersonPlanTagSelector; + GNEFrameModules::TagSelector* myPersonPlanTagSelector; /// @brief internal vehicle attributes - GNEFrameAttributesModuls::AttributesCreator* myPersonPlanAttributes; + GNEFrameAttributeModules::AttributesCreator* myPersonPlanAttributes; /// @brief Path Creator - GNEFrameModuls::PathCreator* myPathCreator; + GNEFrameModules::PathCreator* myPathCreator; /// @brief Person Hierarchy - GNEFrameModuls::HierarchicalElementTree* myPersonHierarchy; + GNEFrameModules::HierarchicalElementTree* myPersonHierarchy; }; diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEPersonTypeFrame.cpp sumo-1.12.0/src/netedit/frames/demand/GNEPersonTypeFrame.cpp --- sumo-1.11.0/src/netedit/frames/demand/GNEPersonTypeFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEPersonTypeFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,393 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GNEPersonTypeFrame.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2019 -/// -// The Widget for edit person type (pTypes with vclass='pedestrian) elements -/****************************************************************************/ -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "GNEPersonTypeFrame.h" - - -// =========================================================================== -// FOX callback mapping -// =========================================================================== - -FXDEFMAP(GNEPersonTypeFrame::PersonTypeSelector) personTypeSelectorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_TYPE, GNEPersonTypeFrame::PersonTypeSelector::onCmdSelectItem) -}; - -FXDEFMAP(GNEPersonTypeFrame::PersonTypeEditor) personTypeEditorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATE, GNEPersonTypeFrame::PersonTypeEditor::onCmdCreatePersonType), - FXMAPFUNC(SEL_COMMAND, MID_GNE_DELETE, GNEPersonTypeFrame::PersonTypeEditor::onCmdDeletePersonType), - FXMAPFUNC(SEL_COMMAND, MID_GNE_RESET, GNEPersonTypeFrame::PersonTypeEditor::onCmdResetPersonType), - FXMAPFUNC(SEL_COMMAND, MID_GNE_COPY, GNEPersonTypeFrame::PersonTypeEditor::onCmdCopyPersonType) -}; - -// Object implementation -FXIMPLEMENT(GNEPersonTypeFrame::PersonTypeSelector, FXGroupBox, personTypeSelectorMap, ARRAYNUMBER(personTypeSelectorMap)) -FXIMPLEMENT(GNEPersonTypeFrame::PersonTypeEditor, FXGroupBox, personTypeEditorMap, ARRAYNUMBER(personTypeEditorMap)) - -// =========================================================================== -// method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNEPersonTypeFrame::PersonTypeSelector - methods -// --------------------------------------------------------------------------- - -GNEPersonTypeFrame::PersonTypeSelector::PersonTypeSelector(GNEPersonTypeFrame* personTypeFrameParent) : - FXGroupBox(personTypeFrameParent->myContentFrame, "Current Person Type", GUIDesignGroupBoxFrame), - myPersonTypeFrameParent(personTypeFrameParent), - myCurrentPersonType(nullptr) { - // Create FXComboBox - myTypeMatchBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SET_TYPE, GUIDesignComboBox); - // fill myTypeMatchBox with list of pTypes IDs - for (const auto& pType : myPersonTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PTYPE)) { - myTypeMatchBox->appendItem(pType->getID().c_str()); - } - // set DEFAULT_PEDTYPE_ID as default pType - myCurrentPersonType = myPersonTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PTYPE, DEFAULT_PEDTYPE_ID); - // Set visible items - if (myTypeMatchBox->getNumItems() <= 20) { - myTypeMatchBox->setNumVisible((int)myTypeMatchBox->getNumItems()); - } else { - myTypeMatchBox->setNumVisible(20); - } - // PersonTypeSelector is always shown - show(); -} - - -GNEPersonTypeFrame::PersonTypeSelector::~PersonTypeSelector() {} - - -GNEDemandElement* -GNEPersonTypeFrame::PersonTypeSelector::getCurrentPersonType() const { - return myCurrentPersonType; -} - - -void -GNEPersonTypeFrame::PersonTypeSelector::setCurrentPersonType(GNEDemandElement* vType) { - myCurrentPersonType = vType; - refreshPersonTypeSelector(); -} - - -void -GNEPersonTypeFrame::PersonTypeSelector::refreshPersonTypeSelector() { - bool valid = false; - myTypeMatchBox->clearItems(); - // fill myTypeMatchBox with list of pTypes IDs - for (const auto& pType : myPersonTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PTYPE)) { - myTypeMatchBox->appendItem(pType->getID().c_str()); - } - // Set visible items - if (myTypeMatchBox->getNumItems() <= 20) { - myTypeMatchBox->setNumVisible((int)myTypeMatchBox->getNumItems()); - } else { - myTypeMatchBox->setNumVisible(20); - } - // make sure that tag is in myTypeMatchBox - for (int i = 0; i < (int)myTypeMatchBox->getNumItems(); i++) { - if (myTypeMatchBox->getItem(i).text() == myCurrentPersonType->getID()) { - myTypeMatchBox->setCurrentItem(i); - valid = true; - } - } - // Check that give vType type is valid - if (!valid) { - // set DEFAULT_VEHTYPE as default pType - myCurrentPersonType = myPersonTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PTYPE, DEFAULT_VTYPE_ID); - // refresh myTypeMatchBox again - for (int i = 0; i < (int)myTypeMatchBox->getNumItems(); i++) { - if (myTypeMatchBox->getItem(i).text() == myCurrentPersonType->getID()) { - myTypeMatchBox->setCurrentItem(i); - } - } - } - // refresh person type editor modul - myPersonTypeFrameParent->myPersonTypeEditor->refreshPersonTypeEditorModul(); - // show Attribute Editor modul if selected item is valid - myPersonTypeFrameParent->myPersonTypeAttributesEditor->showAttributeEditorModul(false, true); -} - - -long -GNEPersonTypeFrame::PersonTypeSelector::onCmdSelectItem(FXObject*, FXSelector, void*) { - // Check if value of myTypeMatchBox correspond of an allowed additional tags - for (const auto& pType : myPersonTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PTYPE)) { - if (pType->getID() == myTypeMatchBox->getText().text()) { - // set pointer - myCurrentPersonType = pType; - // set color of myTypeMatchBox to black (valid) - myTypeMatchBox->setTextColor(FXRGB(0, 0, 0)); - // refresh person type editor modul - myPersonTypeFrameParent->myPersonTypeEditor->refreshPersonTypeEditorModul(); - // show moduls if selected item is valid - myPersonTypeFrameParent->myPersonTypeAttributesEditor->showAttributeEditorModul(false, true); - // Write Warning in console if we're in testing mode - WRITE_DEBUG(("Selected item '" + myTypeMatchBox->getText() + "' in PersonTypeSelector").text()); - return 1; - } - } - myCurrentPersonType = nullptr; - // refresh person type editor modul - myPersonTypeFrameParent->myPersonTypeEditor->refreshPersonTypeEditorModul(); - // hide all moduls if selected item isn't valid - myPersonTypeFrameParent->myPersonTypeAttributesEditor->hideAttributesEditorModul(); - // set color of myTypeMatchBox to red (invalid) - myTypeMatchBox->setTextColor(FXRGB(255, 0, 0)); - // Write Warning in console if we're in testing mode - WRITE_DEBUG("Selected invalid item in PersonTypeSelector"); - return 1; -} - -// --------------------------------------------------------------------------- -// GNEPersonTypeFrame::PersonTypeEditor - methods -// --------------------------------------------------------------------------- - -GNEPersonTypeFrame::PersonTypeEditor::PersonTypeEditor(GNEPersonTypeFrame* personTypeFrameParent) : - FXGroupBox(personTypeFrameParent->myContentFrame, "Person Type Editor", GUIDesignGroupBoxFrame), - myPersonTypeFrameParent(personTypeFrameParent) { - // Create new person type - myCreatePersonTypeButton = new FXButton(this, "Create Person Type", nullptr, this, MID_GNE_CREATE, GUIDesignButton); - // Create delete person type - myDeletePersonTypeButton = new FXButton(this, "Delete Person Type", nullptr, this, MID_GNE_DELETE, GUIDesignButton); - // Create reset person type - myResetDefaultPersonTypeButton = new FXButton(this, "Reset default Person Type", nullptr, this, MID_GNE_RESET, GUIDesignButton); - // Create copy person type - myCopyPersonTypeButton = new FXButton(this, "Copy Person Type", nullptr, this, MID_GNE_COPY, GUIDesignButton); -} - - -GNEPersonTypeFrame::PersonTypeEditor::~PersonTypeEditor() {} - - -void -GNEPersonTypeFrame::PersonTypeEditor::showPersonTypeEditorModul() { - refreshPersonTypeEditorModul(); - show(); -} - - -void -GNEPersonTypeFrame::PersonTypeEditor::hidePersonTypeEditorModul() { - hide(); -} - - -void -GNEPersonTypeFrame::PersonTypeEditor::refreshPersonTypeEditorModul() { - // first check if selected pType is valid - if (myPersonTypeFrameParent->myPersonTypeSelector->getCurrentPersonType() == nullptr) { - // disable all buttons except create button - myDeletePersonTypeButton->disable(); - myResetDefaultPersonTypeButton->disable(); - myCopyPersonTypeButton->disable(); - } else if (GNEAttributeCarrier::parse(myPersonTypeFrameParent->myPersonTypeSelector->getCurrentPersonType()->getAttribute(GNE_ATTR_DEFAULT_VTYPE))) { - // enable copy button - myCopyPersonTypeButton->enable(); - // hide delete person type buttond and show reset default person type button - myDeletePersonTypeButton->hide(); - myResetDefaultPersonTypeButton->show(); - // check if reset default person type button has to be enabled or disabled - if (GNEAttributeCarrier::parse(myPersonTypeFrameParent->myPersonTypeSelector->getCurrentPersonType()->getAttribute(GNE_ATTR_DEFAULT_VTYPE_MODIFIED))) { - myResetDefaultPersonTypeButton->enable(); - } else { - myResetDefaultPersonTypeButton->disable(); - } - } else { - // enable copy button - myCopyPersonTypeButton->enable(); - // show delete person type button and hide reset default person type button - myDeletePersonTypeButton->show(); - myDeletePersonTypeButton->enable(); - myResetDefaultPersonTypeButton->hide(); - } - // update modul - recalc(); -} - - -long -GNEPersonTypeFrame::PersonTypeEditor::onCmdCreatePersonType(FXObject*, FXSelector, void*) { - // obtain a new valid Vehicle Type ID - const std::string personTypeID = myPersonTypeFrameParent->myViewNet->getNet()->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_PTYPE); - // create new person type - GNEDemandElement* personType = new GNEVehicleType(myPersonTypeFrameParent->myViewNet->getNet(), personTypeID, SUMO_TAG_PTYPE); - // add it using undoList (to allow undo-redo) - myPersonTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::PTYPE, "create person type"); - myPersonTypeFrameParent->myViewNet->getUndoList()->add(new GNEChange_DemandElement(personType, true), true); - myPersonTypeFrameParent->myViewNet->getUndoList()->end(); - // set created person type in selector - myPersonTypeFrameParent->myPersonTypeSelector->setCurrentPersonType(personType); - // refresh PersonType Editor Modul - myPersonTypeFrameParent->myPersonTypeEditor->refreshPersonTypeEditorModul(); - return 1; -} - - -long -GNEPersonTypeFrame::PersonTypeEditor::onCmdDeletePersonType(FXObject*, FXSelector, void*) { - // show question dialog if vtype has already assigned persons - if (myPersonTypeFrameParent->myPersonTypeSelector->getCurrentPersonType()->getChildDemandElements().size() > 0) { - std::string plural = myPersonTypeFrameParent->myPersonTypeSelector->getCurrentPersonType()->getChildDemandElements().size() == 1 ? ("") : ("s"); - // show warning in gui testing debug mode - WRITE_DEBUG("Opening FXMessageBox 'remove vType'"); - // Ask confirmation to user - FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, - ("Remove " + toString(SUMO_TAG_PTYPE) + "s").c_str(), "%s", - ("Delete " + toString(SUMO_TAG_PTYPE) + " '" + myPersonTypeFrameParent->myPersonTypeSelector->getCurrentPersonType()->getID() + - "' will remove " + toString(myPersonTypeFrameParent->myPersonTypeSelector->getCurrentPersonType()->getChildDemandElements().size()) + - " person" + plural + ". Continue?").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 'remove vType' with 'No'"); - } else if (answer == 4) { - WRITE_DEBUG("Closed FXMessageBox 'remove vType' with 'ESC'"); - } - } else { - // begin undo list operation - myPersonTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::MODEDELETE, "delete person type"); - // remove person type (and all of their children) - myPersonTypeFrameParent->myViewNet->getNet()->deleteDemandElement(myPersonTypeFrameParent->myPersonTypeSelector->getCurrentPersonType(), - myPersonTypeFrameParent->myViewNet->getUndoList()); - // end undo list operation - myPersonTypeFrameParent->myViewNet->getUndoList()->end(); - } - } else { - // begin undo list operation - myPersonTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::MODEDELETE, "delete person type"); - // remove person type (and all of their children) - myPersonTypeFrameParent->myViewNet->getNet()->deleteDemandElement(myPersonTypeFrameParent->myPersonTypeSelector->getCurrentPersonType(), - myPersonTypeFrameParent->myViewNet->getUndoList()); - // end undo list operation - myPersonTypeFrameParent->myViewNet->getUndoList()->end(); - } - return 1; -} - - -long -GNEPersonTypeFrame::PersonTypeEditor::onCmdResetPersonType(FXObject*, FXSelector, void*) { - // begin reset default person type values - myPersonTypeFrameParent->getViewNet()->getUndoList()->begin(GUIIcon::PTYPE, "reset default person type values"); - // reset all values of default person type - for (const auto& i : GNEAttributeCarrier::getTagProperties(SUMO_TAG_PTYPE)) { - // change all attributes with "" to reset it (except ID and vClass) - if ((i.getAttr() != SUMO_ATTR_ID) && (i.getAttr() != SUMO_ATTR_VCLASS)) { - myPersonTypeFrameParent->myPersonTypeSelector->getCurrentPersonType()->setAttribute(i.getAttr(), "", myPersonTypeFrameParent->myViewNet->getUndoList()); - } - } - // change manually VClass (because it depends of Default pType) - if (myPersonTypeFrameParent->myPersonTypeSelector->getCurrentPersonType()->getAttribute(SUMO_ATTR_ID) == DEFAULT_PEDTYPE_ID) { - myPersonTypeFrameParent->myPersonTypeSelector->getCurrentPersonType()->setAttribute(SUMO_ATTR_VCLASS, toString(SVC_PEDESTRIAN), myPersonTypeFrameParent->myViewNet->getUndoList()); - } - // change special attribute GNE_ATTR_DEFAULT_VTYPE_MODIFIED - myPersonTypeFrameParent->myPersonTypeSelector->getCurrentPersonType()->setAttribute(GNE_ATTR_DEFAULT_VTYPE_MODIFIED, "false", myPersonTypeFrameParent->myViewNet->getUndoList()); - // finish reset default person type values - myPersonTypeFrameParent->getViewNet()->getUndoList()->end(); - // refresh PersonTypeSelector - myPersonTypeFrameParent->myPersonTypeSelector->refreshPersonTypeSelector(); - return 1; -} - - -long -GNEPersonTypeFrame::PersonTypeEditor::onCmdCopyPersonType(FXObject*, FXSelector, void*) { - // obtain a new valid person Type ID - const std::string personTypeID = myPersonTypeFrameParent->myViewNet->getNet()->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_PTYPE); - // obtain person type in which new person Type will be based - GNEVehicleType* vType = dynamic_cast(myPersonTypeFrameParent->myPersonTypeSelector->getCurrentPersonType()); - // check that vType exist - if (vType) { - // create a new person Type based on the current selected person type - GNEDemandElement* personTypeCopy = new GNEVehicleType(myPersonTypeFrameParent->myViewNet->getNet(), personTypeID, vType); - // begin undo list operation - myPersonTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::PTYPE, "copy person type"); - // add it using undoList (to allow undo-redo) - myPersonTypeFrameParent->myViewNet->getUndoList()->add(new GNEChange_DemandElement(personTypeCopy, true), true); - // end undo list operation - myPersonTypeFrameParent->myViewNet->getUndoList()->end(); - // refresh Vehicle Type Selector (to show the new pType) - myPersonTypeFrameParent->myPersonTypeSelector->refreshPersonTypeSelector(); - // set created person type in selector - myPersonTypeFrameParent->myPersonTypeSelector->setCurrentPersonType(personTypeCopy); - // refresh PersonType Editor Modul - myPersonTypeFrameParent->myPersonTypeEditor->refreshPersonTypeEditorModul(); - } - return 1; -} - -// --------------------------------------------------------------------------- -// GNEPersonTypeFrame - methods -// --------------------------------------------------------------------------- - -GNEPersonTypeFrame::GNEPersonTypeFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : - GNEFrame(horizontalFrameParent, viewNet, "Person Types") { - - // create modul for edit person types (Create, copy, etc.) - myPersonTypeEditor = new PersonTypeEditor(this); - - // create person type selector - myPersonTypeSelector = new PersonTypeSelector(this); - - // Create person type attributes editor - myPersonTypeAttributesEditor = new GNEFrameAttributesModuls::AttributesEditor(this); - - // set "VTYPE_DEFAULT" as default person Type - myPersonTypeSelector->setCurrentPersonType(myViewNet->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_PTYPE, DEFAULT_PEDTYPE_ID)); -} - - -GNEPersonTypeFrame::~GNEPersonTypeFrame() {} - - -void -GNEPersonTypeFrame::show() { - // refresh person type and Attribute Editor - myPersonTypeSelector->refreshPersonTypeSelector(); - // show person type attributes editor (except extended attributes) - myPersonTypeAttributesEditor->showAttributeEditorModul(false, true); - // show frame - GNEFrame::show(); -} - - -GNEPersonTypeFrame::PersonTypeSelector* -GNEPersonTypeFrame::getPersonTypeSelector() const { - return myPersonTypeSelector; -} - - -void -GNEPersonTypeFrame::attributeUpdated() { - myPersonTypeSelector->refreshPersonTypeSelector(); -} - - -/****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEPersonTypeFrame.h sumo-1.12.0/src/netedit/frames/demand/GNEPersonTypeFrame.h --- sumo-1.11.0/src/netedit/frames/demand/GNEPersonTypeFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEPersonTypeFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,172 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GNEPersonTypeFrame.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2019 -/// -// The Widget for edit person type (VTypes with vclass='pedestrian) elements -/****************************************************************************/ -#pragma once -#include - -#include - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEPerson; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEPersonTypeFrame - */ -class GNEPersonTypeFrame : public GNEFrame { - -public: - - // =========================================================================== - // class PersonTypeSelector - // =========================================================================== - - class PersonTypeSelector : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEPersonTypeFrame::PersonTypeSelector) - - public: - /// @brief constructor - PersonTypeSelector(GNEPersonTypeFrame* personTypeFrameParent); - - /// @brief destructor - ~PersonTypeSelector(); - - /// @brief get current Vehicle Type - GNEDemandElement* getCurrentPersonType() const; - - /// @brief set current Vehicle Type - void setCurrentPersonType(GNEDemandElement* vType); - - /// @brief refresh person type - void refreshPersonTypeSelector(); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user select another element in ComboBox - long onCmdSelectItem(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(PersonTypeSelector) - - private: - /// @brief pointer to Frame Parent - GNEPersonTypeFrame* myPersonTypeFrameParent; - - /// @brief pointer to current person type - GNEDemandElement* myCurrentPersonType; - - /// @brief comboBox with the list of person types - FXComboBox* myTypeMatchBox; - }; - - // =========================================================================== - // class PersonTypeEditor - // =========================================================================== - - class PersonTypeEditor : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEPersonTypeFrame::PersonTypeEditor) - - public: - /// @brief constructor - PersonTypeEditor(GNEPersonTypeFrame* personTypeFrameParent); - - /// @brief destructor - ~PersonTypeEditor(); - - /// @brief show PersonTypeEditor modul - void showPersonTypeEditorModul(); - - /// @brief hide PersonTypeEditor box - void hidePersonTypeEditorModul(); - - /// @brief update PersonTypeEditor modul - void refreshPersonTypeEditorModul(); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when "Vreate Vehicle Type" button is clicked - long onCmdCreatePersonType(FXObject*, FXSelector, void*); - - /// @brief Called when "Delete Vehicle Type" button is clicked - long onCmdDeletePersonType(FXObject*, FXSelector, void*); - - /// @brief Called when "Delete Vehicle Type" button is clicked - long onCmdResetPersonType(FXObject*, FXSelector, void*); - - /// @brief Called when "Copy Vehicle Type" button is clicked - long onCmdCopyPersonType(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(PersonTypeEditor) - - private: - /// @brief pointer to person type Frame Parent - GNEPersonTypeFrame* myPersonTypeFrameParent; - - /// @brief "create person type" button - FXButton* myCreatePersonTypeButton; - - /// @brief "delete person type" button - FXButton* myDeletePersonTypeButton; - - /// @brief "delete default person type" button - FXButton* myResetDefaultPersonTypeButton; - - /// @brief "copy person type" - FXButton* myCopyPersonTypeButton; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNEPersonTypeFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNEPersonTypeFrame(); - - /// @brief show Frame - void show(); - - /// @brief get person type selector - PersonTypeSelector* getPersonTypeSelector() const; - -protected: - /// @brief function called after set a valid attribute in AttributeCreator/AttributeEditor/ParametersEditor/... - void attributeUpdated(); - -private: - /// @brief person type selector - PersonTypeSelector* myPersonTypeSelector; - - /// @brief editorinternal person type attributes - GNEFrameAttributesModuls::AttributesEditor* myPersonTypeAttributesEditor; - - /// @brief Vehicle Type editor (Create, copy, etc.) - PersonTypeEditor* myPersonTypeEditor; -}; diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNERouteFrame.cpp sumo-1.12.0/src/netedit/frames/demand/GNERouteFrame.cpp --- sumo-1.11.0/src/netedit/frames/demand/GNERouteFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNERouteFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -39,7 +39,7 @@ }; // Object implementation -FXIMPLEMENT(GNERouteFrame::RouteModeSelector, FXGroupBox, RouteModeSelectorMap, ARRAYNUMBER(RouteModeSelectorMap)) +FXIMPLEMENT(GNERouteFrame::RouteModeSelector, FXGroupBoxModule, RouteModeSelectorMap, ARRAYNUMBER(RouteModeSelectorMap)) // =========================================================================== @@ -51,15 +51,15 @@ // --------------------------------------------------------------------------- GNERouteFrame::RouteModeSelector::RouteModeSelector(GNERouteFrame* routeFrameParent) : - FXGroupBox(routeFrameParent->myContentFrame, "Route mode", GUIDesignGroupBoxFrame), - myRouteFrameParent(routeFrameParent), - myCurrentRouteMode(RouteMode::NONCONSECUTIVE_EDGES), - myValidVClass(true) { + FXGroupBoxModule(routeFrameParent->myContentFrame, "Route mode"), + myRouteFrameParent(routeFrameParent) { + // create route template + myRouteTemplate = new GNERoute(routeFrameParent->getViewNet()->getNet()); // first fill myRouteModesStrings myRouteModesStrings.push_back(std::make_pair(RouteMode::NONCONSECUTIVE_EDGES, "non consecutive edges")); myRouteModesStrings.push_back(std::make_pair(RouteMode::CONSECUTIVE_EDGES, "consecutive edges")); // Create FXComboBox for Route mode - myRouteModeMatchBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_ROUTEFRAME_ROUTEMODE, GUIDesignComboBox); + myRouteModeMatchBox = new FXComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_ROUTEFRAME_ROUTEMODE, GUIDesignComboBox); // fill myRouteModeMatchBox with route modes for (const auto& routeMode : myRouteModesStrings) { myRouteModeMatchBox->appendItem(routeMode.second.c_str()); @@ -67,7 +67,7 @@ // Set visible items myRouteModeMatchBox->setNumVisible((int)myRouteModeMatchBox->getNumItems()); // Create FXComboBox for VClass - myVClassMatchBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_ROUTEFRAME_VCLASS, GUIDesignComboBox); + myVClassMatchBox = new FXComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_ROUTEFRAME_VCLASS, GUIDesignComboBox); // fill myVClassMatchBox with all VCLass for (const auto& vClass : SumoVehicleClassStrings.getStrings()) { myVClassMatchBox->appendItem(vClass.c_str()); @@ -81,7 +81,9 @@ } -GNERouteFrame::RouteModeSelector::~RouteModeSelector() {} +GNERouteFrame::RouteModeSelector::~RouteModeSelector() { + delete myRouteTemplate; +} const GNERouteFrame::RouteMode& @@ -107,18 +109,18 @@ // check if current mode is valid if ((myCurrentRouteMode != RouteMode::INVALID) && myValidVClass) { // show route attributes modul - myRouteFrameParent->myRouteAttributes->showAttributesCreatorModul(GNEAttributeCarrier::getTagProperties(SUMO_TAG_ROUTE), {}); + myRouteFrameParent->myRouteAttributes->showAttributesCreatorModule(myRouteTemplate, {}); // show path creator - myRouteFrameParent->myPathCreator->showPathCreatorModul(SUMO_TAG_ROUTE, false, (myCurrentRouteMode == RouteMode::CONSECUTIVE_EDGES)); + myRouteFrameParent->myPathCreator->showPathCreatorModule(SUMO_TAG_ROUTE, false, (myCurrentRouteMode == RouteMode::CONSECUTIVE_EDGES)); // update edge colors myRouteFrameParent->myPathCreator->updateEdgeColors(); // show legend - myRouteFrameParent->myPathLegend->showPathLegendModul(); + myRouteFrameParent->myPathLegend->showPathLegendModule(); } else { // hide all moduls if route mode isnt' valid - myRouteFrameParent->myRouteAttributes->hideAttributesCreatorModul(); - myRouteFrameParent->myPathCreator->hidePathCreatorModul(); - myRouteFrameParent->myPathLegend->hidePathLegendModul(); + myRouteFrameParent->myRouteAttributes->hideAttributesCreatorModule(); + myRouteFrameParent->myPathCreator->hidePathCreatorModule(); + myRouteFrameParent->myPathLegend->hidePathLegendModule(); // reset all flags for (const auto& edge : myRouteFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) { edge.second->resetCandidateFlags(); @@ -193,13 +195,13 @@ myRouteModeSelector = new RouteModeSelector(this); // Create route parameters - myRouteAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + myRouteAttributes = new GNEFrameAttributeModules::AttributesCreator(this); // create consecutive edges modul - myPathCreator = new GNEFrameModuls::PathCreator(this); + myPathCreator = new GNEFrameModules::PathCreator(this); // create legend label - myPathLegend = new GNEFrameModuls::PathLegend(this); + myPathLegend = new GNEFrameModules::PathLegend(this); } @@ -242,7 +244,7 @@ } -GNEFrameModuls::PathCreator* +GNEFrameModules::PathCreator* GNERouteFrame::getPathCreator() const { return myPathCreator; } @@ -282,7 +284,7 @@ // abort path creation myPathCreator->abortPathCreation(); // refresh route attributes - myRouteAttributes->refreshRows(); + myRouteAttributes->refreshAttributesCreator(); // compute path route myViewNet->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_ROUTE, myRouteBaseObject->getStringAttribute(SUMO_ATTR_ID))->computePathElement(); } diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNERouteFrame.h sumo-1.12.0/src/netedit/frames/demand/GNERouteFrame.h --- sumo-1.11.0/src/netedit/frames/demand/GNERouteFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNERouteFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -26,6 +26,12 @@ // =========================================================================== // class definitions // =========================================================================== + +class GNERoute; + +// =========================================================================== +// class definitions +// =========================================================================== /** * @class GNERouteFrame * The Widget for create route elements @@ -45,7 +51,7 @@ // class RouteModeSelector // =========================================================================== - class RouteModeSelector : protected FXGroupBox { + class RouteModeSelector : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNERouteFrame::RouteModeSelector) @@ -85,16 +91,19 @@ GNERouteFrame* myRouteFrameParent; /// @brief comboBox with the list of route modes - FXComboBox* myRouteModeMatchBox; + FXComboBox* myRouteModeMatchBox = nullptr; /// @brief comboBox with the list of VClass - FXComboBox* myVClassMatchBox; + FXComboBox* myVClassMatchBox = nullptr; /// @brief current selected route mode - RouteMode myCurrentRouteMode; + RouteMode myCurrentRouteMode = RouteMode::NONCONSECUTIVE_EDGES; + + /// @brief route template + GNERoute* myRouteTemplate = nullptr; /// @brief flag to check if VClass is Valid - bool myValidVClass; + bool myValidVClass = true; /// @brief list of Route modes that will be shown in Match Box std::vector > myRouteModesStrings; @@ -123,7 +132,7 @@ bool addEdgeRoute(GNEEdge* clickedEdge, const GNEViewNetHelper::MouseButtonKeyPressed& mouseButtonKeyPressed); /// @brief get path creator modul - GNEFrameModuls::PathCreator* getPathCreator() const; + GNEFrameModules::PathCreator* getPathCreator() const; protected: /// @brief create path @@ -140,11 +149,11 @@ RouteModeSelector* myRouteModeSelector; /// @brief internal route attributes - GNEFrameAttributesModuls::AttributesCreator* myRouteAttributes; + GNEFrameAttributeModules::AttributesCreator* myRouteAttributes; /// @brief path creator modul - GNEFrameModuls::PathCreator* myPathCreator; + GNEFrameModules::PathCreator* myPathCreator; /// @brief path legend modul - GNEFrameModuls::PathLegend* myPathLegend; + GNEFrameModules::PathLegend* myPathLegend; }; diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEStopFrame.cpp sumo-1.12.0/src/netedit/frames/demand/GNEStopFrame.cpp --- sumo-1.11.0/src/netedit/frames/demand/GNEStopFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEStopFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -35,9 +35,9 @@ // --------------------------------------------------------------------------- GNEStopFrame::HelpCreation::HelpCreation(GNEStopFrame* StopFrameParent) : - FXGroupBox(StopFrameParent->myContentFrame, "Help", GUIDesignGroupBoxFrame), + FXGroupBoxModule(StopFrameParent->myContentFrame, "Help"), myStopFrameParent(StopFrameParent) { - myInformationLabel = new FXLabel(this, "", 0, GUIDesignLabelFrameInformation); + myInformationLabel = new FXLabel(getCollapsableFrame(), "", 0, GUIDesignLabelFrameInformation); } @@ -64,37 +64,39 @@ // create information label std::ostringstream information; // set text depending of selected Stop type - switch (myStopFrameParent->myStopTagSelector->getCurrentTagProperties().getTag()) { - case SUMO_TAG_STOP_BUSSTOP: - information - << "- Click over a bus stop\n" - << " to create a stop."; - break; - case SUMO_TAG_STOP_CONTAINERSTOP: - information - << "- Click over a container stop\n" - << " to create a stop."; - break; - case SUMO_TAG_STOP_CHARGINGSTATION: - information - << "- Click over a charging \n" - << " station to create a stop."; - break; - case SUMO_TAG_STOP_PARKINGAREA: - information - << "- Click over a parking area\n" - << " to create a stop."; - break; - case SUMO_TAG_STOP_LANE: - information - << "- Click over a lane to\n" - << " create a stop."; - break; - default: - information - << "- No stop parents in\n" - << " current network."; - break; + if (myStopFrameParent->myStopTagSelector->getCurrentTemplateAC()) { + switch (myStopFrameParent->myStopTagSelector->getCurrentTemplateAC()->getTagProperty().getTag()) { + case SUMO_TAG_STOP_BUSSTOP: + information + << "- Click over a bus stop\n" + << " to create a stop."; + break; + case SUMO_TAG_STOP_CONTAINERSTOP: + information + << "- Click over a container stop\n" + << " to create a stop."; + break; + case SUMO_TAG_STOP_CHARGINGSTATION: + information + << "- Click over a charging \n" + << " station to create a stop."; + break; + case SUMO_TAG_STOP_PARKINGAREA: + information + << "- Click over a parking area\n" + << " to create a stop."; + break; + case SUMO_TAG_STOP_LANE: + information + << "- Click over a lane to\n" + << " create a stop."; + break; + default: + information + << "- No stop parents in\n" + << " current network."; + break; + } } // set information label myInformationLabel->setText(information.str().c_str()); @@ -110,18 +112,18 @@ myStopParentBaseObject(new CommonXMLStructure::SumoBaseObject(nullptr)) { // Create Stop parent selector - myStopParentSelector = new GNEFrameModuls::DemandElementSelector(this, {GNETagProperties::TagType::PERSON, GNETagProperties::TagType::VEHICLE, GNETagProperties::TagType::ROUTE}); + myStopParentSelector = new GNEFrameModules::DemandElementSelector(this, {GNETagProperties::TagType::PERSON, GNETagProperties::TagType::VEHICLE, GNETagProperties::TagType::ROUTE}); // Create item Selector modul for Stops - myStopTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::STOP); + myStopTagSelector = new GNEFrameModules::TagSelector(this, GNETagProperties::TagType::STOP, SUMO_TAG_STOP_LANE); // Create Stop parameters - myStopAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + myStopAttributes = new GNEFrameAttributeModules::AttributesCreator(this); // Create Netedit parameter - myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); + myNeteditAttributes = new GNEFrameAttributeModules::NeteditAttributes(this); - // Create Help Creation Modul + // Create Help Creation Module myHelpCreation = new HelpCreation(this); // refresh myStopParentMatchBox @@ -148,16 +150,18 @@ if (validStopParent) { myStopParentSelector->showDemandElementSelector(); myStopTagSelector->showTagSelector(); + // refresh tag selector + myStopTagSelector->refreshTagSelector(); // refresh vType selector myStopParentSelector->refreshDemandElementSelector(); - // refresh item selector - myStopTagSelector->refreshTagProperties(); + // refresh tag selector + myStopTagSelector->refreshTagSelector(); } else { // hide moduls (except help creation) myStopParentSelector->hideDemandElementSelector(); myStopTagSelector->hideTagSelector(); - myStopAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); + myStopAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); // show help creation modul myHelpCreation->showHelpCreation(); } @@ -187,11 +191,17 @@ return false; } // create stop base object - getStopParameter(myStopTagSelector->getCurrentTagProperties().getTag(), + getStopParameter(myStopTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(), objectsUnderCursor.getLaneFront(), objectsUnderCursor.getAdditionalFront()); if (myStopParentBaseObject->getTag() != SUMO_TAG_NOTHING) { myRouteHandler.buildStop(myStopParentBaseObject->getSumoBaseObjectChildren().front(), myStopParentBaseObject->getSumoBaseObjectChildren().front()->getStopParameter()); + // show all trips + if (myStopTagSelector->getCurrentTemplateAC()->getTagProperty().isStop()) { + myViewNet->getDemandViewOptions().menuCheckShowAllTrips->setChecked(TRUE); + } else { + myViewNet->getDemandViewOptions().menuCheckShowAllPersonPlans->setChecked(TRUE); + } // stop sucesfully created, then return true return true; } else { @@ -281,8 +291,34 @@ myStopAttributes->showWarningMessage(); return false; } - // get parent + // get stop parent const GNEDemandElement* stopParent = myStopParentSelector->getCurrentDemandElement(); + // if stopParent is a route, check that stop is placed over a route's edge + if (stopParent->isRoute() && lane) { + bool found = false; + for (const auto& edge : stopParent->getParentEdges()) { + if (edge == lane->getParentEdge()) { + found = true; + } + } + if (!found) { + WRITE_WARNING("Stop must be placed over a route's edge"); + return false; + } + } + // same if stoParent is a vehicle/flow with embedded route + if (stopParent->getChildDemandElements().size() > 0 && stopParent->getChildDemandElements().front()->getTagProperty().isRoute() && lane) { + bool found = false; + for (const auto& edge : stopParent->getChildDemandElements().front()->getParentEdges()) { + if (edge == lane->getParentEdge()) { + found = true; + } + } + if (!found) { + WRITE_WARNING("Stop must be placed over an embeded route's edge"); + return false; + } + } // set parent tag and id myStopParentBaseObject->setTag(stopParent->getTagProperty().getTag()); myStopParentBaseObject->addStringAttribute(SUMO_ATTR_ID, stopParent->getID()); @@ -299,7 +335,7 @@ // create stop object CommonXMLStructure::SumoBaseObject* stopBaseObject = new CommonXMLStructure::SumoBaseObject(myStopParentBaseObject); // get stop attributes - myStopAttributes->getAttributesAndValues(stopBaseObject, false); + myStopAttributes->getAttributesAndValues(stopBaseObject, true); // add netedit values if (!stop.lane.empty()) { myNeteditAttributes->getNeteditAttributesAndValues(stopBaseObject, lane); @@ -341,9 +377,13 @@ stop.extension = stopBaseObject->getTimeAttribute(SUMO_ATTR_EXTENSION); stop.parametersSet |= STOP_EXTENSION_SET; } - if (stopBaseObject->hasBoolAttribute(SUMO_ATTR_TRIGGERED)) { - stop.triggered = stopBaseObject->getBoolAttribute(SUMO_ATTR_TRIGGERED); - stop.parametersSet |= STOP_TRIGGER_SET; + if (stopBaseObject->hasStringAttribute(SUMO_ATTR_TRIGGERED)) { + if ((stopBaseObject->getStringAttribute(SUMO_ATTR_TRIGGERED) == "true") || (stopBaseObject->getStringAttribute(SUMO_ATTR_TRIGGERED) == "person")) { + stop.triggered = true; + stop.parametersSet |= STOP_TRIGGER_SET; + } else { + stop.parametersSet &= ~STOP_TRIGGER_SET; + } } if (stopBaseObject->hasBoolAttribute(SUMO_ATTR_CONTAINER_TRIGGERED)) { stop.containerTriggered = stopBaseObject->getBoolAttribute(SUMO_ATTR_CONTAINER_TRIGGERED); @@ -385,7 +425,7 @@ stop.index = STOP_INDEX_END; } // refresh stop attributes - myStopAttributes->refreshRows(); + myStopAttributes->refreshAttributesCreator(); // set tag stopBaseObject->setTag(stopTag); stopBaseObject->setStopParameter(stop); @@ -398,15 +438,15 @@ void GNEStopFrame::tagSelected() { - if (myStopTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + if (myStopTagSelector->getCurrentTemplateAC()) { // show Stop type selector modul - myStopAttributes->showAttributesCreatorModul(myStopTagSelector->getCurrentTagProperties(), {}); - myNeteditAttributes->showNeteditAttributesModul(myStopTagSelector->getCurrentTagProperties()); + myStopAttributes->showAttributesCreatorModule(myStopTagSelector->getCurrentTemplateAC(), {}); + myNeteditAttributes->showNeteditAttributesModule(myStopTagSelector->getCurrentTemplateAC()->getTagProperty()); myHelpCreation->showHelpCreation(); } else { // hide all moduls if stop parent isn't valid - myStopAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); + myStopAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); myHelpCreation->hideHelpCreation(); } } @@ -417,21 +457,21 @@ // show or hidde moduls depending if current selected stop parent is valid if (myStopParentSelector->getCurrentDemandElement()) { myStopTagSelector->showTagSelector(); - if (myStopTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + if (myStopTagSelector->getCurrentTemplateAC()) { // show moduls - myStopAttributes->showAttributesCreatorModul(myStopTagSelector->getCurrentTagProperties(), {}); - myNeteditAttributes->showNeteditAttributesModul(myStopTagSelector->getCurrentTagProperties()); + myStopAttributes->showAttributesCreatorModule(myStopTagSelector->getCurrentTemplateAC(), {}); + myNeteditAttributes->showNeteditAttributesModule(myStopTagSelector->getCurrentTemplateAC()->getTagProperty()); myHelpCreation->showHelpCreation(); } else { - myStopAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); + myStopAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); myHelpCreation->hideHelpCreation(); } } else { // hide moduls myStopTagSelector->hideTagSelector(); - myStopAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); + myStopAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); myHelpCreation->hideHelpCreation(); } } diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEStopFrame.h sumo-1.12.0/src/netedit/frames/demand/GNEStopFrame.h --- sumo-1.11.0/src/netedit/frames/demand/GNEStopFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEStopFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -37,7 +37,7 @@ // class HelpCreation // =========================================================================== - class HelpCreation : protected FXGroupBox { + class HelpCreation : public FXGroupBoxModule { public: /// @brief constructor @@ -100,16 +100,16 @@ CommonXMLStructure::SumoBaseObject* myStopParentBaseObject; /// @brief Stop parent selectors - GNEFrameModuls::DemandElementSelector* myStopParentSelector; + GNEFrameModules::DemandElementSelector* myStopParentSelector; /// @brief stop tag selector selector (used to select diffent kind of Stops) - GNEFrameModuls::TagSelector* myStopTagSelector; + GNEFrameModules::TagSelector* myStopTagSelector; /// @brief internal Stop attributes - GNEFrameAttributesModuls::AttributesCreator* myStopAttributes; + GNEFrameAttributeModules::AttributesCreator* myStopAttributes; /// @brief Netedit parameter - GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; + GNEFrameAttributeModules::NeteditAttributes* myNeteditAttributes; /// @brief Help creation HelpCreation* myHelpCreation; diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNETypeFrame.cpp sumo-1.12.0/src/netedit/frames/demand/GNETypeFrame.cpp --- sumo-1.11.0/src/netedit/frames/demand/GNETypeFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNETypeFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,456 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GNETypeFrame.cpp +/// @author Pablo Alvarez Lopez +/// @date Feb 2018 +/// +// The Widget for edit Type elements (vehicle, person and container) +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNETypeFrame.h" + + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +FXDEFMAP(GNETypeFrame::TypeSelector) typeSelectorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_TYPE, GNETypeFrame::TypeSelector::onCmdSelectItem) +}; + +FXDEFMAP(GNETypeFrame::TypeEditor) typeEditorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATE, GNETypeFrame::TypeEditor::onCmdCreateType), + FXMAPFUNC(SEL_COMMAND, MID_GNE_DELETE, GNETypeFrame::TypeEditor::onCmdDeleteResetType), + FXMAPFUNC(SEL_COMMAND, MID_GNE_COPY, GNETypeFrame::TypeEditor::onCmdCopyType) +}; + +// Object implementation +FXIMPLEMENT(GNETypeFrame::TypeSelector, FXGroupBoxModule, typeSelectorMap, ARRAYNUMBER(typeSelectorMap)) +FXIMPLEMENT(GNETypeFrame::TypeEditor, FXGroupBoxModule, typeEditorMap, ARRAYNUMBER(typeEditorMap)) + +// =========================================================================== +// method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNETypeFrame::TypeSelector - methods +// --------------------------------------------------------------------------- + +GNETypeFrame::TypeSelector::TypeSelector(GNETypeFrame* typeFrameParent) : + FXGroupBoxModule(typeFrameParent->myContentFrame, "Current Type"), + myTypeFrameParent(typeFrameParent), + myCurrentType(nullptr) { + // Create FXComboBox + myTypeMatchBox = new FXComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_SET_TYPE, GUIDesignComboBox); + // add default Vehicle an Bike types in the first and second positions + for (const auto& defaultvType : DEFAULT_VTYPES) { + myTypeMatchBox->appendItem(defaultvType.c_str()); + } + // fill myTypeMatchBox with list of VTypes IDs + for (const auto& vType : myTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) { + if (DEFAULT_VTYPES.count(vType->getID()) == 0) { + myTypeMatchBox->appendItem(vType->getID().c_str()); + } + } + // set DEFAULT_VEHTYPE as default VType + myCurrentType = myTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID); + // Set visible items + if (myTypeMatchBox->getNumItems() <= 20) { + myTypeMatchBox->setNumVisible((int)myTypeMatchBox->getNumItems()); + } else { + myTypeMatchBox->setNumVisible(20); + } + // TypeSelector is always shown + show(); +} + + +GNETypeFrame::TypeSelector::~TypeSelector() {} + + +GNEDemandElement* +GNETypeFrame::TypeSelector::getCurrentType() const { + return myCurrentType; +} + + +void +GNETypeFrame::TypeSelector::setCurrentType(GNEDemandElement* vType) { + myCurrentType = vType; + refreshTypeSelector(); +} + + +void +GNETypeFrame::TypeSelector::refreshTypeSelector() { + bool valid = false; + // clear items + myTypeMatchBox->clearItems(); + // add default Vehicle an Bike types in the first and second positions + for (const auto& defaultvType : DEFAULT_VTYPES) { + myTypeMatchBox->appendItem(defaultvType.c_str()); + } + // fill myTypeMatchBox with list of VTypes IDs + for (const auto& vType : myTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) { + if (DEFAULT_VTYPES.count(vType->getID()) == 0) { + myTypeMatchBox->appendItem(vType->getID().c_str()); + } + } + // Set visible items + if (myTypeMatchBox->getNumItems() <= 20) { + myTypeMatchBox->setNumVisible((int)myTypeMatchBox->getNumItems()); + } else { + myTypeMatchBox->setNumVisible(20); + } + // make sure that tag is in myTypeMatchBox + if (myCurrentType) { + for (int i = 0; i < (int)myTypeMatchBox->getNumItems(); i++) { + if (myTypeMatchBox->getItem(i).text() == myCurrentType->getID()) { + myTypeMatchBox->setCurrentItem(i); + valid = true; + } + } + } + // Check that give vType type is valid + if (!valid) { + // set DEFAULT_VEHTYPE as default VType + myCurrentType = myTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID); + // refresh myTypeMatchBox again + for (int i = 0; i < (int)myTypeMatchBox->getNumItems(); i++) { + if (myTypeMatchBox->getItem(i).text() == myCurrentType->getID()) { + myTypeMatchBox->setCurrentItem(i); + } + } + } + // refresh vehicle type editor modul + myTypeFrameParent->myTypeEditor->refreshTypeEditorModule(); + // set myCurrentType as inspected element + myTypeFrameParent->getViewNet()->setInspectedAttributeCarriers({myCurrentType}); + // show Attribute Editor modul + myTypeFrameParent->myTypeAttributesEditor->showAttributeEditorModule(false, true); +} + + +void +GNETypeFrame::TypeSelector::refreshTypeSelectorIDs() { + if (myCurrentType) { + myTypeMatchBox->setItem(myTypeMatchBox->getCurrentItem(), myCurrentType->getID().c_str()); + } +} + + +long +GNETypeFrame::TypeSelector::onCmdSelectItem(FXObject*, FXSelector, void*) { + // Check if value of myTypeMatchBox correspond of an allowed additional tags + for (const auto& vType : myTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) { + if (vType->getID() == myTypeMatchBox->getText().text()) { + // set pointer + myCurrentType = vType; + // set color of myTypeMatchBox to black (valid) + myTypeMatchBox->setTextColor(FXRGB(0, 0, 0)); + // refresh vehicle type editor modul + myTypeFrameParent->myTypeEditor->refreshTypeEditorModule(); + // set myCurrentType as inspected element + myTypeFrameParent->getViewNet()->setInspectedAttributeCarriers({myCurrentType}); + // show moduls if selected item is valid + myTypeFrameParent->myTypeAttributesEditor->showAttributeEditorModule(false, true); + // Write Warning in console if we're in testing mode + WRITE_DEBUG(("Selected item '" + myTypeMatchBox->getText() + "' in TypeSelector").text()); + return 1; + } + } + myCurrentType = nullptr; + // refresh vehicle type editor modul + myTypeFrameParent->myTypeEditor->refreshTypeEditorModule(); + // hide all moduls if selected item isn't valid + myTypeFrameParent->myTypeAttributesEditor->hideAttributesEditorModule(); + // set color of myTypeMatchBox to red (invalid) + myTypeMatchBox->setTextColor(FXRGB(255, 0, 0)); + // Write Warning in console if we're in testing mode + WRITE_DEBUG("Selected invalid item in TypeSelector"); + return 1; +} + +// --------------------------------------------------------------------------- +// GNETypeFrame::TypeEditor - methods +// --------------------------------------------------------------------------- + +GNETypeFrame::TypeEditor::TypeEditor(GNETypeFrame* typeFrameParent) : + FXGroupBoxModule(typeFrameParent->myContentFrame, "Type Editor"), + myTypeFrameParent(typeFrameParent) { + // Create new vehicle type + myCreateTypeButton = new FXButton(getCollapsableFrame(), "Create Type", GUIIconSubSys::getIcon(GUIIcon::VTYPE), this, MID_GNE_CREATE, GUIDesignButton); + // Create delete/reset vehicle type + myDeleteResetTypeButton = new FXButton(getCollapsableFrame(), "Delete Type", GUIIconSubSys::getIcon(GUIIcon::MODEDELETE), this, MID_GNE_DELETE, GUIDesignButton); + // Create copy vehicle type + myCopyTypeButton = new FXButton(getCollapsableFrame(), "Copy Type", GUIIconSubSys::getIcon(GUIIcon::COPY), this, MID_GNE_COPY, GUIDesignButton); +} + + +GNETypeFrame::TypeEditor::~TypeEditor() {} + + +void +GNETypeFrame::TypeEditor::showTypeEditorModule() { + refreshTypeEditorModule(); + show(); +} + + +void +GNETypeFrame::TypeEditor::hideTypeEditorModule() { + hide(); +} + + +void +GNETypeFrame::TypeEditor::refreshTypeEditorModule() { + // first check if selected VType is valid + if (myTypeFrameParent->myTypeSelector->getCurrentType() == nullptr) { + // disable buttons + myDeleteResetTypeButton->disable(); + myCopyTypeButton->disable(); + } else if (GNEAttributeCarrier::parse(myTypeFrameParent->myTypeSelector->getCurrentType()->getAttribute(GNE_ATTR_DEFAULT_VTYPE))) { + // enable copy button + myCopyTypeButton->enable(); + // enable and set myDeleteTypeButton as "reset") + myDeleteResetTypeButton->setText("Reset type"); + myDeleteResetTypeButton->setIcon(GUIIconSubSys::getIcon(GUIIcon::RESET)); + // check if reset default vehicle type button has to be enabled or disabled + if (GNEAttributeCarrier::parse(myTypeFrameParent->myTypeSelector->getCurrentType()->getAttribute(GNE_ATTR_DEFAULT_VTYPE_MODIFIED))) { + myDeleteResetTypeButton->enable(); + } else { + myDeleteResetTypeButton->disable(); + } + } else { + // enable copy button + myCopyTypeButton->enable(); + // enable and set myDeleteTypeButton as "delete") + myDeleteResetTypeButton->setText("Delete type"); + myDeleteResetTypeButton->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEDELETE)); + myDeleteResetTypeButton->enable(); + } + // update modul + recalc(); +} + + +long +GNETypeFrame::TypeEditor::onCmdCreateType(FXObject*, FXSelector, void*) { + // obtain a new valid Type ID + const std::string typeID = myTypeFrameParent->myViewNet->getNet()->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_VTYPE); + // create new vehicle type + GNEDemandElement* type = new GNEVType(myTypeFrameParent->myViewNet->getNet(), typeID); + // add it using undoList (to allow undo-redo) + myTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::VTYPE, "create vehicle type"); + myTypeFrameParent->myViewNet->getUndoList()->add(new GNEChange_DemandElement(type, true), true); + myTypeFrameParent->myViewNet->getUndoList()->end(); + // set created vehicle type in selector + myTypeFrameParent->myTypeSelector->setCurrentType(type); + // refresh Type Editor Module + myTypeFrameParent->myTypeEditor->refreshTypeEditorModule(); + return 1; +} + + +long +GNETypeFrame::TypeEditor::onCmdDeleteResetType(FXObject*, FXSelector, void*) { + // continue depending of current mode + if (myDeleteResetTypeButton->getIcon() == GUIIconSubSys::getIcon(GUIIcon::MODEDELETE)) { + deleteType(); + } else { + resetType(); + } + return 1; +} + + +long +GNETypeFrame::TypeEditor::onCmdCopyType(FXObject*, FXSelector, void*) { + // obtain a new valid Type ID + const std::string typeID = myTypeFrameParent->myViewNet->getNet()->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_VTYPE); + // obtain vehicle type in which new Type will be based + GNEVType* vType = dynamic_cast(myTypeFrameParent->myTypeSelector->getCurrentType()); + // check that vType exist + if (vType) { + // create a new Type based on the current selected vehicle type + GNEDemandElement* typeCopy = new GNEVType(myTypeFrameParent->myViewNet->getNet(), typeID, vType); + // begin undo list operation + myTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::VTYPE, "copy vehicle type"); + // add it using undoList (to allow undo-redo) + myTypeFrameParent->myViewNet->getUndoList()->add(new GNEChange_DemandElement(typeCopy, true), true); + // end undo list operation + myTypeFrameParent->myViewNet->getUndoList()->end(); + // refresh Type Selector (to show the new VType) + myTypeFrameParent->myTypeSelector->refreshTypeSelector(); + // set created vehicle type in selector + myTypeFrameParent->myTypeSelector->setCurrentType(typeCopy); + // refresh Type Editor Module + myTypeFrameParent->myTypeEditor->refreshTypeEditorModule(); + } + return 1; +} + + +void +GNETypeFrame::TypeEditor::resetType() { + // begin reset default vehicle type values + myTypeFrameParent->getViewNet()->getUndoList()->begin(GUIIcon::VTYPE, "reset default vehicle type values"); + // reset all values of default vehicle type + for (const auto& attrProperty : GNEAttributeCarrier::getTagProperty(SUMO_TAG_VTYPE)) { + // change all attributes with "" to reset it (except ID and vClass) + if ((attrProperty.getAttr() != SUMO_ATTR_ID) && (attrProperty.getAttr() != SUMO_ATTR_VCLASS)) { + myTypeFrameParent->myTypeSelector->getCurrentType()->setAttribute(attrProperty.getAttr(), "", myTypeFrameParent->myViewNet->getUndoList()); + } + } + // change manually VClass (because it depends of Default VType) + if (myTypeFrameParent->myTypeSelector->getCurrentType()->getAttribute(SUMO_ATTR_ID) == DEFAULT_VTYPE_ID) { + myTypeFrameParent->myTypeSelector->getCurrentType()->setAttribute(SUMO_ATTR_VCLASS, toString(SVC_PASSENGER), myTypeFrameParent->myViewNet->getUndoList()); + } else if (myTypeFrameParent->myTypeSelector->getCurrentType()->getAttribute(SUMO_ATTR_ID) == DEFAULT_BIKETYPE_ID) { + myTypeFrameParent->myTypeSelector->getCurrentType()->setAttribute(SUMO_ATTR_VCLASS, toString(SVC_BICYCLE), myTypeFrameParent->myViewNet->getUndoList()); + } else if (myTypeFrameParent->myTypeSelector->getCurrentType()->getAttribute(SUMO_ATTR_ID) == DEFAULT_TAXITYPE_ID) { + myTypeFrameParent->myTypeSelector->getCurrentType()->setAttribute(SUMO_ATTR_VCLASS, toString(SVC_TAXI), myTypeFrameParent->myViewNet->getUndoList()); + } else if (myTypeFrameParent->myTypeSelector->getCurrentType()->getAttribute(SUMO_ATTR_ID) == DEFAULT_PEDTYPE_ID) { + myTypeFrameParent->myTypeSelector->getCurrentType()->setAttribute(SUMO_ATTR_VCLASS, toString(SVC_PEDESTRIAN), myTypeFrameParent->myViewNet->getUndoList()); + } else if (myTypeFrameParent->myTypeSelector->getCurrentType()->getAttribute(SUMO_ATTR_ID) == DEFAULT_CONTAINERTYPE_ID) { + myTypeFrameParent->myTypeSelector->getCurrentType()->setAttribute(SUMO_ATTR_VCLASS, toString(SVC_PEDESTRIAN), myTypeFrameParent->myViewNet->getUndoList()); + } + // change special attribute GNE_ATTR_DEFAULT_VTYPE_MODIFIED + myTypeFrameParent->myTypeSelector->getCurrentType()->setAttribute(GNE_ATTR_DEFAULT_VTYPE_MODIFIED, "false", myTypeFrameParent->myViewNet->getUndoList()); + // finish reset default vehicle type values + myTypeFrameParent->getViewNet()->getUndoList()->end(); + // refresh TypeSelector + myTypeFrameParent->myTypeSelector->refreshTypeSelector(); +} + + +void +GNETypeFrame::TypeEditor::deleteType() { + // show question dialog if vtype has already assigned vehicles + if (myTypeFrameParent->myTypeSelector->getCurrentType()->getChildDemandElements().size() > 0) { + std::string plural = myTypeFrameParent->myTypeSelector->getCurrentType()->getChildDemandElements().size() == 1 ? ("") : ("s"); + // show warning in gui testing debug mode + WRITE_DEBUG("Opening FXMessageBox 'remove vType'"); + // Ask confirmation to user + FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, + ("Remove " + toString(SUMO_TAG_VTYPE) + "s").c_str(), "%s", + ("Delete " + toString(SUMO_TAG_VTYPE) + " '" + myTypeFrameParent->myTypeSelector->getCurrentType()->getID() + + "' will remove " + toString(myTypeFrameParent->myTypeSelector->getCurrentType()->getChildDemandElements().size()) + + " vehicle" + plural + ". Continue?").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 'remove vType' with 'No'"); + } else if (answer == 4) { + WRITE_DEBUG("Closed FXMessageBox 'remove vType' with 'ESC'"); + } + } else { + // begin undo list operation + myTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::VTYPE, "delete vehicle type"); + // remove vehicle type (and all of their children) + myTypeFrameParent->myViewNet->getNet()->deleteDemandElement(myTypeFrameParent->myTypeSelector->getCurrentType(), + myTypeFrameParent->myViewNet->getUndoList()); + // end undo list operation + myTypeFrameParent->myViewNet->getUndoList()->end(); + } + } else { + // begin undo list operation + myTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::VTYPE, "delete vehicle type"); + // remove vehicle type (and all of their children) + myTypeFrameParent->myViewNet->getNet()->deleteDemandElement(myTypeFrameParent->myTypeSelector->getCurrentType(), + myTypeFrameParent->myViewNet->getUndoList()); + // end undo list operation + myTypeFrameParent->myViewNet->getUndoList()->end(); + } +} + +// --------------------------------------------------------------------------- +// GNETypeFrame - methods +// --------------------------------------------------------------------------- + +GNETypeFrame::GNETypeFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEFrame(horizontalFrameParent, viewNet, "Types") { + + // create modul for edit vehicle types (Create, copy, etc.) + myTypeEditor = new TypeEditor(this); + + // create vehicle type selector + myTypeSelector = new TypeSelector(this); + + // Create vehicle type attributes editor + myTypeAttributesEditor = new GNEFrameAttributeModules::AttributesEditor(this); + + // create modul for open extended attributes dialog + myAttributesEditorExtended = new GNEFrameAttributeModules::AttributesEditorExtended(this); + + // set "VTYPE_DEFAULT" as default vehicle Type + myTypeSelector->setCurrentType(myViewNet->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID)); +} + + +GNETypeFrame::~GNETypeFrame() {} + + +void +GNETypeFrame::show() { + // refresh vehicle type and Attribute Editor + myTypeSelector->refreshTypeSelector(); + // set myCurrentType as inspected element + myTypeAttributesEditor->getFrameParent()->getViewNet()->setInspectedAttributeCarriers({myTypeSelector->getCurrentType()}); + // show vehicle type attributes editor (except extended attributes) + myTypeAttributesEditor->showAttributeEditorModule(false, true); + // show frame + GNEFrame::show(); +} + + +GNETypeFrame::TypeSelector* +GNETypeFrame::getTypeSelector() const { + return myTypeSelector; +} + + +void +GNETypeFrame::attributeUpdated() { + // after changing an attribute myTypeSelector, we need to update the list of typeSelector, because ID could be changed + myTypeSelector->refreshTypeSelectorIDs(); + //... and typeEditor (due reset) + myTypeEditor->refreshTypeEditorModule(); +} + + +void +GNETypeFrame::attributesEditorExtendedDialogOpened() { + // open vehicle type dialog + if (myTypeSelector->getCurrentType()) { + GNEVehicleTypeDialog(myTypeSelector->getCurrentType(), true); + // set myCurrentType as inspected element + myTypeAttributesEditor->getFrameParent()->getViewNet()->setInspectedAttributeCarriers({myTypeSelector->getCurrentType()}); + // call "showAttributeEditorModule" to refresh attribute list + myTypeAttributesEditor->showAttributeEditorModule(false, true); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNETypeFrame.h sumo-1.12.0/src/netedit/frames/demand/GNETypeFrame.h --- sumo-1.11.0/src/netedit/frames/demand/GNETypeFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNETypeFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,181 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GNETypeFrame.h +/// @author Pablo Alvarez Lopez +/// @date Feb 2018 +/// +// The Widget for edit Type elements (vehicle, person and container) +/****************************************************************************/ +#pragma once +#include + +#include + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNEVehicle; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNETypeFrame + */ +class GNETypeFrame : public GNEFrame { + +public: + + // =========================================================================== + // class TypeSelector + // =========================================================================== + + class TypeSelector : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNETypeFrame::TypeSelector) + + public: + /// @brief constructor + TypeSelector(GNETypeFrame* typeFrameParent); + + /// @brief destructor + ~TypeSelector(); + + /// @brief get current Vehicle Type + GNEDemandElement* getCurrentType() const; + + /// @brief set current Vehicle Type + void setCurrentType(GNEDemandElement* vType); + + /// @brief refresh vehicle type selector + void refreshTypeSelector(); + + /// @brief refresh vehicle type selector (only IDs, without refreshing attributes) + void refreshTypeSelectorIDs(); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user select another element in ComboBox + long onCmdSelectItem(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(TypeSelector) + + private: + /// @brief pointer to Frame Parent + GNETypeFrame* myTypeFrameParent; + + /// @brief pointer to current vehicle type + GNEDemandElement* myCurrentType; + + /// @brief comboBox with the list of vTypes + FXComboBox* myTypeMatchBox; + }; + + // =========================================================================== + // class TypeEditor + // =========================================================================== + + class TypeEditor : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNETypeFrame::TypeEditor) + + public: + /// @brief constructor + TypeEditor(GNETypeFrame* typeFrameParent); + + /// @brief destructor + ~TypeEditor(); + + /// @brief show TypeEditor modul + void showTypeEditorModule(); + + /// @brief hide TypeEditor box + void hideTypeEditorModule(); + + /// @brief update TypeEditor modul + void refreshTypeEditorModule(); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when "Vreate Vehicle Type" button is clicked + long onCmdCreateType(FXObject*, FXSelector, void*); + + /// @brief Called when "Delete/Reset Vehicle Type" button is clicked + long onCmdDeleteResetType(FXObject*, FXSelector, void*); + + /// @brief Called when "Copy Vehicle Type" button is clicked + long onCmdCopyType(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(TypeEditor) + + /// @brief reset type + void resetType(); + + /// @brief delete type + void deleteType(); + + private: + /// @brief pointer to vehicle type Frame Parent + GNETypeFrame* myTypeFrameParent; + + /// @brief "create vehicle type" button + FXButton* myCreateTypeButton; + + /// @brief "delete/reset vehicle type" button + FXButton* myDeleteResetTypeButton; + + /// @brief "copy vehicle type" + FXButton* myCopyTypeButton; + }; + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNETypeFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNETypeFrame(); + + /// @brief show Frame + void show(); + + /// @brief get vehicle type selector + TypeSelector* getTypeSelector() const; + +protected: + /// @brief function called after set a valid attribute in AttributeCreator/AttributeEditor/ParametersEditor/... + void attributeUpdated(); + + /// @brief open AttributesCreator extended dialog (used for editing advance attributes of Vehicle Types) + void attributesEditorExtendedDialogOpened(); + +private: + /// @brief vehicle type selector + TypeSelector* myTypeSelector; + + /// @brief editorinternal vehicle type attributes + GNEFrameAttributeModules::AttributesEditor* myTypeAttributesEditor; + + /// @brief modul for open extended attributes dialog + GNEFrameAttributeModules::AttributesEditorExtended* myAttributesEditorExtended; + + /// @brief Vehicle Type editor (Create, copy, etc.) + TypeEditor* myTypeEditor; +}; diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEVehicleFrame.cpp sumo-1.12.0/src/netedit/frames/demand/GNEVehicleFrame.cpp --- sumo-1.11.0/src/netedit/frames/demand/GNEVehicleFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEVehicleFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -37,9 +37,9 @@ // --------------------------------------------------------------------------- GNEVehicleFrame::HelpCreation::HelpCreation(GNEVehicleFrame* vehicleFrameParent) : - FXGroupBox(vehicleFrameParent->myContentFrame, "Help", GUIDesignGroupBoxFrame), + FXGroupBoxModule(vehicleFrameParent->myContentFrame, "Help"), myVehicleFrameParent(vehicleFrameParent) { - myInformationLabel = new FXLabel(this, "", 0, GUIDesignLabelFrameInformation); + myInformationLabel = new FXLabel(getCollapsableFrame(), "", 0, GUIDesignLabelFrameInformation); } @@ -65,7 +65,7 @@ // create information label std::ostringstream information; // set text depending of selected vehicle type - switch (myVehicleFrameParent->myVehicleTagSelector->getCurrentTagProperties().getTag()) { + switch (myVehicleFrameParent->myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty().getTag()) { case SUMO_TAG_VEHICLE: information << "- Click over a route to\n" @@ -103,22 +103,19 @@ myVehicleBaseObject(new CommonXMLStructure::SumoBaseObject(nullptr)) { // Create item Selector modul for vehicles - myVehicleTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::VEHICLE); + myVehicleTagSelector = new GNEFrameModules::TagSelector(this, GNETagProperties::TagType::VEHICLE, SUMO_TAG_TRIP); - // Create vehicle type selector - myVTypeSelector = new GNEFrameModuls::DemandElementSelector(this, SUMO_TAG_VTYPE); + // Create vehicle type selector and set DEFAULT_VTYPE_ID as default element + myTypeSelector = new GNEFrameModules::DemandElementSelector(this, SUMO_TAG_VTYPE, viewNet->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID)); // Create vehicle parameters - myVehicleAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + myVehicleAttributes = new GNEFrameAttributeModules::AttributesCreator(this); - // create PathCreator Modul - myPathCreator = new GNEFrameModuls::PathCreator(this); + // create PathCreator Module + myPathCreator = new GNEFrameModules::PathCreator(this); - // Create Help Creation Modul + // Create Help Creation Module myHelpCreation = new HelpCreation(this); - - // set Vehicle as default vehicle - myVehicleTagSelector->setCurrentTag(SUMO_TAG_VEHICLE); } @@ -129,8 +126,8 @@ void GNEVehicleFrame::show() { - // refresh item selector - myVehicleTagSelector->refreshTagProperties(); + // refresh tag selector + myVehicleTagSelector->refreshTagSelector(); // show frame GNEFrame::show(); } @@ -138,10 +135,14 @@ void GNEVehicleFrame::hide() { - // reset candidate edges + // reset edge candidates for (const auto& edge : myViewNet->getNet()->getAttributeCarriers()->getEdges()) { edge.second->resetCandidateFlags(); } + // reset junctioncandidates + for (const auto& junction : myViewNet->getNet()->getAttributeCarriers()->getJunctions()) { + junction.second->resetCandidateFlags(); + } // hide frame GNEFrame::hide(); } @@ -149,18 +150,23 @@ bool GNEVehicleFrame::addVehicle(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed& mouseButtonKeyPressed) { + // check template AC + if (myVehicleTagSelector->getCurrentTemplateAC() == nullptr) { + return false; + } // begin cleaning vehicle base object myVehicleBaseObject->clear(); // obtain tag (only for improve code legibility) - SumoXMLTag vehicleTag = myVehicleTagSelector->getCurrentTagProperties().getTag(); + SumoXMLTag vehicleTag = myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(); const bool addEdge = ((vehicleTag == SUMO_TAG_TRIP) || (vehicleTag == GNE_TAG_VEHICLE_WITHROUTE) || (vehicleTag == SUMO_TAG_FLOW) || (vehicleTag == GNE_TAG_FLOW_WITHROUTE)); + const bool addJunction = ((vehicleTag == GNE_TAG_TRIP_JUNCTIONS) || (vehicleTag == GNE_TAG_FLOW_JUNCTIONS)); // first check that current selected vehicle is valid if (vehicleTag == SUMO_TAG_NOTHING) { myViewNet->setStatusBarText("Current selected vehicle isn't valid."); return false; } // now check if VType is valid - if (myVTypeSelector->getCurrentDemandElement() == nullptr) { + if (myTypeSelector->getCurrentDemandElement() == nullptr) { myViewNet->setStatusBarText("Current selected vehicle type isn't valid."); return false; } @@ -176,7 +182,7 @@ myVehicleBaseObject->addStringAttribute(SUMO_ATTR_ID, myViewNet->getNet()->getAttributeCarriers()->generateDemandElementID(vehicleTag)); } // add VType - myVehicleBaseObject->addStringAttribute(SUMO_ATTR_TYPE, myVTypeSelector->getCurrentDemandElement()->getID()); + myVehicleBaseObject->addStringAttribute(SUMO_ATTR_TYPE, myTypeSelector->getCurrentDemandElement()->getID()); // set route or edges depending of vehicle type if ((vehicleTag == SUMO_TAG_VEHICLE) || (vehicleTag == GNE_TAG_FLOW_ROUTE)) { // get route @@ -194,7 +200,7 @@ // check if departSpeed is valid if (myVehicleBaseObject->hasStringAttribute(SUMO_ATTR_DEPARTSPEED) && GNEAttributeCarrier::canParse(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTSPEED))) { double departSpeed = GNEAttributeCarrier::parse(myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPARTSPEED)); - if (departSpeed >= myVTypeSelector->getCurrentDemandElement()->getAttributeDouble(SUMO_ATTR_MAXSPEED)) { + if (departSpeed >= myTypeSelector->getCurrentDemandElement()->getAttributeDouble(SUMO_ATTR_MAXSPEED)) { myViewNet->setStatusBarText("Invalid " + toString(SUMO_ATTR_DEPARTSPEED)); return false; } @@ -245,12 +251,12 @@ } } // center view after creation - const auto *vehicle = myViewNet->getNet()->getAttributeCarriers()->retrieveDemandElement(myVehicleBaseObject->getTag(), myVehicleBaseObject->getStringAttribute(SUMO_ATTR_ID), false); + const auto* vehicle = myViewNet->getNet()->getAttributeCarriers()->retrieveDemandElement(myVehicleBaseObject->getTag(), myVehicleBaseObject->getStringAttribute(SUMO_ATTR_ID), false); if (vehicle && !myViewNet->getVisibleBoundary().around(vehicle->getPositionInView())) { myViewNet->centerTo(vehicle->getPositionInView(), false); } // refresh myVehicleAttributes - myVehicleAttributes->refreshRows(); + myVehicleAttributes->refreshAttributesCreator(); // all ok, then return true; return true; } else { @@ -260,13 +266,22 @@ } else if (addEdge && objectsUnderCursor.getEdgeFront()) { // add clicked edge in PathCreator return myPathCreator->addEdge(objectsUnderCursor.getEdgeFront(), mouseButtonKeyPressed.shiftKeyPressed(), mouseButtonKeyPressed.controlKeyPressed()); + } else if (addJunction && objectsUnderCursor.getJunctionFront()) { + // add clicked junction in PathCreator + return myPathCreator->addJunction(objectsUnderCursor.getJunctionFront(), mouseButtonKeyPressed.shiftKeyPressed(), mouseButtonKeyPressed.controlKeyPressed()); } else { return false; } } -GNEFrameModuls::PathCreator* +GNEFrameModules::TagSelector* +GNEVehicleFrame::getVehicleTagSelector() const { + return myVehicleTagSelector; +} + + +GNEFrameModules::PathCreator* GNEVehicleFrame::getPathCreator() const { return myPathCreator; } @@ -277,18 +292,18 @@ void GNEVehicleFrame::tagSelected() { - if (myVehicleTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + if (myVehicleTagSelector->getCurrentTemplateAC()) { // show vehicle type selector modul - myVTypeSelector->showDemandElementSelector(); + myTypeSelector->showDemandElementSelector(); // show path creator modul - if ((myVehicleTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_VEHICLE) && - (myVehicleTagSelector->getCurrentTagProperties().getTag() != GNE_TAG_FLOW_ROUTE)) { - myPathCreator->showPathCreatorModul(myVehicleTagSelector->getCurrentTagProperties().getTag(), false, false); + if ((myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() != SUMO_TAG_VEHICLE) && + (myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() != GNE_TAG_FLOW_ROUTE)) { + myPathCreator->showPathCreatorModule(myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(), false, false); } } else { // hide all moduls if vehicle isn't valid - myVTypeSelector->hideDemandElementSelector(); - myVehicleAttributes->hideAttributesCreatorModul(); + myTypeSelector->hideDemandElementSelector(); + myVehicleAttributes->hideAttributesCreatorModule(); myHelpCreation->hideHelpCreation(); } } @@ -296,22 +311,37 @@ void GNEVehicleFrame::demandElementSelected() { - if (myVTypeSelector->getCurrentDemandElement()) { + if (myTypeSelector->getCurrentDemandElement()) { + // get tag + SumoXMLTag vehicleTag = myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(); // show vehicle attributes modul - myVehicleAttributes->showAttributesCreatorModul(myVehicleTagSelector->getCurrentTagProperties(), {}); - // set current VTypeClass in TripCreator - myPathCreator->setVClass(myVTypeSelector->getCurrentDemandElement()->getVClass()); - // show path creator modul - if ((myVehicleTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_VEHICLE) && - (myVehicleTagSelector->getCurrentTagProperties().getTag() != GNE_TAG_FLOW_ROUTE)) { - myPathCreator->showPathCreatorModul(myVehicleTagSelector->getCurrentTagProperties().getTag(), false, false); + myVehicleAttributes->showAttributesCreatorModule(myVehicleTagSelector->getCurrentTemplateAC(), {}); + // clear colors + myPathCreator->clearJunctionColors(); + myPathCreator->clearEdgeColors(); + // check if use junctions + if ((vehicleTag == GNE_TAG_TRIP_JUNCTIONS) || (vehicleTag == GNE_TAG_FLOW_JUNCTIONS)) { + myPathCreator->updateJunctionColors(); + } else { + // set current VTypeClass in TripCreator + myPathCreator->setVClass(myTypeSelector->getCurrentDemandElement()->getVClass()); + // show path creator modul + if ((vehicleTag != SUMO_TAG_VEHICLE) && (vehicleTag != GNE_TAG_FLOW_ROUTE)) { + myPathCreator->showPathCreatorModule(myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(), false, false); + } } // show help creation myHelpCreation->showHelpCreation(); + // show warning if we have selected a vType oriented to pedestrians or containers + if (myTypeSelector->getCurrentDemandElement()->getVClass() == SVC_PEDESTRIAN) { + WRITE_WARNING("Current selected vType is oriented to pedestrians"); + } else if (myTypeSelector->getCurrentDemandElement()->getVClass() == SVC_IGNORING) { + WRITE_WARNING("Current selected vType is oriented to containers"); + } } else { // hide all moduls if selected item isn't valid - myVehicleAttributes->hideAttributesCreatorModul(); - myPathCreator->hidePathCreatorModul(); + myVehicleAttributes->hideAttributesCreatorModule(); + myPathCreator->hidePathCreatorModule(); myHelpCreation->hideHelpCreation(); // hide help creation myHelpCreation->hideHelpCreation(); @@ -325,10 +355,9 @@ // begin cleaning vehicle base object myVehicleBaseObject->clear(); // obtain tag (only for improve code legibility) - SumoXMLTag vehicleTag = myVehicleTagSelector->getCurrentTagProperties().getTag(); - const bool embebbedRoute = ((vehicleTag == GNE_TAG_VEHICLE_WITHROUTE) || (vehicleTag == GNE_TAG_FLOW_WITHROUTE)); + SumoXMLTag vehicleTag = myVehicleTagSelector->getCurrentTemplateAC()->getTagProperty().getTag(); // check number of edges - if ((myPathCreator->getSelectedEdges().size() > 1) || (myPathCreator->getSelectedEdges().size() > 0 && embebbedRoute)) { + if ((myPathCreator->getSelectedEdges().size() > 0) || (myPathCreator->getSelectedJunctions().size() > 0)) { // Updated myVehicleBaseObject myVehicleAttributes->getAttributesAndValues(myVehicleBaseObject, false); // Check if ID has to be generated @@ -336,7 +365,7 @@ myVehicleBaseObject->addStringAttribute(SUMO_ATTR_ID, myViewNet->getNet()->getAttributeCarriers()->generateDemandElementID(vehicleTag)); } // add VType - myVehicleBaseObject->addStringAttribute(SUMO_ATTR_TYPE, myVTypeSelector->getCurrentDemandElement()->getID()); + myVehicleBaseObject->addStringAttribute(SUMO_ATTR_TYPE, myTypeSelector->getCurrentDemandElement()->getID()); // extract via attribute std::vector viaEdges; for (int i = 1; i < ((int)myPathCreator->getSelectedEdges().size() - 1); i++) { @@ -393,7 +422,7 @@ embeddedRouteObject->setTag(SUMO_TAG_ROUTE); embeddedRouteObject->addStringAttribute(SUMO_ATTR_ID, ""); embeddedRouteObject->addStringListAttribute(SUMO_ATTR_EDGES, routeEdges); - embeddedRouteObject->addColorAttribute(SUMO_ATTR_COLOR, RGBColor::CYAN), + embeddedRouteObject->addColorAttribute(SUMO_ATTR_COLOR, RGBColor::INVISIBLE), embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0), embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0), // parse route @@ -455,7 +484,7 @@ embeddedRouteObject->setTag(SUMO_TAG_ROUTE); embeddedRouteObject->addStringAttribute(SUMO_ATTR_ID, ""); embeddedRouteObject->addStringListAttribute(SUMO_ATTR_EDGES, routeEdges); - embeddedRouteObject->addColorAttribute(SUMO_ATTR_COLOR, RGBColor::CYAN), + embeddedRouteObject->addColorAttribute(SUMO_ATTR_COLOR, RGBColor::INVISIBLE), embeddedRouteObject->addIntAttribute(SUMO_ATTR_REPEAT, 0), embeddedRouteObject->addTimeAttribute(SUMO_ATTR_CYCLETIME, 0), // parse route @@ -463,11 +492,56 @@ // delete vehicleParamters delete flowParameters; } + } else if (vehicleTag == GNE_TAG_TRIP_JUNCTIONS) { + // set tag + myVehicleBaseObject->setTag(SUMO_TAG_TRIP); + // Add parameter departure + if (!myVehicleBaseObject->hasStringAttribute(SUMO_ATTR_DEPART) || myVehicleBaseObject->getStringAttribute(SUMO_ATTR_DEPART).empty()) { + myVehicleBaseObject->addStringAttribute(SUMO_ATTR_DEPART, "0"); + } + // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes + SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(myVehicleBaseObject->getAllAttributes(), getPredefinedTagsMML(), toString(vehicleTag)); + // obtain trip parameters + SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false); + // check trip parameters + if (tripParameters) { + myVehicleBaseObject->setVehicleParameter(tripParameters); + myVehicleBaseObject->addStringAttribute(SUMO_ATTR_FROMJUNCTION, myPathCreator->getSelectedJunctions().front()->getID()); + myVehicleBaseObject->addStringAttribute(SUMO_ATTR_TOJUNCTION, myPathCreator->getSelectedJunctions().back()->getID()); + // parse vehicle + myRouteHandler.parseSumoBaseObject(myVehicleBaseObject); + // delete tripParameters and base object + delete tripParameters; + } + } else if (vehicleTag == GNE_TAG_FLOW_JUNCTIONS) { + // set tag + myVehicleBaseObject->setTag(SUMO_TAG_FLOW); + // set begin and end attributes + if (!myVehicleBaseObject->hasStringAttribute(SUMO_ATTR_BEGIN) || myVehicleBaseObject->getStringAttribute(SUMO_ATTR_BEGIN).empty()) { + myVehicleBaseObject->addStringAttribute(SUMO_ATTR_BEGIN, "0"); + } + if (!myVehicleBaseObject->hasStringAttribute(SUMO_ATTR_END) || myVehicleBaseObject->getStringAttribute(SUMO_ATTR_END).empty()) { + myVehicleBaseObject->addStringAttribute(SUMO_ATTR_END, "3600"); + } + // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes + SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(myVehicleBaseObject->getAllAttributes(), getPredefinedTagsMML(), toString(vehicleTag)); + // obtain flow parameters + SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(vehicleTag, SUMOSAXAttrs, false, true, 0, SUMOTime_MAX); + // check flowParameters + if (flowParameters) { + myVehicleBaseObject->setVehicleParameter(flowParameters); + myVehicleBaseObject->addStringAttribute(SUMO_ATTR_FROMJUNCTION, myPathCreator->getSelectedJunctions().front()->getID()); + myVehicleBaseObject->addStringAttribute(SUMO_ATTR_TOJUNCTION, myPathCreator->getSelectedJunctions().back()->getID()); + // parse vehicle + myRouteHandler.parseSumoBaseObject(myVehicleBaseObject); + // delete flowParameters and base object + delete flowParameters; + } } // abort path creation myPathCreator->abortPathCreation(); // refresh myVehicleAttributes - myVehicleAttributes->refreshRows(); + myVehicleAttributes->refreshAttributesCreator(); } } diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEVehicleFrame.h sumo-1.12.0/src/netedit/frames/demand/GNEVehicleFrame.h --- sumo-1.11.0/src/netedit/frames/demand/GNEVehicleFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEVehicleFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -38,7 +38,7 @@ // class HelpCreation // =========================================================================== - class HelpCreation : protected FXGroupBox { + class HelpCreation : public FXGroupBoxModule { public: /// @brief constructor @@ -86,8 +86,11 @@ */ bool addVehicle(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const GNEViewNetHelper::MouseButtonKeyPressed& mouseButtonKeyPressed); + /// @brief get vehicle tag selector (needed for transform vehicles) + GNEFrameModules::TagSelector* getVehicleTagSelector() const; + /// @brief get PathCreator modul - GNEFrameModuls::PathCreator* getPathCreator() const; + GNEFrameModules::PathCreator* getPathCreator() const; protected: /// @brief Tag selected in TagSelector @@ -107,16 +110,16 @@ CommonXMLStructure::SumoBaseObject* myVehicleBaseObject; /// @brief vehicle tag selector (used to select diffent kind of vehicles) - GNEFrameModuls::TagSelector* myVehicleTagSelector; + GNEFrameModules::TagSelector* myVehicleTagSelector; /// @brief Vehicle Type selectors - GNEFrameModuls::DemandElementSelector* myVTypeSelector; + GNEFrameModules::DemandElementSelector* myTypeSelector; /// @brief internal vehicle attributes - GNEFrameAttributesModuls::AttributesCreator* myVehicleAttributes; + GNEFrameAttributeModules::AttributesCreator* myVehicleAttributes; /// @brief edge path creator (used for trips and flows) - GNEFrameModuls::PathCreator* myPathCreator; + GNEFrameModules::PathCreator* myPathCreator; /// @brief Help creation HelpCreation* myHelpCreation; diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEVehicleTypeFrame.cpp sumo-1.12.0/src/netedit/frames/demand/GNEVehicleTypeFrame.cpp --- sumo-1.11.0/src/netedit/frames/demand/GNEVehicleTypeFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEVehicleTypeFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,440 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GNEVehicleTypeFrame.cpp -/// @author Pablo Alvarez Lopez -/// @date Feb 2018 -/// -// The Widget for edit Vehicle Type elements -/****************************************************************************/ -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEVehicleTypeFrame.h" - - -// =========================================================================== -// FOX callback mapping -// =========================================================================== - -FXDEFMAP(GNEVehicleTypeFrame::VehicleTypeSelector) vehicleTypeSelectorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_TYPE, GNEVehicleTypeFrame::VehicleTypeSelector::onCmdSelectItem) -}; - -FXDEFMAP(GNEVehicleTypeFrame::VehicleTypeEditor) vehicleTypeEditorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATE, GNEVehicleTypeFrame::VehicleTypeEditor::onCmdCreateVehicleType), - FXMAPFUNC(SEL_COMMAND, MID_GNE_DELETE, GNEVehicleTypeFrame::VehicleTypeEditor::onCmdDeleteVehicleType), - FXMAPFUNC(SEL_COMMAND, MID_GNE_RESET, GNEVehicleTypeFrame::VehicleTypeEditor::onCmdResetVehicleType), - FXMAPFUNC(SEL_COMMAND, MID_GNE_COPY, GNEVehicleTypeFrame::VehicleTypeEditor::onCmdCopyVehicleType) -}; - -// Object implementation -FXIMPLEMENT(GNEVehicleTypeFrame::VehicleTypeSelector, FXGroupBox, vehicleTypeSelectorMap, ARRAYNUMBER(vehicleTypeSelectorMap)) -FXIMPLEMENT(GNEVehicleTypeFrame::VehicleTypeEditor, FXGroupBox, vehicleTypeEditorMap, ARRAYNUMBER(vehicleTypeEditorMap)) - -// =========================================================================== -// method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNEVehicleTypeFrame::VehicleTypeSelector - methods -// --------------------------------------------------------------------------- - -GNEVehicleTypeFrame::VehicleTypeSelector::VehicleTypeSelector(GNEVehicleTypeFrame* vehicleTypeFrameParent) : - FXGroupBox(vehicleTypeFrameParent->myContentFrame, "Current Vehicle Type", GUIDesignGroupBoxFrame), - myVehicleTypeFrameParent(vehicleTypeFrameParent), - myCurrentVehicleType(nullptr) { - // Create FXComboBox - myTypeMatchBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SET_TYPE, GUIDesignComboBox); - // add default Vehicle an Bike types in the first and second positions - myTypeMatchBox->appendItem(DEFAULT_VTYPE_ID.c_str()); - myTypeMatchBox->appendItem(DEFAULT_BIKETYPE_ID.c_str()); - // fill myTypeMatchBox with list of VTypes IDs - for (const auto& vType : myVehicleTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) { - if ((vType->getID() != DEFAULT_VTYPE_ID) && (vType->getID() != DEFAULT_BIKETYPE_ID)) { - myTypeMatchBox->appendItem(vType->getID().c_str()); - } - } - // set DEFAULT_VEHTYPE as default VType - myCurrentVehicleType = myVehicleTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID); - // Set visible items - if (myTypeMatchBox->getNumItems() <= 20) { - myTypeMatchBox->setNumVisible((int)myTypeMatchBox->getNumItems()); - } else { - myTypeMatchBox->setNumVisible(20); - } - // VehicleTypeSelector is always shown - show(); -} - - -GNEVehicleTypeFrame::VehicleTypeSelector::~VehicleTypeSelector() {} - - -GNEDemandElement* -GNEVehicleTypeFrame::VehicleTypeSelector::getCurrentVehicleType() const { - return myCurrentVehicleType; -} - - -void -GNEVehicleTypeFrame::VehicleTypeSelector::setCurrentVehicleType(GNEDemandElement* vType) { - myCurrentVehicleType = vType; - refreshVehicleTypeSelector(); -} - - -void -GNEVehicleTypeFrame::VehicleTypeSelector::refreshVehicleTypeSelector() { - bool valid = false; - // clear items - myTypeMatchBox->clearItems(); - // add default Vehicle an Bike types in the first and second positions - myTypeMatchBox->appendItem(DEFAULT_VTYPE_ID.c_str()); - myTypeMatchBox->appendItem(DEFAULT_BIKETYPE_ID.c_str()); - // fill myTypeMatchBox with list of VTypes IDs - for (const auto& vType : myVehicleTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) { - if ((vType->getID() != DEFAULT_VTYPE_ID) && (vType->getID() != DEFAULT_BIKETYPE_ID)) { - myTypeMatchBox->appendItem(vType->getID().c_str()); - } - } - // Set visible items - if (myTypeMatchBox->getNumItems() <= 20) { - myTypeMatchBox->setNumVisible((int)myTypeMatchBox->getNumItems()); - } else { - myTypeMatchBox->setNumVisible(20); - } - // make sure that tag is in myTypeMatchBox - if (myCurrentVehicleType) { - for (int i = 0; i < (int)myTypeMatchBox->getNumItems(); i++) { - if (myTypeMatchBox->getItem(i).text() == myCurrentVehicleType->getID()) { - myTypeMatchBox->setCurrentItem(i); - valid = true; - } - } - } - // Check that give vType type is valid - if (!valid) { - // set DEFAULT_VEHTYPE as default VType - myCurrentVehicleType = myVehicleTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID); - // refresh myTypeMatchBox again - for (int i = 0; i < (int)myTypeMatchBox->getNumItems(); i++) { - if (myTypeMatchBox->getItem(i).text() == myCurrentVehicleType->getID()) { - myTypeMatchBox->setCurrentItem(i); - } - } - } - // refresh vehicle type editor modul - myVehicleTypeFrameParent->myVehicleTypeEditor->refreshVehicleTypeEditorModul(); - // set myCurrentVehicleType as inspected element - myVehicleTypeFrameParent->getViewNet()->setInspectedAttributeCarriers({myCurrentVehicleType}); - // show Attribute Editor modul - myVehicleTypeFrameParent->myVehicleTypeAttributesEditor->showAttributeEditorModul(false, true); -} - - -void -GNEVehicleTypeFrame::VehicleTypeSelector::refreshVehicleTypeSelectorIDs() { - if (myCurrentVehicleType) { - myTypeMatchBox->setItem(myTypeMatchBox->getCurrentItem(), myCurrentVehicleType->getID().c_str()); - } -} - - -long -GNEVehicleTypeFrame::VehicleTypeSelector::onCmdSelectItem(FXObject*, FXSelector, void*) { - // Check if value of myTypeMatchBox correspond of an allowed additional tags - for (const auto& vType : myVehicleTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) { - if (vType->getID() == myTypeMatchBox->getText().text()) { - // set pointer - myCurrentVehicleType = vType; - // set color of myTypeMatchBox to black (valid) - myTypeMatchBox->setTextColor(FXRGB(0, 0, 0)); - // refresh vehicle type editor modul - myVehicleTypeFrameParent->myVehicleTypeEditor->refreshVehicleTypeEditorModul(); - // set myCurrentVehicleType as inspected element - myVehicleTypeFrameParent->getViewNet()->setInspectedAttributeCarriers({myCurrentVehicleType}); - // show moduls if selected item is valid - myVehicleTypeFrameParent->myVehicleTypeAttributesEditor->showAttributeEditorModul(false, true); - // Write Warning in console if we're in testing mode - WRITE_DEBUG(("Selected item '" + myTypeMatchBox->getText() + "' in VehicleTypeSelector").text()); - return 1; - } - } - myCurrentVehicleType = nullptr; - // refresh vehicle type editor modul - myVehicleTypeFrameParent->myVehicleTypeEditor->refreshVehicleTypeEditorModul(); - // hide all moduls if selected item isn't valid - myVehicleTypeFrameParent->myVehicleTypeAttributesEditor->hideAttributesEditorModul(); - // set color of myTypeMatchBox to red (invalid) - myTypeMatchBox->setTextColor(FXRGB(255, 0, 0)); - // Write Warning in console if we're in testing mode - WRITE_DEBUG("Selected invalid item in VehicleTypeSelector"); - return 1; -} - -// --------------------------------------------------------------------------- -// GNEVehicleTypeFrame::VehicleTypeEditor - methods -// --------------------------------------------------------------------------- - -GNEVehicleTypeFrame::VehicleTypeEditor::VehicleTypeEditor(GNEVehicleTypeFrame* vehicleTypeFrameParent) : - FXGroupBox(vehicleTypeFrameParent->myContentFrame, "Vehicle Type Editor", GUIDesignGroupBoxFrame), - myVehicleTypeFrameParent(vehicleTypeFrameParent) { - // Create new vehicle type - myCreateVehicleTypeButton = new FXButton(this, "Create Vehicle Type", nullptr, this, MID_GNE_CREATE, GUIDesignButton); - // Create delete vehicle type - myDeleteVehicleTypeButton = new FXButton(this, "Delete Vehicle Type", nullptr, this, MID_GNE_DELETE, GUIDesignButton); - // Create reset vehicle type - myResetDefaultVehicleTypeButton = new FXButton(this, "Reset default Vehicle Type", nullptr, this, MID_GNE_RESET, GUIDesignButton); - // Create copy vehicle type - myCopyVehicleTypeButton = new FXButton(this, "Copy Vehicle Type", nullptr, this, MID_GNE_COPY, GUIDesignButton); -} - - -GNEVehicleTypeFrame::VehicleTypeEditor::~VehicleTypeEditor() {} - - -void -GNEVehicleTypeFrame::VehicleTypeEditor::showVehicleTypeEditorModul() { - refreshVehicleTypeEditorModul(); - show(); -} - - -void -GNEVehicleTypeFrame::VehicleTypeEditor::hideVehicleTypeEditorModul() { - hide(); -} - - -void -GNEVehicleTypeFrame::VehicleTypeEditor::refreshVehicleTypeEditorModul() { - // first check if selected VType is valid - if (myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType() == nullptr) { - // disable all buttons except create button - myDeleteVehicleTypeButton->disable(); - myResetDefaultVehicleTypeButton->disable(); - myCopyVehicleTypeButton->disable(); - } else if (GNEAttributeCarrier::parse(myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType()->getAttribute(GNE_ATTR_DEFAULT_VTYPE))) { - // enable copy button - myCopyVehicleTypeButton->enable(); - // hide delete vehicle type buttond and show reset default vehicle type button - myDeleteVehicleTypeButton->hide(); - myResetDefaultVehicleTypeButton->show(); - // check if reset default vehicle type button has to be enabled or disabled - if (GNEAttributeCarrier::parse(myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType()->getAttribute(GNE_ATTR_DEFAULT_VTYPE_MODIFIED))) { - myResetDefaultVehicleTypeButton->enable(); - } else { - myResetDefaultVehicleTypeButton->disable(); - } - } else { - // enable copy button - myCopyVehicleTypeButton->enable(); - // show delete vehicle type button and hide reset default vehicle type button - myDeleteVehicleTypeButton->show(); - myDeleteVehicleTypeButton->enable(); - myResetDefaultVehicleTypeButton->hide(); - } - // update modul - recalc(); -} - - -long -GNEVehicleTypeFrame::VehicleTypeEditor::onCmdCreateVehicleType(FXObject*, FXSelector, void*) { - // obtain a new valid Vehicle Type ID - const std::string vehicleTypeID = myVehicleTypeFrameParent->myViewNet->getNet()->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_VTYPE); - // create new vehicle type - GNEDemandElement* vehicleType = new GNEVehicleType(myVehicleTypeFrameParent->myViewNet->getNet(), vehicleTypeID, SUMO_TAG_VTYPE); - // add it using undoList (to allow undo-redo) - myVehicleTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::VTYPE, "create vehicle type"); - myVehicleTypeFrameParent->myViewNet->getUndoList()->add(new GNEChange_DemandElement(vehicleType, true), true); - myVehicleTypeFrameParent->myViewNet->getUndoList()->end(); - // set created vehicle type in selector - myVehicleTypeFrameParent->myVehicleTypeSelector->setCurrentVehicleType(vehicleType); - // refresh VehicleType Editor Modul - myVehicleTypeFrameParent->myVehicleTypeEditor->refreshVehicleTypeEditorModul(); - return 1; -} - - -long -GNEVehicleTypeFrame::VehicleTypeEditor::onCmdDeleteVehicleType(FXObject*, FXSelector, void*) { - // show question dialog if vtype has already assigned vehicles - if (myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType()->getChildDemandElements().size() > 0) { - std::string plural = myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType()->getChildDemandElements().size() == 1 ? ("") : ("s"); - // show warning in gui testing debug mode - WRITE_DEBUG("Opening FXMessageBox 'remove vType'"); - // Ask confirmation to user - FXuint answer = FXMessageBox::question(getApp(), MBOX_YES_NO, - ("Remove " + toString(SUMO_TAG_VTYPE) + "s").c_str(), "%s", - ("Delete " + toString(SUMO_TAG_VTYPE) + " '" + myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType()->getID() + - "' will remove " + toString(myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType()->getChildDemandElements().size()) + - " vehicle" + plural + ". Continue?").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 'remove vType' with 'No'"); - } else if (answer == 4) { - WRITE_DEBUG("Closed FXMessageBox 'remove vType' with 'ESC'"); - } - } else { - // begin undo list operation - myVehicleTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::VTYPE, "delete vehicle type"); - // remove vehicle type (and all of their children) - myVehicleTypeFrameParent->myViewNet->getNet()->deleteDemandElement(myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType(), - myVehicleTypeFrameParent->myViewNet->getUndoList()); - // end undo list operation - myVehicleTypeFrameParent->myViewNet->getUndoList()->end(); - } - } else { - // begin undo list operation - myVehicleTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::VTYPE, "delete vehicle type"); - // remove vehicle type (and all of their children) - myVehicleTypeFrameParent->myViewNet->getNet()->deleteDemandElement(myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType(), - myVehicleTypeFrameParent->myViewNet->getUndoList()); - // end undo list operation - myVehicleTypeFrameParent->myViewNet->getUndoList()->end(); - } - return 1; -} - - -long -GNEVehicleTypeFrame::VehicleTypeEditor::onCmdResetVehicleType(FXObject*, FXSelector, void*) { - // begin reset default vehicle type values - myVehicleTypeFrameParent->getViewNet()->getUndoList()->begin(GUIIcon::VTYPE, "reset default vehicle type values"); - // reset all values of default vehicle type - for (const auto& i : GNEAttributeCarrier::getTagProperties(SUMO_TAG_VTYPE)) { - // change all attributes with "" to reset it (except ID and vClass) - if ((i.getAttr() != SUMO_ATTR_ID) && (i.getAttr() != SUMO_ATTR_VCLASS)) { - myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType()->setAttribute(i.getAttr(), "", myVehicleTypeFrameParent->myViewNet->getUndoList()); - } - } - // change manually VClass (because it depends of Default VType) - if (myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType()->getAttribute(SUMO_ATTR_ID) == DEFAULT_VTYPE_ID) { - myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType()->setAttribute(SUMO_ATTR_VCLASS, toString(SVC_PASSENGER), myVehicleTypeFrameParent->myViewNet->getUndoList()); - } else if (myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType()->getAttribute(SUMO_ATTR_ID) == DEFAULT_BIKETYPE_ID) { - myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType()->setAttribute(SUMO_ATTR_VCLASS, toString(SVC_BICYCLE), myVehicleTypeFrameParent->myViewNet->getUndoList()); - } - // change special attribute GNE_ATTR_DEFAULT_VTYPE_MODIFIED - myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType()->setAttribute(GNE_ATTR_DEFAULT_VTYPE_MODIFIED, "false", myVehicleTypeFrameParent->myViewNet->getUndoList()); - // finish reset default vehicle type values - myVehicleTypeFrameParent->getViewNet()->getUndoList()->end(); - // refresh VehicleTypeSelector - myVehicleTypeFrameParent->myVehicleTypeSelector->refreshVehicleTypeSelector(); - return 1; -} - - -long -GNEVehicleTypeFrame::VehicleTypeEditor::onCmdCopyVehicleType(FXObject*, FXSelector, void*) { - // obtain a new valid Vehicle Type ID - const std::string vehicleTypeID = myVehicleTypeFrameParent->myViewNet->getNet()->getAttributeCarriers()->generateDemandElementID(SUMO_TAG_VTYPE); - // obtain vehicle type in which new Vehicle Type will be based - GNEVehicleType* vType = dynamic_cast(myVehicleTypeFrameParent->myVehicleTypeSelector->getCurrentVehicleType()); - // check that vType exist - if (vType) { - // create a new Vehicle Type based on the current selected vehicle type - GNEDemandElement* vehicleTypeCopy = new GNEVehicleType(myVehicleTypeFrameParent->myViewNet->getNet(), vehicleTypeID, vType); - // begin undo list operation - myVehicleTypeFrameParent->myViewNet->getUndoList()->begin(GUIIcon::VTYPE, "copy vehicle type"); - // add it using undoList (to allow undo-redo) - myVehicleTypeFrameParent->myViewNet->getUndoList()->add(new GNEChange_DemandElement(vehicleTypeCopy, true), true); - // end undo list operation - myVehicleTypeFrameParent->myViewNet->getUndoList()->end(); - // refresh Vehicle Type Selector (to show the new VType) - myVehicleTypeFrameParent->myVehicleTypeSelector->refreshVehicleTypeSelector(); - // set created vehicle type in selector - myVehicleTypeFrameParent->myVehicleTypeSelector->setCurrentVehicleType(vehicleTypeCopy); - // refresh VehicleType Editor Modul - myVehicleTypeFrameParent->myVehicleTypeEditor->refreshVehicleTypeEditorModul(); - } - return 1; -} - -// --------------------------------------------------------------------------- -// GNEVehicleTypeFrame - methods -// --------------------------------------------------------------------------- - -GNEVehicleTypeFrame::GNEVehicleTypeFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : - GNEFrame(horizontalFrameParent, viewNet, "Vehicle Types") { - - // create modul for edit vehicle types (Create, copy, etc.) - myVehicleTypeEditor = new VehicleTypeEditor(this); - - // create vehicle type selector - myVehicleTypeSelector = new VehicleTypeSelector(this); - - // Create vehicle type attributes editor - myVehicleTypeAttributesEditor = new GNEFrameAttributesModuls::AttributesEditor(this); - - // create modul for open extended attributes dialog - myAttributesEditorExtended = new GNEFrameAttributesModuls::AttributesEditorExtended(this); - - // set "VTYPE_DEFAULT" as default vehicle Type - myVehicleTypeSelector->setCurrentVehicleType(myViewNet->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID)); -} - - -GNEVehicleTypeFrame::~GNEVehicleTypeFrame() {} - - -void -GNEVehicleTypeFrame::show() { - // refresh vehicle type and Attribute Editor - myVehicleTypeSelector->refreshVehicleTypeSelector(); - // set myCurrentVehicleType as inspected element - myVehicleTypeAttributesEditor->getFrameParent()->getViewNet()->setInspectedAttributeCarriers({myVehicleTypeSelector->getCurrentVehicleType()}); - // show vehicle type attributes editor (except extended attributes) - myVehicleTypeAttributesEditor->showAttributeEditorModul(false, true); - // show frame - GNEFrame::show(); -} - - -GNEVehicleTypeFrame::VehicleTypeSelector* -GNEVehicleTypeFrame::getVehicleTypeSelector() const { - return myVehicleTypeSelector; -} - - -void -GNEVehicleTypeFrame::attributeUpdated() { - // after changing an attribute myVehicleTypeSelector, we need to update the list of vehicleTypeSelector, because ID could be changed - myVehicleTypeSelector->refreshVehicleTypeSelectorIDs(); -} - - -void -GNEVehicleTypeFrame::attributesEditorExtendedDialogOpened() { - // open vehicle type dialog - if (myVehicleTypeSelector->getCurrentVehicleType()) { - GNEVehicleTypeDialog(myVehicleTypeSelector->getCurrentVehicleType(), true); - // set myCurrentVehicleType as inspected element - myVehicleTypeAttributesEditor->getFrameParent()->getViewNet()->setInspectedAttributeCarriers({myVehicleTypeSelector->getCurrentVehicleType()}); - // call "showAttributeEditorModul" to refresh attribute list - myVehicleTypeAttributesEditor->showAttributeEditorModul(false, true); - } -} - - -/****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/frames/demand/GNEVehicleTypeFrame.h sumo-1.12.0/src/netedit/frames/demand/GNEVehicleTypeFrame.h --- sumo-1.11.0/src/netedit/frames/demand/GNEVehicleTypeFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/demand/GNEVehicleTypeFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,181 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GNEVehicleTypeFrame.h -/// @author Pablo Alvarez Lopez -/// @date Feb 2018 -/// -// The Widget for edit Vehicle Type elements -/****************************************************************************/ -#pragma once -#include - -#include - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEVehicle; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEVehicleTypeFrame - */ -class GNEVehicleTypeFrame : public GNEFrame { - -public: - - // =========================================================================== - // class VehicleTypeSelector - // =========================================================================== - - class VehicleTypeSelector : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEVehicleTypeFrame::VehicleTypeSelector) - - public: - /// @brief constructor - VehicleTypeSelector(GNEVehicleTypeFrame* vehicleTypeFrameParent); - - /// @brief destructor - ~VehicleTypeSelector(); - - /// @brief get current Vehicle Type - GNEDemandElement* getCurrentVehicleType() const; - - /// @brief set current Vehicle Type - void setCurrentVehicleType(GNEDemandElement* vType); - - /// @brief refresh vehicle type selector - void refreshVehicleTypeSelector(); - - /// @brief refresh vehicle type selector (only IDs, without refreshing attributes) - void refreshVehicleTypeSelectorIDs(); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user select another element in ComboBox - long onCmdSelectItem(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(VehicleTypeSelector) - - private: - /// @brief pointer to Frame Parent - GNEVehicleTypeFrame* myVehicleTypeFrameParent; - - /// @brief pointer to current vehicle type - GNEDemandElement* myCurrentVehicleType; - - /// @brief comboBox with the list of vTypes - FXComboBox* myTypeMatchBox; - }; - - // =========================================================================== - // class VehicleTypeEditor - // =========================================================================== - - class VehicleTypeEditor : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEVehicleTypeFrame::VehicleTypeEditor) - - public: - /// @brief constructor - VehicleTypeEditor(GNEVehicleTypeFrame* vehicleTypeFrameParent); - - /// @brief destructor - ~VehicleTypeEditor(); - - /// @brief show VehicleTypeEditor modul - void showVehicleTypeEditorModul(); - - /// @brief hide VehicleTypeEditor box - void hideVehicleTypeEditorModul(); - - /// @brief update VehicleTypeEditor modul - void refreshVehicleTypeEditorModul(); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when "Vreate Vehicle Type" button is clicked - long onCmdCreateVehicleType(FXObject*, FXSelector, void*); - - /// @brief Called when "Delete Vehicle Type" button is clicked - long onCmdDeleteVehicleType(FXObject*, FXSelector, void*); - - /// @brief Called when "Delete Vehicle Type" button is clicked - long onCmdResetVehicleType(FXObject*, FXSelector, void*); - - /// @brief Called when "Copy Vehicle Type" button is clicked - long onCmdCopyVehicleType(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(VehicleTypeEditor) - - private: - /// @brief pointer to vehicle type Frame Parent - GNEVehicleTypeFrame* myVehicleTypeFrameParent; - - /// @brief "create vehicle type" button - FXButton* myCreateVehicleTypeButton; - - /// @brief "delete vehicle type" button - FXButton* myDeleteVehicleTypeButton; - - /// @brief "delete default vehicle type" button - FXButton* myResetDefaultVehicleTypeButton; - - /// @brief "copy vehicle type" - FXButton* myCopyVehicleTypeButton; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNEVehicleTypeFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNEVehicleTypeFrame(); - - /// @brief show Frame - void show(); - - /// @brief get vehicle type selector - VehicleTypeSelector* getVehicleTypeSelector() const; - -protected: - /// @brief function called after set a valid attribute in AttributeCreator/AttributeEditor/ParametersEditor/... - void attributeUpdated(); - - /// @brief open AttributesCreator extended dialog (used for editing advance attributes of Vehicle Types) - void attributesEditorExtendedDialogOpened(); - -private: - /// @brief vehicle type selector - VehicleTypeSelector* myVehicleTypeSelector; - - /// @brief editorinternal vehicle type attributes - GNEFrameAttributesModuls::AttributesEditor* myVehicleTypeAttributesEditor; - - /// @brief modul for open extended attributes dialog - GNEFrameAttributesModuls::AttributesEditorExtended* myAttributesEditorExtended; - - /// @brief Vehicle Type editor (Create, copy, etc.) - VehicleTypeEditor* myVehicleTypeEditor; -}; diff -Nru sumo-1.11.0/src/netedit/frames/GNEFrameAttributeModules.cpp sumo-1.12.0/src/netedit/frames/GNEFrameAttributeModules.cpp --- sumo-1.11.0/src/netedit/frames/GNEFrameAttributeModules.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/GNEFrameAttributeModules.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,2707 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GNEFrameAttributeModules.cpp +/// @author Pablo Alvarez Lopez +/// @date Aug 2019 +/// +// Auxiliar class for GNEFrame Modules (only for attributes edition) +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEFrame.h" +#include "GNEFrameAttributeModules.h" + + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +FXDEFMAP(GNEFrameAttributeModules::AttributesCreatorRow) RowCreatorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEFrameAttributeModules::AttributesCreatorRow::onCmdSetAttribute), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_DIALOG, GNEFrameAttributeModules::AttributesCreatorRow::onCmdOpenAttributeDialog), +}; + +FXDEFMAP(GNEFrameAttributeModules::AttributesCreator) AttributesCreatorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_RESET, GNEFrameAttributeModules::AttributesCreator::onCmdReset), + FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEFrameAttributeModules::AttributesCreator::onCmdHelp), +}; + +FXDEFMAP(GNEFrameAttributeModules::AttributesCreatorFlow) AttributesCreatorFlowMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEFrameAttributeModules::AttributesCreatorFlow::onCmdSetFlowAttribute), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_BUTTON, GNEFrameAttributeModules::AttributesCreatorFlow::onCmdSelectFlowRadioButton), +}; + +FXDEFMAP(GNEFrameAttributeModules::AttributesEditorRow) AttributesEditorRowMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEFrameAttributeModules::AttributesEditorRow::onCmdSetAttribute), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_BOOL, GNEFrameAttributeModules::AttributesEditorRow::onCmdSelectCheckButton), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_DIALOG, GNEFrameAttributeModules::AttributesEditorRow::onCmdOpenAttributeDialog), +}; + +FXDEFMAP(GNEFrameAttributeModules::AttributesEditor) AttributesEditorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEFrameAttributeModules::AttributesEditor::onCmdAttributesEditorHelp) +}; + +FXDEFMAP(GNEFrameAttributeModules::AttributesEditorFlow) AttributesEditorFlowMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEFrameAttributeModules::AttributesEditorFlow::onCmdSetFlowAttribute), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_BUTTON, GNEFrameAttributeModules::AttributesEditorFlow::onCmdSelectFlowRadioButton), +}; + +FXDEFMAP(GNEFrameAttributeModules::AttributesEditorExtended) AttributesEditorExtendedMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_DIALOG, GNEFrameAttributeModules::AttributesEditorExtended::onCmdOpenDialog) +}; + +FXDEFMAP(GNEFrameAttributeModules::GenericDataAttributes) GenericDataAttributesMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_OPEN_PARAMETERS_DIALOG, GNEFrameAttributeModules::GenericDataAttributes::onCmdEditParameters), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEFrameAttributeModules::GenericDataAttributes::onCmdSetParameters) +}; + +FXDEFMAP(GNEFrameAttributeModules::DrawingShape) DrawingShapeMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_STARTDRAWING, GNEFrameAttributeModules::DrawingShape::onCmdStartDrawing), + FXMAPFUNC(SEL_COMMAND, MID_GNE_STOPDRAWING, GNEFrameAttributeModules::DrawingShape::onCmdStopDrawing), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ABORTDRAWING, GNEFrameAttributeModules::DrawingShape::onCmdAbortDrawing) +}; + +FXDEFMAP(GNEFrameAttributeModules::NeteditAttributes) NeteditAttributesMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEFrameAttributeModules::NeteditAttributes::onCmdSetNeteditAttribute), + FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEFrameAttributeModules::NeteditAttributes::onCmdHelp) +}; + +// Object implementation +FXIMPLEMENT(GNEFrameAttributeModules::AttributesCreatorRow, FXHorizontalFrame, RowCreatorMap, ARRAYNUMBER(RowCreatorMap)) +FXIMPLEMENT(GNEFrameAttributeModules::AttributesCreator, FXGroupBoxModule, AttributesCreatorMap, ARRAYNUMBER(AttributesCreatorMap)) +FXIMPLEMENT(GNEFrameAttributeModules::AttributesCreatorFlow, FXGroupBoxModule, AttributesCreatorFlowMap, ARRAYNUMBER(AttributesCreatorFlowMap)) +FXIMPLEMENT(GNEFrameAttributeModules::AttributesEditorRow, FXHorizontalFrame, AttributesEditorRowMap, ARRAYNUMBER(AttributesEditorRowMap)) +FXIMPLEMENT(GNEFrameAttributeModules::AttributesEditor, FXGroupBoxModule, AttributesEditorMap, ARRAYNUMBER(AttributesEditorMap)) +FXIMPLEMENT(GNEFrameAttributeModules::AttributesEditorFlow, FXGroupBoxModule, AttributesEditorFlowMap, ARRAYNUMBER(AttributesEditorFlowMap)) +FXIMPLEMENT(GNEFrameAttributeModules::AttributesEditorExtended, FXGroupBoxModule, AttributesEditorExtendedMap, ARRAYNUMBER(AttributesEditorExtendedMap)) +FXIMPLEMENT(GNEFrameAttributeModules::GenericDataAttributes, FXGroupBoxModule, GenericDataAttributesMap, ARRAYNUMBER(GenericDataAttributesMap)) +FXIMPLEMENT(GNEFrameAttributeModules::DrawingShape, FXGroupBoxModule, DrawingShapeMap, ARRAYNUMBER(DrawingShapeMap)) +FXIMPLEMENT(GNEFrameAttributeModules::NeteditAttributes, FXGroupBoxModule, NeteditAttributesMap, ARRAYNUMBER(NeteditAttributesMap)) + + +// =========================================================================== +// method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEFrameAttributeModules::AttributesCreatorRow - methods +// --------------------------------------------------------------------------- + +GNEFrameAttributeModules::AttributesCreatorRow::AttributesCreatorRow(AttributesCreator* AttributesCreatorParent, const GNEAttributeProperties& attrProperties) : + FXHorizontalFrame(AttributesCreatorParent->getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame), + myAttributesCreatorParent(AttributesCreatorParent), + myAttrProperties(attrProperties) { + // Create left visual elements + myAttributeLabel = new FXLabel(this, "name", nullptr, GUIDesignLabelAttribute); + myAttributeLabel->hide(); + myEnableAttributeCheckButton = new FXCheckButton(this, "name", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButtonAttribute); + myEnableAttributeCheckButton->hide(); + myAttributeButton = new FXButton(this, "button", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute); + myAttributeButton->hide(); + // Create right visual elements + myValueTextField = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + myValueTextField->hide(); + myValueCheckButton = new FXCheckButton(this, "Disabled", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + myValueCheckButton->hide(); + myValueComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignComboBoxAttribute); + myValueComboBox->hide(); + // only create if parent was created + if (getParent()->id()) { + // create AttributesCreatorRow + FXHorizontalFrame::create(); + // refresh row + refreshRow(); + // show AttributesCreatorRow + show(); + } +} + + +void +GNEFrameAttributeModules::AttributesCreatorRow::destroy() { + // only destroy if parent was created + if (getParent()->id()) { + FXHorizontalFrame::destroy(); + } +} + + +const GNEAttributeProperties& +GNEFrameAttributeModules::AttributesCreatorRow::getAttrProperties() const { + return myAttrProperties; +} + + +std::string +GNEFrameAttributeModules::AttributesCreatorRow::getValue() const { + if (myAttrProperties.isBool()) { + return (myValueCheckButton->getCheck() == 1) ? "1" : "0"; + } else if (myAttrProperties.isDiscrete()) { + return myValueComboBox->getText().text(); + } else { + return myValueTextField->getText().text(); + } +} + + +bool +GNEFrameAttributeModules::AttributesCreatorRow::getAttributeCheckButtonCheck() const { + if (shown()) { + return myEnableAttributeCheckButton->getCheck() == TRUE; + } else { + return false; + } +} + + +void +GNEFrameAttributeModules::AttributesCreatorRow::setAttributeCheckButtonCheck(bool value) { + if (shown()) { + // set radio button + myEnableAttributeCheckButton->setCheck(value); + // enable or disable input fields + if (value) { + if (myAttrProperties.isBool()) { + myValueCheckButton->enable(); + } else if (myAttrProperties.isDiscrete()) { + myValueComboBox->enable(); + } else { + myValueTextField->enable(); + } + } else { + if (myAttrProperties.isBool()) { + myValueCheckButton->disable(); + } else if (myAttrProperties.isDiscrete()) { + myValueComboBox->disable(); + } else { + myValueTextField->disable(); + } + } + } +} + + +void +GNEFrameAttributeModules::AttributesCreatorRow::enableAttributesCreatorRow() { + if (myAttrProperties.isBool()) { + return myValueCheckButton->enable(); + } else if (myAttrProperties.isDiscrete()) { + myValueComboBox->enable(); + } else { + return myValueTextField->enable(); + } +} + + +void +GNEFrameAttributeModules::AttributesCreatorRow::disableAttributesCreatorRow() { + if (myAttrProperties.isBool()) { + return myValueCheckButton->disable(); + } else if (myAttrProperties.isDiscrete()) { + myValueComboBox->disable(); + } else { + return myValueTextField->disable(); + } +} + + +bool +GNEFrameAttributeModules::AttributesCreatorRow::isAttributesCreatorRowEnabled() const { + if (!shown()) { + return false; + } else if (myAttrProperties.isBool()) { + return myValueCheckButton->isEnabled(); + } else if (myAttrProperties.isDiscrete()) { + return myValueComboBox->isEnabled(); + } else { + return myValueTextField->isEnabled(); + } +} + + +void +GNEFrameAttributeModules::AttributesCreatorRow::refreshRow() { + // reset invalid value + myInvalidValue.clear(); + // special case for attribute ID + if ((myAttrProperties.getAttr() == SUMO_ATTR_ID) && myAttrProperties.hasAutomaticID()) { + // show check button and disable it + myEnableAttributeCheckButton->setText(myAttrProperties.getAttrStr().c_str()); + myEnableAttributeCheckButton->setCheck(false); + myEnableAttributeCheckButton->show(); + // show text field and disable it + myValueTextField->setTextColor(FXRGB(0, 0, 0)); + myValueTextField->disable(); + // generate ID + myValueTextField->setText(generateID().c_str()); + // show textField + myValueTextField->show(); + } else { + // left + if (myAttrProperties.isColor() || (myAttrProperties.getAttr() == SUMO_ATTR_ALLOW) || (myAttrProperties.getAttr() == SUMO_ATTR_DISALLOW)) { + // show color button + myAttributeButton->setTextColor(FXRGB(0, 0, 0)); + myAttributeButton->setText(myAttrProperties.getAttrStr().c_str()); + myAttributeButton->show(); + } else if (myAttrProperties.isActivatable()) { + // show check button + myEnableAttributeCheckButton->setText(myAttrProperties.getAttrStr().c_str()); + myEnableAttributeCheckButton->show(); + // enable or disable depending of template AC + if (myAttributesCreatorParent->getCurrentTemplateAC()->isAttributeEnabled(myAttrProperties.getAttr())) { + myEnableAttributeCheckButton->setCheck(TRUE); + } else { + myEnableAttributeCheckButton->setCheck(FALSE); + } + } else { + // show label + myAttributeLabel->setText(myAttrProperties.getAttrStr().c_str()); + myAttributeLabel->show(); + } + // right + if (myAttrProperties.isBool()) { + if (GNEAttributeCarrier::parse(myAttributesCreatorParent->getCurrentTemplateAC()->getAttribute(myAttrProperties.getAttr()))) { + myValueCheckButton->setCheck(true); + myValueCheckButton->setText("true"); + } else { + myValueCheckButton->setCheck(false); + myValueCheckButton->setText("false"); + } + myValueCheckButton->show(); + // if it's associated to a label button and is disabled, then disable myValueCheckButton + if (myEnableAttributeCheckButton->shown() && (myEnableAttributeCheckButton->getCheck() == FALSE)) { + myValueCheckButton->disable(); + } + } else if (myAttrProperties.isDiscrete()) { + // fill textField + myValueComboBox->clearItems(); + for (const auto& item : myAttrProperties.getDiscreteValues()) { + myValueComboBox->appendItem(item.c_str()); + } + myValueComboBox->setNumVisible(myValueComboBox->getNumItems()); + myValueComboBox->setTextColor(FXRGB(0, 0, 0)); + myValueComboBox->setText(myAttributesCreatorParent->getCurrentTemplateAC()->getAttribute(myAttrProperties.getAttr()).c_str()); + myValueComboBox->show(); + // if it's associated to a label button and is disabled, then disable myValueTextField + if (myEnableAttributeCheckButton->shown() && (myEnableAttributeCheckButton->getCheck() == FALSE)) { + myValueComboBox->disable(); + } + } else { + myValueTextField->setTextColor(FXRGB(0, 0, 0)); + myValueTextField->setText(myAttributesCreatorParent->getCurrentTemplateAC()->getAttribute(myAttrProperties.getAttr()).c_str()); + myValueTextField->show(); + // if it's associated to a label button and is disabled, then disable myValueTextField + if (myEnableAttributeCheckButton->shown() && (myEnableAttributeCheckButton->getCheck() == FALSE)) { + myValueTextField->disable(); + } + } + } +} + + +void +GNEFrameAttributeModules::AttributesCreatorRow::disableRow() { + myAttributeLabel->disable(); + myEnableAttributeCheckButton->disable(); + myAttributeButton->disable(); + myValueTextField->disable(); + myValueComboBox->disable(); + myValueCheckButton->disable(); +} + + +bool +GNEFrameAttributeModules::AttributesCreatorRow::isAttributeValid() const { + return (myValueTextField->getTextColor() != FXRGB(255, 0, 0) && + myValueComboBox->getTextColor() != FXRGB(255, 0, 0)); +} + + +GNEFrameAttributeModules::AttributesCreator* +GNEFrameAttributeModules::AttributesCreatorRow::getAttributesCreatorParent() const { + return myAttributesCreatorParent; +} + + +long +GNEFrameAttributeModules::AttributesCreatorRow::onCmdSetAttribute(FXObject* obj, FXSelector, void*) { + // check what object was called + if (obj == myEnableAttributeCheckButton) { + if (myEnableAttributeCheckButton->getCheck()) { + // enable text field + if (myValueTextField->shown()) { + myValueTextField->enable(); + } + // enable comboBox + if (myValueComboBox->shown()) { + myValueComboBox->enable(); + } + // enable check button + if (myValueCheckButton->shown()) { + myValueCheckButton->enable(); + } + myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(myAttrProperties.getAttr(), true, -1); + } else { + // disable text field + if (myValueTextField->shown()) { + myValueTextField->disable(); + } + // disable text field + if (myValueComboBox->shown()) { + myValueComboBox->disable(); + } + // disable check button + if (myValueCheckButton->shown()) { + myValueCheckButton->disable(); + } + myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(myAttrProperties.getAttr(), false, -1); + } + } else if (obj == myValueCheckButton) { + if (myValueCheckButton->getCheck()) { + myValueCheckButton->setText("true"); + myAttributesCreatorParent->getCurrentTemplateAC()->setAttribute(myAttrProperties.getAttr(), "true"); + } else { + myValueCheckButton->setText("false"); + myAttributesCreatorParent->getCurrentTemplateAC()->setAttribute(myAttrProperties.getAttr(), "false"); + } + } else if (obj == myValueComboBox) { + // change color of text field depending of myCurrentValueValid + if (myAttributesCreatorParent->getCurrentTemplateAC()->isValid(myAttrProperties.getAttr(), myValueComboBox->getText().text())) { + // check color depending if is a default value + if (myAttrProperties.hasDefaultValue() && (myAttrProperties.getDefaultValue() == myValueComboBox->getText().text())) { + myValueComboBox->setTextColor(FXRGB(128, 128, 128)); + } else { + myValueComboBox->setTextColor(FXRGB(0, 0, 0)); + } + myValueComboBox->killFocus(); + myAttributesCreatorParent->getCurrentTemplateAC()->setAttribute(myAttrProperties.getAttr(), myValueComboBox->getText().text()); + } else { + // if value of TextField isn't valid, change their color to Red + myValueComboBox->setTextColor(FXRGB(255, 0, 0)); + } + } else if (obj == myValueTextField) { + // change color of text field depending of myCurrentValueValid + if (myAttributesCreatorParent->getCurrentTemplateAC()->isValid(myAttrProperties.getAttr(), myValueTextField->getText().text())) { + // check color depending if is a default value + if (myAttrProperties.hasDefaultValue() && (myAttrProperties.getDefaultValue() == myValueTextField->getText().text())) { + myValueTextField->setTextColor(FXRGB(128, 128, 128)); + } else { + myValueTextField->setTextColor(FXRGB(0, 0, 0)); + } + myValueTextField->killFocus(); + myAttributesCreatorParent->getCurrentTemplateAC()->setAttribute(myAttrProperties.getAttr(), myValueTextField->getText().text()); + } else { + // if value of TextField isn't valid, change their color to Red + myValueTextField->setTextColor(FXRGB(255, 0, 0)); + } + } + // Update aditional frame + update(); + return 1; +} + + +long +GNEFrameAttributeModules::AttributesCreatorRow::onCmdOpenAttributeDialog(FXObject*, FXSelector, void*) { + // continue depending of attribute + if (myAttrProperties.getAttr() == SUMO_ATTR_COLOR) { + // create FXColorDialog + FXColorDialog colordialog(this, tr("Color Dialog")); + colordialog.setTarget(this); + // If previous attribute wasn't correct, set black as default color + if (GNEAttributeCarrier::canParse(myValueTextField->getText().text())) { + colordialog.setRGBA(MFXUtils::getFXColor(GNEAttributeCarrier::parse(myValueTextField->getText().text()))); + } else { + colordialog.setRGBA(MFXUtils::getFXColor(GNEAttributeCarrier::parse(myAttrProperties.getDefaultValue()))); + } + // execute dialog to get a new color + if (colordialog.execute()) { + myValueTextField->setText(toString(MFXUtils::getRGBColor(colordialog.getRGBA())).c_str(), TRUE); + } + } else if ((myAttrProperties.getAttr() == SUMO_ATTR_ALLOW) || (myAttrProperties.getAttr() == SUMO_ATTR_DISALLOW)) { + // get allow string + std::string allow = myValueTextField->getText().text(); + // get accept changes + bool acceptChanges = false; + // opena allowDisallow dialog + GNEAllowDisallow(myAttributesCreatorParent->getFrameParent()->getViewNet(), &allow, &acceptChanges).execute(); + // continue depending of acceptChanges + if (acceptChanges) { + /// @brief Constructor (For string + myValueTextField->setText(allow.c_str(), TRUE); + } + } + return 0; +} + + +std::string +GNEFrameAttributeModules::AttributesCreatorRow::generateID() const { + // get attribute carriers + const auto& GNEAttributeCarriers = myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers(); + // continue depending of type + if (myAttrProperties.getTagPropertyParent().isShape()) { + return GNEAttributeCarriers->generateShapeID(myAttrProperties.getTagPropertyParent().getXMLTag()); + } else if (myAttrProperties.getTagPropertyParent().isAdditionalElement()) { + return GNEAttributeCarriers->generateAdditionalID(myAttrProperties.getTagPropertyParent().getTag()); + } else if (myAttrProperties.getTagPropertyParent().isDemandElement()) { + return GNEAttributeCarriers->generateDemandElementID(myAttrProperties.getTagPropertyParent().getTag()); + } else { + return ""; + } +} + + +bool +GNEFrameAttributeModules::AttributesCreatorRow::isValidID() const { + if (myAttrProperties.getTagPropertyParent().isAdditionalElement()) { + return (myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers()->retrieveAdditional( + myAttrProperties.getTagPropertyParent().getTag(), myValueTextField->getText().text(), false) == nullptr); + } else if (myAttrProperties.getTagPropertyParent().isDemandElement()) { + return (myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers()->retrieveAdditional( + myAttrProperties.getTagPropertyParent().getTag(), myValueTextField->getText().text(), false) == nullptr); + } else { + throw ProcessError("Unsuported additional ID"); + } +} + +// --------------------------------------------------------------------------- +// GNEFrameAttributeModules::AttributesCreator - methods +// --------------------------------------------------------------------------- + +GNEFrameAttributeModules::AttributesCreator::AttributesCreator(GNEFrame* frameParent) : + FXGroupBoxModule(frameParent->myContentFrame, "Internal attributes"), + myFrameParent(frameParent), + myTemplateAC(nullptr) { + // resize myAttributesCreatorRows + myAttributesCreatorRows.resize(GNEAttributeCarrier::MAXNUMBEROFATTRIBUTES, nullptr); + // create myAttributesCreatorFlow + myAttributesCreatorFlow = new AttributesCreatorFlow(this); + // create reset and help button + myFrameButtons = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + myResetButton = new FXButton(myFrameButtons, "", GUIIconSubSys::getIcon(GUIIcon::RESET), this, MID_GNE_RESET, GUIDesignButtonIcon); + new FXButton(myFrameButtons, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); +} + + +GNEFrameAttributeModules::AttributesCreator::~AttributesCreator() {} + + +void +GNEFrameAttributeModules::AttributesCreator::showAttributesCreatorModule(GNEAttributeCarrier* templateAC, const std::vector& hiddenAttributes) { + // destroy all rows + for (auto& row : myAttributesCreatorRows) { + // destroy and delete all rows + if (row != nullptr) { + row->destroy(); + delete row; + row = nullptr; + } + } + if (templateAC) { + // set current template AC and hidden attributes + myTemplateAC = templateAC; + myHiddenAttributes = hiddenAttributes; + // refresh rows (new rows will be created) + refreshRows(true); + // enable reset + myResetButton->enable(); + // show + show(); + } else { + throw ProcessError("invalid templateAC in showAttributesCreatorModule"); + } +} + + +void +GNEFrameAttributeModules::AttributesCreator::hideAttributesCreatorModule() { + // hide attributes creator flow + myAttributesCreatorFlow->hideAttributesCreatorFlowModule(); + // hide modul + hide(); +} + + +GNEFrame* +GNEFrameAttributeModules::AttributesCreator::getFrameParent() const { + return myFrameParent; +} + + +void +GNEFrameAttributeModules::AttributesCreator::getAttributesAndValues(CommonXMLStructure::SumoBaseObject* baseObject, bool includeAll) const { + // get standard parameters + for (const auto& row : myAttributesCreatorRows) { + if (row && row->getAttrProperties().getAttr() != SUMO_ATTR_NOTHING) { + const auto& attrProperties = row->getAttrProperties(); + // flag for row enabled + const bool rowEnabled = row->isAttributesCreatorRowEnabled(); + // flag for default attributes + const bool hasDefaultStaticValue = !attrProperties.hasDefaultValue() || (attrProperties.getDefaultValue() != row->getValue()); + // flag for enablitables attributes + const bool isFlowDefinitionAttribute = attrProperties.isFlowDefinition(); + // flag for optional attributes + const bool isActivatableAttribute = attrProperties.isActivatable() && row->getAttributeCheckButtonCheck(); + // check if flags configuration allow to include values + if (rowEnabled && (includeAll || hasDefaultStaticValue || isFlowDefinitionAttribute || isActivatableAttribute)) { + // add attribute depending of type + if (attrProperties.isInt()) { + const int intValue = GNEAttributeCarrier::canParse(row->getValue()) ? GNEAttributeCarrier::parse(row->getValue()) : GNEAttributeCarrier::parse(attrProperties.getDefaultValue()); + baseObject->addIntAttribute(attrProperties.getAttr(), intValue); + } else if (attrProperties.isFloat()) { + const double doubleValue = GNEAttributeCarrier::canParse(row->getValue()) ? GNEAttributeCarrier::parse(row->getValue()) : GNEAttributeCarrier::parse(attrProperties.getDefaultValue()); + baseObject->addDoubleAttribute(attrProperties.getAttr(), doubleValue); + } else if (attrProperties.isBool()) { + const bool boolValue = GNEAttributeCarrier::canParse(row->getValue()) ? GNEAttributeCarrier::parse(row->getValue()) : GNEAttributeCarrier::parse(attrProperties.getDefaultValue()); + baseObject->addBoolAttribute(attrProperties.getAttr(), boolValue); + } else if (attrProperties.isposition()) { + const Position positionValue = GNEAttributeCarrier::canParse(row->getValue()) ? GNEAttributeCarrier::parse(row->getValue()) : GNEAttributeCarrier::parse(attrProperties.getDefaultValue()); + baseObject->addPositionAttribute(attrProperties.getAttr(), positionValue); + } else if (attrProperties.isSUMOTime()) { + const SUMOTime timeValue = GNEAttributeCarrier::canParse(row->getValue()) ? GNEAttributeCarrier::parse(row->getValue()) : GNEAttributeCarrier::parse(attrProperties.getDefaultValue()); + baseObject->addTimeAttribute(attrProperties.getAttr(), timeValue); + } else if (attrProperties.isColor()) { + const RGBColor colorValue = GNEAttributeCarrier::canParse(row->getValue()) ? GNEAttributeCarrier::parse(row->getValue()) : GNEAttributeCarrier::parse(attrProperties.getDefaultValue()); + baseObject->addColorAttribute(attrProperties.getAttr(), colorValue); + } else if (attrProperties.isList()) { + if (attrProperties.isposition()) { + const PositionVector positionVectorValue = GNEAttributeCarrier::canParse(row->getValue()) ? GNEAttributeCarrier::parse(row->getValue()) : GNEAttributeCarrier::parse(attrProperties.getDefaultValue()); + baseObject->addPositionVectorAttribute(attrProperties.getAttr(), positionVectorValue); + } else { + const std::vector stringVectorValue = GNEAttributeCarrier::canParse >(row->getValue()) ? GNEAttributeCarrier::parse >(row->getValue()) : GNEAttributeCarrier::parse >(attrProperties.getDefaultValue()); + baseObject->addStringListAttribute(attrProperties.getAttr(), stringVectorValue); + } + } else { + baseObject->addStringAttribute(attrProperties.getAttr(), row->getValue()); + } + } + } + } + // add extra flow attributes (only will updated if myAttributesCreatorFlow is shown) + if (myAttributesCreatorFlow->shownAttributesCreatorFlowModule()) { + myAttributesCreatorFlow->setFlowParameters(baseObject); + } +} + + +GNEAttributeCarrier* +GNEFrameAttributeModules::AttributesCreator::getCurrentTemplateAC() const { + return myTemplateAC; +} + + +void +GNEFrameAttributeModules::AttributesCreator::showWarningMessage(std::string extra) const { + std::string errorMessage; + // show warning box if input parameters aren't invalid + if (extra.size() == 0) { + errorMessage = "Invalid input parameter of " + myTemplateAC->getTagProperty().getTagStr(); + } else { + errorMessage = "Invalid input parameter of " + myTemplateAC->getTagProperty().getTagStr() + ": " + extra; + } + // set message in status bar + myFrameParent->myViewNet->setStatusBarText(errorMessage); + // Write Warning in console if we're in testing mode + WRITE_DEBUG(errorMessage); +} + + +void +GNEFrameAttributeModules::AttributesCreator::refreshAttributesCreator() { + // just refresh row without creating new rows + if (shown() && myTemplateAC) { + refreshRows(false); + } +} + + +void +GNEFrameAttributeModules::AttributesCreator::disableAttributesCreator() { + // disable all rows + for (const auto& row : myAttributesCreatorRows) { + if (row) { + row->disableRow(); + } + } + // also disable reset + myResetButton->disable(); +} + + +bool +GNEFrameAttributeModules::AttributesCreator::areValuesValid() const { + // iterate over standar parameters + for (const auto& attribute : myTemplateAC->getTagProperty()) { + // Return false if error message of attriuve isn't empty + if (myAttributesCreatorRows.at(attribute.getPositionListed()) && !myAttributesCreatorRows.at(attribute.getPositionListed())->isAttributeValid()) { + return false; + } + } + return true; +} + + +long +GNEFrameAttributeModules::AttributesCreator::onCmdReset(FXObject*, FXSelector, void*) { + if (myTemplateAC) { + myTemplateAC->resetDefaultValues(); + refreshRows(false); + } + return 1; +} + + +long +GNEFrameAttributeModules::AttributesCreator::onCmdHelp(FXObject*, FXSelector, void*) { + // open Help attributes dialog + myFrameParent->openHelpAttributesDialog(myTemplateAC); + return 1; +} + + +void +GNEFrameAttributeModules::AttributesCreator::refreshRows(const bool createRows) { + // declare a flag to show Flow editor + bool showFlowEditor = false; + // iterate over tag attributes and create AttributesCreatorRows for every attribute + for (const auto& attribute : myTemplateAC->getTagProperty()) { + // declare falg to check conditions for show attribute + bool showAttribute = true; + // check that only non-unique attributes (except ID) are created (And depending of includeExtendedAttributes) + if (attribute.isUnique() && (attribute.getAttr() != SUMO_ATTR_ID)) { + showAttribute = false; + } + // check if attribute must stay hidden + if (std::find(myHiddenAttributes.begin(), myHiddenAttributes.end(), attribute.getAttr()) != myHiddenAttributes.end()) { + showAttribute = false; + } + // check if attribute is a flow definitionattribute + if (attribute.isFlowDefinition()) { + showAttribute = false; + showFlowEditor = true; + } + // check special case for vaporizer IDs + if ((attribute.getAttr() == SUMO_ATTR_ID) && (attribute.getTagPropertyParent().getTag() == SUMO_TAG_VAPORIZER)) { + showAttribute = false; + } + // check special case for VType IDs in vehicle Frame + if ((attribute.getAttr() == SUMO_ATTR_TYPE) && (myFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand()) && + (myFrameParent->getViewNet()->getEditModes().demandEditMode == DemandEditMode::DEMAND_VEHICLE)) { + showAttribute = false; + } + // show attribute depending of showAttribute flag + if (showAttribute) { + // check if we have to create a new row + if (createRows) { + myAttributesCreatorRows.at(attribute.getPositionListed()) = new AttributesCreatorRow(this, attribute); + } else { + myAttributesCreatorRows.at(attribute.getPositionListed())->refreshRow(); + } + } + } + // reparent help button (to place it at bottom) + myFrameButtons->reparent(getCollapsableFrame()); + // recalc + recalc(); + // check if flow editor has to be shown + if (showFlowEditor) { + myAttributesCreatorFlow->showAttributesCreatorFlowModule(); + } else { + myAttributesCreatorFlow->hideAttributesCreatorFlowModule(); + } +} + +// --------------------------------------------------------------------------- +// GNEFrameAttributeModules::AttributesCreatorFlow - methods +// --------------------------------------------------------------------------- + +GNEFrameAttributeModules::AttributesCreatorFlow::AttributesCreatorFlow(AttributesCreator* attributesCreatorParent) : + FXGroupBoxModule(attributesCreatorParent->getFrameParent()->myContentFrame, "Flow attributes"), + myAttributesCreatorParent(attributesCreatorParent) { + // declare auxiliar horizontal frame + FXHorizontalFrame* auxiliarHorizontalFrame = nullptr; + // create elements for end attribute + auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + myAttributeEndRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_END).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); + myValueEndTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + // create elements for number attribute + auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + myAttributeNumberRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_NUMBER).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); + myValueNumberTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + // create elements for vehsPerHour attribute + auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + myAttributeVehsPerHourRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_VEHSPERHOUR).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); + myValueVehsPerHourTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + // create elements for period attribute + auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + myAttributePeriodRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PERIOD).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); + myValuePeriodTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + // create elements for Probability attribute + auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + myAttributeProbabilityRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PROB).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); + myValueProbabilityTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); +} + + +GNEFrameAttributeModules::AttributesCreatorFlow::~AttributesCreatorFlow() {} + + +void +GNEFrameAttributeModules::AttributesCreatorFlow::showAttributesCreatorFlowModule() { + // update per hour attr + if (myAttributesCreatorParent->getCurrentTemplateAC()->getTagProperty().hasAttribute(SUMO_ATTR_PERSONSPERHOUR)) { + myPerHourAttr = SUMO_ATTR_PERSONSPERHOUR; + } else if (myAttributesCreatorParent->getCurrentTemplateAC()->getTagProperty().hasAttribute(SUMO_ATTR_CONTAINERSPERHOUR)) { + myPerHourAttr = SUMO_ATTR_CONTAINERSPERHOUR; + } else { + myPerHourAttr = SUMO_ATTR_VEHSPERHOUR; + } + // refresh + refreshAttributesCreatorFlow(); + // show + show(); +} + + +void +GNEFrameAttributeModules::AttributesCreatorFlow::hideAttributesCreatorFlowModule() { + hide(); +} + + +bool +GNEFrameAttributeModules::AttributesCreatorFlow::shownAttributesCreatorFlowModule() const { + return shown(); +} + + +void +GNEFrameAttributeModules::AttributesCreatorFlow::refreshAttributesCreatorFlow() { + const auto flow = myAttributesCreatorParent->getCurrentTemplateAC(); + // End + myValueEndTextField->setText(flow->getAttribute(SUMO_ATTR_END).c_str()); + if (flow->isAttributeEnabled(SUMO_ATTR_END)) { + myAttributeEndRadioButton->setCheck(true); + myValueEndTextField->enable(); + } else { + myAttributeEndRadioButton->setCheck(false); + myValueEndTextField->disable(); + } + // Number + myValueNumberTextField->setText(flow->getAttribute(SUMO_ATTR_NUMBER).c_str()); + if (flow->isAttributeEnabled(SUMO_ATTR_NUMBER)) { + myAttributeNumberRadioButton->setCheck(true); + myValueNumberTextField->enable(); + } else { + myAttributeNumberRadioButton->setCheck(false); + myValueNumberTextField->disable(); + } + // per hour + myAttributeVehsPerHourRadioButton->setText(toString(myPerHourAttr).c_str()); + myValueVehsPerHourTextField->setText(flow->getAttribute(myPerHourAttr).c_str()); + if (flow->isAttributeEnabled(myPerHourAttr)) { + myAttributeVehsPerHourRadioButton->setCheck(true); + myValueVehsPerHourTextField->enable(); + } else { + myAttributeVehsPerHourRadioButton->setCheck(false); + myValueVehsPerHourTextField->disable(); + } + // Period + myValuePeriodTextField->setText(flow->getAttribute(SUMO_ATTR_PERIOD).c_str()); + if (flow->isAttributeEnabled(SUMO_ATTR_PERIOD)) { + myAttributePeriodRadioButton->setCheck(true); + myValuePeriodTextField->enable(); + } else { + myAttributePeriodRadioButton->setCheck(false); + myValuePeriodTextField->disable(); + } + // Probability + myValueProbabilityTextField->setText(flow->getAttribute(SUMO_ATTR_PROB).c_str()); + if (flow->isAttributeEnabled(SUMO_ATTR_PROB)) { + myAttributeProbabilityRadioButton->setCheck(true); + myValueProbabilityTextField->enable(); + } else { + myAttributeProbabilityRadioButton->setCheck(false); + myValueProbabilityTextField->disable(); + } +} + + +void +GNEFrameAttributeModules::AttributesCreatorFlow::setFlowParameters(CommonXMLStructure::SumoBaseObject* baseObject) { + // end + if (myValueEndTextField->isEnabled()) { + baseObject->addDoubleAttribute(SUMO_ATTR_END, GNEAttributeCarrier::parse(myValueEndTextField->getText().text())); + } + // number + if (myValueNumberTextField->isEnabled()) { + baseObject->addIntAttribute(SUMO_ATTR_NUMBER, GNEAttributeCarrier::parse(myValueNumberTextField->getText().text())); + } + // per hour + if (myValueVehsPerHourTextField->isEnabled()) { + baseObject->addIntAttribute(myPerHourAttr, GNEAttributeCarrier::parse(myValueNumberTextField->getText().text())); + } + if (myValuePeriodTextField->isEnabled()) { + baseObject->addDoubleAttribute(SUMO_ATTR_PERIOD, GNEAttributeCarrier::parse(myValuePeriodTextField->getText().text())); + } + if (myValueProbabilityTextField->isEnabled()) { + baseObject->addDoubleAttribute(SUMO_ATTR_PROB, GNEAttributeCarrier::parse(myValueProbabilityTextField->getText().text())); + } +} + + +void +GNEFrameAttributeModules::AttributesCreatorFlow::showWarningMessage(std::string extra) const { + std::string errorMessage; + // show warning box if input parameters aren't invalid + if (extra.size() == 0) { + errorMessage = "Invalid input parameter of " + myAttributesCreatorParent->getCurrentTemplateAC()->getTagProperty().getTagStr(); + } else { + errorMessage = "Invalid input parameter of " + myAttributesCreatorParent->getCurrentTemplateAC()->getTagProperty().getTagStr() + ": " + extra; + } + // set message in status bar + myAttributesCreatorParent->getFrameParent()->myViewNet->setStatusBarText(errorMessage); + // Write Warning in console if we're in testing mode + WRITE_DEBUG(errorMessage); +} + + +bool +GNEFrameAttributeModules::AttributesCreatorFlow::areValuesValid() const { + // check every flow attribute + if (myValueEndTextField->isEnabled() && (myValueEndTextField->getTextColor() == FXRGB(255, 0, 0))) { + return false; + } + if (myValueNumberTextField->isEnabled() && (myValueNumberTextField->getTextColor() == FXRGB(255, 0, 0))) { + return false; + } + if (myValueVehsPerHourTextField->isEnabled() && (myValueVehsPerHourTextField->getTextColor() == FXRGB(255, 0, 0))) { + return false; + } + if (myValuePeriodTextField->isEnabled() && (myValuePeriodTextField->getTextColor() == FXRGB(255, 0, 0))) { + return false; + } + if (myValueProbabilityTextField->isEnabled() && (myValueProbabilityTextField->getTextColor() == FXRGB(255, 0, 0))) { + return false; + } + return true; +} + + +long +GNEFrameAttributeModules::AttributesCreatorFlow::onCmdSetFlowAttribute(FXObject* obj, FXSelector, void*) { + // obtain clicked textfield + FXTextField* textField = nullptr; + SumoXMLAttr attr = SUMO_ATTR_NOTHING; + // check what text field was pressed + if (obj == myValueEndTextField) { + textField = myValueEndTextField; + attr = SUMO_ATTR_END; + } else if (obj == myValueNumberTextField) { + textField = myValueNumberTextField; + attr = SUMO_ATTR_NUMBER; + } else if (obj == myValueVehsPerHourTextField) { + textField = myValueVehsPerHourTextField; + attr = myPerHourAttr; + } else if (obj == myValuePeriodTextField) { + textField = myValuePeriodTextField; + attr = SUMO_ATTR_PERIOD; + } else if (obj == myValueProbabilityTextField) { + textField = myValueProbabilityTextField; + attr = SUMO_ATTR_PROB; + } else { + throw ProcessError("Invalid text field"); + } + // check if value is valid + if (myAttributesCreatorParent->getCurrentTemplateAC()->isValid(attr, textField->getText().text())) { + textField->setTextColor(FXRGB(0, 0, 0)); + } else { + textField->setTextColor(FXRGB(255, 0, 0)); + } + textField->killFocus(); + return 1; +} + + +long +GNEFrameAttributeModules::AttributesCreatorFlow::onCmdSelectFlowRadioButton(FXObject* obj, FXSelector, void*) { + // get previous parameters + const int previousParameters = GNEAttributeCarrier::parse(myAttributesCreatorParent->getCurrentTemplateAC()->getAttribute(GNE_ATTR_FLOWPARAMETERS)); + // check what check button was pressed + if (obj == myAttributeEndRadioButton) { + myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(SUMO_ATTR_END, true, previousParameters); + } else if (obj == myAttributeNumberRadioButton) { + myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(SUMO_ATTR_NUMBER, true, previousParameters); + } else if (obj == myAttributeVehsPerHourRadioButton) { + myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(SUMO_ATTR_VEHSPERHOUR, true, previousParameters); + } else if (obj == myAttributePeriodRadioButton) { + myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(SUMO_ATTR_PERIOD, true, previousParameters); + } else if (obj == myAttributeProbabilityRadioButton) { + myAttributesCreatorParent->getCurrentTemplateAC()->toogleAttribute(SUMO_ATTR_PROB, true, previousParameters); + } else { + throw ProcessError("Invalid Radio Button"); + } + // refresh attributes + refreshAttributesCreatorFlow(); + return 1; +} + +// --------------------------------------------------------------------------- +// GNEFrameAttributeModules::AttributesEditorRow - methods +// --------------------------------------------------------------------------- + +GNEFrameAttributeModules::AttributesEditorRow::AttributesEditorRow(GNEFrameAttributeModules::AttributesEditor* attributeEditorParent, const GNEAttributeProperties& ACAttr, + const std::string& value, const bool attributeEnabled, const bool computed) : + FXHorizontalFrame(attributeEditorParent->getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame), + myAttributesEditorParent(attributeEditorParent), + myACAttr(ACAttr), + myMultiple(GNEAttributeCarrier::parse>(value).size() > 1) { + // Create and hide label + myAttributeLabel = new FXLabel(this, "attributeLabel", nullptr, GUIDesignLabelAttribute); + myAttributeLabel->hide(); + // Create and hide check button + myAttributeCheckButton = new FXCheckButton(this, "attributeCheckButton", this, MID_GNE_SET_ATTRIBUTE_BOOL, GUIDesignCheckButtonAttribute); + myAttributeCheckButton->hide(); + // Create and hide ButtonCombinableChoices + myAttributeButtonCombinableChoices = new FXButton(this, "attributeButtonCombinableChoices", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute); + myAttributeButtonCombinableChoices->hide(); + // create and hidde color editor + myAttributeColorButton = new FXButton(this, "attributeColorButton", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute); + myAttributeColorButton->hide(); + // Create and hide textField for string attributes + myValueTextField = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + myValueTextField->hide(); + // Create and hide ComboBox + myValueComboBoxChoices = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignComboBoxAttribute); + myValueComboBoxChoices->hide(); + // Create and hide checkButton + myValueCheckButton = new FXCheckButton(this, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + myValueCheckButton->hide(); + // only create if parent was created + if (getParent()->id()) { + // create AttributesEditorRow + FXHorizontalFrame::create(); + // start enabling all elements, depending if attribute is enabled + if (attributeEnabled == false) { + myValueTextField->disable(); + myValueComboBoxChoices->disable(); + myValueCheckButton->disable(); + } else { + myValueTextField->enable(); + myValueComboBoxChoices->enable(); + myValueCheckButton->enable(); + } + // if Tag correspond to an network element but we're in demand mode (or vice versa), disable all elements + if (myACAttr.getAttr() != SUMO_ATTR_NOTHING) { + if (isSupermodeValid(myAttributesEditorParent->getFrameParent()->myViewNet, myACAttr)) { + myAttributeButtonCombinableChoices->enable(); + myAttributeColorButton->enable(); + myAttributeCheckButton->enable(); + } else { + myAttributeColorButton->disable(); + myAttributeCheckButton->disable(); + myValueTextField->disable(); + myValueComboBoxChoices->disable(); + myValueCheckButton->disable(); + myAttributeButtonCombinableChoices->disable(); + } + } + // set left column + if (myACAttr.isColor()) { + // show color button and set color text depending of computed + if (computed) { + myAttributeColorButton->setTextColor(FXRGB(0, 0, 255)); + } else { + myAttributeColorButton->setTextColor(FXRGB(0, 0, 0)); + } + myAttributeColorButton->setText(myACAttr.getAttrStr().c_str()); + myAttributeColorButton->show(); + } else if ((myACAttr.getAttr() == SUMO_ATTR_ALLOW) || (myACAttr.getAttr() == SUMO_ATTR_DISALLOW)) { + myAttributeButtonCombinableChoices->setText(myACAttr.getAttrStr().c_str()); + myAttributeButtonCombinableChoices->show(); + } else if (myACAttr.isActivatable()) { + // show checkbox button and set color text depending of computed + if (computed) { + myAttributeCheckButton->setTextColor(FXRGB(0, 0, 255)); + } else { + myAttributeCheckButton->setTextColor(FXRGB(0, 0, 0)); + } + myAttributeCheckButton->setText(myACAttr.getAttrStr().c_str()); + myAttributeCheckButton->show(); + // check or uncheck depending of attributeEnabled + if (attributeEnabled) { + myAttributeCheckButton->setCheck(TRUE); + } else { + myAttributeCheckButton->setCheck(FALSE); + } + } else { + // Show attribute Label + myAttributeLabel->setText(myACAttr.getAttrStr().c_str()); + myAttributeLabel->show(); + } + // Set field depending of the type of value + if (myACAttr.isBool()) { + // first we need to check if all boolean values are equal + bool allBooleanValuesEqual = true; + // declare boolean vector + std::vector booleanVector; + // check if value can be parsed to a boolean vector + if (GNEAttributeCarrier::canParse >(value)) { + booleanVector = GNEAttributeCarrier::parse >(value); + } + // iterate over pased booleans comparing all element with the first + for (const auto& booleanValue : booleanVector) { + if (booleanValue != booleanVector.front()) { + allBooleanValuesEqual = false; + } + } + // use checkbox or textfield depending if all booleans are equal + if (allBooleanValuesEqual) { + // set check button + if ((booleanVector.size() > 0) && booleanVector.front()) { + myValueCheckButton->setCheck(true); + myValueCheckButton->setText("true"); + } else { + myValueCheckButton->setCheck(false); + myValueCheckButton->setText("false"); + } + // show check button + myValueCheckButton->show(); + } else { + // show list of bools (0 1) + myValueTextField->setText(value.c_str()); + // set text depending of computed + if (computed) { + myValueTextField->setTextColor(FXRGB(0, 0, 255)); + } else { + myValueTextField->setTextColor(FXRGB(0, 0, 0)); + } + myValueTextField->show(); + } + } else if (myACAttr.isDiscrete()) { + // Check if are VClasses + if ((myACAttr.getDiscreteValues().size() > 0) && myACAttr.isVClasses()) { + // hide label + myAttributeLabel->hide(); + // Show button combinable choices + myAttributeButtonCombinableChoices->setText(myACAttr.getAttrStr().c_str()); + myAttributeButtonCombinableChoices->show(); + // Show string with the values + myValueTextField->setText(value.c_str()); + // set color depending of computed + if (computed) { + myValueTextField->setTextColor(FXRGB(0, 0, 255)); + } else { + myValueTextField->setTextColor(FXRGB(0, 0, 0)); + } + myValueTextField->show(); + } else if (!myMultiple) { + // fill comboBox + myValueComboBoxChoices->clearItems(); + for (const auto& discreteValue : myACAttr.getDiscreteValues()) { + myValueComboBoxChoices->appendItem(discreteValue.c_str()); + } + // show combo box with values + myValueComboBoxChoices->setNumVisible((int)myACAttr.getDiscreteValues().size()); + myValueComboBoxChoices->setCurrentItem(myValueComboBoxChoices->findItem(value.c_str())); + // set color depending of computed + if (computed) { + myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 255)); + } else { + myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0)); + } + myValueComboBoxChoices->show(); + } else { + // represent combinable choices in multiple selections always with a textfield instead with a comboBox + myValueTextField->setText(value.c_str()); + // set color depending of computed + if (computed) { + myValueTextField->setTextColor(FXRGB(0, 0, 255)); + } else { + myValueTextField->setTextColor(FXRGB(0, 0, 0)); + } + myValueTextField->show(); + } + } else { + // In any other case (String, list, etc.), show value as String + myValueTextField->setText(value.c_str()); + // set color depending of computed + if (computed) { + myValueTextField->setTextColor(FXRGB(0, 0, 255)); + } else { + myValueTextField->setTextColor(FXRGB(0, 0, 0)); + } + myValueTextField->show(); + } + // Show AttributesEditorRow + show(); + } +} + + +void +GNEFrameAttributeModules::AttributesEditorRow::destroy() { + // only destroy if parent was created + if (getParent()->id()) { + FXHorizontalFrame::destroy(); + } +} + + +void +GNEFrameAttributeModules::AttributesEditorRow::refreshAttributesEditorRow(const std::string& value, + const bool forceRefresh, const bool attributeEnabled, const bool computed) { + // start enabling all elements, depending if attribute is enabled + if (attributeEnabled == false) { + myValueTextField->disable(); + myValueComboBoxChoices->disable(); + myValueCheckButton->disable(); + } else { + myValueTextField->enable(); + myValueComboBoxChoices->enable(); + myValueCheckButton->enable(); + } + // if Tag correspond to an network element but we're in demand mode (or vice versa), disable all elements + if (myACAttr.getAttr() != SUMO_ATTR_NOTHING) { + if (isSupermodeValid(myAttributesEditorParent->getFrameParent()->myViewNet, myACAttr)) { + myAttributeButtonCombinableChoices->enable(); + myAttributeColorButton->enable(); + myAttributeCheckButton->enable(); + } else { + myAttributeColorButton->disable(); + myAttributeCheckButton->disable(); + myValueTextField->disable(); + myValueComboBoxChoices->disable(); + myValueCheckButton->disable(); + myAttributeButtonCombinableChoices->disable(); + } + } + // set check buton + if (myAttributeCheckButton->shown()) { + myAttributeCheckButton->setCheck(attributeEnabled); + } + if (myValueTextField->shown()) { + // set last valid value and restore color if onlyValid is disabled + if (myValueTextField->getTextColor() == FXRGB(0, 0, 0) || myValueTextField->getTextColor() == FXRGB(0, 0, 255) || forceRefresh) { + myValueTextField->setText(value.c_str()); + // set blue color if is an computed value + if (computed) { + myValueTextField->setTextColor(FXRGB(0, 0, 255)); + } else { + myValueTextField->setTextColor(FXRGB(0, 0, 0)); + } + } + } else if (myValueComboBoxChoices->shown()) { + // fill comboBox again + myValueComboBoxChoices->clearItems(); + for (const auto& discreteValue : myACAttr.getDiscreteValues()) { + myValueComboBoxChoices->appendItem(discreteValue.c_str()); + } + // show combo box with values + myValueComboBoxChoices->setNumVisible((int)myACAttr.getDiscreteValues().size()); + myValueComboBoxChoices->setCurrentItem(myValueComboBoxChoices->findItem(value.c_str())); + // set blue color if is an computed value + if (computed) { + myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 255)); + } else { + myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0)); + } + myValueComboBoxChoices->show(); + } else if (myValueCheckButton->shown()) { + if (GNEAttributeCarrier::canParse(value)) { + myValueCheckButton->setCheck(GNEAttributeCarrier::parse(value)); + } else { + myValueCheckButton->setCheck(false); + } + } +} + + +bool +GNEFrameAttributeModules::AttributesEditorRow::isAttributesEditorRowValid() const { + return ((myValueTextField->getTextColor() == FXRGB(0, 0, 0)) || (myValueTextField->getTextColor() == FXRGB(0, 0, 255))) && + ((myValueComboBoxChoices->getTextColor() == FXRGB(0, 0, 0)) || (myValueComboBoxChoices->getTextColor() == FXRGB(0, 0, 255))); +} + + +long +GNEFrameAttributeModules::AttributesEditorRow::onCmdOpenAttributeDialog(FXObject* obj, FXSelector, void*) { + const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers(); + if (obj == myAttributeColorButton) { + // create FXColorDialog + FXColorDialog colordialog(this, tr("Color Dialog")); + colordialog.setTarget(this); + // If previous attribute wasn't correct, set black as default color + if (GNEAttributeCarrier::canParse(myValueTextField->getText().text())) { + colordialog.setRGBA(MFXUtils::getFXColor(GNEAttributeCarrier::parse(myValueTextField->getText().text()))); + } else if (!myACAttr.getDefaultValue().empty()) { + colordialog.setRGBA(MFXUtils::getFXColor(GNEAttributeCarrier::parse(myACAttr.getDefaultValue()))); + } else { + colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::BLACK)); + } + // execute dialog to get a new color + if (colordialog.execute()) { + std::string newValue = toString(MFXUtils::getRGBColor(colordialog.getRGBA())); + myValueTextField->setText(newValue.c_str()); + if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->isValid(myACAttr.getAttr(), newValue)) { + // if its valid for the first AC than its valid for all (of the same type) + if (ACs.size() > 1) { + myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(ACs.front()->getTagProperty().getGUIIcon(), "Change multiple attributes"); + } + // Set new value of attribute in all selected ACs + for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { + inspectedAC->setAttribute(myACAttr.getAttr(), newValue, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()); + } + // If previously value was incorrect, change font color to black + myValueTextField->setTextColor(FXRGB(0, 0, 0)); + myValueTextField->killFocus(); + } + } + return 0; + } else if (obj == myAttributeButtonCombinableChoices) { + // if its valid for the first AC than its valid for all (of the same type) + if (ACs.size() > 1) { + myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(ACs.front()->getTagProperty().getGUIIcon(), "Change multiple attributes"); + } + // get attribute to modify + SumoXMLAttr modifiedAttr = myACAttr.getAttr() == SUMO_ATTR_DISALLOW ? SUMO_ATTR_ALLOW : myACAttr.getAttr(); + // declare accept changes + bool acceptChanges = false; + // open GNEAllowDisallow (also used to modify SUMO_ATTR_CHANGE_LEFT etc + GNEAllowDisallow(myAttributesEditorParent->getFrameParent()->myViewNet, myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front(), modifiedAttr, &acceptChanges).execute(); + // continue depending of acceptChanges + if (acceptChanges) { + std::string allowed = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(modifiedAttr); + // Set new value of attribute in all selected ACs + for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { + inspectedAC->setAttribute(modifiedAttr, allowed, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()); + } + // finish change multiple attributes + if (ACs.size() > 1) { + myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->end(); + } + // update frame parent after attribute sucesfully set + myAttributesEditorParent->getFrameParent()->attributeUpdated(); + } + return 1; + } else { + throw ProcessError("Invalid call to onCmdOpenAttributeDialog"); + } +} + + +long +GNEFrameAttributeModules::AttributesEditorRow::onCmdSetAttribute(FXObject*, FXSelector, void*) { + // Declare changed value + std::string newVal; + // First, obtain the string value of the new attribute depending of their type + if (myACAttr.isBool()) { + // first check if we're editing boolean as a list of string or as a checkbox + if (myValueCheckButton->shown()) { + // Set true o false depending of the checkBox + if (myValueCheckButton->getCheck()) { + myValueCheckButton->setText("true"); + newVal = "true"; + } else { + myValueCheckButton->setText("false"); + newVal = "false"; + } + } else { + // obtain boolean value of myValueTextField (because we're inspecting multiple attribute carriers with different values) + newVal = myValueTextField->getText().text(); + } + } else if (myACAttr.isDiscrete()) { + // Check if are VClasses + if ((myACAttr.getDiscreteValues().size() > 0) && myACAttr.isVClasses()) { + // Get value obtained using AttributesEditor + newVal = myValueTextField->getText().text(); + } else if (!myMultiple) { + // Get value of ComboBox + newVal = myValueComboBoxChoices->getText().text(); + } else { + // due this is a multiple selection, obtain value of myValueTextField instead of comboBox + newVal = myValueTextField->getText().text(); + } + } else { + // Check if default value of attribute must be set + if (myValueTextField->getText().empty() && myACAttr.hasDefaultValue()) { + newVal = myACAttr.getDefaultValue(); + myValueTextField->setText(newVal.c_str()); + } else if (myACAttr.isInt() && GNEAttributeCarrier::canParse(myValueTextField->getText().text())) { + // filter int attributes + double doubleValue = GNEAttributeCarrier::parse(myValueTextField->getText().text()); + // check if myValueTextField has to be updated + if ((doubleValue - (int)doubleValue) == 0) { + newVal = toString((int)doubleValue); + myValueTextField->setText(newVal.c_str(), FALSE); + } + } else if ((myACAttr.getAttr() == SUMO_ATTR_ANGLE) && GNEAttributeCarrier::canParse(myValueTextField->getText().text())) { + // filter angle + double angle = GNEAttributeCarrier::parse(myValueTextField->getText().text()); + // filter if angle isn't between [0,360] + if ((angle < 0) || (angle > 360)) { + // apply modul + angle = fmod(angle, 360); + } + // set newVal + newVal = toString(angle); + // update Textfield + myValueTextField->setText(newVal.c_str(), FALSE); + } else { + // obtain value of myValueTextField + newVal = myValueTextField->getText().text(); + } + } + // we need a extra check for Position and Shape Values, due #2658 + if ((myACAttr.getAttr() == SUMO_ATTR_POSITION) || (myACAttr.getAttr() == SUMO_ATTR_SHAPE)) { + newVal = stripWhitespaceAfterComma(newVal); + } + // get inspected ACs (for code cleaning) + const auto& inspectedACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers(); + // Check if attribute must be changed + if ((inspectedACs.size() > 0) && inspectedACs.front()->isValid(myACAttr.getAttr(), newVal)) { + // check if we're merging junction + if (!mergeJunction(myACAttr.getAttr(), inspectedACs, newVal)) { + // if its valid for the first AC than its valid for all (of the same type) + if (inspectedACs.size() > 1) { + myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(inspectedACs.front()->getTagProperty().getGUIIcon(), "Change multiple attributes"); + } else if (myACAttr.getAttr() == SUMO_ATTR_ID) { + // IDs attribute has to be encapsulated + myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(inspectedACs.front()->getTagProperty().getGUIIcon(), "change " + myACAttr.getTagPropertyParent().getTagStr() + " attribute"); + } + // Set new value of attribute in all selected ACs + for (const auto& inspectedAC : inspectedACs) { + inspectedAC->setAttribute(myACAttr.getAttr(), newVal, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()); + } + // finish change multiple attributes or ID Attributes + if (inspectedACs.size() > 1) { + myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->end(); + } else if (myACAttr.getAttr() == SUMO_ATTR_ID) { + myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->end(); + } + // If previously value was incorrect, change font color to black + if (myACAttr.isVClasses()) { + myValueTextField->setTextColor(FXRGB(0, 0, 0)); + myValueTextField->killFocus(); + // in this case, we need to refresh the other values (For example, allow/Disallow objects) + myAttributesEditorParent->refreshAttributeEditor(false, false); + } else if (myACAttr.isDiscrete()) { + myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0)); + myValueComboBoxChoices->killFocus(); + } else if (myValueTextField != nullptr) { + myValueTextField->setTextColor(FXRGB(0, 0, 0)); + myValueTextField->killFocus(); + } + // update frame parent after attribute sucesfully set + myAttributesEditorParent->getFrameParent()->attributeUpdated(); + } + } else { + // If value of TextField isn't valid, change color to Red depending of type + if (myACAttr.isVClasses()) { + myValueTextField->setTextColor(FXRGB(255, 0, 0)); + myValueTextField->killFocus(); + } else if (myACAttr.isDiscrete()) { + myValueComboBoxChoices->setTextColor(FXRGB(255, 0, 0)); + myValueComboBoxChoices->killFocus(); + } else if (myValueTextField != nullptr) { + myValueTextField->setTextColor(FXRGB(255, 0, 0)); + } + // Write Warning in console if we're in testing mode + WRITE_DEBUG("Value '" + newVal + "' for attribute " + myACAttr.getAttrStr() + " of " + myACAttr.getTagPropertyParent().getTagStr() + " isn't valid"); + } + return 1; +} + + +long +GNEFrameAttributeModules::AttributesEditorRow::onCmdSelectCheckButton(FXObject*, FXSelector, void*) { + const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers(); + // obtain undoList (To improve code legibly) + GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList(); + // check if we have to enable or disable + if (myAttributeCheckButton->getCheck()) { + // enable input values + myValueCheckButton->enable(); + myValueTextField->enable(); + // enable attribute + undoList->begin(ACs.front()->getTagProperty().getGUIIcon(), "enable attribute '" + myACAttr.getAttrStr() + "'"); + ACs.front()->enableAttribute(myACAttr.getAttr(), undoList); + undoList->end(); + } else { + // disable input values + myValueCheckButton->disable(); + myValueTextField->disable(); + // disable attribute + undoList->begin(ACs.front()->getTagProperty().getGUIIcon(), "disable attribute '" + myACAttr.getAttrStr() + "'"); + ACs.front()->disableAttribute(myACAttr.getAttr(), undoList); + undoList->end(); + } + return 0; +} + + +GNEFrameAttributeModules::AttributesEditorRow::AttributesEditorRow() : + myAttributesEditorParent(nullptr), + myMultiple(false) { +} + + +std::string +GNEFrameAttributeModules::AttributesEditorRow::stripWhitespaceAfterComma(const std::string& stringValue) { + std::string result(stringValue); + while (result.find(", ") != std::string::npos) { + result = StringUtils::replace(result, ", ", ","); + } + return result; +} + + +bool +GNEFrameAttributeModules::AttributesEditorRow::mergeJunction(SumoXMLAttr attr, const std::vector& inspectedACs, const std::string& newVal) const { + // check if we're editing junction position + if ((inspectedACs.size() == 1) && (inspectedACs.front()->getTagProperty().getTag() == SUMO_TAG_JUNCTION) && (attr == SUMO_ATTR_POSITION)) { + // retrieve original junction + GNEJunction* movedJunction = myAttributesEditorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers()->retrieveJunction(inspectedACs.front()->getID()); + // parse position + const Position newPosition = GNEAttributeCarrier::parse(newVal); + // iterate over network junction + for (const auto& junction : myAttributesEditorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers()->getJunctions()) { + // check distance position + if ((junction.second->getPositionInView().distanceTo2D(newPosition) < POSITION_EPS) && + myAttributesEditorParent->getFrameParent()->getViewNet()->mergeJunctions(movedJunction, junction.second)) { + return true; + } + } + } + // nothing to merge + return false; +} + +// --------------------------------------------------------------------------- +// GNEFrameAttributeModules::AttributesEditor - methods +// --------------------------------------------------------------------------- + +GNEFrameAttributeModules::AttributesEditor::AttributesEditor(GNEFrame* FrameParent) : + FXGroupBoxModule(FrameParent->myContentFrame, "Internal attributes"), + myFrameParent(FrameParent), + myIncludeExtended(true) { + // resize myAttributesEditorRows + myAttributesEditorRows.resize(GNEAttributeCarrier::MAXNUMBEROFATTRIBUTES, nullptr); + // create myAttributesFlowEditor + myAttributesEditorFlow = new AttributesEditorFlow(this); + // leave it hidden + myAttributesEditorFlow->hideAttributesEditorFlowModule(); + // Create help button + myHelpButton = new FXButton(getCollapsableFrame(), "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); +} + + +void +GNEFrameAttributeModules::AttributesEditor::showAttributeEditorModule(bool includeExtended, bool forceAttributeEnabled) { + myIncludeExtended = includeExtended; + // first remove all rows + for (auto& row : myAttributesEditorRows) { + // destroy and delete all rows + if (row != nullptr) { + row->destroy(); + delete row; + row = nullptr; + } + } + // get inspected ACs + const auto& ACs = myFrameParent->getViewNet()->getInspectedAttributeCarriers(); + // declare flag to check if flow editor has to be shown + bool showFlowEditor = false; + if (ACs.size() > 0) { + // Iterate over attributes + for (const auto& attrProperty : ACs.front()->getTagProperty()) { + // declare flag to show/hidde atribute + bool editAttribute = true; + // disable editing for unique attributes in case of multi-selection + if ((ACs.size() > 1) && attrProperty.isUnique()) { + editAttribute = false; + } + // disable editing of extended attributes if includeExtended isn't enabled + if (attrProperty.isExtended() && !includeExtended) { + editAttribute = false; + } + // disable editing of flow definition attributes, but enable flow editor + if (attrProperty.isFlowDefinition()) { + editAttribute = false; + showFlowEditor = true; + } + // continue if attribute is editable + if (editAttribute) { + // Declare a set of occuring values and insert attribute's values of item (note: We use a set to avoid repeated values) + std::set occuringValues; + // iterate over edited attributes + for (const auto& inspectedAC : ACs) { + occuringValues.insert(inspectedAC->getAttribute(attrProperty.getAttr())); + } + // get current value + std::ostringstream oss; + for (auto values = occuringValues.begin(); values != occuringValues.end(); values++) { + if (values != occuringValues.begin()) { + oss << " "; + } + oss << *values; + } + // obtain value to be shown in row + std::string value = oss.str(); + // declare a flag for enabled attributes + bool attributeEnabled = ACs.front()->isAttributeEnabled(attrProperty.getAttr()); + // overwritte value if attribute is disabled (used by LinkIndex) + if (attributeEnabled == false) { + value = ACs.front()->getAlternativeValueForDisabledAttributes(attrProperty.getAttr()); + } + // extra check for Triggered and container Triggered + if (ACs.front()->getTagProperty().isStop() || ACs.front()->getTagProperty().isStopPerson()) { + if ((attrProperty.getAttr() == SUMO_ATTR_EXPECTED) && (ACs.front()->isAttributeEnabled(SUMO_ATTR_TRIGGERED) == false)) { + attributeEnabled = false; + } else if ((attrProperty.getAttr() == SUMO_ATTR_EXPECTED_CONTAINERS) && (ACs.front()->isAttributeEnabled(SUMO_ATTR_CONTAINER_TRIGGERED) == false)) { + attributeEnabled = false; + } + } + // if forceEnablellAttribute is enable, force attributeEnabled (except for ID) + if (forceAttributeEnabled && (attrProperty.getAttr() != SUMO_ATTR_ID)) { + attributeEnabled = true; + } + // check if this attribute is computed + const bool computed = (ACs.size() > 1) ? false : ACs.front()->isAttributeComputed(attrProperty.getAttr()); + // create attribute editor row + myAttributesEditorRows[attrProperty.getPositionListed()] = new AttributesEditorRow(this, attrProperty, value, attributeEnabled, computed); + } + } + // check if Flow editor has to be shown + if (showFlowEditor) { + myAttributesEditorFlow->showAttributeEditorFlowModule(); + } else { + myAttributesEditorFlow->hideAttributesEditorFlowModule(); + } + // show AttributesEditor + show(); + } else { + myAttributesEditorFlow->hideAttributesEditorFlowModule(); + } + // reparent help button (to place it at bottom) + myHelpButton->reparent(this); +} + + +void +GNEFrameAttributeModules::AttributesEditor::hideAttributesEditorModule() { + // hide AttributesEditorFlowModule + myAttributesEditorFlow->hideAttributesEditorFlowModule(); + // hide also AttributesEditor + hide(); +} + + +void +GNEFrameAttributeModules::AttributesEditor::refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition) { + // get inspected ACs + const auto& ACs = myFrameParent->getViewNet()->getInspectedAttributeCarriers(); + // first check if there is inspected attribute carriers + if (ACs.size() > 0) { + // Iterate over inspected attribute carriers + for (const auto& attrProperty : ACs.front()->getTagProperty()) { + // declare flag to show/hidde atribute + bool editAttribute = true; + // disable editing for unique attributes in case of multi-selection + if ((ACs.size() > 1) && attrProperty.isUnique()) { + editAttribute = false; + } + // disable editing of extended attributes if includeExtended isn't enabled + if (attrProperty.isExtended() && !myIncludeExtended) { + editAttribute = false; + } + // disable editing of flow definition attributes, but enable flow editor + if (attrProperty.isFlowDefinition()) { + editAttribute = false; + } + // continue if attribute is editable + if (editAttribute) { + // Declare a set of occuring values and insert attribute's values of item (note: We use a set to avoid repeated values) + std::set occuringValues; + // iterate over edited attributes + for (const auto& inspectedAC : ACs) { + occuringValues.insert(inspectedAC->getAttribute(attrProperty.getAttr())); + } + // get current value + std::ostringstream oss; + for (auto values = occuringValues.begin(); values != occuringValues.end(); values++) { + if (values != occuringValues.begin()) { + oss << " "; + } + oss << *values; + } + // obtain value to be shown in row + std::string value = oss.str(); + // declare a flag for enabled attributes + bool attributeEnabled = ACs.front()->isAttributeEnabled(attrProperty.getAttr()); + // overwritte value if attribute is disabled (used by LinkIndex) + if (attributeEnabled == false) { + value = ACs.front()->getAlternativeValueForDisabledAttributes(attrProperty.getAttr()); + } + // extra check for Triggered and container Triggered + if (ACs.front()->getTagProperty().isStop() || ACs.front()->getTagProperty().isStopPerson()) { + if ((attrProperty.getAttr() == SUMO_ATTR_EXPECTED) && (ACs.front()->isAttributeEnabled(SUMO_ATTR_TRIGGERED) == false)) { + attributeEnabled = false; + } else if ((attrProperty.getAttr() == SUMO_ATTR_EXPECTED_CONTAINERS) && (ACs.front()->isAttributeEnabled(SUMO_ATTR_CONTAINER_TRIGGERED) == false)) { + attributeEnabled = false; + } + } + // check if this attribute is computed + const bool computed = (ACs.size() > 1) ? false : ACs.front()->isAttributeComputed(attrProperty.getAttr()); + // Check if Position or Shape refresh has to be forced + if ((attrProperty.getAttr() == SUMO_ATTR_SHAPE) && forceRefreshShape) { + myAttributesEditorRows[attrProperty.getPositionListed()]->refreshAttributesEditorRow(value, true, attributeEnabled, computed); + } else if ((attrProperty.getAttr() == SUMO_ATTR_POSITION) && forceRefreshPosition) { + // Refresh attributes maintain invalid values + myAttributesEditorRows[attrProperty.getPositionListed()]->refreshAttributesEditorRow(value, true, attributeEnabled, computed); + } else { + // Refresh attributes maintain invalid values + myAttributesEditorRows[attrProperty.getPositionListed()]->refreshAttributesEditorRow(value, false, attributeEnabled, computed); + } + } + } + // check if flow editor has to be update + if (myAttributesEditorFlow->isAttributesEditorFlowModuleShown()) { + myAttributesEditorFlow->refreshAttributeEditorFlow(); + } + } +} + + +GNEFrame* +GNEFrameAttributeModules::AttributesEditor::getFrameParent() const { + return myFrameParent; +} + + +long +GNEFrameAttributeModules::AttributesEditor::onCmdAttributesEditorHelp(FXObject*, FXSelector, void*) { + // open Help attributes dialog if there is inspected ACs + if (myFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) { + // open Help attributes dialog + myFrameParent->openHelpAttributesDialog(myFrameParent->getViewNet()->getInspectedAttributeCarriers().front()); + } + return 1; +} + +// --------------------------------------------------------------------------- +// GNEFrameAttributeModules::AttributesEditorFlow - methods +// --------------------------------------------------------------------------- + +GNEFrameAttributeModules::AttributesEditorFlow::AttributesEditorFlow(AttributesEditor* attributesEditorParent) : + FXGroupBoxModule(attributesEditorParent->getFrameParent()->myContentFrame, "Flow attributes"), + myAttributesEditorParent(attributesEditorParent) { + // declare auxiliar horizontal frame + FXHorizontalFrame* auxiliarHorizontalFrame = nullptr; + // create elements for end attribute + auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + myAttributeEndRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_END).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); + myValueEndTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + // create elements for number attribute + auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + myAttributeNumberRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_NUMBER).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); + myValueNumberTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + // create elements for vehsPerHour attribute + auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + myAttributeVehsPerHourRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_VEHSPERHOUR).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); + myValueVehsPerHourTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + // create elements for period attribute + auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + myAttributePeriodRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PERIOD).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); + myValuePeriodTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + // create elements for Probability attribute + auxiliarHorizontalFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + myAttributeProbabilityRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PROB).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); + myValueProbabilityTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); +} + + +void +GNEFrameAttributeModules::AttributesEditorFlow::showAttributeEditorFlowModule() { + if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) { + // refresh attributeEditorFlowModule + refreshAttributeEditorFlow(); + // show flow + show(); + } else { + hide(); + } +} + + +void +GNEFrameAttributeModules::AttributesEditorFlow::hideAttributesEditorFlowModule() { + // simply hide modul + hide(); +} + + +bool +GNEFrameAttributeModules::AttributesEditorFlow::isAttributesEditorFlowModuleShown() const { + return shown(); +} + + +void +GNEFrameAttributeModules::AttributesEditorFlow::refreshAttributeEditorFlow() { + if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) { + // simply refresh every flow attribute + refreshEnd(); + refreshNumber(); + refreshVehsPerHour(); + refreshPeriod(); + refreshProbability(); + } +} + + +long +GNEFrameAttributeModules::AttributesEditorFlow::onCmdSetFlowAttribute(FXObject* obj, FXSelector, void*) { + const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers(); + // obtain undoList (To improve code legibly) + GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList(); + SumoXMLAttr attr = SUMO_ATTR_NOTHING; + std::string value; + // check what check button was pressed + if (obj == myValueEndTextField) { + attr = SUMO_ATTR_END; + value = myValueEndTextField->getText().text(); + } else if (obj == myValueNumberTextField) { + attr = SUMO_ATTR_NUMBER; + value = myValueNumberTextField->getText().text(); + } else if (obj == myValueVehsPerHourTextField) { + // check attribute + if (ACs.front()->getTagProperty().hasAttribute(SUMO_ATTR_VEHSPERHOUR)) { + attr = SUMO_ATTR_VEHSPERHOUR; + } else { + attr = SUMO_ATTR_PERSONSPERHOUR; + } + value = myValueVehsPerHourTextField->getText().text(); + } else if (obj == myValuePeriodTextField) { + attr = SUMO_ATTR_PERIOD; + value = myValuePeriodTextField->getText().text(); + } else if (obj == myValueProbabilityTextField) { + attr = SUMO_ATTR_PROB; + value = myValueProbabilityTextField->getText().text(); + } else { + throw ProcessError("Invalid text field"); + } + // write debug (for Netedit tests) + WRITE_DEBUG("Selected checkBox for attribute '" + toString(attr) + "'"); + // check if we're editing multiple attributes + if (ACs.size() > 1) { + undoList->begin(ACs.front()->getTagProperty().getGUIIcon(), "Change multiple " + toString(attr) + " attributes"); + } + // enable attribute with undo/redo + for (const auto& inspectedAC : ACs) { + inspectedAC->setAttribute(attr, value, undoList); + } + // check if we're editing multiple attributes + if (ACs.size() > 1) { + undoList->end(); + } + // refresh Attributes edito parent + refreshAttributeEditorFlow(); + return 1; +} + + +long +GNEFrameAttributeModules::AttributesEditorFlow::onCmdSelectFlowRadioButton(FXObject* obj, FXSelector, void*) { + const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers(); + // obtain undoList (To improve code legibly) + GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList(); + SumoXMLAttr attr = SUMO_ATTR_NOTHING; + // check what check button was pressed + if (obj == myAttributeEndRadioButton) { + attr = SUMO_ATTR_END; + } else if (obj == myAttributeNumberRadioButton) { + attr = SUMO_ATTR_NUMBER; + } else if (obj == myAttributeVehsPerHourRadioButton) { + attr = SUMO_ATTR_VEHSPERHOUR; + } else if (obj == myAttributePeriodRadioButton) { + attr = SUMO_ATTR_PERIOD; + } else if (obj == myAttributeProbabilityRadioButton) { + attr = SUMO_ATTR_PROB; + } else { + throw ProcessError("Invalid Radio Button"); + } + // write debug (for Netedit tests) + WRITE_DEBUG("Selected checkBox for attribute '" + toString(attr) + "'"); + // begin undo list + if (ACs.size() > 1) { + undoList->begin(ACs.front()->getTagProperty().getGUIIcon(), "enable multiple " + toString(attr) + " attributes"); + } else { + undoList->begin(ACs.front()->getTagProperty().getGUIIcon(), "enable attribute '" + toString(attr) + "'"); + } + // enable attribute with undo/redo + for (const auto& inspectedAC : ACs) { + inspectedAC->enableAttribute(attr, undoList); + } + // end undoList + undoList->end(); + // refresh Attributes edito parent + refreshAttributeEditorFlow(); + return 1; +} + + +void +GNEFrameAttributeModules::AttributesEditorFlow::refreshEnd() { + // first we need to check if all attributes are enabled or disabled + int allAttributesEnabledOrDisabled = 0; + for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { + allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(SUMO_ATTR_END); + } + if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) { + // Declare a set of occuring values and insert attribute's values of item + std::set occuringValues; + for (const auto& values : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { + occuringValues.insert(values->getAttribute(SUMO_ATTR_END)); + } + // get current value + std::ostringstream endValue; + for (const auto& occuringValue : occuringValues) { + if (occuringValue != *occuringValues.begin()) { + endValue << " "; + } + endValue << occuringValue; + } + // set radio button and text field + myValueEndTextField->enable(); + myValueEndTextField->setText(endValue.str().c_str()); + myAttributeEndRadioButton->setCheck(TRUE); + } else { + // disable radio button and text field + myValueEndTextField->disable(); + // check if we set an special value in textField + if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) { + myValueEndTextField->setText("Different flow attributes"); + } else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) { + myValueEndTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_END).c_str()); + } else { + myValueEndTextField->setText(""); + } + myAttributeEndRadioButton->setCheck(FALSE); + } +} + + +void +GNEFrameAttributeModules::AttributesEditorFlow::refreshNumber() { + // first we need to check if all attributes are enabled or disabled + int allAttributesEnabledOrDisabled = 0; + for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { + allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(SUMO_ATTR_NUMBER); + } + if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) { + // Declare a set of occuring values and insert attribute's values of item + std::set occuringValues; + for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { + occuringValues.insert(inspectedAC->getAttribute(SUMO_ATTR_NUMBER)); + } + // get current value + std::ostringstream numberValues; + for (const auto& occuringValue : occuringValues) { + if (occuringValue != *occuringValues.begin()) { + numberValues << " "; + } + numberValues << occuringValue; + } + // set radio button and text field + myValueNumberTextField->enable(); + myValueNumberTextField->setText(numberValues.str().c_str()); + myAttributeNumberRadioButton->setCheck(TRUE); + } else { + // disable radio button + myValueNumberTextField->disable(); + // check if we set an special value in textField + if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) { + myValueNumberTextField->setText("Different flow attributes"); + } else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) { + myValueNumberTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_NUMBER).c_str()); + } else { + myValueNumberTextField->setText(""); + } + myAttributeNumberRadioButton->setCheck(FALSE); + } +} + + +void +GNEFrameAttributeModules::AttributesEditorFlow::refreshVehsPerHour() { + // declare attribute + SumoXMLAttr attr = SUMO_ATTR_VEHSPERHOUR; + // first change attribute + if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().hasAttribute(SUMO_ATTR_PERSONSPERHOUR)) { + attr = SUMO_ATTR_PERSONSPERHOUR; + } + // update radio button + myAttributeVehsPerHourRadioButton->setText(toString(attr).c_str()); + // we need to check if all attributes are enabled or disabled + int allAttributesEnabledOrDisabled = 0; + for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { + allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(attr); + } + if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) { + // Declare a set of occuring values and insert attribute's values of item + std::set occuringValues; + for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { + occuringValues.insert(inspectedAC->getAttribute(attr)); + } + // get current value + std::ostringstream vehsPerHourValues; + for (const auto& occuringValue : occuringValues) { + if (occuringValue != *occuringValues.begin()) { + vehsPerHourValues << " "; + } + vehsPerHourValues << occuringValue; + } + // set radio button and text field + myValueVehsPerHourTextField->enable(); + myValueVehsPerHourTextField->setText(vehsPerHourValues.str().c_str()); + myAttributeVehsPerHourRadioButton->setCheck(TRUE); + } else { + // disable radio button + myValueVehsPerHourTextField->disable(); + // check if we set an special value in textField + if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) { + myValueVehsPerHourTextField->setText("Different flow attributes"); + } else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) { + myValueVehsPerHourTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(attr).c_str()); + } else { + myValueVehsPerHourTextField->setText(""); + } + myAttributeVehsPerHourRadioButton->setCheck(FALSE); + } +} + + +void +GNEFrameAttributeModules::AttributesEditorFlow::refreshPeriod() { + // first we need to check if all attributes are enabled or disabled + int allAttributesEnabledOrDisabled = 0; + for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { + allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(SUMO_ATTR_PERIOD); + } + if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) { + // Declare a set of occuring values and insert attribute's values of item + std::set occuringValues; + for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { + occuringValues.insert(inspectedAC->getAttribute(SUMO_ATTR_PERIOD)); + } + // get current value + std::ostringstream periodValues; + for (const auto& occuringValue : occuringValues) { + if (occuringValue != *occuringValues.begin()) { + periodValues << " "; + } + periodValues << occuringValue; + } + // set radio button and text field + myValuePeriodTextField->enable(); + myValuePeriodTextField->setText(periodValues.str().c_str()); + myAttributePeriodRadioButton->setCheck(TRUE); + } else { + // disable radio button and text field + myValuePeriodTextField->disable(); + // check if we set an special value in textField + if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) { + myValuePeriodTextField->setText("Different flow attributes"); + } else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) { + myValuePeriodTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_PERIOD).c_str()); + } else { + myValuePeriodTextField->setText(""); + } + myAttributePeriodRadioButton->setCheck(FALSE); + } +} + + +void +GNEFrameAttributeModules::AttributesEditorFlow::refreshProbability() { + // first we need to check if all attributes are enabled or disabled + int allAttributesEnabledOrDisabled = 0; + for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { + allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(SUMO_ATTR_PROB); + } + if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) { + // Declare a set of occuring values and insert attribute's values of item + std::set occuringValues; + for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { + occuringValues.insert(inspectedAC->getAttribute(SUMO_ATTR_PROB)); + } + // get current value + std::ostringstream probabilityValues; + for (const auto& occuringValue : occuringValues) { + if (occuringValue != *occuringValues.begin()) { + probabilityValues << " "; + } + probabilityValues << occuringValue; + } + // set radio button and text field + myValueProbabilityTextField->enable(); + myValueProbabilityTextField->setText(probabilityValues.str().c_str()); + myAttributeProbabilityRadioButton->enable(); + myAttributeProbabilityRadioButton->setCheck(TRUE); + } else { + // disable radio button and text field + myValueProbabilityTextField->disable(); + // check if we set an special value in textField + if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) { + myValueProbabilityTextField->setText("Different flow attributes"); + } else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) { + myValueProbabilityTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_PROB).c_str()); + } else { + myValueProbabilityTextField->setText(""); + } + myAttributeProbabilityRadioButton->setCheck(FALSE); + } +} + +// --------------------------------------------------------------------------- +// GNEFrameAttributeModules::AttributesEditorExtended- methods +// --------------------------------------------------------------------------- + +GNEFrameAttributeModules::AttributesEditorExtended::AttributesEditorExtended(GNEFrame* frameParent) : + FXGroupBoxModule(frameParent->myContentFrame, "Extended attributes"), + myFrameParent(frameParent) { + // Create open dialog button + new FXButton(getCollapsableFrame(), "Open attributes editor", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButton); +} + + +GNEFrameAttributeModules::AttributesEditorExtended::~AttributesEditorExtended() {} + + +void +GNEFrameAttributeModules::AttributesEditorExtended::showAttributesEditorExtendedModule() { + show(); +} + + +void +GNEFrameAttributeModules::AttributesEditorExtended::hideAttributesEditorExtendedModule() { + hide(); +} + + +long +GNEFrameAttributeModules::AttributesEditorExtended::onCmdOpenDialog(FXObject*, FXSelector, void*) { + // open AttributesCreator extended dialog + myFrameParent->attributesEditorExtendedDialogOpened(); + return 1; +} + +// --------------------------------------------------------------------------- +// GNEFrameAttributeModules::GenericDataAttributes - methods +// --------------------------------------------------------------------------- + +GNEFrameAttributeModules::GenericDataAttributes::GenericDataAttributes(GNEFrame* frameParent) : + FXGroupBoxModule(frameParent->myContentFrame, "Attributes"), + myFrameParent(frameParent) { + // create textfield and buttons + myTextFieldParameters = new FXTextField(getCollapsableFrame(), GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + myButtonEditParameters = new FXButton(getCollapsableFrame(), "Edit attributes", nullptr, this, MID_GNE_OPEN_PARAMETERS_DIALOG, GUIDesignButton); +} + + +GNEFrameAttributeModules::GenericDataAttributes::~GenericDataAttributes() {} + + +void +GNEFrameAttributeModules::GenericDataAttributes::showGenericDataAttributes() { + // refresh GenericDataAttributes + refreshGenericDataAttributes(); + // show groupbox + show(); +} + + +void +GNEFrameAttributeModules::GenericDataAttributes::hideGenericDataAttributes() { + // hide groupbox + hide(); +} + + +void +GNEFrameAttributeModules::GenericDataAttributes::refreshGenericDataAttributes() { + myTextFieldParameters->setText(getParametersStr().c_str()); + myTextFieldParameters->setTextColor(FXRGB(0, 0, 0)); +} + + +const std::map& +GNEFrameAttributeModules::GenericDataAttributes::getParametersMap() const { + return myParameters; +} + + +std::string +GNEFrameAttributeModules::GenericDataAttributes::getParametersStr() const { + std::string result; + // Generate an string using the following structure: "key1=value1|key2=value2|... + for (const auto& parameter : myParameters) { + result += parameter.first + "=" + parameter.second + "|"; + } + // remove the last "|" + if (!result.empty()) { + result.pop_back(); + } + return result; +} + + +std::vector > +GNEFrameAttributeModules::GenericDataAttributes::getParameters() const { + std::vector > result; + // Generate a vector string using the following structure: ", ,... + for (const auto& parameter : myParameters) { + result.push_back(std::make_pair(parameter.first, parameter.second)); + } + return result; +} + + +void +GNEFrameAttributeModules::GenericDataAttributes::setParameters(const std::vector >& parameters) { + // declare result string + std::string result; + // Generate an string using the following structure: "key1=value1|key2=value2|... + for (const auto& parameter : parameters) { + result += parameter.first + "=" + parameter.second + "|"; + } + // remove the last "|" + if (!result.empty()) { + result.pop_back(); + } + // set result in textField (and call onCmdEditParameters) + myTextFieldParameters->setText(result.c_str(), TRUE); +} + + +GNEFrame* +GNEFrameAttributeModules::GenericDataAttributes::getFrameParent() const { + return myFrameParent; +} + + +long +GNEFrameAttributeModules::GenericDataAttributes::onCmdEditParameters(FXObject*, FXSelector, void*) { + // write debug information + WRITE_DEBUG("Open single parameters dialog"); + if (GNESingleParametersDialog(this).execute()) { + // write debug information + WRITE_DEBUG("Close single parameters dialog"); + // Refresh parameter EditorCreator + refreshGenericDataAttributes(); + } else { + // write debug information + WRITE_DEBUG("Cancel single parameters dialog"); + } + return 1; +} + + +long +GNEFrameAttributeModules::GenericDataAttributes::onCmdSetParameters(FXObject*, FXSelector, void*) { + // clear current existent parameters + myParameters.clear(); + // check if current given string is valid + if (Parameterised::areParametersValid(myTextFieldParameters->getText().text(), true)) { + // parsed parameters ok, then set text field black and continue + myTextFieldParameters->setTextColor(FXRGB(0, 0, 0)); + myTextFieldParameters->killFocus(); + // obtain parameters "key=value" + std::vector parameters = StringTokenizer(myTextFieldParameters->getText().text(), "|", true).getVector(); + // iterate over parameters + for (const auto& parameter : parameters) { + // obtain key, value + std::vector keyParam = StringTokenizer(parameter, "=", true).getVector(); + // save it in myParameters + myParameters[keyParam.front()] = keyParam.back(); + } + // overwritte myTextFieldParameters (to remove duplicated parameters + myTextFieldParameters->setText(getParametersStr().c_str(), FALSE); + } else { + myTextFieldParameters->setTextColor(FXRGB(255, 0, 0)); + } + return 1; +} + +// --------------------------------------------------------------------------- +// GNEFrameAttributeModules::DrawingShape - methods +// --------------------------------------------------------------------------- + +GNEFrameAttributeModules::DrawingShape::DrawingShape(GNEFrame* frameParent) : + FXGroupBoxModule(frameParent->myContentFrame, "Drawing"), + myFrameParent(frameParent), + myDeleteLastCreatedPoint(false) { + // create start and stop buttons + myStartDrawingButton = new FXButton(getCollapsableFrame(), "Start drawing", 0, this, MID_GNE_STARTDRAWING, GUIDesignButton); + myStopDrawingButton = new FXButton(getCollapsableFrame(), "Stop drawing", 0, this, MID_GNE_STOPDRAWING, GUIDesignButton); + myAbortDrawingButton = new FXButton(getCollapsableFrame(), "Abort drawing", 0, this, MID_GNE_ABORTDRAWING, GUIDesignButton); + // create information label + std::ostringstream information; + information + << "- 'Start drawing' or ENTER\n" + << " draws shape boundary.\n" + << "- 'Stop drawing' or ENTER\n" + << " creates shape.\n" + << "- 'Shift + Click'removes\n" + << " last created point.\n" + << "- 'Abort drawing' or ESC\n" + << " removes drawed shape."; + myInformationLabel = new FXLabel(getCollapsableFrame(), information.str().c_str(), 0, GUIDesignLabelFrameInformation); + // disable stop and abort functions as init + myStopDrawingButton->disable(); + myAbortDrawingButton->disable(); +} + + +GNEFrameAttributeModules::DrawingShape::~DrawingShape() {} + + +void GNEFrameAttributeModules::DrawingShape::showDrawingShape() { + // abort current drawing before show + abortDrawing(); + // show FXGroupBoxModule + FXGroupBoxModule::show(); +} + + +void GNEFrameAttributeModules::DrawingShape::hideDrawingShape() { + // abort current drawing before hide + abortDrawing(); + // show FXGroupBoxModule + FXGroupBoxModule::hide(); +} + + +void +GNEFrameAttributeModules::DrawingShape::startDrawing() { + // Only start drawing if DrawingShape modul is shown + if (shown()) { + // change buttons + myStartDrawingButton->disable(); + myStopDrawingButton->enable(); + myAbortDrawingButton->enable(); + } +} + + +void +GNEFrameAttributeModules::DrawingShape::stopDrawing() { + // try to build shape + if (myFrameParent->shapeDrawed()) { + // clear created points + myTemporalShapeShape.clear(); + myFrameParent->myViewNet->updateViewNet(); + // change buttons + myStartDrawingButton->enable(); + myStopDrawingButton->disable(); + myAbortDrawingButton->disable(); + } else { + // abort drawing if shape cannot be created + abortDrawing(); + } +} + + +void +GNEFrameAttributeModules::DrawingShape::abortDrawing() { + // clear created points + myTemporalShapeShape.clear(); + myFrameParent->myViewNet->updateViewNet(); + // change buttons + myStartDrawingButton->enable(); + myStopDrawingButton->disable(); + myAbortDrawingButton->disable(); +} + + +void +GNEFrameAttributeModules::DrawingShape::addNewPoint(const Position& P) { + if (myStopDrawingButton->isEnabled()) { + myTemporalShapeShape.push_back(P); + } else { + throw ProcessError("A new point cannot be added if drawing wasn't started"); + } +} + + +void +GNEFrameAttributeModules::DrawingShape::removeLastPoint() { + +} + + +const PositionVector& +GNEFrameAttributeModules::DrawingShape::getTemporalShape() const { + return myTemporalShapeShape; +} + + +bool +GNEFrameAttributeModules::DrawingShape::isDrawing() const { + return myStopDrawingButton->isEnabled(); +} + + +void +GNEFrameAttributeModules::DrawingShape::setDeleteLastCreatedPoint(bool value) { + myDeleteLastCreatedPoint = value; +} + + +bool +GNEFrameAttributeModules::DrawingShape::getDeleteLastCreatedPoint() { + return myDeleteLastCreatedPoint; +} + + +long +GNEFrameAttributeModules::DrawingShape::onCmdStartDrawing(FXObject*, FXSelector, void*) { + startDrawing(); + return 0; +} + + +long +GNEFrameAttributeModules::DrawingShape::onCmdStopDrawing(FXObject*, FXSelector, void*) { + stopDrawing(); + return 0; +} + + +long +GNEFrameAttributeModules::DrawingShape::onCmdAbortDrawing(FXObject*, FXSelector, void*) { + abortDrawing(); + return 0; +} + +// --------------------------------------------------------------------------- +// GNEFrameAttributeModules::NeteditAttributes- methods +// --------------------------------------------------------------------------- + +GNEFrameAttributeModules::NeteditAttributes::NeteditAttributes(GNEFrame* frameParent) : + FXGroupBoxModule(frameParent->myContentFrame, "Netedit attributes"), + myFrameParent(frameParent), + myCurrentLengthValid(true), + myActualAdditionalReferencePoint(AdditionalReferencePoint::LEFT) { + // Create FXListBox for the reference points and fill it + myReferencePointMatchBox = new FXComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignComboBox); + myReferencePointMatchBox->appendItem("reference left"); + myReferencePointMatchBox->appendItem("reference right"); + myReferencePointMatchBox->appendItem("reference center"); + // Create Frame for Length Label and textField + myLengthFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + new FXLabel(myLengthFrame, toString(SUMO_ATTR_LENGTH).c_str(), 0, GUIDesignLabelAttribute); + myLengthTextField = new FXTextField(myLengthFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + myLengthTextField->setText("10"); + // Create Frame for block close polygon and checkBox (By default disabled) + myCloseShapeFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + new FXLabel(myCloseShapeFrame, "Close shape", 0, GUIDesignLabelAttribute); + myCloseShapeCheckButton = new FXCheckButton(myCloseShapeFrame, "false", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + // Create Frame for center element after creation (By default enabled) + myCenterViewAfterCreationFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + new FXLabel(myCenterViewAfterCreationFrame, "Center view", 0, GUIDesignLabelAttribute); + myCenterViewAfterCreationButton = new FXCheckButton(myCenterViewAfterCreationFrame, "false", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + myCenterViewAfterCreationButton->setCheck(true); + // Create help button + helpReferencePoint = new FXButton(getCollapsableFrame(), "Help", 0, this, MID_HELP, GUIDesignButtonRectangular); + // Set visible items + myReferencePointMatchBox->setNumVisible((int)myReferencePointMatchBox->getNumItems()); +} + + +GNEFrameAttributeModules::NeteditAttributes::~NeteditAttributes() {} + + +void +GNEFrameAttributeModules::NeteditAttributes::showNeteditAttributesModule(const GNETagProperties& tagProperty) { + // we assume that frame will not be show + bool showFrame = false; + // check if length text field has to be showed + if (tagProperty.canMaskStartEndPos()) { + myLengthFrame->show(); + myReferencePointMatchBox->show(); + showFrame = true; + } else { + myLengthFrame->hide(); + myReferencePointMatchBox->hide(); + } + // check if close shape check button has to be show + if (tagProperty.canCloseShape()) { + myCloseShapeFrame->show(); + showFrame = true; + } else { + myCloseShapeFrame->hide(); + } + // check if center camera after creation check button has to be show + if (tagProperty.canCenterCameraAfterCreation()) { + myCenterViewAfterCreationFrame->show(); + showFrame = true; + } else { + myCenterViewAfterCreationFrame->hide(); + } + // if at least one element is show, show modul + if (showFrame) { + recalc(); + show(); + } else { + hide(); + } +} + + +void +GNEFrameAttributeModules::NeteditAttributes::hideNeteditAttributesModule() { + hide(); +} + + +bool +GNEFrameAttributeModules::NeteditAttributes::getNeteditAttributesAndValues(CommonXMLStructure::SumoBaseObject* baseObject, const GNELane* lane) const { + // check if we need to obtain a start and end position over an edge + if (myReferencePointMatchBox->shown()) { + // we need a valid lane to calculate position over lane + if (lane == nullptr) { + return false; + } else if (myCurrentLengthValid) { + // Obtain position of the mouse over lane (limited over grid) + double mousePositionOverLane = lane->getLaneShape().nearest_offset_to_point2D(myFrameParent->myViewNet->snapToActiveGrid(myFrameParent->myViewNet->getPositionInformation())) / lane->getLengthGeometryFactor(); + // check if current reference point is valid + if (myActualAdditionalReferencePoint == AdditionalReferencePoint::INVALID) { + std::string errorMessage = "Current selected reference point isn't valid"; + myFrameParent->myViewNet->setStatusBarText(errorMessage); + // Write Warning in console if we're in testing mode + WRITE_DEBUG(errorMessage); + return false; + } else { + // obtain length + double length = GNEAttributeCarrier::parse(myLengthTextField->getText().text()); + // set start and end position + baseObject->addDoubleAttribute(SUMO_ATTR_STARTPOS, setStartPosition(mousePositionOverLane, length)); + baseObject->addDoubleAttribute(SUMO_ATTR_ENDPOS, setEndPosition(mousePositionOverLane, length)); + } + } else { + return false; + } + } + // Save close shape value if shape's element can be closed + if (myCloseShapeCheckButton->shown()) { + baseObject->addBoolAttribute(GNE_ATTR_CLOSE_SHAPE, myCloseShapeCheckButton->getCheck() == 1); + } + // check center element after creation + if (myCenterViewAfterCreationButton->shown()) { + baseObject->addBoolAttribute(GNE_ATTR_CENTER_AFTER_CREATION, myCenterViewAfterCreationButton->getCheck() == 1); + } + // all ok, then return true to continue creating element + return true; +} + + +long +GNEFrameAttributeModules::NeteditAttributes::onCmdSetNeteditAttribute(FXObject* obj, FXSelector, void*) { + if (obj == myCloseShapeCheckButton) { + if (myCloseShapeCheckButton->getCheck()) { + myCloseShapeCheckButton->setText("true"); + } else { + myCloseShapeCheckButton->setText("false"); + } + } else if (obj == myCenterViewAfterCreationButton) { + if (myCenterViewAfterCreationButton->getCheck()) { + myCenterViewAfterCreationButton->setText("true"); + } else { + myCenterViewAfterCreationButton->setText("false"); + } + } else if (obj == myLengthTextField) { + // change color of text field depending of the input length + if (GNEAttributeCarrier::canParse(myLengthTextField->getText().text()) && + GNEAttributeCarrier::parse(myLengthTextField->getText().text()) > 0) { + myLengthTextField->setTextColor(FXRGB(0, 0, 0)); + myLengthTextField->killFocus(); + myCurrentLengthValid = true; + } else { + myLengthTextField->setTextColor(FXRGB(255, 0, 0)); + myCurrentLengthValid = false; + } + // Update aditional frame + update(); + } else if (obj == myReferencePointMatchBox) { + // Cast actual reference point type + if (myReferencePointMatchBox->getText() == "reference left") { + myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0)); + myActualAdditionalReferencePoint = AdditionalReferencePoint::LEFT; + myLengthTextField->enable(); + } else if (myReferencePointMatchBox->getText() == "reference right") { + myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0)); + myActualAdditionalReferencePoint = AdditionalReferencePoint::RIGHT; + myLengthTextField->enable(); + } else if (myReferencePointMatchBox->getText() == "reference center") { + myLengthTextField->enable(); + myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0)); + myActualAdditionalReferencePoint = AdditionalReferencePoint::CENTER; + myLengthTextField->enable(); + } else { + myReferencePointMatchBox->setTextColor(FXRGB(255, 0, 0)); + myActualAdditionalReferencePoint = AdditionalReferencePoint::INVALID; + myLengthTextField->disable(); + } + } + + return 1; +} + + +long +GNEFrameAttributeModules::NeteditAttributes::onCmdHelp(FXObject*, FXSelector, void*) { + // Create dialog box + FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(getCollapsableFrame(), "Netedit Parameters Help", GUIDesignDialogBox); + additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL)); + // set help text + std::ostringstream help; + help + << "- Referece point: Mark the initial position of the additional element.\n" + << " Example: If you want to create a busStop with a length of 30 in the point 100 of the lane:\n" + << " - Reference Left will create it with startPos = 70 and endPos = 100.\n" + << " - Reference Right will create it with startPos = 100 and endPos = 130.\n" + << " - Reference Center will create it with startPos = 85 and endPos = 115.\n" + << "\n" + << "- Block movement: if is enabled, the created additional element will be blocked. i.e. cannot be moved with\n" + << " the mouse. This option can be modified inspecting element.\n" + << "- Center view: if is enabled, view will be center over created element."; + // Create label with the help text + new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), 0, GUIDesignLabelFrameInformation); + // Create horizontal separator + new FXHorizontalSeparator(additionalNeteditAttributesHelpDialog, GUIDesignHorizontalSeparator); + // Create frame for OK Button + FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(additionalNeteditAttributesHelpDialog, GUIDesignAuxiliarHorizontalFrame); + // Create Button Close (And two more horizontal frames to center it) + new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame); + new FXButton(myHorizontalFrameOKButton, "OK\t\tclose", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK); + new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame); + // Write Warning in console if we're in testing mode + WRITE_DEBUG("Opening NeteditAttributes help dialog"); + // create Dialog + additionalNeteditAttributesHelpDialog->create(); + // show in the given position + additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR); + // refresh APP + getApp()->refresh(); + // open as modal dialog (will block all windows until stop() or stopModal() is called) + getApp()->runModalFor(additionalNeteditAttributesHelpDialog); + // Write Warning in console if we're in testing mode + WRITE_DEBUG("Closing NeteditAttributes help dialog"); + return 1; + /********** + help from PolygonFrame + << "- Block movement: If enabled, the created polygon element will be blocked. i.e. cannot be moved with\n" + << " the mouse. This option can be modified inspecting element.\n" + << "\n" + << "- Block shape: If enabled, the shape of created polygon element will be blocked. i.e. their geometry points\n" + << " cannot be edited be moved with the mouse. This option can be modified inspecting element.\n" + << "\n" + << "- Close shape: If enabled, the created polygon element will be closed. i.e. the last created geometry point\n" + << " will be connected with the first geometry point automatically. This option can be modified inspecting element."; + + ****************/ +} + + +double +GNEFrameAttributeModules::NeteditAttributes::setStartPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const { + switch (myActualAdditionalReferencePoint) { + case AdditionalReferencePoint::LEFT: + return positionOfTheMouseOverLane; + case AdditionalReferencePoint::RIGHT: + return positionOfTheMouseOverLane - lengthOfAdditional; + case AdditionalReferencePoint::CENTER: + return positionOfTheMouseOverLane - lengthOfAdditional / 2; + default: + throw InvalidArgument("Reference Point invalid"); + } +} + + +double +GNEFrameAttributeModules::NeteditAttributes::setEndPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const { + switch (myActualAdditionalReferencePoint) { + case AdditionalReferencePoint::LEFT: + return positionOfTheMouseOverLane + lengthOfAdditional; + case AdditionalReferencePoint::RIGHT: + return positionOfTheMouseOverLane; + case AdditionalReferencePoint::CENTER: + return positionOfTheMouseOverLane + lengthOfAdditional / 2; + default: + throw InvalidArgument("Reference Point invalid"); + } +} + + +bool +GNEFrameAttributeModules::isSupermodeValid(const GNEViewNet* viewNet, const GNEAttributeCarrier* AC) { + if (viewNet->getEditModes().isCurrentSupermodeNetwork() && ( + AC->getTagProperty().isNetworkElement() || + AC->getTagProperty().isAdditionalElement() || + AC->getTagProperty().isShape() || + AC->getTagProperty().isTAZElement())) { + return true; + } else if (viewNet->getEditModes().isCurrentSupermodeDemand() && + AC->getTagProperty().isDemandElement()) { + return true; + } else if (viewNet->getEditModes().isCurrentSupermodeData() && + AC->getTagProperty().isDataElement()) { + return true; + } else { + return false; + } +} + + +bool +GNEFrameAttributeModules::isSupermodeValid(const GNEViewNet* viewNet, const GNEAttributeProperties& ACAttr) { + if (ACAttr.getTagPropertyParent().isNetworkElement() || ACAttr.getTagPropertyParent().isAdditionalElement() || + ACAttr.getTagPropertyParent().isShape() || ACAttr.getTagPropertyParent().isTAZElement()) { + return (viewNet->getEditModes().isCurrentSupermodeNetwork()); + } else if (ACAttr.getTagPropertyParent().isDemandElement()) { + return (viewNet->getEditModes().isCurrentSupermodeDemand()); + } else if (ACAttr.getTagPropertyParent().isDataElement()) { + return (viewNet->getEditModes().isCurrentSupermodeData()); + } else { + return false; + } +} + +/****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/frames/GNEFrameAttributeModules.h sumo-1.12.0/src/netedit/frames/GNEFrameAttributeModules.h --- sumo-1.11.0/src/netedit/frames/GNEFrameAttributeModules.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/GNEFrameAttributeModules.h 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,806 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GNEFrameAttributeModules.h +/// @author Pablo Alvarez Lopez +/// @date Aug 2019 +/// +// Auxiliar class for GNEFrame Modules (only for attributes edition) +/****************************************************************************/ +#pragma once +#include + +#include +#include +#include +#include +#include + +// =========================================================================== +// class declaration +// =========================================================================== + +class GNEFrame; + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNEFrameAttributeModules { + +public: + // =========================================================================== + // class declaration + // =========================================================================== + + class AttributesCreator; + class AttributesEditor; + class AttributesCreatorFlow; + class AttributesEditorFlow; + + // =========================================================================== + // class AttributesCreatorRow + // =========================================================================== + + class AttributesCreatorRow : public FXHorizontalFrame { + /// @brief FOX-declaration + FXDECLARE(GNEFrameAttributeModules::AttributesCreatorRow) + + public: + /// @brief constructor + AttributesCreatorRow(AttributesCreator* AttributesCreatorParent, const GNEAttributeProperties& attrProperties); + + /// @brief destroy AttributesCreatorRow (but don't delete) + void destroy(); + + /// @brief return Attr + const GNEAttributeProperties& getAttrProperties() const; + + /// @brief return value + std::string getValue() const; + + /// @brief return status of label checkbox button + bool getAttributeCheckButtonCheck() const; + + /// @brief enable or disable label checkbox button for optional attributes + void setAttributeCheckButtonCheck(bool value); + + /// @brief enable row + void enableAttributesCreatorRow(); + + /// @brief disable row + void disableAttributesCreatorRow(); + + /// @brief check if row is enabled + bool isAttributesCreatorRowEnabled() const; + + /// @brief refresh row + void refreshRow(); + + /// @brief disable Rows + void disableRow(); + + /// @brief check if current attribute is valid + bool isAttributeValid() const; + + /// @brief get AttributesCreator parent + AttributesCreator* getAttributesCreatorParent() const; + + /// @name FOX-callbacks + /// @{ + /// @brief called when user set the value of an attribute of type int/float/string/bool + long onCmdSetAttribute(FXObject*, FXSelector, void*); + + /// @brief called when user press the open dialog button + long onCmdOpenAttributeDialog(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(AttributesCreatorRow) + + /// @brief generate ID + std::string generateID() const; + + /// @brief check if current ID placed in myValueTextField is valid + bool isValidID() const; + + private: + /// @brief pointer to AttributesCreator + AttributesCreator* myAttributesCreatorParent = nullptr; + + /// @brief attribute properties + const GNEAttributeProperties myAttrProperties; + + /// @brief string which indicates the reason due current value is invalid + std::string myInvalidValue; + + /// @brief Label with the name of the attribute + FXLabel* myAttributeLabel = nullptr; + + /// @brief check button to enable/disable Label attribute + FXCheckButton* myEnableAttributeCheckButton = nullptr; + + /// @brief Button for open color or allow/disallow editor + FXButton* myAttributeButton = nullptr; + + /// @brief textField to modify the default value of string parameters + FXTextField* myValueTextField = nullptr; + + /// @brief check button to enable/disable the value of boolean parameters + FXCheckButton* myValueCheckButton = nullptr; + + /// @brief comboBox for discrete vaues + FXComboBox* myValueComboBox = nullptr; + }; + + // =========================================================================== + // class AttributesCreator + // =========================================================================== + + class AttributesCreator : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNEFrameAttributeModules::AttributesCreator) + + // declare friend class + friend class Row; + + public: + /// @brief constructor + AttributesCreator(GNEFrame* frameParent); + + /// @brief destructor + ~AttributesCreator(); + + /// @brief show AttributesCreator modul + void showAttributesCreatorModule(GNEAttributeCarrier* templateAC, const std::vector& hiddenAttributes); + + /// @brief hide group box + void hideAttributesCreatorModule(); + + /// @brief return frame parent + GNEFrame* getFrameParent() const; + + /// @brief get attributes and their values + void getAttributesAndValues(CommonXMLStructure::SumoBaseObject* baseObject, bool includeAll) const; + + /// @brief get current template AC + GNEAttributeCarrier* getCurrentTemplateAC() const; + + /// @brief check if parameters of attributes are valid + bool areValuesValid() const; + + /// @brief show warning message with information about non-valid attributes + void showWarningMessage(std::string extra = "") const; + + /// @brief refresh attribute creator + void refreshAttributesCreator(); + + /// @brief disable AttributesCreator + void disableAttributesCreator(); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when reset button is pressed + long onCmdReset(FXObject*, FXSelector, void*); + + /// @brief Called when help button is pressed + long onCmdHelp(FXObject*, FXSelector, void*); + + /// @} + + protected: + FOX_CONSTRUCTOR(AttributesCreator); + + /// @brief refresh rows + void refreshRows(const bool createRows); + + private: + /// @brief pointer to Frame Parent + GNEFrame* myFrameParent = nullptr; + + /// @brief pointer to myAttributesCreatorFlow + AttributesCreatorFlow* myAttributesCreatorFlow = nullptr; + + /// @brief current templateAC + GNEAttributeCarrier* myTemplateAC; + + /// @brief hidden attributes + std::vector myHiddenAttributes; + + /// @brief vector with the AttributesCreatorRow + std::vector myAttributesCreatorRows; + + /// @brief frame buttons + FXHorizontalFrame* myFrameButtons = nullptr; + + /// @brief reset button + FXButton* myResetButton = nullptr; + }; + + // =========================================================================== + // class AttributesCreatorFlow + // =========================================================================== + + class AttributesCreatorFlow : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNEFrameAttributeModules::AttributesCreatorFlow) + + public: + /// @brief constructor + AttributesCreatorFlow(AttributesCreator* attributesCreatorParent); + + /// @brief destructor + ~AttributesCreatorFlow(); + + /// @brief show AttributesCreatorFlow modul + void showAttributesCreatorFlowModule(); + + /// @brief hide group box + void hideAttributesCreatorFlowModule(); + + /// @brief shown AttributesCreatorFlow modul + bool shownAttributesCreatorFlowModule() const; + + /// @brief refresh AttributesCreatorFlow + void refreshAttributesCreatorFlow(); + + /// @brief set parameters + void setFlowParameters(CommonXMLStructure::SumoBaseObject* baseObject); + + /// @brief check if parameters of attributes are valid + bool areValuesValid() const; + + /// @brief show warning message with information about non-valid attributes + void showWarningMessage(std::string extra = "") const; + + /// @name FOX-callbacks + /// @{ + /// @brief called when user set the value of an attribute of type int/float/string/bool + long onCmdSetFlowAttribute(FXObject*, FXSelector, void*); + + /// @brief called when user press a radio button + long onCmdSelectFlowRadioButton(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(AttributesCreatorFlow); + + private: + /// @brief pointer to Attributes Creator Parent + AttributesCreator* myAttributesCreatorParent; + + /// @brief Radio button for 'end' attribute + FXRadioButton* myAttributeEndRadioButton = nullptr; + + /// @brief textField for 'end' attribute + FXTextField* myValueEndTextField = nullptr; + + /// @brief Radio button for 'number' attribute + FXRadioButton* myAttributeNumberRadioButton = nullptr; + + /// @brief textField for 'number' attribute + FXTextField* myValueNumberTextField = nullptr; + + /// @brief Radio button for 'VehsPerHour' attribute + FXRadioButton* myAttributeVehsPerHourRadioButton = nullptr; + + /// @brief textField for 'VehsPerHour' attribute + FXTextField* myValueVehsPerHourTextField = nullptr; + + /// @brief Radio button for 'period' attribute + FXRadioButton* myAttributePeriodRadioButton = nullptr; + + /// @brief textField for 'period' attribute + FXTextField* myValuePeriodTextField = nullptr; + + /// @brief Radio button for 'probability' attribute + FXRadioButton* myAttributeProbabilityRadioButton = nullptr; + + /// @brief textField for 'probability' attribute + FXTextField* myValueProbabilityTextField = nullptr; + + /// @brief per hours attr + SumoXMLAttr myPerHourAttr = SUMO_ATTR_NOTHING; + }; + + // =========================================================================== + // class AttributesEditorRow + // =========================================================================== + + class AttributesEditorRow : protected FXHorizontalFrame { + /// @brief FOX-declaration + FXDECLARE(GNEFrameAttributeModules::AttributesEditorRow) + + public: + /// @brief constructor + AttributesEditorRow(AttributesEditor* attributeEditorParent, const GNEAttributeProperties& ACAttr, const std::string& value, + const bool attributeEnabled, const bool computed); + + /// @brief destroy AttributesCreatorRow (but don't delete) + void destroy(); + + /// @brief refresh current row + void refreshAttributesEditorRow(const std::string& value, const bool forceRefresh, const bool attributeEnabled, const bool computed); + + /// @brief check if current attribute of TextField/ComboBox is valid + bool isAttributesEditorRowValid() const; + + /// @name FOX-callbacks + /// @{ + + /// @brief try to set new attribute value + long onCmdSetAttribute(FXObject*, FXSelector, void*); + + /// @brief called when user press a check button + long onCmdSelectCheckButton(FXObject*, FXSelector, void*); + + /// @brief open model dialog for more comfortable attribute editing + long onCmdOpenAttributeDialog(FXObject*, FXSelector, void*); + /// @} + + protected: + /// @brief default constructor + AttributesEditorRow(); + + /// @brief removed invalid spaces of Positions and shapes + std::string stripWhitespaceAfterComma(const std::string& stringValue); + + /// @brief check junction merging + bool mergeJunction(SumoXMLAttr attr, const std::vector& inspectedACs, const std::string& newVal) const; + + private: + /// @brief pointer to AttributesEditor parent + AttributesEditor* myAttributesEditorParent; + + /// @brief current AC Attribute + const GNEAttributeProperties myACAttr; + + /// @brief flag to check if input element contains multiple values + const bool myMultiple; + + /// @brief pointer to attribute label + FXLabel* myAttributeLabel = nullptr; + + /// @brief pointer to attribute menu check + FXCheckButton* myAttributeCheckButton = nullptr; + + /// @brief pointer to buttonCombinableChoices + FXButton* myAttributeButtonCombinableChoices = nullptr; + + /// @brief Button for open color editor + FXButton* myAttributeColorButton = nullptr; + + /// @brief textField to modify the value of string attributes + FXTextField* myValueTextField = nullptr; + + /// @brief pointer to combo box choices + FXComboBox* myValueComboBoxChoices = nullptr; + + /// @brief pointer to menu check + FXCheckButton* myValueCheckButton = nullptr; + }; + + // =========================================================================== + // class AttributesEditor + // =========================================================================== + + class AttributesEditor : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNEFrameAttributeModules::AttributesEditor) + + public: + /// @brief constructor + AttributesEditor(GNEFrame* inspectorFrameParent); + + /// @brief show attributes of multiple ACs + void showAttributeEditorModule(bool includeExtended, bool forceAttributeEnabled); + + /// @brief hide attribute editor + void hideAttributesEditorModule(); + + /// @brief refresh attribute editor (only the valid values will be refresh) + void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition); + + /// @brief pointer to GNEFrame parent + GNEFrame* getFrameParent() const; + + /// @name FOX-callbacks + /// @{ + /// @brief Called when user press the help button + long onCmdAttributesEditorHelp(FXObject*, FXSelector, void*); + /// @} + + protected: + /// @brief fox need this + FOX_CONSTRUCTOR(AttributesEditor) + + private: + /// @brief pointer to GNEFrame parent + GNEFrame* myFrameParent; + + /// @brief pointer to attributesEditorFlow + AttributesEditorFlow* myAttributesEditorFlow = nullptr; + + /// @brief list of Attribute editor rows + std::vector myAttributesEditorRows; + + /// @brief button for help + FXButton* myHelpButton = nullptr; + + /// @brief flag used to mark if current edited ACs are bein edited including extended attribute + bool myIncludeExtended; + }; + + // =========================================================================== + // class AttributesEditorFlow + // =========================================================================== + + class AttributesEditorFlow : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNEFrameAttributeModules::AttributesEditorFlow) + + public: + /// @brief constructor + AttributesEditorFlow(AttributesEditor* attributesEditorParent); + + /// @brief show attributes editor Flow Module + void showAttributeEditorFlowModule(); + + /// @brief hide attribute EditorFlow + void hideAttributesEditorFlowModule(); + + /// @brief check if attribute editor flow modul is shown + bool isAttributesEditorFlowModuleShown() const; + + /// @brief refresh attribute EditorFlow (only the valid values will be refresh) + void refreshAttributeEditorFlow(); + + /// @name FOX-callbacks + /// @{ + /// @brief called when user set the value of an attribute of type int/float/string/bool + long onCmdSetFlowAttribute(FXObject*, FXSelector, void*); + + /// @brief called when user press a radio button + long onCmdSelectFlowRadioButton(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(AttributesEditorFlow) + + /// @brief refresh end + void refreshEnd(); + + /// @brief refresh parameter number + void refreshNumber(); + + /// @brief refresh parameter VehsPerHour + void refreshVehsPerHour(); + + /// @brief refresh parameter Period + void refreshPeriod(); + + /// @brief refresh parameter Probability + void refreshProbability(); + + private: + /// @brief pointer to AttributesEditor parent + AttributesEditor* myAttributesEditorParent = nullptr; + + /// @brief Radio button for 'end' attribute + FXRadioButton* myAttributeEndRadioButton = nullptr; + + /// @brief textField for 'end' attribute + FXTextField* myValueEndTextField = nullptr; + + /// @brief Radio button for 'number' attribute + FXRadioButton* myAttributeNumberRadioButton = nullptr; + + /// @brief textField for 'number' attribute + FXTextField* myValueNumberTextField = nullptr; + + /// @brief Radio button for 'VehsPerHour' attribute + FXRadioButton* myAttributeVehsPerHourRadioButton = nullptr; + + /// @brief textField for 'VehsPerHour' attribute + FXTextField* myValueVehsPerHourTextField = nullptr; + + /// @brief Radio button for 'period' attribute + FXRadioButton* myAttributePeriodRadioButton = nullptr; + + /// @brief textField for 'period' attribute + FXTextField* myValuePeriodTextField = nullptr; + + /// @brief Radio button for 'probability' attribute + FXRadioButton* myAttributeProbabilityRadioButton = nullptr; + + /// @brief textField for 'probability' attribute + FXTextField* myValueProbabilityTextField = nullptr; + }; + + // =========================================================================== + // class AttributesEditorExtended + // =========================================================================== + + class AttributesEditorExtended : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNEFrameAttributeModules::AttributesEditorExtended) + + public: + /// @brief constructor + AttributesEditorExtended(GNEFrame* frameParent); + + /// @brief destructor + ~AttributesEditorExtended(); + + /// @brief show AttributesEditorExtended modul + void showAttributesEditorExtendedModule(); + + /// @brief hide group box + void hideAttributesEditorExtendedModule(); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when open dialog button is clicked + long onCmdOpenDialog(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(AttributesEditorExtended) + + private: + /// @brief pointer to Frame Parent + GNEFrame* myFrameParent = nullptr; + }; + + // =========================================================================== + // class GenericDataAttributes + // =========================================================================== + + class GenericDataAttributes : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNEFrameAttributeModules::GenericDataAttributes) + + public: + /// @brief constructor + GenericDataAttributes(GNEFrame* frameParent); + + /// @brief destructor + ~GenericDataAttributes(); + + /// @brief show netedit attributes EditorCreator + void showGenericDataAttributes(); + + /// @brief hide netedit attributes EditorCreator + void hideGenericDataAttributes(); + + /// @brief refresh netedit attributes + void refreshGenericDataAttributes(); + + /// @brief get parameters as map + const std::map& getParametersMap() const; + + /// @brief get parameters as string + std::string getParametersStr() const; + + /// @brief get parameters as vector of strings + std::vector > getParameters() const; + + /// @brief set parameters + void setParameters(const std::vector >& parameters); + + /// @brief pointer to frame parent + GNEFrame* getFrameParent() const; + + /// @name FOX-callbacks + /// @{ + /// @brief Called when user clicks over add parameter + long onCmdEditParameters(FXObject*, FXSelector, void*); + + /// @brief Called when user udpate the parameter text field + long onCmdSetParameters(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(GenericDataAttributes) + + private: + /// @brief pointer to frame parent + GNEFrame* myFrameParent = nullptr; + + /// @brief pointer to current map of parameters + std::map myParameters; + + /// @brief text field for write parameters + FXTextField* myTextFieldParameters = nullptr; + + /// @brief button for edit parameters using specific dialog + FXButton* myButtonEditParameters = nullptr; + }; + + // =========================================================================== + // class DrawingShape + // =========================================================================== + + class DrawingShape : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNEFrameAttributeModules::DrawingShape) + + public: + /// @brief constructor + DrawingShape(GNEFrame* frameParent); + + /// @brief destructor + ~DrawingShape(); + + /// @brief show Drawing mode + void showDrawingShape(); + + /// @brief hide Drawing mode + void hideDrawingShape(); + + /// @brief start drawing + void startDrawing(); + + /// @brief stop drawing and check if shape can be created + void stopDrawing(); + + /// @brief abort drawing + void abortDrawing(); + + /// @brief add new point to temporal shape + void addNewPoint(const Position& P); + + /// @brief remove last added point + void removeLastPoint(); + + /// @brief get Temporal shape + const PositionVector& getTemporalShape() const; + + /// @brief return true if currently a shape is drawed + bool isDrawing() const; + + /// @brief enable or disable delete last created point + void setDeleteLastCreatedPoint(bool value); + + /// @brief get flag delete last created point + bool getDeleteLastCreatedPoint(); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user press start drawing button + long onCmdStartDrawing(FXObject*, FXSelector, void*); + + /// @brief Called when the user press stop drawing button + long onCmdStopDrawing(FXObject*, FXSelector, void*); + + /// @brief Called when the user press abort drawing button + long onCmdAbortDrawing(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(DrawingShape) + + private: + /// @brief pointer to frame parent + GNEFrame* myFrameParent; + + /// @brief flag to enable/disable delete point mode + bool myDeleteLastCreatedPoint; + + /// @brief current drawed shape + PositionVector myTemporalShapeShape; + + /// @brief button for start drawing + FXButton* myStartDrawingButton; + + /// @brief button for stop drawing + FXButton* myStopDrawingButton; + + /// @brief button for abort drawing + FXButton* myAbortDrawingButton; + + /// @brief Label with information + FXLabel* myInformationLabel; + }; + + // =========================================================================== + // class NeteditAttributes + // =========================================================================== + + class NeteditAttributes : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNEFrameAttributeModules::NeteditAttributes) + + public: + /// @brief constructor + NeteditAttributes(GNEFrame* frameParent); + + /// @brief destructor + ~NeteditAttributes(); + + /// @brief show Netedit attributes modul + void showNeteditAttributesModule(const GNETagProperties& tagValue); + + /// @brief hide Netedit attributes modul + void hideNeteditAttributesModule(); + + /// @brief fill valuesMap with netedit attributes + bool getNeteditAttributesAndValues(CommonXMLStructure::SumoBaseObject* baseObject, const GNELane* lane) const; + + /// @name FOX-callbacks + /// @{ + /// @brief Called when user changes some element of NeteditAttributes + long onCmdSetNeteditAttribute(FXObject*, FXSelector, void*); + + /// @brief Called when user press the help button + long onCmdHelp(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(NeteditAttributes) + + private: + /// @brief list of the reference points + enum class AdditionalReferencePoint { + LEFT, + RIGHT, + CENTER, + INVALID + }; + + /// @brief obtain the Start position values of StoppingPlaces and E2 detector over the lane + double setStartPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const; + + /// @brief obtain the End position values of StoppingPlaces and E2 detector over the lane + double setEndPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const; + + /// @brief pointer to frame parent + GNEFrame* myFrameParent; + + /// @brief match box with the list of reference points + FXComboBox* myReferencePointMatchBox; + + /// @brief horizontal frame for length + FXHorizontalFrame* myLengthFrame; + + /// @brief textField for length + FXTextField* myLengthTextField; + + /// @brief horizontal frame for close polygon + FXHorizontalFrame* myCloseShapeFrame; + + /// @brief checkbox to enable/disable close polygon + FXCheckButton* myCloseShapeCheckButton; + + /// @brief horizontal frame for center view after creation frame + FXHorizontalFrame* myCenterViewAfterCreationFrame; + + /// @brief checkbox to enable/disable center element after creation + FXCheckButton* myCenterViewAfterCreationButton; + + /// @brief Button for help about the reference point + FXButton* helpReferencePoint; + + /// @brief Flag to check if current length is valid + bool myCurrentLengthValid; + + /// @brief actual additional reference point selected in the match Box + AdditionalReferencePoint myActualAdditionalReferencePoint; + }; + + /// @brief return true if AC can be edited in the current supermode + static bool isSupermodeValid(const GNEViewNet* viewNet, const GNEAttributeCarrier* AC); + + /// @brief return true if give ACAttr can be edited in the current supermode + static bool isSupermodeValid(const GNEViewNet* viewNet, const GNEAttributeProperties& ACAttr); +}; diff -Nru sumo-1.11.0/src/netedit/frames/GNEFrameAttributesModuls.cpp sumo-1.12.0/src/netedit/frames/GNEFrameAttributesModuls.cpp --- sumo-1.11.0/src/netedit/frames/GNEFrameAttributesModuls.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/GNEFrameAttributesModuls.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,2783 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GNEFrameAttributesModuls.cpp -/// @author Pablo Alvarez Lopez -/// @date Aug 2019 -/// -// Auxiliar class for GNEFrame Moduls (only for attributes edition) -/****************************************************************************/ -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEFrame.h" -#include "GNEFrameAttributesModuls.h" - - -// =========================================================================== -// FOX callback mapping -// =========================================================================== - -FXDEFMAP(GNEFrameAttributesModuls::AttributesCreatorRow) RowCreatorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEFrameAttributesModuls::AttributesCreatorRow::onCmdSetAttribute), - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_BOOL, GNEFrameAttributesModuls::AttributesCreatorRow::onCmdSelectCheckButton), - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_DIALOG, GNEFrameAttributesModuls::AttributesCreatorRow::onCmdSelectColorButton), -}; - -FXDEFMAP(GNEFrameAttributesModuls::AttributesCreator) AttributesCreatorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEFrameAttributesModuls::AttributesCreator::onCmdHelp) -}; - -FXDEFMAP(GNEFrameAttributesModuls::AttributesCreatorFlow) AttributesCreatorFlowMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEFrameAttributesModuls::AttributesCreatorFlow::onCmdSetFlowAttribute), - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_BUTTON, GNEFrameAttributesModuls::AttributesCreatorFlow::onCmdSelectFlowRadioButton), -}; - -FXDEFMAP(GNEFrameAttributesModuls::AttributesEditorRow) AttributesEditorRowMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEFrameAttributesModuls::AttributesEditorRow::onCmdSetAttribute), - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_BOOL, GNEFrameAttributesModuls::AttributesEditorRow::onCmdSelectCheckButton), - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_DIALOG, GNEFrameAttributesModuls::AttributesEditorRow::onCmdOpenAttributeDialog), -}; - -FXDEFMAP(GNEFrameAttributesModuls::AttributesEditor) AttributesEditorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEFrameAttributesModuls::AttributesEditor::onCmdAttributesEditorHelp) -}; - -FXDEFMAP(GNEFrameAttributesModuls::AttributesEditorFlow) AttributesEditorFlowMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEFrameAttributesModuls::AttributesEditorFlow::onCmdSetFlowAttribute), - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_BUTTON, GNEFrameAttributesModuls::AttributesEditorFlow::onCmdSelectFlowRadioButton), -}; - -FXDEFMAP(GNEFrameAttributesModuls::AttributesEditorExtended) AttributesEditorExtendedMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_DIALOG, GNEFrameAttributesModuls::AttributesEditorExtended::onCmdOpenDialog) -}; - -FXDEFMAP(GNEFrameAttributesModuls::ParametersEditorCreator) ParametersEditorCreatorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_OPEN_PARAMETERS_DIALOG, GNEFrameAttributesModuls::ParametersEditorCreator::onCmdEditParameters), - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEFrameAttributesModuls::ParametersEditorCreator::onCmdSetParameters) -}; - -FXDEFMAP(GNEFrameAttributesModuls::DrawingShape) DrawingShapeMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_STARTDRAWING, GNEFrameAttributesModuls::DrawingShape::onCmdStartDrawing), - FXMAPFUNC(SEL_COMMAND, MID_GNE_STOPDRAWING, GNEFrameAttributesModuls::DrawingShape::onCmdStopDrawing), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ABORTDRAWING, GNEFrameAttributesModuls::DrawingShape::onCmdAbortDrawing) -}; - -FXDEFMAP(GNEFrameAttributesModuls::NeteditAttributes) NeteditAttributesMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEFrameAttributesModuls::NeteditAttributes::onCmdSetNeteditAttribute), - FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEFrameAttributesModuls::NeteditAttributes::onCmdHelp) -}; - -// Object implementation -FXIMPLEMENT(GNEFrameAttributesModuls::AttributesCreatorRow, FXHorizontalFrame, RowCreatorMap, ARRAYNUMBER(RowCreatorMap)) -FXIMPLEMENT(GNEFrameAttributesModuls::AttributesCreator, FXGroupBox, AttributesCreatorMap, ARRAYNUMBER(AttributesCreatorMap)) -FXIMPLEMENT(GNEFrameAttributesModuls::AttributesCreatorFlow, FXGroupBox, AttributesCreatorFlowMap, ARRAYNUMBER(AttributesCreatorFlowMap)) -FXIMPLEMENT(GNEFrameAttributesModuls::AttributesEditorRow, FXHorizontalFrame, AttributesEditorRowMap, ARRAYNUMBER(AttributesEditorRowMap)) -FXIMPLEMENT(GNEFrameAttributesModuls::AttributesEditor, FXGroupBox, AttributesEditorMap, ARRAYNUMBER(AttributesEditorMap)) -FXIMPLEMENT(GNEFrameAttributesModuls::AttributesEditorFlow, FXGroupBox, AttributesEditorFlowMap, ARRAYNUMBER(AttributesEditorFlowMap)) -FXIMPLEMENT(GNEFrameAttributesModuls::AttributesEditorExtended, FXGroupBox, AttributesEditorExtendedMap, ARRAYNUMBER(AttributesEditorExtendedMap)) -FXIMPLEMENT(GNEFrameAttributesModuls::ParametersEditorCreator, FXGroupBox, ParametersEditorCreatorMap, ARRAYNUMBER(ParametersEditorCreatorMap)) -FXIMPLEMENT(GNEFrameAttributesModuls::DrawingShape, FXGroupBox, DrawingShapeMap, ARRAYNUMBER(DrawingShapeMap)) -FXIMPLEMENT(GNEFrameAttributesModuls::NeteditAttributes, FXGroupBox, NeteditAttributesMap, ARRAYNUMBER(NeteditAttributesMap)) - - -// =========================================================================== -// method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNEFrameAttributesModuls::AttributesCreatorRow - methods -// --------------------------------------------------------------------------- - -GNEFrameAttributesModuls::AttributesCreatorRow::AttributesCreatorRow(AttributesCreator* AttributesCreatorParent, const GNEAttributeProperties& attrProperties) : - FXHorizontalFrame(AttributesCreatorParent, GUIDesignAuxiliarHorizontalFrame), - myAttributesCreatorParent(AttributesCreatorParent), - myAttrProperties(attrProperties) { - // Create left visual elements - myAttributeLabel = new FXLabel(this, "name", nullptr, GUIDesignLabelAttribute); - myAttributeLabel->hide(); - myAttributeCheckButton = new FXCheckButton(this, "name", this, MID_GNE_SET_ATTRIBUTE_BOOL, GUIDesignCheckButtonAttribute); - myAttributeCheckButton->hide(); - myAttributeColorButton = new FXButton(this, "ColorButton", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute); - myAttributeColorButton->hide(); - // Create right visual elements - myValueTextField = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - myValueTextField->hide(); - myValueCheckButton = new FXCheckButton(this, "Disabled", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); - myValueCheckButton->hide(); - // by default attribute check button is true (except for until) - if ((attrProperties.getTagPropertyParent().isStop() || attrProperties.getTagPropertyParent().isStopPerson()) && (attrProperties.getAttr() == SUMO_ATTR_UNTIL)) { - myAttributeCheckButton->setCheck(FALSE); - } else { - myAttributeCheckButton->setCheck(TRUE); - } - // only create if parent was created - if (getParent()->id()) { - // create AttributesCreatorRow - FXHorizontalFrame::create(); - // reset invalid value - myInvalidValue = ""; - // special case for attribute ID - if (attrProperties.getAttr() == SUMO_ATTR_ID) { - // show check button and disable it - myAttributeCheckButton->setText(myAttrProperties.getAttrStr().c_str()); - myAttributeCheckButton->setCheck(false); - myAttributeCheckButton->show(); - // show text field and disable it - myValueTextField->setTextColor(FXRGB(0, 0, 0)); - myValueTextField->disable(); - // generate ID - myValueTextField->setText(generateID().c_str()); - // show textField - myValueTextField->show(); - } else { - // show label, button for edit colors or radio button - if (myAttrProperties.isColor()) { - myAttributeColorButton->setTextColor(FXRGB(0, 0, 0)); - myAttributeColorButton->setText(myAttrProperties.getAttrStr().c_str()); - myAttributeColorButton->show(); - } else if (myAttrProperties.isActivatable()) { - myAttributeCheckButton->setText(myAttrProperties.getAttrStr().c_str()); - myAttributeCheckButton->show(); - // special case for attributes "Parking", "until" and "duration" (by default disabled) - if ((myAttrProperties.getTagPropertyParent().isStop() || myAttrProperties.getTagPropertyParent().isStopPerson()) && - (myAttrProperties.getAttr() == SUMO_ATTR_UNTIL || myAttrProperties.getAttr() == SUMO_ATTR_EXTENSION || - myAttrProperties.getAttr() == SUMO_ATTR_PARKING)) { - myAttributeCheckButton->setCheck(FALSE); - } else { - myAttributeCheckButton->setCheck(TRUE); - } - } else { - myAttributeLabel->setText(myAttrProperties.getAttrStr().c_str()); - myAttributeLabel->show(); - } - if (myAttrProperties.isBool()) { - if (GNEAttributeCarrier::parse(attrProperties.getDefaultValue())) { - myValueCheckButton->setCheck(true); - myValueCheckButton->setText("true"); - } else { - myValueCheckButton->setCheck(false); - myValueCheckButton->setText("false"); - } - myValueCheckButton->show(); - // if it's associated to a label button and is disabled, then disable myValueCheckButton - if (myAttributeCheckButton->shown() && (myAttributeCheckButton->getCheck() == FALSE)) { - myValueCheckButton->disable(); - } - } else { - myValueTextField->setTextColor(FXRGB(0, 0, 0)); - myValueTextField->setText(attrProperties.getDefaultValue().c_str()); - myValueTextField->show(); - // if it's associated to a label button and is disabled, then disable myValueTextField - if (myAttributeCheckButton->shown() && (myAttributeCheckButton->getCheck() == FALSE)) { - myValueTextField->disable(); - } - } - } - // show AttributesCreatorRow - show(); - } -} - - -void -GNEFrameAttributesModuls::AttributesCreatorRow::destroy() { - // only destroy if parent was created - if (getParent()->id()) { - FXHorizontalFrame::destroy(); - } -} - - -const GNEAttributeProperties& -GNEFrameAttributesModuls::AttributesCreatorRow::getAttrProperties() const { - return myAttrProperties; -} - - -std::string -GNEFrameAttributesModuls::AttributesCreatorRow::getValue() const { - if (myAttrProperties.isBool()) { - return (myValueCheckButton->getCheck() == 1) ? "1" : "0"; - } else { - return myValueTextField->getText().text(); - } -} - - -bool -GNEFrameAttributesModuls::AttributesCreatorRow::getAttributeCheckButtonCheck() const { - if (shown()) { - return myAttributeCheckButton->getCheck() == TRUE; - } else { - return false; - } -} - - -void -GNEFrameAttributesModuls::AttributesCreatorRow::setAttributeCheckButtonCheck(bool value) { - if (shown()) { - // set radio button - myAttributeCheckButton->setCheck(value); - // enable or disable input fields - if (value) { - if (myAttrProperties.isBool()) { - myValueCheckButton->enable(); - } else { - myValueTextField->enable(); - } - } else { - if (myAttrProperties.isBool()) { - myValueCheckButton->disable(); - } else { - myValueTextField->disable(); - } - } - } -} - - -void -GNEFrameAttributesModuls::AttributesCreatorRow::enableAttributesCreatorRow() { - if (myAttrProperties.isBool()) { - return myValueCheckButton->enable(); - } else { - return myValueTextField->enable(); - } -} - - -void -GNEFrameAttributesModuls::AttributesCreatorRow::disableAttributesCreatorRow() { - if (myAttrProperties.isBool()) { - return myValueCheckButton->disable(); - } else { - return myValueTextField->disable(); - } -} - - -bool -GNEFrameAttributesModuls::AttributesCreatorRow::isAttributesCreatorRowEnabled() const { - if (!shown()) { - return false; - } else if (myAttrProperties.isBool()) { - return myValueCheckButton->isEnabled(); - } else { - return myValueTextField->isEnabled(); - } -} - - -void -GNEFrameAttributesModuls::AttributesCreatorRow::refreshRow() const { - // currently only row with ID attribute must be updated - if (myAttrProperties.getAttr() == SUMO_ATTR_ID) { - myValueTextField->setText(generateID().c_str()); - } -} - - -const std::string& -GNEFrameAttributesModuls::AttributesCreatorRow::isAttributeValid() const { - return myInvalidValue; -} - - -GNEFrameAttributesModuls::AttributesCreator* -GNEFrameAttributesModuls::AttributesCreatorRow::getAttributesCreatorParent() const { - return myAttributesCreatorParent; -} - - -long -GNEFrameAttributesModuls::AttributesCreatorRow::onCmdSetAttribute(FXObject* obj, FXSelector, void*) { - // We assume that current value is valid - myInvalidValue = ""; - // Check if format of current value of myTextField is correct - if (obj == myValueCheckButton) { - if (myValueCheckButton->getCheck()) { - myValueCheckButton->setText("true"); - } else { - myValueCheckButton->setText("false"); - } - } else if (myAttrProperties.isComplex()) { - // check complex attribute - myInvalidValue = checkComplexAttribute(myValueTextField->getText().text()); - } else if (myAttrProperties.isInt()) { - // first filter int attributes - if (GNEAttributeCarrier::canParse(myValueTextField->getText().text())) { - // obtain parsed attribute - double parsedDouble = GNEAttributeCarrier::parse(myValueTextField->getText().text()); - // check if parsed double doesn't have decimal part (or is 0) - if ((parsedDouble - (int)parsedDouble) == 0) { - myValueTextField->setText(toString((int)parsedDouble).c_str(), FALSE); - // Check if int value must be positive - if (myAttrProperties.isPositive() && (parsedDouble < 0)) { - myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' cannot be negative"; - } - } else { - myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' doesn't have a valid 'int' format"; - } - } else { - myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' doesn't have a valid 'int' format"; - } - - } else if (myAttrProperties.getAttr() == SUMO_ATTR_ANGLE) { - if (GNEAttributeCarrier::canParse(myValueTextField->getText().text())) { - // filter angle - double angle = GNEAttributeCarrier::parse(myValueTextField->getText().text()); - // filter if angle isn't between [0,360] - if ((angle < 0) || (angle > 360)) { - // apply modul - angle = fmod(angle, 360); - } - // update Textfield - myValueTextField->setText(toString(angle).c_str(), FALSE); - } else { - myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' doesn't have a valid 'float' format between [0, 360]"; - } - } else if (myAttrProperties.isSUMOTime()) { - // time attributes work as positive doubles - if (!GNEAttributeCarrier::canParse(myValueTextField->getText().text())) { - myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' doesn't have a valid SUMOTime format"; - } - } else if (myAttrProperties.isFloat()) { - if (GNEAttributeCarrier::canParse(myValueTextField->getText().text())) { - // convert string to double - double doubleValue = GNEAttributeCarrier::parse(myValueTextField->getText().text()); - // Check if double value must be positive - if (myAttrProperties.isPositive() && (doubleValue < 0)) { - myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' cannot be negative"; - // check if double value is a probability - } else if (myAttrProperties.isProbability() && ((doubleValue < 0) || doubleValue > 1)) { - myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' takes only values between 0 and 1"; - } else if (myAttrProperties.hasAttrRange() && ((doubleValue < myAttrProperties.getMinimumRange()) || doubleValue > myAttrProperties.getMaximumRange())) { - myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' takes only values between " + toString(myAttrProperties.getMinimumRange()) + " and " + toString(myAttrProperties.getMaximumRange()); - } else if ((myAttributesCreatorParent->getCurrentTagProperties().getTag() == SUMO_TAG_E2DETECTOR) && (myAttrProperties.getAttr() == SUMO_ATTR_LENGTH) && (doubleValue == 0)) { - myInvalidValue = "E2 length cannot be 0"; - } - } else { - myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' doesn't have a valid 'float' format"; - } - } else if (myAttrProperties.isColor()) { - // check if filename format is valid - if (GNEAttributeCarrier::canParse(myValueTextField->getText().text()) == false) { - myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' doesn't have a valid 'RBGColor' format"; - } - } else if (myAttrProperties.isFilename()) { - const std::string file = myValueTextField->getText().text(); - // check if filename format is valid - if (SUMOXMLDefinitions::isValidFilename(file) == false) { - myInvalidValue = "input contains invalid characters for a filename"; - } else if (myAttrProperties.getAttr() == SUMO_ATTR_IMGFILE) { - if (!file.empty()) { - // only load value if file exist and can be loaded - if (GUITexturesHelper::getTextureID(file) == -1) { - myInvalidValue = "doesn't exist image '" + file + "'"; - } - } - } - } else if (myAttrProperties.getAttr() == SUMO_ATTR_NAME) { - const std::string name = myValueTextField->getText().text(); - // check if name format is valid - if (SUMOXMLDefinitions::isValidAttribute(name) == false) { - myInvalidValue = "input contains invalid characters"; - } - } else if (myAttrProperties.getAttr() == SUMO_ATTR_VTYPES) { - const std::string types = myValueTextField->getText().text(); - // if list of VTypes isn't empty, check that all characters are valid - if (!types.empty() && !SUMOXMLDefinitions::isValidListOfTypeID(types)) { - myInvalidValue = "list of IDs contains invalid characters"; - } - } else if (myAttrProperties.getAttr() == SUMO_ATTR_INDEX) { - // special case for stop indx - const std::string index = myValueTextField->getText().text(); - if ((index != "fit") && (index != "end") && !GNEAttributeCarrier::canParse(index)) { - myInvalidValue = "index isn't either 'fit' or 'end' or a valid positive int"; - } else if (GNEAttributeCarrier::canParse(index) && (GNEAttributeCarrier::parse(index) < 0)) { - myInvalidValue = "index cannot be negative"; - } - } else if ((myAttrProperties.getAttr() == SUMO_ATTR_EXPECTED) || (myAttrProperties.getAttr() == SUMO_ATTR_EXPECTED_CONTAINERS)) { - // check if attribute can be parsed in a list of Ids - std::vector vehicleIDs = GNEAttributeCarrier::parse >(myValueTextField->getText().text()); - // check every ID - for (const auto& vehicleID : vehicleIDs) { - if (!SUMOXMLDefinitions::isValidVehicleID(vehicleID)) { - myInvalidValue = "invalid id used in " + myAttrProperties.getAttrStr(); - } - } - } else if (myAttrProperties.getAttr() == SUMO_ATTR_TRIP_ID) { - if (!SUMOXMLDefinitions::isValidVehicleID(myValueTextField->getText().text())) { - myInvalidValue = "invalid id used in " + myAttrProperties.getAttrStr(); - } - } else if (myAttrProperties.getAttr() == SUMO_ATTR_ID) { - // check ID depending of tag - if (myAttrProperties.getTagPropertyParent().isNetworkElement() && !SUMOXMLDefinitions::isValidNetID(myValueTextField->getText().text())) { - myInvalidValue = "invalid id used in " + myAttrProperties.getAttrStr(); - } else if (myAttrProperties.getTagPropertyParent().isDetector() && !SUMOXMLDefinitions::isValidDetectorID(myValueTextField->getText().text())) { - myInvalidValue = "invalid id used in " + myAttrProperties.getAttrStr(); - } else if (myAttrProperties.getTagPropertyParent().isAdditionalElement() && !SUMOXMLDefinitions::isValidNetID(myValueTextField->getText().text())) { - myInvalidValue = "invalid id used in " + myAttrProperties.getAttrStr(); - } else if (myAttrProperties.getTagPropertyParent().isShape() && !SUMOXMLDefinitions::isValidTypeID(myValueTextField->getText().text())) { - myInvalidValue = "invalid id used in " + myAttrProperties.getAttrStr(); - } else if (myAttrProperties.getTagPropertyParent().isDemandElement() && !SUMOXMLDefinitions::isValidVehicleID(myValueTextField->getText().text())) { - myInvalidValue = "invalid id used in " + myAttrProperties.getAttrStr(); - } - } else if ((myAttrProperties.getAttr() == SUMO_ATTR_FREQUENCY) && myAttrProperties.getTagPropertyParent().isDetector()) { - if (!myValueTextField->getText().empty()) { - if (!GNEAttributeCarrier::canParse(myValueTextField->getText().text())) { - myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' doesn't have a valid 'float' or empty format"; - } else if (GNEAttributeCarrier::parse(myValueTextField->getText().text()) < 0) { - myInvalidValue = "'" + myAttrProperties.getAttrStr() + "' cannot be negative"; - } - } - } - // change color of text field depending of myCurrentValueValid - if (myInvalidValue.size() == 0) { - myValueTextField->setTextColor(FXRGB(0, 0, 0)); - myValueTextField->killFocus(); - } else { - // IF value of TextField isn't valid, change their color to Red - myValueTextField->setTextColor(FXRGB(255, 0, 0)); - } - // Update aditional frame - update(); - return 1; -} - - -long -GNEFrameAttributesModuls::AttributesCreatorRow::onCmdSelectCheckButton(FXObject*, FXSelector, void*) { - if (myAttributeCheckButton->getCheck()) { - // enable input values - myValueCheckButton->enable(); - myValueTextField->enable(); - // refresh row - refreshRow(); - } else { - // disable input values - myValueCheckButton->disable(); - myValueTextField->disable(); - } - return 0; -} - - -long -GNEFrameAttributesModuls::AttributesCreatorRow::onCmdSelectColorButton(FXObject*, FXSelector, void*) { - // create FXColorDialog - FXColorDialog colordialog(this, tr("Color Dialog")); - colordialog.setTarget(this); - // If previous attribute wasn't correct, set black as default color - if (GNEAttributeCarrier::canParse(myValueTextField->getText().text())) { - colordialog.setRGBA(MFXUtils::getFXColor(GNEAttributeCarrier::parse(myValueTextField->getText().text()))); - } else { - colordialog.setRGBA(MFXUtils::getFXColor(GNEAttributeCarrier::parse(myAttrProperties.getDefaultValue()))); - } - // execute dialog to get a new color - if (colordialog.execute()) { - myValueTextField->setText(toString(MFXUtils::getRGBColor(colordialog.getRGBA())).c_str()); - onCmdSetAttribute(nullptr, 0, nullptr); - } - return 0; -} - - -std::string -GNEFrameAttributesModuls::AttributesCreatorRow::checkComplexAttribute(const std::string& value) { - // declare values needed to check if given complex parameters are valid - std::string errorMessage; - DepartDefinition dd; - DepartLaneDefinition dld; - DepartPosDefinition dpd; - DepartPosLatDefinition dpld; - ArrivalLaneDefinition ald; - DepartSpeedDefinition dsd; - ArrivalPosDefinition apd; - ArrivalPosLatDefinition apld; - ArrivalSpeedDefinition asd; - SVCPermissions mode; - int valueInt; - double valueDouble; - SUMOTime valueSUMOTime; - // check complex attribute - switch (myAttrProperties.getAttr()) { - case SUMO_ATTR_DEPART: - case SUMO_ATTR_BEGIN: - SUMOVehicleParameter::parseDepart(value, myAttrProperties.getAttrStr(), "", valueSUMOTime, dd, errorMessage); - break; - case SUMO_ATTR_DEPARTLANE: - SUMOVehicleParameter::parseDepartLane(value, myAttrProperties.getAttrStr(), "", valueInt, dld, errorMessage); - break; - case SUMO_ATTR_DEPARTPOS: - SUMOVehicleParameter::parseDepartPos(value, myAttrProperties.getAttrStr(), "", valueDouble, dpd, errorMessage); - break; - case SUMO_ATTR_DEPARTSPEED: - SUMOVehicleParameter::parseDepartSpeed(value, myAttrProperties.getAttrStr(), "", valueDouble, dsd, errorMessage); - break; - case SUMO_ATTR_ARRIVALLANE: - SUMOVehicleParameter::parseArrivalLane(value, myAttrProperties.getAttrStr(), "", valueInt, ald, errorMessage); - break; - case SUMO_ATTR_ARRIVALPOS: - SUMOVehicleParameter::parseArrivalPos(value, myAttrProperties.getAttrStr(), "", valueDouble, apd, errorMessage); - break; - case SUMO_ATTR_ARRIVALSPEED: - SUMOVehicleParameter::parseArrivalSpeed(value, myAttrProperties.getAttrStr(), "", valueDouble, asd, errorMessage); - break; - case SUMO_ATTR_DEPARTPOS_LAT: - SUMOVehicleParameter::parseDepartPosLat(value, myAttrProperties.getAttrStr(), "", valueDouble, dpld, errorMessage); - break; - case SUMO_ATTR_ARRIVALPOS_LAT: - SUMOVehicleParameter::parseArrivalPosLat(value, myAttrProperties.getAttrStr(), "", valueDouble, apld, errorMessage); - break; - case SUMO_ATTR_MODES: - SUMOVehicleParameter::parsePersonModes(value, myAttrProperties.getAttrStr(), "", mode, errorMessage); - break; - default: - throw ProcessError("Invalid complex attribute"); - } - // return error message (Will be empty if value is valid) - return errorMessage; -} - - -std::string -GNEFrameAttributesModuls::AttributesCreatorRow::generateID() const { - // get attribute carriers - const auto& GNEAttributeCarriers = myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers(); - // continue depending of type - if (myAttrProperties.getTagPropertyParent().isShape()) { - return GNEAttributeCarriers->generateShapeID(myAttrProperties.getTagPropertyParent().getXMLTag()); - } else if (myAttrProperties.getTagPropertyParent().isAdditionalElement()) { - return GNEAttributeCarriers->generateAdditionalID(myAttrProperties.getTagPropertyParent().getTag()); - } else if (myAttrProperties.getTagPropertyParent().isDemandElement()) { - return GNEAttributeCarriers->generateDemandElementID(myAttrProperties.getTagPropertyParent().getTag()); - } else { - return ""; - } -} - - -bool -GNEFrameAttributesModuls::AttributesCreatorRow::isValidID() const { - return (myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers()->retrieveAdditional( - myAttrProperties.getTagPropertyParent().getTag(), - myValueTextField->getText().text(), false) == nullptr); -} - -// --------------------------------------------------------------------------- -// GNEFrameAttributesModuls::AttributesCreator - methods -// --------------------------------------------------------------------------- - -GNEFrameAttributesModuls::AttributesCreator::AttributesCreator(GNEFrame* frameParent) : - FXGroupBox(frameParent->myContentFrame, "Internal attributes", GUIDesignGroupBoxFrame), - myFrameParent(frameParent) { - // resize myAttributesCreatorRows - myAttributesCreatorRows.resize(GNEAttributeCarrier::MAXNUMBEROFATTRIBUTES, nullptr); - // create myAttributesCreatorFlow - myAttributesCreatorFlow = new AttributesCreatorFlow(this); - // create help button - myHelpButton = new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); -} - - -GNEFrameAttributesModuls::AttributesCreator::~AttributesCreator() {} - - -void -GNEFrameAttributesModuls::AttributesCreator::showAttributesCreatorModul(const GNETagProperties& tagProperties, const std::vector& hiddenAttributes) { - // set current tag Properties - myTagProperties = tagProperties; - // first destroy all rows - for (auto& row : myAttributesCreatorRows) { - // destroy and delete all rows - if (row != nullptr) { - row->destroy(); - delete row; - row = nullptr; - } - } - // now declare a flag to show Flow editor - bool showFlowEditor = false; - // iterate over tag attributes and create AttributesCreatorRows for every attribute - for (const auto& attribute : myTagProperties) { - // declare falg to check conditions for show attribute - bool showAttribute = true; - // check that only non-unique attributes (except ID) are created (And depending of includeExtendedAttributes) - if (attribute.isUnique() && (attribute.getAttr() != SUMO_ATTR_ID)) { - showAttribute = false; - } - // check if attribute must stay hidden - if (std::find(hiddenAttributes.begin(), hiddenAttributes.end(), attribute.getAttr()) != hiddenAttributes.end()) { - showAttribute = false; - } - // check if attribute is a flow definitionattribute - if (attribute.isFlowDefinition()) { - showAttribute = false; - showFlowEditor = true; - } - // check special case for vaporizer IDs - if ((attribute.getAttr() == SUMO_ATTR_ID) && (attribute.getTagPropertyParent().getTag() == SUMO_TAG_VAPORIZER)) { - showAttribute = false; - } - // check special case for VType IDs in vehicle Frame - if ((attribute.getAttr() == SUMO_ATTR_TYPE) && (myFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand()) && - (myFrameParent->getViewNet()->getEditModes().demandEditMode == DemandEditMode::DEMAND_VEHICLE)) { - showAttribute = false; - } - // show attribute depending of showAttribute flag - if (showAttribute) { - myAttributesCreatorRows.at(attribute.getPositionListed()) = new AttributesCreatorRow(this, attribute); - } - } - // reparent help button (to place it at bottom) - myHelpButton->reparent(this); - // recalc - recalc(); - // check if flow editor has to be shown - if (showFlowEditor) { - myAttributesCreatorFlow->showAttributesCreatorFlowModul(tagProperties.hasAttribute(SUMO_ATTR_PERSONSPERHOUR)); - } else { - myAttributesCreatorFlow->hideAttributesCreatorFlowModul(); - } - // show - show(); -} - - -void -GNEFrameAttributesModuls::AttributesCreator::hideAttributesCreatorModul() { - // hide attributes creator flow - myAttributesCreatorFlow->hideAttributesCreatorFlowModul(); - // hide modul - hide(); -} - - -GNEFrame* -GNEFrameAttributesModuls::AttributesCreator::getFrameParent() const { - return myFrameParent; -} - - -void -GNEFrameAttributesModuls::AttributesCreator::getAttributesAndValues(CommonXMLStructure::SumoBaseObject* baseObject, bool includeAll) const { - // get standard parameters - for (const auto& row : myAttributesCreatorRows) { - if (row && row->getAttrProperties().getAttr() != SUMO_ATTR_NOTHING) { - const auto& attrProperties = row->getAttrProperties(); - // flag for row enabled - bool rowEnabled = row->isAttributesCreatorRowEnabled(); - // flag for default attributes - bool hasDefaultStaticValue = !attrProperties.hasStaticDefaultValue() || (attrProperties.getDefaultValue() != row->getValue()); - // flag for enablitables attributes - bool isFlowDefinitionAttribute = attrProperties.isFlowDefinition(); - // flag for optional attributes - bool isActivatableAttribute = attrProperties.isActivatable() && row->getAttributeCheckButtonCheck(); - // check if flags configuration allow to include values - if (rowEnabled && (includeAll || hasDefaultStaticValue || isFlowDefinitionAttribute || isActivatableAttribute)) { - // add attribute depending of type - if (attrProperties.isInt()) { - baseObject->addIntAttribute(attrProperties.getAttr(), GNEAttributeCarrier::parse(row->getValue())); - } else if (attrProperties.isFloat()) { - baseObject->addDoubleAttribute(attrProperties.getAttr(), GNEAttributeCarrier::parse(row->getValue())); - } else if (attrProperties.isBool()) { - baseObject->addBoolAttribute(attrProperties.getAttr(), GNEAttributeCarrier::parse(row->getValue())); - } else if (attrProperties.isposition()) { - baseObject->addPositionAttribute(attrProperties.getAttr(), GNEAttributeCarrier::parse(row->getValue())); - } else if (attrProperties.isSUMOTime()) { - baseObject->addTimeAttribute(attrProperties.getAttr(), GNEAttributeCarrier::parse(row->getValue())); - } else if (attrProperties.isColor()) { - baseObject->addColorAttribute(attrProperties.getAttr(), GNEAttributeCarrier::parse(row->getValue())); - } else if (attrProperties.isList()) { - if (attrProperties.isposition()) { - baseObject->addPositionVectorAttribute(attrProperties.getAttr(), GNEAttributeCarrier::parse(row->getValue())); - } else { - baseObject->addStringListAttribute(attrProperties.getAttr(), GNEAttributeCarrier::parse >(row->getValue())); - } - } else { - baseObject->addStringAttribute(attrProperties.getAttr(), row->getValue()); - } - } - } - } - // add extra flow attributes (only will updated if myAttributesCreatorFlow is shown) - myAttributesCreatorFlow->setFlowParameters(baseObject); -} - - -GNETagProperties -GNEFrameAttributesModuls::AttributesCreator::getCurrentTagProperties() const { - return myTagProperties; -} - - -void -GNEFrameAttributesModuls::AttributesCreator::showWarningMessage(std::string extra) const { - std::string errorMessage; - // iterate over standar parameters - for (const auto& attribute : myTagProperties) { - if (errorMessage.empty() && myAttributesCreatorRows.at(attribute.getPositionListed())) { - // Return string with the error if at least one of the parameter isn't valid - std::string attributeValue = myAttributesCreatorRows.at(attribute.getPositionListed())->isAttributeValid(); - if (attributeValue.size() != 0) { - errorMessage = attributeValue; - } - } - } - // show warning box if input parameters aren't invalid - if (extra.size() == 0) { - errorMessage = "Invalid input parameter of " + myTagProperties.getTagStr() + ": " + errorMessage; - } else { - errorMessage = "Invalid input parameter of " + myTagProperties.getTagStr() + ": " + extra; - } - - // set message in status bar - myFrameParent->myViewNet->setStatusBarText(errorMessage); - // Write Warning in console if we're in testing mode - WRITE_DEBUG(errorMessage); -} - - -bool -GNEFrameAttributesModuls::AttributesCreator::areValuesValid() const { - // iterate over standar parameters - for (const auto& attribute : myTagProperties) { - // Return false if error message of attriuve isn't empty - if (myAttributesCreatorRows.at(attribute.getPositionListed()) && myAttributesCreatorRows.at(attribute.getPositionListed())->isAttributeValid().size() != 0) { - return false; - } - } - return true; -} - - -void -GNEFrameAttributesModuls::AttributesCreator::refreshRows() { - // currently only row with attribute ID must be refresh - if (myTagProperties.hasAttribute(SUMO_ATTR_ID) && (myTagProperties.getTag() != SUMO_TAG_VAPORIZER)) { - myAttributesCreatorRows[myTagProperties.getAttributeProperties(SUMO_ATTR_ID).getPositionListed()]->refreshRow(); - } -} - -long -GNEFrameAttributesModuls::AttributesCreator::onCmdHelp(FXObject*, FXSelector, void*) { - // open Help attributes dialog - myFrameParent->openHelpAttributesDialog(myTagProperties); - return 1; -} - -// --------------------------------------------------------------------------- -// GNEFrameAttributesModuls::AttributesCreatorFlow - methods -// --------------------------------------------------------------------------- - -GNEFrameAttributesModuls::AttributesCreatorFlow::AttributesCreatorFlow(AttributesCreator* attributesCreatorParent) : - FXGroupBox(attributesCreatorParent->getFrameParent()->myContentFrame, "Flow attributes", GUIDesignGroupBoxFrame), - myAttributesCreatorParent(attributesCreatorParent), - myFlowParameters(VEHPARS_END_SET | VEHPARS_NUMBER_SET) { - // declare auxiliar horizontal frame - FXHorizontalFrame* auxiliarHorizontalFrame = nullptr; - // create elements for end attribute - auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myAttributeEndRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_END).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); - myValueEndTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create elements for number attribute - auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myAttributeNumberRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_NUMBER).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); - myValueNumberTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create elements for vehsPerHour attribute - auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myAttributeVehsPerHourRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_VEHSPERHOUR).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); - myValueVehsPerHourTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create elements for period attribute - auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myAttributePeriodRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PERIOD).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); - myValuePeriodTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create elements for Probability attribute - auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myAttributeProbabilityRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PROB).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); - myValueProbabilityTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // set default values - myValueEndTextField->setText("3600"); - myValueNumberTextField->setText("1800"); - myValueVehsPerHourTextField->setText("1800"); - myValuePeriodTextField->setText("2"); - myValueProbabilityTextField->setText("0.5"); - // refresh attributes - refreshAttributesCreatorFlow(); -} - - -GNEFrameAttributesModuls::AttributesCreatorFlow::~AttributesCreatorFlow() {} - - -void -GNEFrameAttributesModuls::AttributesCreatorFlow::showAttributesCreatorFlowModul(const bool persons) { - if (persons) { - myAttributeVehsPerHourRadioButton->setText(toString(SUMO_ATTR_PERSONSPERHOUR).c_str()); - } else { - myAttributeVehsPerHourRadioButton->setText(toString(SUMO_ATTR_VEHSPERHOUR).c_str()); - } - // show - show(); -} - - -void -GNEFrameAttributesModuls::AttributesCreatorFlow::hideAttributesCreatorFlowModul() { - hide(); -} - - -void -GNEFrameAttributesModuls::AttributesCreatorFlow::refreshAttributesCreatorFlow() { - if (myFlowParameters & VEHPARS_END_SET) { - myAttributeEndRadioButton->setCheck(TRUE); - myValueEndTextField->enable(); - } else { - myAttributeEndRadioButton->setCheck(FALSE); - myValueEndTextField->disable(); - } - if (myFlowParameters & VEHPARS_NUMBER_SET) { - myAttributeNumberRadioButton->setCheck(TRUE); - myValueNumberTextField->enable(); - } else { - myAttributeNumberRadioButton->setCheck(FALSE); - myValueNumberTextField->disable(); - } - if (myFlowParameters & VEHPARS_VPH_SET) { - myAttributeVehsPerHourRadioButton->setCheck(TRUE); - myValueVehsPerHourTextField->enable(); - } else { - myAttributeVehsPerHourRadioButton->setCheck(FALSE); - myValueVehsPerHourTextField->disable(); - } - if (myFlowParameters & VEHPARS_PERIOD_SET) { - myAttributePeriodRadioButton->setCheck(TRUE); - myValuePeriodTextField->enable(); - } else { - myAttributePeriodRadioButton->setCheck(FALSE); - myValuePeriodTextField->disable(); - } - if (myFlowParameters & VEHPARS_PROB_SET) { - myAttributeProbabilityRadioButton->setCheck(TRUE); - myValueProbabilityTextField->enable(); - } else { - myAttributeProbabilityRadioButton->setCheck(FALSE); - myValueProbabilityTextField->disable(); - } -} - - -void -GNEFrameAttributesModuls::AttributesCreatorFlow::setFlowParameters(CommonXMLStructure::SumoBaseObject* baseObject) { - if (myFlowParameters & VEHPARS_END_SET) { - baseObject->addDoubleAttribute(SUMO_ATTR_END, GNEAttributeCarrier::parse(myValueEndTextField->getText().text())); - } - if (myFlowParameters & VEHPARS_NUMBER_SET) { - baseObject->addIntAttribute(SUMO_ATTR_NUMBER, GNEAttributeCarrier::parse(myValueNumberTextField->getText().text())); - } - if (myFlowParameters & VEHPARS_VPH_SET) { - if (myAttributeVehsPerHourRadioButton->getText().text() == toString(SUMO_ATTR_VEHSPERHOUR)) { - baseObject->addDoubleAttribute(SUMO_ATTR_VEHSPERHOUR, GNEAttributeCarrier::parse(myValueVehsPerHourTextField->getText().text())); - } else { - baseObject->addDoubleAttribute(SUMO_ATTR_PERSONSPERHOUR, GNEAttributeCarrier::parse(myValueVehsPerHourTextField->getText().text())); - } - } - if (myFlowParameters & VEHPARS_PERIOD_SET) { - baseObject->addDoubleAttribute(SUMO_ATTR_PERIOD, GNEAttributeCarrier::parse(myValuePeriodTextField->getText().text())); - } - if (myFlowParameters & VEHPARS_PROB_SET) { - baseObject->addDoubleAttribute(SUMO_ATTR_PROB, GNEAttributeCarrier::parse(myValueProbabilityTextField->getText().text())); - } -} - - -void -GNEFrameAttributesModuls::AttributesCreatorFlow::showWarningMessage(std::string /* extra */) const { - std::string errorMessage; - /* - // iterate over standar parameters - for (const auto &i : myTagProperties) { - if (errorMessage.empty() && myAttributesCreatorRows.at(i.getPositionListed())) { - // Return string with the error if at least one of the parameter isn't valid - std::string attributeValue = myAttributesCreatorRows.at(i.getPositionListed())->isAttributeValid(); - if (attributeValue.size() != 0) { - errorMessage = attributeValue; - } - } - } - // show warning box if input parameters aren't invalid - if (extra.size() == 0) { - errorMessage = "Invalid input parameter of " + myTagProperties.getTagStr() + ": " + errorMessage; - } else { - errorMessage = "Invalid input parameter of " + myTagProperties.getTagStr() + ": " + extra; - } - */ - // set message in status bar - myAttributesCreatorParent->getFrameParent()->myViewNet->setStatusBarText(errorMessage); - // Write Warning in console if we're in testing mode - WRITE_DEBUG(errorMessage); -} - - -bool -GNEFrameAttributesModuls::AttributesCreatorFlow::areValuesValid() const { - // check every flow attribute - if (myFlowParameters & VEHPARS_END_SET) { - if (GNEAttributeCarrier::canParse(myValueEndTextField->getText().text())) { - if (GNEAttributeCarrier::parse(myValueEndTextField->getText().text()) < 0) { - return false; - } - } else { - return false; - } - } - if (myFlowParameters & VEHPARS_NUMBER_SET) { - if (GNEAttributeCarrier::canParse(myValueNumberTextField->getText().text())) { - if (GNEAttributeCarrier::parse(myValueNumberTextField->getText().text()) < 0) { - return false; - } - } else { - return false; - } - } - if (myFlowParameters & VEHPARS_VPH_SET) { - if (GNEAttributeCarrier::canParse(myValueVehsPerHourTextField->getText().text())) { - if (GNEAttributeCarrier::parse(myValueVehsPerHourTextField->getText().text()) < 0) { - return false; - } - } else { - return false; - } - } - if (myFlowParameters & VEHPARS_PERIOD_SET) { - if (GNEAttributeCarrier::canParse(myValuePeriodTextField->getText().text())) { - if (GNEAttributeCarrier::parse(myValuePeriodTextField->getText().text()) < 0) { - return false; - } - } else { - return false; - } - } - if (myFlowParameters & VEHPARS_PROB_SET) { - if (GNEAttributeCarrier::canParse(myValueProbabilityTextField->getText().text())) { - if (GNEAttributeCarrier::parse(myValueProbabilityTextField->getText().text()) < 0) { - return false; - } - } else { - return false; - } - } - return true; -} - - -long -GNEFrameAttributesModuls::AttributesCreatorFlow::onCmdSetFlowAttribute(FXObject* obj, FXSelector, void*) { - // obtain clicked textfield - FXTextField* textField = nullptr; - // check what text field was pressed - if (obj == myValueEndTextField) { - textField = myValueEndTextField; - } else if (obj == myValueNumberTextField) { - textField = myValueNumberTextField; - } else if (obj == myValueVehsPerHourTextField) { - textField = myValueVehsPerHourTextField; - } else if (obj == myValuePeriodTextField) { - textField = myValuePeriodTextField; - } else if (obj == myValueProbabilityTextField) { - textField = myValueProbabilityTextField; - } else { - throw ProcessError("Invalid text field"); - } - // check if value is valid - if (GNEAttributeCarrier::canParse(textField->getText().text()) && (GNEAttributeCarrier::parse(textField->getText().text()) >= 0)) { - textField->setTextColor(FXRGB(0, 0, 0)); - } else { - textField->setTextColor(FXRGB(255, 0, 0)); - } - textField->killFocus(); - return 1; -} - - -long -GNEFrameAttributesModuls::AttributesCreatorFlow::onCmdSelectFlowRadioButton(FXObject* obj, FXSelector, void*) { - // check what check button was pressed - if (obj == myAttributeEndRadioButton) { - GNERouteHandler::setFlowParameters(SUMO_ATTR_END, myFlowParameters); - } else if (obj == myAttributeNumberRadioButton) { - GNERouteHandler::setFlowParameters(SUMO_ATTR_NUMBER, myFlowParameters); - } else if (obj == myAttributeVehsPerHourRadioButton) { - if (myAttributeVehsPerHourRadioButton->getText().text() == toString(SUMO_ATTR_VEHSPERHOUR)) { - GNERouteHandler::setFlowParameters(SUMO_ATTR_VEHSPERHOUR, myFlowParameters); - } else { - GNERouteHandler::setFlowParameters(SUMO_ATTR_PERSONSPERHOUR, myFlowParameters); - } - } else if (obj == myAttributePeriodRadioButton) { - GNERouteHandler::setFlowParameters(SUMO_ATTR_PERIOD, myFlowParameters); - } else if (obj == myAttributeProbabilityRadioButton) { - GNERouteHandler::setFlowParameters(SUMO_ATTR_PROB, myFlowParameters); - } else { - throw ProcessError("Invalid Radio Button"); - } - // refresh attributes - refreshAttributesCreatorFlow(); - return 1; -} - -// --------------------------------------------------------------------------- -// GNEFrameAttributesModuls::AttributesEditorRow - methods -// --------------------------------------------------------------------------- - -GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow(GNEFrameAttributesModuls::AttributesEditor* attributeEditorParent, const GNEAttributeProperties& ACAttr, - const std::string& value, const bool attributeEnabled, const bool computed) : - FXHorizontalFrame(attributeEditorParent, GUIDesignAuxiliarHorizontalFrame), - myAttributesEditorParent(attributeEditorParent), - myACAttr(ACAttr), - myMultiple(GNEAttributeCarrier::parse>(value).size() > 1) { - // Create and hide label - myAttributeLabel = new FXLabel(this, "attributeLabel", nullptr, GUIDesignLabelAttribute); - myAttributeLabel->hide(); - // Create and hide check button - myAttributeCheckButton = new FXCheckButton(this, "attributeCheckButton", this, MID_GNE_SET_ATTRIBUTE_BOOL, GUIDesignCheckButtonAttribute); - myAttributeCheckButton->hide(); - // Create and hide ButtonCombinableChoices - myAttributeButtonCombinableChoices = new FXButton(this, "attributeButtonCombinableChoices", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute); - myAttributeButtonCombinableChoices->hide(); - // create and hidde color editor - myAttributeColorButton = new FXButton(this, "attributeColorButton", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute); - myAttributeColorButton->hide(); - // Create and hide textField for string attributes - myValueTextField = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - myValueTextField->hide(); - // Create and hide ComboBox - myValueComboBoxChoices = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignComboBoxAttribute); - myValueComboBoxChoices->hide(); - // Create and hide checkButton - myValueCheckButton = new FXCheckButton(this, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); - myValueCheckButton->hide(); - // only create if parent was created - if (getParent()->id()) { - // create AttributesEditorRow - FXHorizontalFrame::create(); - // start enabling all elements, depending if attribute is enabled - if (attributeEnabled == false) { - myValueTextField->disable(); - myValueComboBoxChoices->disable(); - myValueCheckButton->disable(); - } else { - myValueTextField->enable(); - myValueComboBoxChoices->enable(); - myValueCheckButton->enable(); - } - // if Tag correspond to an network element but we're in demand mode (or vice versa), disable all elements - if (myACAttr.getAttr() != SUMO_ATTR_NOTHING) { - if (isSupermodeValid(myAttributesEditorParent->getFrameParent()->myViewNet, myACAttr)) { - myAttributeButtonCombinableChoices->enable(); - myAttributeColorButton->enable(); - myAttributeCheckButton->enable(); - } else { - myAttributeColorButton->disable(); - myAttributeCheckButton->disable(); - myValueTextField->disable(); - myValueComboBoxChoices->disable(); - myValueCheckButton->disable(); - myAttributeButtonCombinableChoices->disable(); - } - } - // set left column - if (myACAttr.isColor()) { - // show color button and set color text depending of computed - if (computed) { - myAttributeColorButton->setTextColor(FXRGB(0, 0, 255)); - } else { - myAttributeColorButton->setTextColor(FXRGB(0, 0, 0)); - } - myAttributeColorButton->setText(myACAttr.getAttrStr().c_str()); - myAttributeColorButton->show(); - } else if (myACAttr.isActivatable()) { - // show checkbox button and set color text depending of computed - if (computed) { - myAttributeCheckButton->setTextColor(FXRGB(0, 0, 255)); - } else { - myAttributeCheckButton->setTextColor(FXRGB(0, 0, 0)); - } - myAttributeCheckButton->setText(myACAttr.getAttrStr().c_str()); - myAttributeCheckButton->show(); - // check or uncheck depending of attributeEnabled - if (attributeEnabled) { - myAttributeCheckButton->setCheck(TRUE); - } else { - myAttributeCheckButton->setCheck(FALSE); - } - } else { - // Show attribute Label - myAttributeLabel->setText(myACAttr.getAttrStr().c_str()); - myAttributeLabel->show(); - } - // Set field depending of the type of value - if (myACAttr.isBool()) { - // first we need to check if all boolean values are equal - bool allBooleanValuesEqual = true; - // declare boolean vector - std::vector booleanVector; - // check if value can be parsed to a boolean vector - if (GNEAttributeCarrier::canParse >(value)) { - booleanVector = GNEAttributeCarrier::parse >(value); - } - // iterate over pased booleans comparing all element with the first - for (const auto& booleanValue : booleanVector) { - if (booleanValue != booleanVector.front()) { - allBooleanValuesEqual = false; - } - } - // use checkbox or textfield depending if all booleans are equal - if (allBooleanValuesEqual) { - // set check button - if ((booleanVector.size() > 0) && booleanVector.front()) { - myValueCheckButton->setCheck(true); - myValueCheckButton->setText("true"); - } else { - myValueCheckButton->setCheck(false); - myValueCheckButton->setText("false"); - } - // show check button - myValueCheckButton->show(); - } else { - // show list of bools (0 1) - myValueTextField->setText(value.c_str()); - // set text depending of computed - if (computed) { - myValueTextField->setTextColor(FXRGB(0, 0, 255)); - } else { - myValueTextField->setTextColor(FXRGB(0, 0, 0)); - } - myValueTextField->show(); - } - } else if (myACAttr.isDiscrete()) { - // Check if are VClasses - if ((myACAttr.getDiscreteValues().size() > 0) && myACAttr.isVClasses()) { - // hide label - myAttributeLabel->hide(); - // Show button combinable choices - myAttributeButtonCombinableChoices->setText(myACAttr.getAttrStr().c_str()); - myAttributeButtonCombinableChoices->show(); - // Show string with the values - myValueTextField->setText(value.c_str()); - // set color depending of computed - if (computed) { - myValueTextField->setTextColor(FXRGB(0, 0, 255)); - } else { - myValueTextField->setTextColor(FXRGB(0, 0, 0)); - } - myValueTextField->show(); - } else if (!myMultiple) { - // fill comboBox - myValueComboBoxChoices->clearItems(); - for (const auto& discreteValue : myACAttr.getDiscreteValues()) { - myValueComboBoxChoices->appendItem(discreteValue.c_str()); - } - // show combo box with values - myValueComboBoxChoices->setNumVisible((int)myACAttr.getDiscreteValues().size()); - myValueComboBoxChoices->setCurrentItem(myValueComboBoxChoices->findItem(value.c_str())); - // set color depending of computed - if (computed) { - myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 255)); - } else { - myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0)); - } - myValueComboBoxChoices->show(); - } else { - // represent combinable choices in multiple selections always with a textfield instead with a comboBox - myValueTextField->setText(value.c_str()); - // set color depending of computed - if (computed) { - myValueTextField->setTextColor(FXRGB(0, 0, 255)); - } else { - myValueTextField->setTextColor(FXRGB(0, 0, 0)); - } - myValueTextField->show(); - } - } else { - // In any other case (String, list, etc.), show value as String - myValueTextField->setText(value.c_str()); - // set color depending of computed - if (computed) { - myValueTextField->setTextColor(FXRGB(0, 0, 255)); - } else { - myValueTextField->setTextColor(FXRGB(0, 0, 0)); - } - myValueTextField->show(); - } - // Show AttributesEditorRow - show(); - } -} - - -void -GNEFrameAttributesModuls::AttributesEditorRow::destroy() { - // only destroy if parent was created - if (getParent()->id()) { - FXHorizontalFrame::destroy(); - } -} - - -void -GNEFrameAttributesModuls::AttributesEditorRow::refreshAttributesEditorRow(const std::string& value, - const bool forceRefresh, const bool attributeEnabled, const bool computed) { - // start enabling all elements, depending if attribute is enabled - if (attributeEnabled == false) { - myValueTextField->disable(); - myValueComboBoxChoices->disable(); - myValueCheckButton->disable(); - } else { - myValueTextField->enable(); - myValueComboBoxChoices->enable(); - myValueCheckButton->enable(); - } - // if Tag correspond to an network element but we're in demand mode (or vice versa), disable all elements - if (myACAttr.getAttr() != SUMO_ATTR_NOTHING) { - if (isSupermodeValid(myAttributesEditorParent->getFrameParent()->myViewNet, myACAttr)) { - myAttributeButtonCombinableChoices->enable(); - myAttributeColorButton->enable(); - myAttributeCheckButton->enable(); - } else { - myAttributeColorButton->disable(); - myAttributeCheckButton->disable(); - myValueTextField->disable(); - myValueComboBoxChoices->disable(); - myValueCheckButton->disable(); - myAttributeButtonCombinableChoices->disable(); - } - } - // set check buton - if (myAttributeCheckButton->shown()) { - myAttributeCheckButton->setCheck(attributeEnabled); - } - if (myValueTextField->shown()) { - // set last valid value and restore color if onlyValid is disabled - if (myValueTextField->getTextColor() == FXRGB(0, 0, 0) || myValueTextField->getTextColor() == FXRGB(0, 0, 255) || forceRefresh) { - myValueTextField->setText(value.c_str()); - // set blue color if is an computed value - if (computed) { - myValueTextField->setTextColor(FXRGB(0, 0, 255)); - } else { - myValueTextField->setTextColor(FXRGB(0, 0, 0)); - } - } - } else if (myValueComboBoxChoices->shown()) { - // fill comboBox again - myValueComboBoxChoices->clearItems(); - for (const auto& discreteValue : myACAttr.getDiscreteValues()) { - myValueComboBoxChoices->appendItem(discreteValue.c_str()); - } - // show combo box with values - myValueComboBoxChoices->setNumVisible((int)myACAttr.getDiscreteValues().size()); - myValueComboBoxChoices->setCurrentItem(myValueComboBoxChoices->findItem(value.c_str())); - // set blue color if is an computed value - if (computed) { - myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 255)); - } else { - myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0)); - } - myValueComboBoxChoices->show(); - } else if (myValueCheckButton->shown()) { - if (GNEAttributeCarrier::canParse(value)) { - myValueCheckButton->setCheck(GNEAttributeCarrier::parse(value)); - } else { - myValueCheckButton->setCheck(false); - } - } -} - - -bool -GNEFrameAttributesModuls::AttributesEditorRow::isAttributesEditorRowValid() const { - return ((myValueTextField->getTextColor() == FXRGB(0, 0, 0)) || (myValueTextField->getTextColor() == FXRGB(0, 0, 255))) && - ((myValueComboBoxChoices->getTextColor() == FXRGB(0, 0, 0)) || (myValueComboBoxChoices->getTextColor() == FXRGB(0, 0, 255))); -} - - -long -GNEFrameAttributesModuls::AttributesEditorRow::onCmdOpenAttributeDialog(FXObject* obj, FXSelector, void*) { - const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers(); - if (obj == myAttributeColorButton) { - // create FXColorDialog - FXColorDialog colordialog(this, tr("Color Dialog")); - colordialog.setTarget(this); - // If previous attribute wasn't correct, set black as default color - if (GNEAttributeCarrier::canParse(myValueTextField->getText().text())) { - colordialog.setRGBA(MFXUtils::getFXColor(GNEAttributeCarrier::parse(myValueTextField->getText().text()))); - } else if (!myACAttr.getDefaultValue().empty()) { - colordialog.setRGBA(MFXUtils::getFXColor(GNEAttributeCarrier::parse(myACAttr.getDefaultValue()))); - } else { - colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::BLACK)); - } - // execute dialog to get a new color - if (colordialog.execute()) { - std::string newValue = toString(MFXUtils::getRGBColor(colordialog.getRGBA())); - myValueTextField->setText(newValue.c_str()); - if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->isValid(myACAttr.getAttr(), newValue)) { - // if its valid for the first AC than its valid for all (of the same type) - if (ACs.size() > 1) { - myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(ACs.front()->getTagProperty().getGUIIcon(), "Change multiple attributes"); - } - // Set new value of attribute in all selected ACs - for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { - inspectedAC->setAttribute(myACAttr.getAttr(), newValue, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()); - } - // If previously value was incorrect, change font color to black - myValueTextField->setTextColor(FXRGB(0, 0, 0)); - myValueTextField->killFocus(); - } - } - return 0; - } else if (obj == myAttributeButtonCombinableChoices) { - // if its valid for the first AC than its valid for all (of the same type) - if (ACs.size() > 1) { - myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(ACs.front()->getTagProperty().getGUIIcon(), "Change multiple attributes"); - } - // get attribute to modify - SumoXMLAttr modifiedAttr = myACAttr.getAttr() == SUMO_ATTR_DISALLOW ? SUMO_ATTR_ALLOW : myACAttr.getAttr(); - // declare accept changes - bool acceptChanges = false; - // open GNEAllowDisallow (also used to modify SUMO_ATTR_CHANGE_LEFT etc - GNEAllowDisallow(myAttributesEditorParent->getFrameParent()->myViewNet, myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front(), modifiedAttr, &acceptChanges).execute(); - // continue depending of acceptChanges - if (acceptChanges) { - std::string allowed = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAttribute(modifiedAttr); - // Set new value of attribute in all selected ACs - for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { - inspectedAC->setAttribute(modifiedAttr, allowed, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()); - } - // finish change multiple attributes - if (ACs.size() > 1) { - myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->end(); - } - // update frame parent after attribute sucesfully set - myAttributesEditorParent->getFrameParent()->attributeUpdated(); - } - return 1; - } else { - throw ProcessError("Invalid call to onCmdOpenAttributeDialog"); - } -} - - -long -GNEFrameAttributesModuls::AttributesEditorRow::onCmdSetAttribute(FXObject*, FXSelector, void*) { - // Declare changed value - std::string newVal; - // First, obtain the string value of the new attribute depending of their type - if (myACAttr.isBool()) { - // first check if we're editing boolean as a list of string or as a checkbox - if (myValueCheckButton->shown()) { - // Set true o false depending of the checkBox - if (myValueCheckButton->getCheck()) { - myValueCheckButton->setText("true"); - newVal = "true"; - } else { - myValueCheckButton->setText("false"); - newVal = "false"; - } - } else { - // obtain boolean value of myValueTextField (because we're inspecting multiple attribute carriers with different values) - newVal = myValueTextField->getText().text(); - } - } else if (myACAttr.isDiscrete()) { - // Check if are VClasses - if ((myACAttr.getDiscreteValues().size() > 0) && myACAttr.isVClasses()) { - // Get value obtained using AttributesEditor - newVal = myValueTextField->getText().text(); - } else if (!myMultiple) { - // Get value of ComboBox - newVal = myValueComboBoxChoices->getText().text(); - } else { - // due this is a multiple selection, obtain value of myValueTextField instead of comboBox - newVal = myValueTextField->getText().text(); - } - } else { - // Check if default value of attribute must be set - if (myValueTextField->getText().empty() && myACAttr.hasStaticDefaultValue()) { - newVal = myACAttr.getDefaultValue(); - myValueTextField->setText(newVal.c_str()); - } else if (myACAttr.isInt() && GNEAttributeCarrier::canParse(myValueTextField->getText().text())) { - // filter int attributes - double doubleValue = GNEAttributeCarrier::parse(myValueTextField->getText().text()); - // check if myValueTextField has to be updated - if ((doubleValue - (int)doubleValue) == 0) { - newVal = toString((int)doubleValue); - myValueTextField->setText(newVal.c_str(), FALSE); - } - } else if ((myACAttr.getAttr() == SUMO_ATTR_ANGLE) && GNEAttributeCarrier::canParse(myValueTextField->getText().text())) { - // filter angle - double angle = GNEAttributeCarrier::parse(myValueTextField->getText().text()); - // filter if angle isn't between [0,360] - if ((angle < 0) || (angle > 360)) { - // apply modul - angle = fmod(angle, 360); - } - // set newVal - newVal = toString(angle); - // update Textfield - myValueTextField->setText(newVal.c_str(), FALSE); - } else { - // obtain value of myValueTextField - newVal = myValueTextField->getText().text(); - } - } - // we need a extra check for Position and Shape Values, due #2658 - if ((myACAttr.getAttr() == SUMO_ATTR_POSITION) || (myACAttr.getAttr() == SUMO_ATTR_SHAPE)) { - newVal = stripWhitespaceAfterComma(newVal); - } - // get inspected ACs (for code cleaning) - const auto& inspectedACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers(); - // Check if attribute must be changed - if ((inspectedACs.size() > 0) && inspectedACs.front()->isValid(myACAttr.getAttr(), newVal)) { - // check if we're merging junction - if (!mergeJunction(myACAttr.getAttr(), inspectedACs, newVal)) { - // if its valid for the first AC than its valid for all (of the same type) - if (inspectedACs.size() > 1) { - myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(inspectedACs.front()->getTagProperty().getGUIIcon(), "Change multiple attributes"); - } else if (myACAttr.getAttr() == SUMO_ATTR_ID) { - // IDs attribute has to be encapsulated - myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->begin(inspectedACs.front()->getTagProperty().getGUIIcon(), "change " + myACAttr.getTagPropertyParent().getTagStr() + " attribute"); - } - // Set new value of attribute in all selected ACs - for (const auto& inspectedAC : inspectedACs) { - inspectedAC->setAttribute(myACAttr.getAttr(), newVal, myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()); - } - // finish change multiple attributes or ID Attributes - if (inspectedACs.size() > 1) { - myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->end(); - } else if (myACAttr.getAttr() == SUMO_ATTR_ID) { - myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList()->end(); - } - // If previously value was incorrect, change font color to black - if (myACAttr.isVClasses()) { - myValueTextField->setTextColor(FXRGB(0, 0, 0)); - myValueTextField->killFocus(); - // in this case, we need to refresh the other values (For example, allow/Disallow objects) - myAttributesEditorParent->refreshAttributeEditor(false, false); - } else if (myACAttr.isDiscrete()) { - myValueComboBoxChoices->setTextColor(FXRGB(0, 0, 0)); - myValueComboBoxChoices->killFocus(); - } else if (myValueTextField != nullptr) { - myValueTextField->setTextColor(FXRGB(0, 0, 0)); - myValueTextField->killFocus(); - } - // update frame parent after attribute sucesfully set - myAttributesEditorParent->getFrameParent()->attributeUpdated(); - } - } else { - // If value of TextField isn't valid, change color to Red depending of type - if (myACAttr.isVClasses()) { - myValueTextField->setTextColor(FXRGB(255, 0, 0)); - myValueTextField->killFocus(); - } else if (myACAttr.isDiscrete()) { - myValueComboBoxChoices->setTextColor(FXRGB(255, 0, 0)); - myValueComboBoxChoices->killFocus(); - } else if (myValueTextField != nullptr) { - myValueTextField->setTextColor(FXRGB(255, 0, 0)); - } - // Write Warning in console if we're in testing mode - WRITE_DEBUG("Value '" + newVal + "' for attribute " + myACAttr.getAttrStr() + " of " + myACAttr.getTagPropertyParent().getTagStr() + " isn't valid"); - } - return 1; -} - - -long -GNEFrameAttributesModuls::AttributesEditorRow::onCmdSelectCheckButton(FXObject*, FXSelector, void*) { - const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers(); - // obtain undoList (To improve code legibly) - GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList(); - // check if we have to enable or disable - if (myAttributeCheckButton->getCheck()) { - // enable input values - myValueCheckButton->enable(); - myValueTextField->enable(); - // enable attribute - undoList->begin(ACs.front()->getTagProperty().getGUIIcon(), "enable attribute '" + myACAttr.getAttrStr() + "'"); - ACs.front()->enableAttribute(myACAttr.getAttr(), undoList); - undoList->end(); - } else { - // disable input values - myValueCheckButton->disable(); - myValueTextField->disable(); - // disable attribute - undoList->begin(ACs.front()->getTagProperty().getGUIIcon(), "disable attribute '" + myACAttr.getAttrStr() + "'"); - ACs.front()->disableAttribute(myACAttr.getAttr(), undoList); - undoList->end(); - } - return 0; -} - - -GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow() : - myMultiple(false) { -} - - -std::string -GNEFrameAttributesModuls::AttributesEditorRow::stripWhitespaceAfterComma(const std::string& stringValue) { - std::string result(stringValue); - while (result.find(", ") != std::string::npos) { - result = StringUtils::replace(result, ", ", ","); - } - return result; -} - - -bool -GNEFrameAttributesModuls::AttributesEditorRow::mergeJunction(SumoXMLAttr attr, const std::vector& inspectedACs, const std::string& newVal) const { - // check if we're editing junction position - if ((inspectedACs.size() == 1) && (inspectedACs.front()->getTagProperty().getTag() == SUMO_TAG_JUNCTION) && (attr == SUMO_ATTR_POSITION)) { - // retrieve original junction - GNEJunction* movedJunction = myAttributesEditorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers()->retrieveJunction(inspectedACs.front()->getID()); - // parse position - const Position newPosition = GNEAttributeCarrier::parse(newVal); - // iterate over network junction - for (const auto& junction : myAttributesEditorParent->getFrameParent()->getViewNet()->getNet()->getAttributeCarriers()->getJunctions()) { - // check distance position - if ((junction.second->getPositionInView().distanceTo2D(newPosition) < POSITION_EPS) && - myAttributesEditorParent->getFrameParent()->getViewNet()->mergeJunctions(movedJunction, junction.second)) { - return true; - } - } - } - // nothing to merge - return false; -} - -// --------------------------------------------------------------------------- -// GNEFrameAttributesModuls::AttributesEditor - methods -// --------------------------------------------------------------------------- - -GNEFrameAttributesModuls::AttributesEditor::AttributesEditor(GNEFrame* FrameParent) : - FXGroupBox(FrameParent->myContentFrame, "Internal attributes", GUIDesignGroupBoxFrame), - myFrameParent(FrameParent), - myIncludeExtended(true) { - // resize myAttributesEditorRows - myAttributesEditorRows.resize(GNEAttributeCarrier::MAXNUMBEROFATTRIBUTES, nullptr); - // create myAttributesFlowEditor - myAttributesEditorFlow = new AttributesEditorFlow(this); - // leave it hidden - myAttributesEditorFlow->hideAttributesEditorFlowModul(); - // Create help button - myHelpButton = new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); -} - - -void -GNEFrameAttributesModuls::AttributesEditor::showAttributeEditorModul(bool includeExtended, bool forceAttributeEnabled) { - myIncludeExtended = includeExtended; - // first remove all rows - for (auto& row : myAttributesEditorRows) { - // destroy and delete all rows - if (row != nullptr) { - row->destroy(); - delete row; - row = nullptr; - } - } - // get inspected ACs - const auto& ACs = myFrameParent->getViewNet()->getInspectedAttributeCarriers(); - // declare flag to check if flow editor has to be shown - bool showFlowEditor = false; - if (ACs.size() > 0) { - // Iterate over attributes - for (const auto& attrProperty : ACs.front()->getTagProperty()) { - // declare flag to show/hidde atribute - bool editAttribute = true; - // disable editing for unique attributes in case of multi-selection - if ((ACs.size() > 1) && attrProperty.isUnique()) { - editAttribute = false; - } - // disable editing of extended attributes if includeExtended isn't enabled - if (attrProperty.isExtended() && !includeExtended) { - editAttribute = false; - } - // disable editing of flow definition attributes, but enable flow editor - if (attrProperty.isFlowDefinition()) { - editAttribute = false; - showFlowEditor = true; - } - // continue if attribute is editable - if (editAttribute) { - // Declare a set of occuring values and insert attribute's values of item (note: We use a set to avoid repeated values) - std::set occuringValues; - // iterate over edited attributes - for (const auto& inspectedAC : ACs) { - occuringValues.insert(inspectedAC->getAttribute(attrProperty.getAttr())); - } - // get current value - std::ostringstream oss; - for (auto values = occuringValues.begin(); values != occuringValues.end(); values++) { - if (values != occuringValues.begin()) { - oss << " "; - } - oss << *values; - } - // obtain value to be shown in row - std::string value = oss.str(); - // declare a flag for enabled attributes - bool attributeEnabled = ACs.front()->isAttributeEnabled(attrProperty.getAttr()); - // overwritte value if attribute is disabled (used by LinkIndex) - if (attributeEnabled == false) { - value = ACs.front()->getAlternativeValueForDisabledAttributes(attrProperty.getAttr()); - } - // extra check for Triggered and container Triggered - if (ACs.front()->getTagProperty().isStop() || ACs.front()->getTagProperty().isStopPerson()) { - if ((attrProperty.getAttr() == SUMO_ATTR_EXPECTED) && (ACs.front()->isAttributeEnabled(SUMO_ATTR_TRIGGERED) == false)) { - attributeEnabled = false; - } else if ((attrProperty.getAttr() == SUMO_ATTR_EXPECTED_CONTAINERS) && (ACs.front()->isAttributeEnabled(SUMO_ATTR_CONTAINER_TRIGGERED) == false)) { - attributeEnabled = false; - } - } - // if forceEnablellAttribute is enable, force attributeEnabled (except for ID) - if (forceAttributeEnabled && (attrProperty.getAttr() != SUMO_ATTR_ID)) { - attributeEnabled = true; - } - // check if this attribute is computed - const bool computed = (ACs.size() > 1) ? false : ACs.front()->isAttributeComputed(attrProperty.getAttr()); - // create attribute editor row - myAttributesEditorRows[attrProperty.getPositionListed()] = new AttributesEditorRow(this, attrProperty, value, attributeEnabled, computed); - } - } - // check if Flow editor has to be shown - if (showFlowEditor) { - myAttributesEditorFlow->showAttributeEditorFlowModul(); - } else { - myAttributesEditorFlow->hideAttributesEditorFlowModul(); - } - // show AttributesEditor - show(); - } else { - myAttributesEditorFlow->hideAttributesEditorFlowModul(); - } - // reparent help button (to place it at bottom) - myHelpButton->reparent(this); -} - - -void -GNEFrameAttributesModuls::AttributesEditor::hideAttributesEditorModul() { - // hide AttributesEditorFlowModul - myAttributesEditorFlow->hideAttributesEditorFlowModul(); - // hide also AttributesEditor - hide(); -} - - -void -GNEFrameAttributesModuls::AttributesEditor::refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition) { - // get inspected ACs - const auto& ACs = myFrameParent->getViewNet()->getInspectedAttributeCarriers(); - // first check if there is inspected attribute carriers - if (ACs.size() > 0) { - // Iterate over inspected attribute carriers - for (const auto& attrProperty : ACs.front()->getTagProperty()) { - // declare flag to show/hidde atribute - bool editAttribute = true; - // disable editing for unique attributes in case of multi-selection - if ((ACs.size() > 1) && attrProperty.isUnique()) { - editAttribute = false; - } - // disable editing of extended attributes if includeExtended isn't enabled - if (attrProperty.isExtended() && !myIncludeExtended) { - editAttribute = false; - } - // disable editing of flow definition attributes, but enable flow editor - if (attrProperty.isFlowDefinition()) { - editAttribute = false; - } - // continue if attribute is editable - if (editAttribute) { - // Declare a set of occuring values and insert attribute's values of item (note: We use a set to avoid repeated values) - std::set occuringValues; - // iterate over edited attributes - for (const auto& inspectedAC : ACs) { - occuringValues.insert(inspectedAC->getAttribute(attrProperty.getAttr())); - } - // get current value - std::ostringstream oss; - for (auto values = occuringValues.begin(); values != occuringValues.end(); values++) { - if (values != occuringValues.begin()) { - oss << " "; - } - oss << *values; - } - // obtain value to be shown in row - std::string value = oss.str(); - // declare a flag for enabled attributes - bool attributeEnabled = ACs.front()->isAttributeEnabled(attrProperty.getAttr()); - // overwritte value if attribute is disabled (used by LinkIndex) - if (attributeEnabled == false) { - value = ACs.front()->getAlternativeValueForDisabledAttributes(attrProperty.getAttr()); - } - // extra check for Triggered and container Triggered - if (ACs.front()->getTagProperty().isStop() || ACs.front()->getTagProperty().isStopPerson()) { - if ((attrProperty.getAttr() == SUMO_ATTR_EXPECTED) && (ACs.front()->isAttributeEnabled(SUMO_ATTR_TRIGGERED) == false)) { - attributeEnabled = false; - } else if ((attrProperty.getAttr() == SUMO_ATTR_EXPECTED_CONTAINERS) && (ACs.front()->isAttributeEnabled(SUMO_ATTR_CONTAINER_TRIGGERED) == false)) { - attributeEnabled = false; - } - } - // check if this attribute is computed - const bool computed = (ACs.size() > 1) ? false : ACs.front()->isAttributeComputed(attrProperty.getAttr()); - // Check if Position or Shape refresh has to be forced - if ((attrProperty.getAttr() == SUMO_ATTR_SHAPE) && forceRefreshShape) { - myAttributesEditorRows[attrProperty.getPositionListed()]->refreshAttributesEditorRow(value, true, attributeEnabled, computed); - } else if ((attrProperty.getAttr() == SUMO_ATTR_POSITION) && forceRefreshPosition) { - // Refresh attributes maintain invalid values - myAttributesEditorRows[attrProperty.getPositionListed()]->refreshAttributesEditorRow(value, true, attributeEnabled, computed); - } else { - // Refresh attributes maintain invalid values - myAttributesEditorRows[attrProperty.getPositionListed()]->refreshAttributesEditorRow(value, false, attributeEnabled, computed); - } - } - } - // check if flow editor has to be update - if (myAttributesEditorFlow->isAttributesEditorFlowModulShown()) { - myAttributesEditorFlow->refreshAttributeEditorFlow(); - } - } -} - - -GNEFrame* -GNEFrameAttributesModuls::AttributesEditor::getFrameParent() const { - return myFrameParent; -} - - -long -GNEFrameAttributesModuls::AttributesEditor::onCmdAttributesEditorHelp(FXObject*, FXSelector, void*) { - // open Help attributes dialog if there is inspected ACs - if (myFrameParent->getViewNet()->getInspectedAttributeCarriers().size() > 0) { - // open Help attributes dialog - myFrameParent->openHelpAttributesDialog(myFrameParent->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty()); - } - return 1; -} - -// --------------------------------------------------------------------------- -// GNEFrameAttributesModuls::AttributesEditorFlow - methods -// --------------------------------------------------------------------------- - -GNEFrameAttributesModuls::AttributesEditorFlow::AttributesEditorFlow(AttributesEditor* attributesEditorParent) : - FXGroupBox(attributesEditorParent->getFrameParent()->myContentFrame, "Flow attributes", GUIDesignGroupBoxFrame), - myAttributesEditorParent(attributesEditorParent) { - // declare auxiliar horizontal frame - FXHorizontalFrame* auxiliarHorizontalFrame = nullptr; - // create elements for end attribute - auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myAttributeEndRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_END).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); - myValueEndTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create elements for number attribute - auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myAttributeNumberRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_NUMBER).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); - myValueNumberTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create elements for vehsPerHour attribute - auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myAttributeVehsPerHourRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_VEHSPERHOUR).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); - myValueVehsPerHourTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create elements for period attribute - auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myAttributePeriodRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PERIOD).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); - myValuePeriodTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create elements for Probability attribute - auxiliarHorizontalFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myAttributeProbabilityRadioButton = new FXRadioButton(auxiliarHorizontalFrame, toString(SUMO_ATTR_PROB).c_str(), this, MID_GNE_SET_ATTRIBUTE_BUTTON, GUIDesignRadioButtonAttribute); - myValueProbabilityTextField = new FXTextField(auxiliarHorizontalFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); -} - - -void -GNEFrameAttributesModuls::AttributesEditorFlow::showAttributeEditorFlowModul() { - if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) { - // refresh attributeEditorFlowModul - refreshAttributeEditorFlow(); - // show flow - show(); - } else { - hide(); - } -} - - -void -GNEFrameAttributesModuls::AttributesEditorFlow::hideAttributesEditorFlowModul() { - // simply hide modul - hide(); -} - - -bool -GNEFrameAttributesModuls::AttributesEditorFlow::isAttributesEditorFlowModulShown() const { - return shown(); -} - - -void -GNEFrameAttributesModuls::AttributesEditorFlow::refreshAttributeEditorFlow() { - if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 0) { - // simply refresh every flow attribute - refreshEnd(); - refreshNumber(); - refreshVehsPerHour(); - refreshPeriod(); - refreshProbability(); - } -} - - -long -GNEFrameAttributesModuls::AttributesEditorFlow::onCmdSetFlowAttribute(FXObject* obj, FXSelector, void*) { - const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers(); - // obtain undoList (To improve code legibly) - GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList(); - SumoXMLAttr attr = SUMO_ATTR_NOTHING; - std::string value; - // check what check button was pressed - if (obj == myValueEndTextField) { - attr = SUMO_ATTR_END; - value = myValueEndTextField->getText().text(); - } else if (obj == myValueNumberTextField) { - attr = SUMO_ATTR_NUMBER; - value = myValueNumberTextField->getText().text(); - } else if (obj == myValueVehsPerHourTextField) { - // check attribute - if (ACs.front()->getTagProperty().hasAttribute(SUMO_ATTR_VEHSPERHOUR)) { - attr = SUMO_ATTR_VEHSPERHOUR; - } else { - attr = SUMO_ATTR_PERSONSPERHOUR; - } - value = myValueVehsPerHourTextField->getText().text(); - } else if (obj == myValuePeriodTextField) { - attr = SUMO_ATTR_PERIOD; - value = myValuePeriodTextField->getText().text(); - } else if (obj == myValueProbabilityTextField) { - attr = SUMO_ATTR_PROB; - value = myValueProbabilityTextField->getText().text(); - } else { - throw ProcessError("Invalid text field"); - } - // write debug (for Netedit tests) - WRITE_DEBUG("Selected checkBox for attribute '" + toString(attr) + "'"); - // check if we're editing multiple attributes - if (ACs.size() > 1) { - undoList->begin(ACs.front()->getTagProperty().getGUIIcon(), "Change multiple " + toString(attr) + " attributes"); - } - // enable attribute with undo/redo - for (const auto& inspectedAC : ACs) { - inspectedAC->setAttribute(attr, value, undoList); - } - // check if we're editing multiple attributes - if (ACs.size() > 1) { - undoList->end(); - } - // refresh Attributes edito parent - refreshAttributeEditorFlow(); - return 1; -} - - -long -GNEFrameAttributesModuls::AttributesEditorFlow::onCmdSelectFlowRadioButton(FXObject* obj, FXSelector, void*) { - const auto& ACs = myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers(); - // obtain undoList (To improve code legibly) - GNEUndoList* undoList = myAttributesEditorParent->getFrameParent()->myViewNet->getUndoList(); - SumoXMLAttr attr = SUMO_ATTR_NOTHING; - // check what check button was pressed - if (obj == myAttributeEndRadioButton) { - attr = SUMO_ATTR_END; - } else if (obj == myAttributeNumberRadioButton) { - attr = SUMO_ATTR_NUMBER; - } else if (obj == myAttributeVehsPerHourRadioButton) { - attr = SUMO_ATTR_VEHSPERHOUR; - } else if (obj == myAttributePeriodRadioButton) { - attr = SUMO_ATTR_PERIOD; - } else if (obj == myAttributeProbabilityRadioButton) { - attr = SUMO_ATTR_PROB; - } else { - throw ProcessError("Invalid Radio Button"); - } - // write debug (for Netedit tests) - WRITE_DEBUG("Selected checkBox for attribute '" + toString(attr) + "'"); - // begin undo list - if (ACs.size() > 1) { - undoList->begin(ACs.front()->getTagProperty().getGUIIcon(), "enable multiple " + toString(attr) + " attributes"); - } else { - undoList->begin(ACs.front()->getTagProperty().getGUIIcon(), "enable attribute '" + toString(attr) + "'"); - } - // enable attribute with undo/redo - for (const auto& inspectedAC : ACs) { - inspectedAC->enableAttribute(attr, undoList); - } - // end undoList - undoList->end(); - // refresh Attributes edito parent - refreshAttributeEditorFlow(); - return 1; -} - - -void -GNEFrameAttributesModuls::AttributesEditorFlow::refreshEnd() { - // first we need to check if all attributes are enabled or disabled - int allAttributesEnabledOrDisabled = 0; - for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { - allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(SUMO_ATTR_END); - } - if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) { - // Declare a set of occuring values and insert attribute's values of item - std::set occuringValues; - for (const auto& values : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { - occuringValues.insert(values->getAttribute(SUMO_ATTR_END)); - } - // get current value - std::ostringstream endValue; - for (const auto& occuringValue : occuringValues) { - if (occuringValue != *occuringValues.begin()) { - endValue << " "; - } - endValue << occuringValue; - } - // set radio button and text field - myValueEndTextField->enable(); - myValueEndTextField->setText(endValue.str().c_str()); - myAttributeEndRadioButton->setCheck(TRUE); - } else { - // disable radio button and text field - myValueEndTextField->disable(); - // check if we set an special value in textField - if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) { - myValueEndTextField->setText("Different flow attributes"); - } else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) { - myValueEndTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_END).c_str()); - } else { - myValueEndTextField->setText(""); - } - myAttributeEndRadioButton->setCheck(FALSE); - } -} - - -void -GNEFrameAttributesModuls::AttributesEditorFlow::refreshNumber() { - // first we need to check if all attributes are enabled or disabled - int allAttributesEnabledOrDisabled = 0; - for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { - allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(SUMO_ATTR_NUMBER); - } - if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) { - // Declare a set of occuring values and insert attribute's values of item - std::set occuringValues; - for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { - occuringValues.insert(inspectedAC->getAttribute(SUMO_ATTR_NUMBER)); - } - // get current value - std::ostringstream numberValues; - for (const auto& occuringValue : occuringValues) { - if (occuringValue != *occuringValues.begin()) { - numberValues << " "; - } - numberValues << occuringValue; - } - // set radio button and text field - myValueNumberTextField->enable(); - myValueNumberTextField->setText(numberValues.str().c_str()); - myAttributeNumberRadioButton->setCheck(TRUE); - } else { - // disable radio button - myValueNumberTextField->disable(); - // check if we set an special value in textField - if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) { - myValueNumberTextField->setText("Different flow attributes"); - } else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) { - myValueNumberTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_NUMBER).c_str()); - } else { - myValueNumberTextField->setText(""); - } - myAttributeNumberRadioButton->setCheck(FALSE); - } -} - - -void -GNEFrameAttributesModuls::AttributesEditorFlow::refreshVehsPerHour() { - // declare attribute - SumoXMLAttr attr = SUMO_ATTR_VEHSPERHOUR; - // first change attribute - if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().hasAttribute(SUMO_ATTR_PERSONSPERHOUR)) { - attr = SUMO_ATTR_PERSONSPERHOUR; - } - // update radio button - myAttributeVehsPerHourRadioButton->setText(toString(attr).c_str()); - // we need to check if all attributes are enabled or disabled - int allAttributesEnabledOrDisabled = 0; - for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { - allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(attr); - } - if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) { - // Declare a set of occuring values and insert attribute's values of item - std::set occuringValues; - for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { - occuringValues.insert(inspectedAC->getAttribute(attr)); - } - // get current value - std::ostringstream vehsPerHourValues; - for (const auto& occuringValue : occuringValues) { - if (occuringValue != *occuringValues.begin()) { - vehsPerHourValues << " "; - } - vehsPerHourValues << occuringValue; - } - // set radio button and text field - myValueVehsPerHourTextField->enable(); - myValueVehsPerHourTextField->setText(vehsPerHourValues.str().c_str()); - myAttributeVehsPerHourRadioButton->setCheck(TRUE); - } else { - // disable radio button - myValueVehsPerHourTextField->disable(); - // check if we set an special value in textField - if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) { - myValueVehsPerHourTextField->setText("Different flow attributes"); - } else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) { - myValueVehsPerHourTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(attr).c_str()); - } else { - myValueVehsPerHourTextField->setText(""); - } - myAttributeVehsPerHourRadioButton->setCheck(FALSE); - } -} - - -void -GNEFrameAttributesModuls::AttributesEditorFlow::refreshPeriod() { - // first we need to check if all attributes are enabled or disabled - int allAttributesEnabledOrDisabled = 0; - for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { - allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(SUMO_ATTR_PERIOD); - } - if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) { - // Declare a set of occuring values and insert attribute's values of item - std::set occuringValues; - for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { - occuringValues.insert(inspectedAC->getAttribute(SUMO_ATTR_PERIOD)); - } - // get current value - std::ostringstream periodValues; - for (const auto& occuringValue : occuringValues) { - if (occuringValue != *occuringValues.begin()) { - periodValues << " "; - } - periodValues << occuringValue; - } - // set radio button and text field - myValuePeriodTextField->enable(); - myValuePeriodTextField->setText(periodValues.str().c_str()); - myAttributePeriodRadioButton->setCheck(TRUE); - } else { - // disable radio button and text field - myValuePeriodTextField->disable(); - // check if we set an special value in textField - if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) { - myValuePeriodTextField->setText("Different flow attributes"); - } else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) { - myValuePeriodTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_PERIOD).c_str()); - } else { - myValuePeriodTextField->setText(""); - } - myAttributePeriodRadioButton->setCheck(FALSE); - } -} - - -void -GNEFrameAttributesModuls::AttributesEditorFlow::refreshProbability() { - // first we need to check if all attributes are enabled or disabled - int allAttributesEnabledOrDisabled = 0; - for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { - allAttributesEnabledOrDisabled += inspectedAC->isAttributeEnabled(SUMO_ATTR_PROB); - } - if (allAttributesEnabledOrDisabled == (int)myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size()) { - // Declare a set of occuring values and insert attribute's values of item - std::set occuringValues; - for (const auto& inspectedAC : myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers()) { - occuringValues.insert(inspectedAC->getAttribute(SUMO_ATTR_PROB)); - } - // get current value - std::ostringstream probabilityValues; - for (const auto& occuringValue : occuringValues) { - if (occuringValue != *occuringValues.begin()) { - probabilityValues << " "; - } - probabilityValues << occuringValue; - } - // set radio button and text field - myValueProbabilityTextField->enable(); - myValueProbabilityTextField->setText(probabilityValues.str().c_str()); - myAttributeProbabilityRadioButton->enable(); - myAttributeProbabilityRadioButton->setCheck(TRUE); - } else { - // disable radio button and text field - myValueProbabilityTextField->disable(); - // check if we set an special value in textField - if ((allAttributesEnabledOrDisabled > 0) && (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() > 1)) { - myValueProbabilityTextField->setText("Different flow attributes"); - } else if (myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().size() == 1) { - myValueProbabilityTextField->setText(myAttributesEditorParent->getFrameParent()->getViewNet()->getInspectedAttributeCarriers().front()->getAlternativeValueForDisabledAttributes(SUMO_ATTR_PROB).c_str()); - } else { - myValueProbabilityTextField->setText(""); - } - myAttributeProbabilityRadioButton->setCheck(FALSE); - } -} - -// --------------------------------------------------------------------------- -// GNEFrameAttributesModuls::AttributesEditorExtended- methods -// --------------------------------------------------------------------------- - -GNEFrameAttributesModuls::AttributesEditorExtended::AttributesEditorExtended(GNEFrame* frameParent) : - FXGroupBox(frameParent->myContentFrame, "Extended attributes", GUIDesignGroupBoxFrame), - myFrameParent(frameParent) { - // Create open dialog button - new FXButton(this, "Open attributes editor", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButton); -} - - -GNEFrameAttributesModuls::AttributesEditorExtended::~AttributesEditorExtended() {} - - -void -GNEFrameAttributesModuls::AttributesEditorExtended::showAttributesEditorExtendedModul() { - show(); -} - - -void -GNEFrameAttributesModuls::AttributesEditorExtended::hideAttributesEditorExtendedModul() { - hide(); -} - - -long -GNEFrameAttributesModuls::AttributesEditorExtended::onCmdOpenDialog(FXObject*, FXSelector, void*) { - // open AttributesCreator extended dialog - myFrameParent->attributesEditorExtendedDialogOpened(); - return 1; -} - -// --------------------------------------------------------------------------- -// GNEFrameAttributesModuls::ParametersEditorCreator - methods -// --------------------------------------------------------------------------- - -GNEFrameAttributesModuls::ParametersEditorCreator::ParametersEditorCreator(GNEFrame* frameParent) : - FXGroupBox(frameParent->myContentFrame, "Parameters", GUIDesignGroupBoxFrame), - myFrameParent(frameParent) { - // create textfield and buttons - myTextFieldParameters = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - myButtonEditParameters = new FXButton(this, "Edit parameters", nullptr, this, MID_GNE_OPEN_PARAMETERS_DIALOG, GUIDesignButton); -} - - -GNEFrameAttributesModuls::ParametersEditorCreator::~ParametersEditorCreator() {} - - -void -GNEFrameAttributesModuls::ParametersEditorCreator::showParametersEditorCreator() { - // refresh ParametersEditorCreator - refreshParametersEditorCreator(); - // show groupbox - show(); -} - - -void -GNEFrameAttributesModuls::ParametersEditorCreator::hideParametersEditorCreator() { - // hide groupbox - hide(); -} - - -void -GNEFrameAttributesModuls::ParametersEditorCreator::refreshParametersEditorCreator() { - myTextFieldParameters->setText(getParametersStr().c_str()); - myTextFieldParameters->setTextColor(FXRGB(0, 0, 0)); -} - - -const std::map& -GNEFrameAttributesModuls::ParametersEditorCreator::getParametersMap() const { - return myParameters; -} - - -std::string -GNEFrameAttributesModuls::ParametersEditorCreator::getParametersStr() const { - std::string result; - // Generate an string using the following structure: "key1=value1|key2=value2|... - for (const auto& parameter : myParameters) { - result += parameter.first + "=" + parameter.second + "|"; - } - // remove the last "|" - if (!result.empty()) { - result.pop_back(); - } - return result; -} - - -std::vector > -GNEFrameAttributesModuls::ParametersEditorCreator::getParameters() const { - std::vector > result; - // Generate a vector string using the following structure: ", ,... - for (const auto& parameter : myParameters) { - result.push_back(std::make_pair(parameter.first, parameter.second)); - } - return result; -} - - -void -GNEFrameAttributesModuls::ParametersEditorCreator::setParameters(const std::vector >& parameters) { - // declare result string - std::string result; - // Generate an string using the following structure: "key1=value1|key2=value2|... - for (const auto& parameter : parameters) { - result += parameter.first + "=" + parameter.second + "|"; - } - // remove the last "|" - if (!result.empty()) { - result.pop_back(); - } - // set result in textField (and call onCmdEditParameters) - myTextFieldParameters->setText(result.c_str(), TRUE); -} - - -GNEFrame* -GNEFrameAttributesModuls::ParametersEditorCreator::getFrameParent() const { - return myFrameParent; -} - - -long -GNEFrameAttributesModuls::ParametersEditorCreator::onCmdEditParameters(FXObject*, FXSelector, void*) { - // write debug information - WRITE_DEBUG("Open single parameters dialog"); - if (GNESingleParametersDialog(this).execute()) { - // write debug information - WRITE_DEBUG("Close single parameters dialog"); - // Refresh parameter EditorCreator - refreshParametersEditorCreator(); - } else { - // write debug information - WRITE_DEBUG("Cancel single parameters dialog"); - } - return 1; -} - - -long -GNEFrameAttributesModuls::ParametersEditorCreator::onCmdSetParameters(FXObject*, FXSelector, void*) { - // clear current existent parameters - myParameters.clear(); - // check if current given string is valid - if (Parameterised::areParametersValid(myTextFieldParameters->getText().text(), true)) { - // parsed parameters ok, then set text field black and continue - myTextFieldParameters->setTextColor(FXRGB(0, 0, 0)); - myTextFieldParameters->killFocus(); - // obtain parameters "key=value" - std::vector parameters = StringTokenizer(myTextFieldParameters->getText().text(), "|", true).getVector(); - // iterate over parameters - for (const auto& parameter : parameters) { - // obtain key, value - std::vector keyParam = StringTokenizer(parameter, "=", true).getVector(); - // save it in myParameters - myParameters[keyParam.front()] = keyParam.back(); - } - // overwritte myTextFieldParameters (to remove duplicated parameters - myTextFieldParameters->setText(getParametersStr().c_str(), FALSE); - } else { - myTextFieldParameters->setTextColor(FXRGB(255, 0, 0)); - } - return 1; -} - -// --------------------------------------------------------------------------- -// GNEFrameAttributesModuls::DrawingShape - methods -// --------------------------------------------------------------------------- - -GNEFrameAttributesModuls::DrawingShape::DrawingShape(GNEFrame* frameParent) : - FXGroupBox(frameParent->myContentFrame, "Drawing", GUIDesignGroupBoxFrame), - myFrameParent(frameParent), - myDeleteLastCreatedPoint(false) { - // create start and stop buttons - myStartDrawingButton = new FXButton(this, "Start drawing", 0, this, MID_GNE_STARTDRAWING, GUIDesignButton); - myStopDrawingButton = new FXButton(this, "Stop drawing", 0, this, MID_GNE_STOPDRAWING, GUIDesignButton); - myAbortDrawingButton = new FXButton(this, "Abort drawing", 0, this, MID_GNE_ABORTDRAWING, GUIDesignButton); - // create information label - std::ostringstream information; - information - << "- 'Start drawing' or ENTER\n" - << " draws shape boundary.\n" - << "- 'Stop drawing' or ENTER\n" - << " creates shape.\n" - << "- 'Shift + Click'removes\n" - << " last created point.\n" - << "- 'Abort drawing' or ESC\n" - << " removes drawed shape."; - myInformationLabel = new FXLabel(this, information.str().c_str(), 0, GUIDesignLabelFrameInformation); - // disable stop and abort functions as init - myStopDrawingButton->disable(); - myAbortDrawingButton->disable(); -} - - -GNEFrameAttributesModuls::DrawingShape::~DrawingShape() {} - - -void GNEFrameAttributesModuls::DrawingShape::showDrawingShape() { - // abort current drawing before show - abortDrawing(); - // show FXGroupBox - FXGroupBox::show(); -} - - -void GNEFrameAttributesModuls::DrawingShape::hideDrawingShape() { - // abort current drawing before hide - abortDrawing(); - // show FXGroupBox - FXGroupBox::hide(); -} - - -void -GNEFrameAttributesModuls::DrawingShape::startDrawing() { - // Only start drawing if DrawingShape modul is shown - if (shown()) { - // change buttons - myStartDrawingButton->disable(); - myStopDrawingButton->enable(); - myAbortDrawingButton->enable(); - } -} - - -void -GNEFrameAttributesModuls::DrawingShape::stopDrawing() { - // try to build shape - if (myFrameParent->shapeDrawed()) { - // clear created points - myTemporalShapeShape.clear(); - myFrameParent->myViewNet->updateViewNet(); - // change buttons - myStartDrawingButton->enable(); - myStopDrawingButton->disable(); - myAbortDrawingButton->disable(); - } else { - // abort drawing if shape cannot be created - abortDrawing(); - } -} - - -void -GNEFrameAttributesModuls::DrawingShape::abortDrawing() { - // clear created points - myTemporalShapeShape.clear(); - myFrameParent->myViewNet->updateViewNet(); - // change buttons - myStartDrawingButton->enable(); - myStopDrawingButton->disable(); - myAbortDrawingButton->disable(); -} - - -void -GNEFrameAttributesModuls::DrawingShape::addNewPoint(const Position& P) { - if (myStopDrawingButton->isEnabled()) { - myTemporalShapeShape.push_back(P); - } else { - throw ProcessError("A new point cannot be added if drawing wasn't started"); - } -} - - -void -GNEFrameAttributesModuls::DrawingShape::removeLastPoint() { - -} - - -const PositionVector& -GNEFrameAttributesModuls::DrawingShape::getTemporalShape() const { - return myTemporalShapeShape; -} - - -bool -GNEFrameAttributesModuls::DrawingShape::isDrawing() const { - return myStopDrawingButton->isEnabled(); -} - - -void -GNEFrameAttributesModuls::DrawingShape::setDeleteLastCreatedPoint(bool value) { - myDeleteLastCreatedPoint = value; -} - - -bool -GNEFrameAttributesModuls::DrawingShape::getDeleteLastCreatedPoint() { - return myDeleteLastCreatedPoint; -} - - -long -GNEFrameAttributesModuls::DrawingShape::onCmdStartDrawing(FXObject*, FXSelector, void*) { - startDrawing(); - return 0; -} - - -long -GNEFrameAttributesModuls::DrawingShape::onCmdStopDrawing(FXObject*, FXSelector, void*) { - stopDrawing(); - return 0; -} - - -long -GNEFrameAttributesModuls::DrawingShape::onCmdAbortDrawing(FXObject*, FXSelector, void*) { - abortDrawing(); - return 0; -} - -// --------------------------------------------------------------------------- -// GNEFrameAttributesModuls::NeteditAttributes- methods -// --------------------------------------------------------------------------- - -GNEFrameAttributesModuls::NeteditAttributes::NeteditAttributes(GNEFrame* frameParent) : - FXGroupBox(frameParent->myContentFrame, "Netedit attributes", GUIDesignGroupBoxFrame), - myFrameParent(frameParent), - myCurrentLengthValid(true), - myActualAdditionalReferencePoint(GNE_ADDITIONALREFERENCEPOINT_LEFT) { - // Create FXListBox for the reference points and fill it - myReferencePointMatchBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignComboBox); - myReferencePointMatchBox->appendItem("reference left"); - myReferencePointMatchBox->appendItem("reference right"); - myReferencePointMatchBox->appendItem("reference center"); - // Create Frame for Length Label and textField - myLengthFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - new FXLabel(myLengthFrame, toString(SUMO_ATTR_LENGTH).c_str(), 0, GUIDesignLabelAttribute); - myLengthTextField = new FXTextField(myLengthFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - myLengthTextField->setText("10"); - // Create Frame for block close polygon and checkBox (By default disabled) - myCloseShapeFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - new FXLabel(myCloseShapeFrame, "Close shape", 0, GUIDesignLabelAttribute); - myCloseShapeCheckButton = new FXCheckButton(myCloseShapeFrame, "false", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); - // Create Frame for center element after creation (By default enabled) - myCenterViewAfterCreationFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - new FXLabel(myCenterViewAfterCreationFrame, "Center view", 0, GUIDesignLabelAttribute); - myCenterViewAfterCreationButton = new FXCheckButton(myCenterViewAfterCreationFrame, "false", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); - myCenterViewAfterCreationButton->setCheck(true); - // Create help button - helpReferencePoint = new FXButton(this, "Help", 0, this, MID_HELP, GUIDesignButtonRectangular); - // Set visible items - myReferencePointMatchBox->setNumVisible((int)myReferencePointMatchBox->getNumItems()); -} - - -GNEFrameAttributesModuls::NeteditAttributes::~NeteditAttributes() {} - - -void -GNEFrameAttributesModuls::NeteditAttributes::showNeteditAttributesModul(const GNETagProperties& tagProperty) { - // we assume that frame will not be show - bool showFrame = false; - // check if length text field has to be showed - if (tagProperty.canMaskStartEndPos()) { - myLengthFrame->show(); - myReferencePointMatchBox->show(); - showFrame = true; - } else { - myLengthFrame->hide(); - myReferencePointMatchBox->hide(); - } - // check if close shape check button has to be show - if (tagProperty.canCloseShape()) { - myCloseShapeFrame->show(); - showFrame = true; - } else { - myCloseShapeFrame->hide(); - } - // check if center camera after creation check button has to be show - if (tagProperty.canCenterCameraAfterCreation()) { - myCenterViewAfterCreationFrame->show(); - showFrame = true; - } else { - myCenterViewAfterCreationFrame->hide(); - } - // if at least one element is show, show modul - if (showFrame) { - recalc(); - show(); - } else { - hide(); - } -} - - -void -GNEFrameAttributesModuls::NeteditAttributes::hideNeteditAttributesModul() { - hide(); -} - - -bool -GNEFrameAttributesModuls::NeteditAttributes::getNeteditAttributesAndValues(CommonXMLStructure::SumoBaseObject* baseObject, const GNELane* lane) const { - // check if we need to obtain a start and end position over an edge - if (myReferencePointMatchBox->shown()) { - // we need a valid lane to calculate position over lane - if (lane == nullptr) { - return false; - } else if (myCurrentLengthValid) { - // Obtain position of the mouse over lane (limited over grid) - double mousePositionOverLane = lane->getLaneShape().nearest_offset_to_point2D(myFrameParent->myViewNet->snapToActiveGrid(myFrameParent->myViewNet->getPositionInformation())) / lane->getLengthGeometryFactor(); - // check if current reference point is valid - if (myActualAdditionalReferencePoint == GNE_ADDITIONALREFERENCEPOINT_INVALID) { - std::string errorMessage = "Current selected reference point isn't valid"; - myFrameParent->myViewNet->setStatusBarText(errorMessage); - // Write Warning in console if we're in testing mode - WRITE_DEBUG(errorMessage); - return false; - } else { - // obtain length - double length = GNEAttributeCarrier::parse(myLengthTextField->getText().text()); - // set start and end position - baseObject->addDoubleAttribute(SUMO_ATTR_STARTPOS, setStartPosition(mousePositionOverLane, length)); - baseObject->addDoubleAttribute(SUMO_ATTR_ENDPOS, setEndPosition(mousePositionOverLane, length)); - } - } else { - return false; - } - } - // Save close shape value if shape's element can be closed - if (myCloseShapeCheckButton->shown()) { - baseObject->addBoolAttribute(GNE_ATTR_CLOSE_SHAPE, myCloseShapeCheckButton->getCheck() == 1); - } - // check center element after creation - if (myCenterViewAfterCreationButton->shown()) { - baseObject->addBoolAttribute(GNE_ATTR_CENTER_AFTER_CREATION, myCenterViewAfterCreationButton->getCheck() == 1); - } - // all ok, then return true to continue creating element - return true; -} - - -long -GNEFrameAttributesModuls::NeteditAttributes::onCmdSetNeteditAttribute(FXObject* obj, FXSelector, void*) { - if (obj == myCloseShapeCheckButton) { - if (myCloseShapeCheckButton->getCheck()) { - myCloseShapeCheckButton->setText("true"); - } else { - myCloseShapeCheckButton->setText("false"); - } - } else if (obj == myCenterViewAfterCreationButton) { - if (myCenterViewAfterCreationButton->getCheck()) { - myCenterViewAfterCreationButton->setText("true"); - } else { - myCenterViewAfterCreationButton->setText("false"); - } - } else if (obj == myLengthTextField) { - // change color of text field depending of the input length - if (GNEAttributeCarrier::canParse(myLengthTextField->getText().text()) && - GNEAttributeCarrier::parse(myLengthTextField->getText().text()) > 0) { - myLengthTextField->setTextColor(FXRGB(0, 0, 0)); - myLengthTextField->killFocus(); - myCurrentLengthValid = true; - } else { - myLengthTextField->setTextColor(FXRGB(255, 0, 0)); - myCurrentLengthValid = false; - } - // Update aditional frame - update(); - } else if (obj == myReferencePointMatchBox) { - // Cast actual reference point type - if (myReferencePointMatchBox->getText() == "reference left") { - myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0)); - myActualAdditionalReferencePoint = GNE_ADDITIONALREFERENCEPOINT_LEFT; - myLengthTextField->enable(); - } else if (myReferencePointMatchBox->getText() == "reference right") { - myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0)); - myActualAdditionalReferencePoint = GNE_ADDITIONALREFERENCEPOINT_RIGHT; - myLengthTextField->enable(); - } else if (myReferencePointMatchBox->getText() == "reference center") { - myLengthTextField->enable(); - myReferencePointMatchBox->setTextColor(FXRGB(0, 0, 0)); - myActualAdditionalReferencePoint = GNE_ADDITIONALREFERENCEPOINT_CENTER; - myLengthTextField->enable(); - } else { - myReferencePointMatchBox->setTextColor(FXRGB(255, 0, 0)); - myActualAdditionalReferencePoint = GNE_ADDITIONALREFERENCEPOINT_INVALID; - myLengthTextField->disable(); - } - } - - return 1; -} - - -long -GNEFrameAttributesModuls::NeteditAttributes::onCmdHelp(FXObject*, FXSelector, void*) { - // Create dialog box - FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(this, "Netedit Parameters Help", GUIDesignDialogBox); - additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL)); - // set help text - std::ostringstream help; - help - << "- Referece point: Mark the initial position of the additional element.\n" - << " Example: If you want to create a busStop with a length of 30 in the point 100 of the lane:\n" - << " - Reference Left will create it with startPos = 70 and endPos = 100.\n" - << " - Reference Right will create it with startPos = 100 and endPos = 130.\n" - << " - Reference Center will create it with startPos = 85 and endPos = 115.\n" - << "\n" - << "- Block movement: if is enabled, the created additional element will be blocked. i.e. cannot be moved with\n" - << " the mouse. This option can be modified inspecting element.\n" - << "- Center view: if is enabled, view will be center over created element."; - // Create label with the help text - new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), 0, GUIDesignLabelFrameInformation); - // Create horizontal separator - new FXHorizontalSeparator(additionalNeteditAttributesHelpDialog, GUIDesignHorizontalSeparator); - // Create frame for OK Button - FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(additionalNeteditAttributesHelpDialog, GUIDesignAuxiliarHorizontalFrame); - // Create Button Close (And two more horizontal frames to center it) - new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame); - new FXButton(myHorizontalFrameOKButton, "OK\t\tclose", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK); - new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame); - // Write Warning in console if we're in testing mode - WRITE_DEBUG("Opening NeteditAttributes help dialog"); - // create Dialog - additionalNeteditAttributesHelpDialog->create(); - // show in the given position - additionalNeteditAttributesHelpDialog->show(PLACEMENT_CURSOR); - // refresh APP - getApp()->refresh(); - // open as modal dialog (will block all windows until stop() or stopModal() is called) - getApp()->runModalFor(additionalNeteditAttributesHelpDialog); - // Write Warning in console if we're in testing mode - WRITE_DEBUG("Closing NeteditAttributes help dialog"); - return 1; - /********** - help from PolygonFrame - << "- Block movement: If enabled, the created polygon element will be blocked. i.e. cannot be moved with\n" - << " the mouse. This option can be modified inspecting element.\n" - << "\n" - << "- Block shape: If enabled, the shape of created polygon element will be blocked. i.e. their geometry points\n" - << " cannot be edited be moved with the mouse. This option can be modified inspecting element.\n" - << "\n" - << "- Close shape: If enabled, the created polygon element will be closed. i.e. the last created geometry point\n" - << " will be connected with the first geometry point automatically. This option can be modified inspecting element."; - - ****************/ -} - - -double -GNEFrameAttributesModuls::NeteditAttributes::setStartPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const { - switch (myActualAdditionalReferencePoint) { - case GNE_ADDITIONALREFERENCEPOINT_LEFT: - return positionOfTheMouseOverLane; - case GNE_ADDITIONALREFERENCEPOINT_RIGHT: - return positionOfTheMouseOverLane - lengthOfAdditional; - case GNE_ADDITIONALREFERENCEPOINT_CENTER: - return positionOfTheMouseOverLane - lengthOfAdditional / 2; - default: - throw InvalidArgument("Reference Point invalid"); - } -} - - -double -GNEFrameAttributesModuls::NeteditAttributes::setEndPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const { - switch (myActualAdditionalReferencePoint) { - case GNE_ADDITIONALREFERENCEPOINT_LEFT: - return positionOfTheMouseOverLane + lengthOfAdditional; - case GNE_ADDITIONALREFERENCEPOINT_RIGHT: - return positionOfTheMouseOverLane; - case GNE_ADDITIONALREFERENCEPOINT_CENTER: - return positionOfTheMouseOverLane + lengthOfAdditional / 2; - default: - throw InvalidArgument("Reference Point invalid"); - } -} - - -bool -GNEFrameAttributesModuls::isSupermodeValid(const GNEViewNet* viewNet, const GNEAttributeCarrier* AC) { - if (viewNet->getEditModes().isCurrentSupermodeNetwork() && ( - AC->getTagProperty().isNetworkElement() || - AC->getTagProperty().isAdditionalElement() || - AC->getTagProperty().isShape() || - AC->getTagProperty().isTAZElement())) { - return true; - } else if (viewNet->getEditModes().isCurrentSupermodeDemand() && - AC->getTagProperty().isDemandElement()) { - return true; - } else if (viewNet->getEditModes().isCurrentSupermodeData() && - AC->getTagProperty().isDataElement()) { - return true; - } else { - return false; - } -} - - -bool -GNEFrameAttributesModuls::isSupermodeValid(const GNEViewNet* viewNet, const GNEAttributeProperties& ACAttr) { - if (ACAttr.getTagPropertyParent().isNetworkElement() || ACAttr.getTagPropertyParent().isAdditionalElement() || - ACAttr.getTagPropertyParent().isShape() || ACAttr.getTagPropertyParent().isTAZElement()) { - return (viewNet->getEditModes().isCurrentSupermodeNetwork()); - } else if (ACAttr.getTagPropertyParent().isDemandElement()) { - return (viewNet->getEditModes().isCurrentSupermodeDemand()); - } else if (ACAttr.getTagPropertyParent().isDataElement()) { - return (viewNet->getEditModes().isCurrentSupermodeData()); - } else { - return false; - } -} - -/****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/frames/GNEFrameAttributesModuls.h sumo-1.12.0/src/netedit/frames/GNEFrameAttributesModuls.h --- sumo-1.11.0/src/netedit/frames/GNEFrameAttributesModuls.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/GNEFrameAttributesModuls.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,789 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GNEFrameAttributesModuls.h -/// @author Pablo Alvarez Lopez -/// @date Aug 2019 -/// -// Auxiliar class for GNEFrame Moduls (only for attributes edition) -/****************************************************************************/ -#pragma once -#include - -#include -#include -#include -#include - -// =========================================================================== -// class declaration -// =========================================================================== - -class GNEFrame; - -// =========================================================================== -// class definitions -// =========================================================================== - -class GNEFrameAttributesModuls { - -public: - // =========================================================================== - // class declaration - // =========================================================================== - - class AttributesCreator; - class AttributesEditor; - class AttributesCreatorFlow; - class AttributesEditorFlow; - - // =========================================================================== - // class AttributesCreatorRow - // =========================================================================== - - class AttributesCreatorRow : public FXHorizontalFrame { - /// @brief FOX-declaration - FXDECLARE(GNEFrameAttributesModuls::AttributesCreatorRow) - - public: - /// @brief constructor - AttributesCreatorRow(AttributesCreator* AttributesCreatorParent, const GNEAttributeProperties& attrProperties); - - /// @brief destroy AttributesCreatorRow (but don't delete) - void destroy(); - - /// @brief return Attr - const GNEAttributeProperties& getAttrProperties() const; - - /// @brief return value - std::string getValue() const; - - /// @brief return status of label checkbox button - bool getAttributeCheckButtonCheck() const; - - /// @brief enable or disable label checkbox button for optional attributes - void setAttributeCheckButtonCheck(bool value); - - /// @brief enable row - void enableAttributesCreatorRow(); - - /// @brief disable row - void disableAttributesCreatorRow(); - - /// @brief check if row is enabled - bool isAttributesCreatorRowEnabled() const; - - /// @brief refresh row - void refreshRow() const; - - /// @brief returns a empty string if current value is valid, a string with information about invalid value in other case - const std::string& isAttributeValid() const; - - /// @brief get AttributesCreator parent - AttributesCreator* getAttributesCreatorParent() const; - - /// @name FOX-callbacks - /// @{ - /// @brief called when user set the value of an attribute of type int/float/string/bool - long onCmdSetAttribute(FXObject*, FXSelector, void*); - - /// @brief called when user press a check button - long onCmdSelectCheckButton(FXObject*, FXSelector, void*); - - /// @brief called when user press the "Color" button - long onCmdSelectColorButton(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(AttributesCreatorRow) - - /// @brief check if given complex attribute is valid - std::string checkComplexAttribute(const std::string& value); - - /// @brief generate ID - std::string generateID() const; - - /// @brief check if current ID placed in myValueTextField is valid - bool isValidID() const; - - private: - /// @brief pointer to AttributesCreator - AttributesCreator* myAttributesCreatorParent = nullptr; - - /// @brief attribute properties - const GNEAttributeProperties myAttrProperties; - - /// @brief string which indicates the reason due current value is invalid - std::string myInvalidValue; - - /// @brief Label with the name of the attribute - FXLabel* myAttributeLabel = nullptr; - - /// @brief check button to enable/disable Label attribute - FXCheckButton* myAttributeCheckButton = nullptr; - - /// @brief Button for open color editor - FXButton* myAttributeColorButton = nullptr; - - /// @brief textField to modify the default value of string parameters - FXTextField* myValueTextField = nullptr; - - /// @brief check button to enable/disable the value of boolean parameters - FXCheckButton* myValueCheckButton = nullptr; - }; - - // =========================================================================== - // class AttributesCreator - // =========================================================================== - - class AttributesCreator : public FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEFrameAttributesModuls::AttributesCreator) - - // declare friend class - friend class Row; - - public: - /// @brief constructor - AttributesCreator(GNEFrame* frameParent); - - /// @brief destructor - ~AttributesCreator(); - - /**@brief show AttributesCreator modul - * @param tagProperties GNETagProperties which contain all attributes - * @param hiddenAttributes list of attributes contained in tagProperties but not shown - */ - void showAttributesCreatorModul(const GNETagProperties& tagProperties, const std::vector& hiddenAttributes); - - /// @brief hide group box - void hideAttributesCreatorModul(); - - /// @brief return frame parent - GNEFrame* getFrameParent() const; - - /// @brief get attributes and their values - void getAttributesAndValues(CommonXMLStructure::SumoBaseObject* baseObject, bool includeAll) const; - - /// @brief get current edited Tag Properties - GNETagProperties getCurrentTagProperties() const; - - /// @brief check if parameters of attributes are valid - bool areValuesValid() const; - - /// @brief show warning message with information about non-valid attributes - void showWarningMessage(std::string extra = "") const; - - /// @name FOX-callbacks - /// @{ - /// @brief Called when help button is pressed - long onCmdHelp(FXObject*, FXSelector, void*); - /// @} - - /// @brief refresh rows (called after creating an element) - void refreshRows(); - - protected: - FOX_CONSTRUCTOR(AttributesCreator); - - private: - /// @brief pointer to Frame Parent - GNEFrame* myFrameParent = nullptr; - - /// @brief pointer to myAttributesCreatorFlow - AttributesCreatorFlow* myAttributesCreatorFlow = nullptr; - - /// @brief current edited Tag Properties - GNETagProperties myTagProperties; - - /// @brief vector with the AttributesCreatorRow - std::vector myAttributesCreatorRows; - - /// @brief help button - FXButton* myHelpButton = nullptr; - }; - - // =========================================================================== - // class AttributesCreatorFlow - // =========================================================================== - - class AttributesCreatorFlow : public FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEFrameAttributesModuls::AttributesCreatorFlow) - - public: - /// @brief constructor - AttributesCreatorFlow(AttributesCreator* attributesCreatorParent); - - /// @brief destructor - ~AttributesCreatorFlow(); - - /// @brief show AttributesCreatorFlow modul - void showAttributesCreatorFlowModul(const bool persons); - - /// @brief hide group box - void hideAttributesCreatorFlowModul(); - - /// @brief refresh AttributesCreatorFlow - void refreshAttributesCreatorFlow(); - - /// @brief set parameters - void setFlowParameters(CommonXMLStructure::SumoBaseObject* baseObject); - - /// @brief check if parameters of attributes are valid - bool areValuesValid() const; - - /// @brief show warning message with information about non-valid attributes - void showWarningMessage(std::string extra = "") const; - - /// @name FOX-callbacks - /// @{ - /// @brief called when user set the value of an attribute of type int/float/string/bool - long onCmdSetFlowAttribute(FXObject*, FXSelector, void*); - - /// @brief called when user press a radio button - long onCmdSelectFlowRadioButton(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(AttributesCreatorFlow); - - private: - /// @brief pointer to Attributes Creator Parent - AttributesCreator* myAttributesCreatorParent; - - /// @brief Radio button for 'end' attribute - FXRadioButton* myAttributeEndRadioButton = nullptr; - - /// @brief textField for 'end' attribute - FXTextField* myValueEndTextField = nullptr; - - /// @brief Radio button for 'number' attribute - FXRadioButton* myAttributeNumberRadioButton = nullptr; - - /// @brief textField for 'number' attribute - FXTextField* myValueNumberTextField = nullptr; - - /// @brief Radio button for 'VehsPerHour' attribute - FXRadioButton* myAttributeVehsPerHourRadioButton = nullptr; - - /// @brief textField for 'VehsPerHour' attribute - FXTextField* myValueVehsPerHourTextField = nullptr; - - /// @brief Radio button for 'period' attribute - FXRadioButton* myAttributePeriodRadioButton = nullptr; - - /// @brief textField for 'period' attribute - FXTextField* myValuePeriodTextField = nullptr; - - /// @brief Radio button for 'probability' attribute - FXRadioButton* myAttributeProbabilityRadioButton = nullptr; - - /// @brief textField for 'probability' attribute - FXTextField* myValueProbabilityTextField = nullptr; - - /// @brief variable used to save current flow configuration - int myFlowParameters; - }; - - // =========================================================================== - // class AttributesEditorRow - // =========================================================================== - - class AttributesEditorRow : protected FXHorizontalFrame { - /// @brief FOX-declaration - FXDECLARE(GNEFrameAttributesModuls::AttributesEditorRow) - - public: - /// @brief constructor - AttributesEditorRow(AttributesEditor* attributeEditorParent, const GNEAttributeProperties& ACAttr, const std::string& value, - const bool attributeEnabled, const bool computed); - - /// @brief destroy AttributesCreatorRow (but don't delete) - void destroy(); - - /// @brief refresh current row - void refreshAttributesEditorRow(const std::string& value, const bool forceRefresh, const bool attributeEnabled, const bool computed); - - /// @brief check if current attribute of TextField/ComboBox is valid - bool isAttributesEditorRowValid() const; - - /// @name FOX-callbacks - /// @{ - - /// @brief try to set new attribute value - long onCmdSetAttribute(FXObject*, FXSelector, void*); - - /// @brief called when user press a check button - long onCmdSelectCheckButton(FXObject*, FXSelector, void*); - - /// @brief open model dialog for more comfortable attribute editing - long onCmdOpenAttributeDialog(FXObject*, FXSelector, void*); - /// @} - - protected: - /// @brief default constructor - AttributesEditorRow(); - - /// @brief removed invalid spaces of Positions and shapes - std::string stripWhitespaceAfterComma(const std::string& stringValue); - - /// @brief check junction merging - bool mergeJunction(SumoXMLAttr attr, const std::vector& inspectedACs, const std::string& newVal) const; - - private: - /// @brief pointer to AttributesEditor parent - AttributesEditor* myAttributesEditorParent; - - /// @brief current AC Attribute - const GNEAttributeProperties myACAttr; - - /// @brief flag to check if input element contains multiple values - const bool myMultiple; - - /// @brief pointer to attribute label - FXLabel* myAttributeLabel = nullptr; - - /// @brief pointer to attribute menu check - FXCheckButton* myAttributeCheckButton = nullptr; - - /// @brief pointer to buttonCombinableChoices - FXButton* myAttributeButtonCombinableChoices = nullptr; - - /// @brief Button for open color editor - FXButton* myAttributeColorButton = nullptr; - - /// @brief textField to modify the value of string attributes - FXTextField* myValueTextField = nullptr; - - /// @brief pointer to combo box choices - FXComboBox* myValueComboBoxChoices = nullptr; - - /// @brief pointer to menu check - FXCheckButton* myValueCheckButton = nullptr; - }; - - // =========================================================================== - // class AttributesEditor - // =========================================================================== - - class AttributesEditor : public FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEFrameAttributesModuls::AttributesEditor) - - public: - /// @brief constructor - AttributesEditor(GNEFrame* inspectorFrameParent); - - /// @brief show attributes of multiple ACs - void showAttributeEditorModul(bool includeExtended, bool forceAttributeEnabled); - - /// @brief hide attribute editor - void hideAttributesEditorModul(); - - /// @brief refresh attribute editor (only the valid values will be refresh) - void refreshAttributeEditor(bool forceRefreshShape, bool forceRefreshPosition); - - /// @brief pointer to GNEFrame parent - GNEFrame* getFrameParent() const; - - /// @name FOX-callbacks - /// @{ - /// @brief Called when user press the help button - long onCmdAttributesEditorHelp(FXObject*, FXSelector, void*); - /// @} - - protected: - /// @brief fox need this - FOX_CONSTRUCTOR(AttributesEditor) - - private: - /// @brief pointer to GNEFrame parent - GNEFrame* myFrameParent; - - /// @brief pointer to attributesEditorFlow - AttributesEditorFlow* myAttributesEditorFlow = nullptr; - - /// @brief list of Attribute editor rows - std::vector myAttributesEditorRows; - - /// @brief button for help - FXButton* myHelpButton = nullptr; - - /// @brief flag used to mark if current edited ACs are bein edited including extended attribute - bool myIncludeExtended; - }; - - // =========================================================================== - // class AttributesEditorFlow - // =========================================================================== - - class AttributesEditorFlow : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEFrameAttributesModuls::AttributesEditorFlow) - - public: - /// @brief constructor - AttributesEditorFlow(AttributesEditor* attributesEditorParent); - - /// @brief show attributes editor Flow Modul - void showAttributeEditorFlowModul(); - - /// @brief hide attribute EditorFlow - void hideAttributesEditorFlowModul(); - - /// @brief check if attribute editor flow modul is shown - bool isAttributesEditorFlowModulShown() const; - - /// @brief refresh attribute EditorFlow (only the valid values will be refresh) - void refreshAttributeEditorFlow(); - - /// @name FOX-callbacks - /// @{ - /// @brief called when user set the value of an attribute of type int/float/string/bool - long onCmdSetFlowAttribute(FXObject*, FXSelector, void*); - - /// @brief called when user press a radio button - long onCmdSelectFlowRadioButton(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(AttributesEditorFlow) - - /// @brief refresh end - void refreshEnd(); - - /// @brief refresh parameter number - void refreshNumber(); - - /// @brief refresh parameter VehsPerHour - void refreshVehsPerHour(); - - /// @brief refresh parameter Period - void refreshPeriod(); - - /// @brief refresh parameter Probability - void refreshProbability(); - - private: - /// @brief pointer to AttributesEditor parent - AttributesEditor* myAttributesEditorParent = nullptr; - - /// @brief Radio button for 'end' attribute - FXRadioButton* myAttributeEndRadioButton = nullptr; - - /// @brief textField for 'end' attribute - FXTextField* myValueEndTextField = nullptr; - - /// @brief Radio button for 'number' attribute - FXRadioButton* myAttributeNumberRadioButton = nullptr; - - /// @brief textField for 'number' attribute - FXTextField* myValueNumberTextField = nullptr; - - /// @brief Radio button for 'VehsPerHour' attribute - FXRadioButton* myAttributeVehsPerHourRadioButton = nullptr; - - /// @brief textField for 'VehsPerHour' attribute - FXTextField* myValueVehsPerHourTextField = nullptr; - - /// @brief Radio button for 'period' attribute - FXRadioButton* myAttributePeriodRadioButton = nullptr; - - /// @brief textField for 'period' attribute - FXTextField* myValuePeriodTextField = nullptr; - - /// @brief Radio button for 'probability' attribute - FXRadioButton* myAttributeProbabilityRadioButton = nullptr; - - /// @brief textField for 'probability' attribute - FXTextField* myValueProbabilityTextField = nullptr; - }; - - // =========================================================================== - // class AttributesEditorExtended - // =========================================================================== - - class AttributesEditorExtended : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEFrameAttributesModuls::AttributesEditorExtended) - - public: - /// @brief constructor - AttributesEditorExtended(GNEFrame* frameParent); - - /// @brief destructor - ~AttributesEditorExtended(); - - /// @brief show AttributesEditorExtended modul - void showAttributesEditorExtendedModul(); - - /// @brief hide group box - void hideAttributesEditorExtendedModul(); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when open dialog button is clicked - long onCmdOpenDialog(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(AttributesEditorExtended) - - private: - /// @brief pointer to Frame Parent - GNEFrame* myFrameParent = nullptr; - }; - - // =========================================================================== - // class ParametersEditorCreator - // =========================================================================== - - class ParametersEditorCreator : private FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEFrameAttributesModuls::ParametersEditorCreator) - - public: - /// @brief constructor - ParametersEditorCreator(GNEFrame* frameParent); - - /// @brief destructor - ~ParametersEditorCreator(); - - /// @brief show netedit attributes EditorCreator - void showParametersEditorCreator(); - - /// @brief hide netedit attributes EditorCreator - void hideParametersEditorCreator(); - - /// @brief refresh netedit attributes - void refreshParametersEditorCreator(); - - /// @brief get parameters as map - const std::map& getParametersMap() const; - - /// @brief get parameters as string - std::string getParametersStr() const; - - /// @brief get parameters as vector of strings - std::vector > getParameters() const; - - /// @brief set parameters - void setParameters(const std::vector >& parameters); - - /// @brief pointer to frame parent - GNEFrame* getFrameParent() const; - - /// @name FOX-callbacks - /// @{ - /// @brief Called when user clicks over add parameter - long onCmdEditParameters(FXObject*, FXSelector, void*); - - /// @brief Called when user udpate the parameter text field - long onCmdSetParameters(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(ParametersEditorCreator) - - private: - /// @brief pointer to frame parent - GNEFrame* myFrameParent = nullptr; - - /// @brief pointer to current map of parameters - std::map myParameters; - - /// @brief text field for write parameters - FXTextField* myTextFieldParameters = nullptr; - - /// @brief button for edit parameters using specific dialog - FXButton* myButtonEditParameters = nullptr; - }; - - // =========================================================================== - // class DrawingShape - // =========================================================================== - - class DrawingShape : private FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEFrameAttributesModuls::DrawingShape) - - public: - /// @brief constructor - DrawingShape(GNEFrame* frameParent); - - /// @brief destructor - ~DrawingShape(); - - /// @brief show Drawing mode - void showDrawingShape(); - - /// @brief hide Drawing mode - void hideDrawingShape(); - - /// @brief start drawing - void startDrawing(); - - /// @brief stop drawing and check if shape can be created - void stopDrawing(); - - /// @brief abort drawing - void abortDrawing(); - - /// @brief add new point to temporal shape - void addNewPoint(const Position& P); - - /// @brief remove last added point - void removeLastPoint(); - - /// @brief get Temporal shape - const PositionVector& getTemporalShape() const; - - /// @brief return true if currently a shape is drawed - bool isDrawing() const; - - /// @brief enable or disable delete last created point - void setDeleteLastCreatedPoint(bool value); - - /// @brief get flag delete last created point - bool getDeleteLastCreatedPoint(); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user press start drawing button - long onCmdStartDrawing(FXObject*, FXSelector, void*); - - /// @brief Called when the user press stop drawing button - long onCmdStopDrawing(FXObject*, FXSelector, void*); - - /// @brief Called when the user press abort drawing button - long onCmdAbortDrawing(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(DrawingShape) - - private: - /// @brief pointer to frame parent - GNEFrame* myFrameParent; - - /// @brief flag to enable/disable delete point mode - bool myDeleteLastCreatedPoint; - - /// @brief current drawed shape - PositionVector myTemporalShapeShape; - - /// @brief button for start drawing - FXButton* myStartDrawingButton; - - /// @brief button for stop drawing - FXButton* myStopDrawingButton; - - /// @brief button for abort drawing - FXButton* myAbortDrawingButton; - - /// @brief Label with information - FXLabel* myInformationLabel; - }; - - // =========================================================================== - // class NeteditAttributes - // =========================================================================== - - class NeteditAttributes : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEFrameAttributesModuls::NeteditAttributes) - - public: - /// @brief constructor - NeteditAttributes(GNEFrame* frameParent); - - /// @brief destructor - ~NeteditAttributes(); - - /// @brief show Netedit attributes modul - void showNeteditAttributesModul(const GNETagProperties& tagValue); - - /// @brief hide Netedit attributes modul - void hideNeteditAttributesModul(); - - /// @brief fill valuesMap with netedit attributes - bool getNeteditAttributesAndValues(CommonXMLStructure::SumoBaseObject* baseObject, const GNELane* lane) const; - - /// @name FOX-callbacks - /// @{ - /// @brief Called when user changes some element of NeteditAttributes - long onCmdSetNeteditAttribute(FXObject*, FXSelector, void*); - - /// @brief Called when user press the help button - long onCmdHelp(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(NeteditAttributes) - - private: - /// @brief list of the reference points - enum AdditionalReferencePoint { - GNE_ADDITIONALREFERENCEPOINT_LEFT, - GNE_ADDITIONALREFERENCEPOINT_RIGHT, - GNE_ADDITIONALREFERENCEPOINT_CENTER, - GNE_ADDITIONALREFERENCEPOINT_INVALID - }; - - /// @brief obtain the Start position values of StoppingPlaces and E2 detector over the lane - double setStartPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const; - - /// @brief obtain the End position values of StoppingPlaces and E2 detector over the lane - double setEndPosition(double positionOfTheMouseOverLane, double lengthOfAdditional) const; - - /// @brief pointer to frame parent - GNEFrame* myFrameParent; - - /// @brief match box with the list of reference points - FXComboBox* myReferencePointMatchBox; - - /// @brief horizontal frame for length - FXHorizontalFrame* myLengthFrame; - - /// @brief textField for length - FXTextField* myLengthTextField; - - /// @brief horizontal frame for close polygon - FXHorizontalFrame* myCloseShapeFrame; - - /// @brief checkbox to enable/disable close polygon - FXCheckButton* myCloseShapeCheckButton; - - /// @brief horizontal frame for center view after creation frame - FXHorizontalFrame* myCenterViewAfterCreationFrame; - - /// @brief checkbox to enable/disable center element after creation - FXCheckButton* myCenterViewAfterCreationButton; - - /// @brief Button for help about the reference point - FXButton* helpReferencePoint; - - /// @brief Flag to check if current length is valid - bool myCurrentLengthValid; - - /// @brief actual additional reference point selected in the match Box - AdditionalReferencePoint myActualAdditionalReferencePoint; - }; - - /// @brief return true if AC can be edited in the current supermode - static bool isSupermodeValid(const GNEViewNet* viewNet, const GNEAttributeCarrier* AC); - - /// @brief return true if give ACAttr can be edited in the current supermode - static bool isSupermodeValid(const GNEViewNet* viewNet, const GNEAttributeProperties& ACAttr); -}; diff -Nru sumo-1.11.0/src/netedit/frames/GNEFrame.cpp sumo-1.12.0/src/netedit/frames/GNEFrame.cpp --- sumo-1.11.0/src/netedit/frames/GNEFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/GNEFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -199,16 +199,16 @@ } void -GNEFrame::openHelpAttributesDialog(const GNETagProperties& tagProperties) const { - FXDialogBox* attributesHelpDialog = new FXDialogBox(myScrollWindowsContents, ("Parameters of " + tagProperties.getTagStr()).c_str(), GUIDesignDialogBoxResizable, 0, 0, 0, 0, 10, 10, 10, 38, 4, 4); +GNEFrame::openHelpAttributesDialog(const GNEAttributeCarrier* AC) const { + FXDialogBox* attributesHelpDialog = new FXDialogBox(myScrollWindowsContents, ("Parameters of " + AC->getTagStr()).c_str(), GUIDesignDialogBoxResizable, 0, 0, 0, 0, 10, 10, 10, 38, 4, 4); // Create FXTable FXTable* myTable = new FXTable(attributesHelpDialog, attributesHelpDialog, MID_TABLE, GUIDesignTableNotEditable); attributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEINSPECT)); int sizeColumnDescription = 0; int sizeColumnDefinitions = 0; - myTable->setVisibleRows((FXint)(tagProperties.getNumberOfAttributes())); + myTable->setVisibleRows((FXint)(AC->getTagProperty().getNumberOfAttributes())); myTable->setVisibleColumns(3); - myTable->setTableSize((FXint)(tagProperties.getNumberOfAttributes()), 3); + myTable->setTableSize((FXint)(AC->getTagProperty().getNumberOfAttributes()), 3); myTable->setBackColor(FXRGB(255, 255, 255)); myTable->setColumnText(0, "Attribute"); myTable->setColumnText(1, "Description"); @@ -216,22 +216,22 @@ myTable->getRowHeader()->setWidth(0); // Iterate over vector of additional parameters int itemIndex = 0; - for (const auto& i : tagProperties) { + for (const auto& tagProperty : AC->getTagProperty()) { // Set attribute - FXTableItem* attribute = new FXTableItem(i.getAttrStr().c_str()); + FXTableItem* attribute = new FXTableItem(tagProperty.getAttrStr().c_str()); attribute->setJustify(FXTableItem::CENTER_X); myTable->setItem(itemIndex, 0, attribute); // Set description of element FXTableItem* type = new FXTableItem(""); - type->setText(i.getDescription().c_str()); - sizeColumnDescription = MAX2(sizeColumnDescription, (int)i.getDescription().size()); + type->setText(tagProperty.getDescription().c_str()); + sizeColumnDescription = MAX2(sizeColumnDescription, (int)tagProperty.getDescription().size()); type->setJustify(FXTableItem::CENTER_X); myTable->setItem(itemIndex, 1, type); // Set definition - FXTableItem* definition = new FXTableItem(i.getDefinition().c_str()); + FXTableItem* definition = new FXTableItem(tagProperty.getDefinition().c_str()); definition->setJustify(FXTableItem::LEFT); myTable->setItem(itemIndex, 2, definition); - sizeColumnDefinitions = MAX2(sizeColumnDefinitions, (int)i.getDefinition().size()); + sizeColumnDefinitions = MAX2(sizeColumnDefinitions, (int)tagProperty.getDefinition().size()); itemIndex++; } // set header @@ -251,7 +251,7 @@ new FXButton(myHorizontalFrameOKButton, "OK\t\tclose", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), attributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK); new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame); // Write Warning in console if we're in testing mode - WRITE_DEBUG("Opening HelpAttributes dialog for tag '" + tagProperties.getTagStr() + "' showing " + toString(tagProperties.getNumberOfAttributes()) + " attributes"); + WRITE_DEBUG("Opening HelpAttributes dialog for tag '" + AC->getTagProperty().getTagStr() + "' showing " + toString(AC->getTagProperty().getNumberOfAttributes()) + " attributes"); // create Dialog attributesHelpDialog->create(); // show in the given position @@ -261,7 +261,7 @@ // open as modal dialog (will block all windows until stop() or stopModal() is called) getApp()->runModalFor(attributesHelpDialog); // Write Warning in console if we're in testing mode - WRITE_DEBUG("Closing HelpAttributes dialog for tag '" + tagProperties.getTagStr() + "'"); + WRITE_DEBUG("Closing HelpAttributes dialog for tag '" + AC->getTagProperty().getTagStr() + "'"); } diff -Nru sumo-1.11.0/src/netedit/frames/GNEFrame.h sumo-1.12.0/src/netedit/frames/GNEFrame.h --- sumo-1.11.0/src/netedit/frames/GNEFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/GNEFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -19,8 +19,8 @@ /****************************************************************************/ #pragma once #include -#include "GNEFrameModuls.h" -#include "GNEFrameAttributesModuls.h" +#include "GNEFrameModules.h" +#include "GNEFrameAttributeModules.h" // =========================================================================== // class definitions @@ -33,8 +33,8 @@ class GNEFrame : public FXVerticalFrame { /// @brief friend class - friend class GNEFrameModuls; - friend class GNEFrameAttributesModuls; + friend class GNEFrameModules; + friend class GNEFrameAttributeModules; public: /**@brief Constructor @@ -105,7 +105,7 @@ /// @} /// @brief Open help attributes dialog - void openHelpAttributesDialog(const GNETagProperties& tagProperties) const; + void openHelpAttributesDialog(const GNEAttributeCarrier* AC) const; /// @brief get predefinedTagsMML const std::vector& getPredefinedTagsMML() const; diff -Nru sumo-1.11.0/src/netedit/frames/GNEFrameModules.cpp sumo-1.12.0/src/netedit/frames/GNEFrameModules.cpp --- sumo-1.11.0/src/netedit/frames/GNEFrameModules.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/GNEFrameModules.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,3187 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GNEFrameModules.cpp +/// @author Pablo Alvarez Lopez +/// @date Aug 2019 +/// +// Auxiliar class for GNEFrame Modules +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEFrameModules.h" + + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +FXDEFMAP(GNEFrameModules::TagSelector) TagSelectorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_TAG_SELECTED, GNEFrameModules::TagSelector::onCmdSelectTag) +}; + +FXDEFMAP(GNEFrameModules::DemandElementSelector) DemandElementSelectorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_TYPE, GNEFrameModules::DemandElementSelector::onCmdSelectDemandElement), +}; + +FXDEFMAP(GNEFrameModules::HierarchicalElementTree) HierarchicalElementTreeMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_CENTER, GNEFrameModules::HierarchicalElementTree::onCmdCenterItem), + FXMAPFUNC(SEL_COMMAND, MID_GNE_INSPECT, GNEFrameModules::HierarchicalElementTree::onCmdInspectItem), + FXMAPFUNC(SEL_COMMAND, MID_GNE_DELETE, GNEFrameModules::HierarchicalElementTree::onCmdDeleteItem), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ACHIERARCHY_MOVEUP, GNEFrameModules::HierarchicalElementTree::onCmdMoveItemUp), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ACHIERARCHY_MOVEDOWN, GNEFrameModules::HierarchicalElementTree::onCmdMoveItemDown), + FXMAPFUNC(SEL_RIGHTBUTTONRELEASE, MID_GNE_ACHIERARCHY_SHOWCHILDMENU, GNEFrameModules::HierarchicalElementTree::onCmdShowChildMenu) +}; + +FXDEFMAP(GNEFrameModules::DrawingShape) DrawingShapeMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_STARTDRAWING, GNEFrameModules::DrawingShape::onCmdStartDrawing), + FXMAPFUNC(SEL_COMMAND, MID_GNE_STOPDRAWING, GNEFrameModules::DrawingShape::onCmdStopDrawing), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ABORTDRAWING, GNEFrameModules::DrawingShape::onCmdAbortDrawing) +}; + +FXDEFMAP(GNEFrameModules::OverlappedInspection) OverlappedInspectionMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_OVERLAPPED_NEXT, GNEFrameModules::OverlappedInspection::onCmdNextElement), + FXMAPFUNC(SEL_COMMAND, MID_GNE_OVERLAPPED_PREVIOUS, GNEFrameModules::OverlappedInspection::onCmdPreviousElement), + FXMAPFUNC(SEL_COMMAND, MID_GNE_OVERLAPPED_SHOWLIST, GNEFrameModules::OverlappedInspection::onCmdShowList), + FXMAPFUNC(SEL_COMMAND, MID_GNE_OVERLAPPED_ITEMSELECTED, GNEFrameModules::OverlappedInspection::onCmdListItemSelected), + FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEFrameModules::OverlappedInspection::onCmdOverlappingHelp) +}; + +FXDEFMAP(GNEFrameModules::PathCreator) PathCreatorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_ABORT, GNEFrameModules::PathCreator::onCmdAbortPathCreation), + FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_FINISH, GNEFrameModules::PathCreator::onCmdCreatePath), + FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_REMOVELAST, GNEFrameModules::PathCreator::onCmdRemoveLastElement), + FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_SHOWCANDIDATES, GNEFrameModules::PathCreator::onCmdShowCandidateEdges) +}; + + +// Object implementation +FXIMPLEMENT(GNEFrameModules::TagSelector, FXGroupBoxModule, TagSelectorMap, ARRAYNUMBER(TagSelectorMap)) +FXIMPLEMENT(GNEFrameModules::DemandElementSelector, FXGroupBoxModule, DemandElementSelectorMap, ARRAYNUMBER(DemandElementSelectorMap)) +FXIMPLEMENT(GNEFrameModules::HierarchicalElementTree, FXGroupBoxModule, HierarchicalElementTreeMap, ARRAYNUMBER(HierarchicalElementTreeMap)) +FXIMPLEMENT(GNEFrameModules::DrawingShape, FXGroupBoxModule, DrawingShapeMap, ARRAYNUMBER(DrawingShapeMap)) +FXIMPLEMENT(GNEFrameModules::OverlappedInspection, FXGroupBoxModule, OverlappedInspectionMap, ARRAYNUMBER(OverlappedInspectionMap)) +FXIMPLEMENT(GNEFrameModules::PathCreator, FXGroupBoxModule, PathCreatorMap, ARRAYNUMBER(PathCreatorMap)) + + +// =========================================================================== +// method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEFrameModules::TagSelector - methods +// --------------------------------------------------------------------------- + +GNEFrameModules::TagSelector::TagSelector(GNEFrame* frameParent, GNETagProperties::TagType type, SumoXMLTag tag, bool onlyDrawables) : + FXGroupBoxModule(frameParent->myContentFrame, "Element"), + myFrameParent(frameParent), + myTagType(type), + myCurrentTemplateAC(nullptr) { + // Create MFXIconComboBox + myTagsMatchBox = new MFXIconComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_TAG_SELECTED, GUIDesignComboBox); + // set current tag type without notifying + setCurrentTagType(myTagType, onlyDrawables, false); + // set current tag without notifying + setCurrentTag(tag, false); + // TagSelector is always shown + show(); +} + + +GNEFrameModules::TagSelector::~TagSelector() { + // clear myACTemplates and myTagsMatchBox + for (const auto& ACTemplate : myACTemplates) { + delete ACTemplate; + } + myACTemplates.clear(); +} + + +void +GNEFrameModules::TagSelector::showTagSelector() { + show(); +} + + +void +GNEFrameModules::TagSelector::hideTagSelector() { + hide(); +} + + +GNEAttributeCarrier* +GNEFrameModules::TagSelector::getTemplateAC(SumoXMLTag ACTag) const { + // clear myACTemplates and myTagsMatchBox + for (const auto& ACTemplate : myACTemplates) { + if (ACTemplate->getAC()->getTagProperty().getTag() == ACTag) { + return ACTemplate->getAC(); + } + } + return nullptr; +} + + +GNEAttributeCarrier* +GNEFrameModules::TagSelector::getCurrentTemplateAC() const { + return myCurrentTemplateAC; +} + + +void +GNEFrameModules::TagSelector::setCurrentTagType(GNETagProperties::TagType tagType, const bool onlyDrawables, const bool notifyFrameParent) { + // check if net has proj + const bool proj = (GeoConvHelper::getFinal().getProjString() != "!"); + // set new tagType + myTagType = tagType; + // change TagSelector text + switch (myTagType) { + case GNETagProperties::TagType::NETWORKELEMENT: + setText("network elements"); + break; + case GNETagProperties::TagType::ADDITIONALELEMENT: + setText("Additional elements"); + break; + case GNETagProperties::TagType::SHAPE: + setText("Shape elements"); + break; + case GNETagProperties::TagType::TAZELEMENT: + setText("TAZ elements"); + break; + case GNETagProperties::TagType::VEHICLE: + setText("Vehicles"); + break; + case GNETagProperties::TagType::STOP: + setText("Stops"); + break; + case GNETagProperties::TagType::PERSON: + setText("Persons"); + break; + case GNETagProperties::TagType::PERSONPLAN: + setText("Person plans"); + break; + case GNETagProperties::TagType::CONTAINER: + setText("Container"); + break; + case GNETagProperties::TagType::CONTAINERPLAN: + setText("Container plans"); + break; + case GNETagProperties::TagType::PERSONTRIP: + setText("Person trips"); + break; + case GNETagProperties::TagType::WALK: + setText("Walks"); + break; + case GNETagProperties::TagType::RIDE: + setText("Rides"); + break; + case GNETagProperties::TagType::STOPPERSON: + setText("Person stops"); + break; + default: + throw ProcessError("invalid tag property"); + } + // clear myACTemplates and myTagsMatchBox + for (const auto& ACTemplate : myACTemplates) { + delete ACTemplate; + } + myACTemplates.clear(); + myTagsMatchBox->clearItems(); + // get tag properties + const auto tagProperties = GNEAttributeCarrier::getTagPropertiesByType(myTagType); + // fill myACTemplates and myTagsMatchBox + for (const auto& tagProperty : tagProperties) { + if ((!onlyDrawables || tagProperty.isDrawable()) && (!tagProperty.requireProj() || proj)) { + myACTemplates.push_back(new ACTemplate(myFrameParent->getViewNet()->getNet(), tagProperty)); + myTagsMatchBox->appendIconItem(tagProperty.getFieldString().c_str(), GUIIconSubSys::getIcon(tagProperty.getGUIIcon()), tagProperty.getBackGroundColor()); + } + } + // set color of myTypeMatchBox to black (valid) + myTagsMatchBox->setTextColor(FXRGB(0, 0, 0)); + // Set visible items + myTagsMatchBox->setNumVisible((int)myTagsMatchBox->getNumItems()); + // set first myACTemplate as edited AC + myCurrentTemplateAC = myACTemplates.front()->getAC(); + // call tag selected function + if (notifyFrameParent) { + myFrameParent->tagSelected(); + } +} + + +void +GNEFrameModules::TagSelector::setCurrentTag(SumoXMLTag newTag, const bool notifyFrameParent) { + // first reset myCurrentTemplateAC + myCurrentTemplateAC = nullptr; + // iterate over all myTagsMatchBox + for (int i = 0; i < (int)myACTemplates.size(); i++) { + if (myACTemplates.at(i)->getAC() && (myACTemplates.at(i)->getAC()->getTagProperty().getTag() == newTag)) { + // set current template and currentItem + myCurrentTemplateAC = myACTemplates.at(i)->getAC(); + myTagsMatchBox->setCurrentItem(i); + // set color of myTypeMatchBox to black (valid) + myTagsMatchBox->setTextColor(FXRGB(0, 0, 0)); + } + } + // call tag selected function + if (notifyFrameParent) { + myFrameParent->tagSelected(); + } +} + + +void +GNEFrameModules::TagSelector::refreshTagSelector() { + // call tag selected function + myFrameParent->tagSelected(); +} + + +long +GNEFrameModules::TagSelector::onCmdSelectTag(FXObject*, FXSelector, void*) { + // iterate over all myTagsMatchBox + for (int i = 0; i < (int)myACTemplates.size(); i++) { + if (myACTemplates.at(i)->getAC() && myACTemplates.at(i)->getAC()->getTagProperty().getFieldString() == myTagsMatchBox->getText().text()) { + // set templateAC and currentItem + myCurrentTemplateAC = myACTemplates.at(i)->getAC(); + myTagsMatchBox->setCurrentItem(i); + // set color of myTypeMatchBox to black (valid) + myTagsMatchBox->setTextColor(FXRGB(0, 0, 0)); + // call tag selected function + myFrameParent->tagSelected(); + // Write Warning in console if we're in testing mode + WRITE_DEBUG(("Selected item '" + myTagsMatchBox->getText() + "' in TagSelector").text()); + return 1; + } + } + // reset templateAC + myCurrentTemplateAC = nullptr; + // set color of myTypeMatchBox to red (invalid) + myTagsMatchBox->setTextColor(FXRGB(255, 0, 0)); + // Write Warning in console if we're in testing mode + WRITE_DEBUG("Selected invalid item in TagSelector"); + // call tag selected function + myFrameParent->tagSelected(); + return 1; +} + + +GNEAttributeCarrier* +GNEFrameModules::TagSelector::ACTemplate::getAC() const { + return myAC; +} + + +GNEFrameModules::TagSelector::ACTemplate::ACTemplate(GNENet* net, const GNETagProperties tagProperty) : + myAC(nullptr) { + // create attribute carrier depending of + switch (tagProperty.getTag()) { + // additional elements + case SUMO_TAG_BUS_STOP: + case SUMO_TAG_TRAIN_STOP: + myAC = new GNEBusStop(tagProperty.getTag(), net); + break; + case SUMO_TAG_ACCESS: + myAC = new GNEAccess(net); + break; + case SUMO_TAG_CONTAINER_STOP: + myAC = new GNEContainerStop(net); + break; + case SUMO_TAG_CHARGING_STATION: + myAC = new GNEChargingStation(net); + break; + case SUMO_TAG_PARKING_AREA: + myAC = new GNEParkingArea(net); + break; + case SUMO_TAG_PARKING_SPACE: + myAC = new GNEParkingSpace(net); + break; + case SUMO_TAG_E1DETECTOR: + myAC = new GNEDetectorE1(net); + break; + case SUMO_TAG_E2DETECTOR: + case GNE_TAG_E2DETECTOR_MULTILANE: + myAC = new GNEDetectorE2(tagProperty.getTag(), net); + break; + case SUMO_TAG_E3DETECTOR: + myAC = new GNEDetectorE3(net); + break; + case SUMO_TAG_DET_ENTRY: + case SUMO_TAG_DET_EXIT: + myAC = new GNEDetectorEntryExit(tagProperty.getTag(), net); + break; + case SUMO_TAG_INSTANT_INDUCTION_LOOP: + myAC = new GNEDetectorE1Instant(net); + break; + case SUMO_TAG_VSS: + myAC = new GNEVariableSpeedSign(net); + break; + case SUMO_TAG_STEP: + myAC = new GNEVariableSpeedSignStep(net); + break; + case SUMO_TAG_CALIBRATOR: + case SUMO_TAG_LANECALIBRATOR: + myAC = new GNECalibrator(tagProperty.getTag(), net); + break; + case GNE_TAG_FLOW_CALIBRATOR: + myAC = new GNECalibratorFlow(net); + break; + case SUMO_TAG_REROUTER: + myAC = new GNERerouter(net); + break; + case SUMO_TAG_INTERVAL: + myAC = new GNERerouterInterval(net); + break; + case SUMO_TAG_CLOSING_REROUTE: + myAC = new GNEClosingReroute(net); + break; + case SUMO_TAG_CLOSING_LANE_REROUTE: + myAC = new GNEClosingLaneReroute(net); + break; + case SUMO_TAG_DEST_PROB_REROUTE: + myAC = new GNEDestProbReroute(net); + break; + case SUMO_TAG_PARKING_AREA_REROUTE: + myAC = new GNEParkingAreaReroute(net); + break; + case SUMO_TAG_ROUTE_PROB_REROUTE: + myAC = new GNERouteProbReroute(net); + break; + case SUMO_TAG_ROUTEPROBE: + myAC = new GNERouteProbe(net); + break; + case SUMO_TAG_VAPORIZER: + myAC = new GNEVaporizer(net); + break; + // shapes + case SUMO_TAG_POLY: + myAC = new GNEPoly(net); + break; + case SUMO_TAG_POI: + case GNE_TAG_POILANE: + case GNE_TAG_POIGEO: + myAC = new GNEPOI(tagProperty.getTag(), net); + break; + // TAZs + case SUMO_TAG_TAZ: + myAC = new GNETAZ(net); + break; + case SUMO_TAG_TAZSOURCE: + case SUMO_TAG_TAZSINK: + myAC = new GNETAZSourceSink(tagProperty.getTag(), net); + break; + // Demand elements + case SUMO_TAG_ROUTE: + case GNE_TAG_ROUTE_EMBEDDED: + myAC = new GNERoute(tagProperty.getTag(), net); + break; + case SUMO_TAG_VTYPE: + myAC = new GNEVType(net); + break; + case SUMO_TAG_VTYPE_DISTRIBUTION: + myAC = new GNEVTypeDistribution(net); + break; + case SUMO_TAG_VEHICLE: + case GNE_TAG_VEHICLE_WITHROUTE: + case GNE_TAG_FLOW_ROUTE: + case GNE_TAG_FLOW_WITHROUTE: + case SUMO_TAG_TRIP: + case GNE_TAG_TRIP_JUNCTIONS: + case SUMO_TAG_FLOW: + case GNE_TAG_FLOW_JUNCTIONS: + myAC = new GNEVehicle(tagProperty.getTag(), net); + break; + case SUMO_TAG_STOP_LANE: + case SUMO_TAG_STOP_BUSSTOP: + case SUMO_TAG_STOP_CONTAINERSTOP: + case SUMO_TAG_STOP_CHARGINGSTATION: + case SUMO_TAG_STOP_PARKINGAREA: + case GNE_TAG_STOPPERSON_EDGE: + case GNE_TAG_STOPPERSON_BUSSTOP: + case GNE_TAG_STOPCONTAINER_EDGE: + case GNE_TAG_STOPCONTAINER_CONTAINERSTOP: + myAC = new GNEStop(tagProperty.getTag(), net); + break; + case SUMO_TAG_PERSON: + case SUMO_TAG_PERSONFLOW: + myAC = new GNEPerson(tagProperty.getTag(), net); + break; + case SUMO_TAG_CONTAINER: + case SUMO_TAG_CONTAINERFLOW: + myAC = new GNEContainer(tagProperty.getTag(), net); + break; + case GNE_TAG_TRANSPORT_EDGE: + case GNE_TAG_TRANSPORT_CONTAINERSTOP: + myAC = new GNETransport(tagProperty.getTag(), net); + break; + case GNE_TAG_TRANSHIP_EDGE: + case GNE_TAG_TRANSHIP_CONTAINERSTOP: + case GNE_TAG_TRANSHIP_EDGES: + myAC = new GNETranship(tagProperty.getTag(), net); + break; + case GNE_TAG_PERSONTRIP_EDGE: + case GNE_TAG_PERSONTRIP_BUSSTOP: + case GNE_TAG_PERSONTRIP_JUNCTIONS: + myAC = new GNEPersonTrip(tagProperty.getTag(), net); + break; + case GNE_TAG_WALK_EDGE: + case GNE_TAG_WALK_BUSSTOP: + case GNE_TAG_WALK_EDGES: + case GNE_TAG_WALK_ROUTE: + case GNE_TAG_WALK_JUNCTIONS: + myAC = new GNEWalk(tagProperty.getTag(), net); + break; + case GNE_TAG_RIDE_EDGE: + case GNE_TAG_RIDE_BUSSTOP: + myAC = new GNERide(tagProperty.getTag(), net); + break; + default: + throw ProcessError("Non-supported tagProperty in ACTemplate"); + break; + } +} + + +GNEFrameModules::TagSelector::ACTemplate::~ACTemplate() { + delete myAC; +} + +// --------------------------------------------------------------------------- +// GNEFrameModules::DemandElementSelector - methods +// --------------------------------------------------------------------------- + +GNEFrameModules::DemandElementSelector::DemandElementSelector(GNEFrame* frameParent, SumoXMLTag demandElementTag, GNEDemandElement* defaultElement) : + FXGroupBoxModule(frameParent->myContentFrame, ("Parent " + toString(demandElementTag)).c_str()), + myFrameParent(frameParent), + myCurrentDemandElement(defaultElement), + myDemandElementTags({demandElementTag}) { + // Create MFXIconComboBox + myDemandElementsMatchBox = new MFXIconComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_SET_TYPE, GUIDesignComboBox); + // refresh demand element MatchBox + refreshDemandElementSelector(); + // shown after creation + show(); +} + + +GNEFrameModules::DemandElementSelector::DemandElementSelector(GNEFrame* frameParent, const std::vector& tagTypes) : + FXGroupBoxModule(frameParent->myContentFrame, "Parent element"), + myFrameParent(frameParent), + myCurrentDemandElement(nullptr) { + // fill myDemandElementTags + for (const auto& tagType : tagTypes) { + const auto tagProperties = GNEAttributeCarrier::getTagPropertiesByType(tagType); + for (const auto& tagProperty : tagProperties) { + myDemandElementTags.push_back(tagProperty.getTag()); + } + } + // Create MFXIconComboBox + myDemandElementsMatchBox = new MFXIconComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_SET_TYPE, GUIDesignComboBox); + // refresh demand element MatchBox + refreshDemandElementSelector(); + // shown after creation + show(); +} + + +GNEFrameModules::DemandElementSelector::~DemandElementSelector() {} + + +GNEDemandElement* +GNEFrameModules::DemandElementSelector::getCurrentDemandElement() const { + return myCurrentDemandElement; +} + + +const std::vector& +GNEFrameModules::DemandElementSelector::getAllowedTags() const { + return myDemandElementTags; +} + + +void +GNEFrameModules::DemandElementSelector::setDemandElement(GNEDemandElement* demandElement) { + // first check that demandElement tag correspond to a tag of myDemandElementTags + if (std::find(myDemandElementTags.begin(), myDemandElementTags.end(), demandElement->getTagProperty().getTag()) != myDemandElementTags.end()) { + // update text of myDemandElementsMatchBox + myDemandElementsMatchBox->setItem(demandElement->getID().c_str(), demandElement->getIcon()); + // Set new current demand element + myCurrentDemandElement = demandElement; + // call demandElementSelected function + myFrameParent->demandElementSelected(); + } +} + + +void +GNEFrameModules::DemandElementSelector::showDemandElementSelector() { + // first refresh modul + refreshDemandElementSelector(); + // if current selected item isn't valid, set DEFAULT_VTYPE_ID or DEFAULT_PEDTYPE_ID + if (myCurrentDemandElement) { + myDemandElementsMatchBox->setItem(myCurrentDemandElement->getID().c_str(), myCurrentDemandElement->getIcon()); + } else if (myDemandElementTags.size() == 1) { + if (myDemandElementTags.at(0) == SUMO_TAG_VTYPE) { + const auto defaultVType = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID); + myDemandElementsMatchBox->setItem(defaultVType->getID().c_str(), defaultVType->getIcon()); + } + } + onCmdSelectDemandElement(nullptr, 0, nullptr); + show(); +} + + +void +GNEFrameModules::DemandElementSelector::hideDemandElementSelector() { + hide(); +} + + +bool +GNEFrameModules::DemandElementSelector::isDemandElementSelectorShown() const { + return shown(); +} + + +void +GNEFrameModules::DemandElementSelector::refreshDemandElementSelector() { + // get demand elemenst container + const auto& demandElements = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements(); + // clear demand elements comboBox + myDemandElementsMatchBox->clearItems(); + // fill myTypeMatchBox with list of demand elements + for (const auto& demandElementTag : myDemandElementTags) { + // special case for VTypes + if (demandElementTag == SUMO_TAG_VTYPE) { + // add default types in the first positions + myDemandElementsMatchBox->appendIconItem(DEFAULT_VTYPE_ID.c_str(), GUIIconSubSys::getIcon(GUIIcon::VTYPE)); + myDemandElementsMatchBox->appendIconItem(DEFAULT_BIKETYPE_ID.c_str(), GUIIconSubSys::getIcon(GUIIcon::VTYPE)); + myDemandElementsMatchBox->appendIconItem(DEFAULT_TAXITYPE_ID.c_str(), GUIIconSubSys::getIcon(GUIIcon::VTYPE)); + myDemandElementsMatchBox->appendIconItem(DEFAULT_PEDTYPE_ID.c_str(), GUIIconSubSys::getIcon(GUIIcon::VTYPE)); + myDemandElementsMatchBox->appendIconItem(DEFAULT_CONTAINERTYPE_ID.c_str(), GUIIconSubSys::getIcon(GUIIcon::VTYPE)); + // add rest of vTypes + for (const auto& vType : demandElements.at(demandElementTag)) { + // avoid insert duplicated default vType + if (DEFAULT_VTYPES.count(vType->getID()) == 0) { + myDemandElementsMatchBox->appendIconItem(vType->getID().c_str(), vType->getIcon()); + } + } + } else { + // insert all Ids + for (const auto& demandElement : demandElements.at(demandElementTag)) { + myDemandElementsMatchBox->appendIconItem(demandElement->getID().c_str(), demandElement->getIcon()); + } + } + } + // Set number of items (maximum 10) + if (myDemandElementsMatchBox->getNumItems() < 10) { + myDemandElementsMatchBox->setNumVisible((int)myDemandElementsMatchBox->getNumItems()); + } else { + myDemandElementsMatchBox->setNumVisible(10); + } + // update myCurrentDemandElement + if (myDemandElementsMatchBox->getNumItems() == 0) { + myCurrentDemandElement = nullptr; + } else if (myCurrentDemandElement) { + for (int i = 0; i < myDemandElementsMatchBox->getNumItems(); i++) { + if (myDemandElementsMatchBox->getItem(i).text() == myCurrentDemandElement->getID()) { + myDemandElementsMatchBox->setCurrentItem(i, FALSE); + } + } + } else { + // set first element in the list as myCurrentDemandElement (Special case for default person and vehicle type) + if (myDemandElementsMatchBox->getItem(0).text() == DEFAULT_VTYPE_ID) { + myCurrentDemandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDefaultType(); + } else { + // disable myCurrentDemandElement + myCurrentDemandElement = nullptr; + // update myCurrentDemandElement with the first allowed element + for (auto i = myDemandElementTags.begin(); (i != myDemandElementTags.end()) && (myCurrentDemandElement == nullptr); i++) { + if (demandElements.at(*i).size() > 0) { + myCurrentDemandElement = *demandElements.at(*i).begin(); + } + } + } + } +} + + +GNEEdge* +GNEFrameModules::DemandElementSelector::getPersonPlanPreviousEdge() const { + if (myCurrentDemandElement == nullptr) { + return nullptr; + } + if (!myCurrentDemandElement->getTagProperty().isPerson()) { + return nullptr; + } + if (myCurrentDemandElement->getChildDemandElements().empty()) { + return nullptr; + } + // get last person plan + const GNEDemandElement* lastPersonPlan = myCurrentDemandElement->getChildDemandElements().back(); + // check tag + switch (lastPersonPlan->getTagProperty().getTag()) { + // person trips + case GNE_TAG_PERSONTRIP_EDGE: + // rides + case GNE_TAG_RIDE_EDGE: + // walks + case GNE_TAG_WALK_EDGE: + case GNE_TAG_WALK_EDGES: + // stops + case GNE_TAG_STOPPERSON_EDGE: + return lastPersonPlan->getParentEdges().back(); + // person trips + case GNE_TAG_PERSONTRIP_BUSSTOP: + // person trips + case GNE_TAG_RIDE_BUSSTOP: + // walks + case GNE_TAG_WALK_BUSSTOP: + // stops + case GNE_TAG_STOPPERSON_BUSSTOP: + return lastPersonPlan->getParentAdditionals().back()->getParentLanes().front()->getParentEdge(); + // route walks + case GNE_TAG_WALK_ROUTE: + return lastPersonPlan->getParentDemandElements().back()->getParentEdges().back(); + default: + return nullptr; + } +} + + +GNEEdge* +GNEFrameModules::DemandElementSelector::getContainerPlanPreviousEdge() const { + if (myCurrentDemandElement == nullptr) { + return nullptr; + } + if (!myCurrentDemandElement->getTagProperty().isContainer()) { + return nullptr; + } + if (myCurrentDemandElement->getChildDemandElements().empty()) { + return nullptr; + } + // get last container plan + const GNEDemandElement* lastContainerPlan = myCurrentDemandElement->getChildDemandElements().back(); + // check tag + switch (lastContainerPlan->getTagProperty().getTag()) { + // transport + case GNE_TAG_TRANSPORT_EDGE: + // tranship + case GNE_TAG_TRANSHIP_EDGE: + case GNE_TAG_TRANSHIP_EDGES: + // stop + case GNE_TAG_STOPCONTAINER_EDGE: + return lastContainerPlan->getParentEdges().back(); + // transport + case GNE_TAG_TRANSPORT_CONTAINERSTOP: + // tranship + case GNE_TAG_TRANSHIP_CONTAINERSTOP: + // stop + case GNE_TAG_STOPCONTAINER_CONTAINERSTOP: + return lastContainerPlan->getParentAdditionals().back()->getParentLanes().front()->getParentEdge(); + default: + return nullptr; + } +} + + +long +GNEFrameModules::DemandElementSelector::onCmdSelectDemandElement(FXObject*, FXSelector, void*) { + // Check if value of myTypeMatchBox correspond to a demand element + for (const auto& demandElementTag : myDemandElementTags) { + for (const auto& demandElement : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(demandElementTag)) { + if (demandElement->getID() == myDemandElementsMatchBox->getText().text()) { + // set color of myTypeMatchBox to black (valid) + myDemandElementsMatchBox->setTextColor(FXRGB(0, 0, 0)); + // Set new current demand element + myCurrentDemandElement = demandElement; + // call demandElementSelected function + myFrameParent->demandElementSelected(); + // Write Warning in console if we're in testing mode + WRITE_DEBUG(("Selected item '" + myDemandElementsMatchBox->getText() + "' in DemandElementSelector").text()); + return 1; + } + } + } + // if demand element selected is invalid, set demand element as null + myCurrentDemandElement = nullptr; + // call demandElementSelected function + myFrameParent->demandElementSelected(); + // change color of myDemandElementsMatchBox to red (invalid) + myDemandElementsMatchBox->setTextColor(FXRGB(255, 0, 0)); + // Write Warning in console if we're in testing mode + WRITE_DEBUG("Selected invalid item in DemandElementSelector"); + return 1; +} + +// --------------------------------------------------------------------------- +// GNEFrameModules::HierarchicalElementTree - methods +// --------------------------------------------------------------------------- + +GNEFrameModules::HierarchicalElementTree::HierarchicalElementTree(GNEFrame* frameParent) : + FXGroupBoxModule(frameParent->myContentFrame, "Hierarchy"), + myFrameParent(frameParent), + myHE(nullptr), + myClickedAC(nullptr), + myClickedJunction(nullptr), + myClickedEdge(nullptr), + myClickedLane(nullptr), + myClickedCrossing(nullptr), + myClickedConnection(nullptr), + myClickedShape(nullptr), + myClickedTAZElement(nullptr), + myClickedAdditional(nullptr), + myClickedDemandElement(nullptr), + myClickedDataSet(nullptr), + myClickedDataInterval(nullptr), + myClickedGenericData(nullptr) { + // Create three list + myTreeListDinamic = new FXTreeListDinamic(getCollapsableFrame(), this, MID_GNE_ACHIERARCHY_SHOWCHILDMENU, GUIDesignTreeListDinamic); + hide(); +} + + +GNEFrameModules::HierarchicalElementTree::~HierarchicalElementTree() {} + + +void +GNEFrameModules::HierarchicalElementTree::showHierarchicalElementTree(GNEAttributeCarrier* AC) { + myHE = dynamic_cast(AC); + // show HierarchicalElementTree and refresh HierarchicalElementTree + if (myHE) { + // refresh HierarchicalElementTree + refreshHierarchicalElementTree(); + // show myTreeListDinamic + myTreeListDinamic->show(); + //show modul + show(); + } +} + + +void +GNEFrameModules::HierarchicalElementTree::hideHierarchicalElementTree() { + // set all pointers null + myHE = nullptr; + myClickedAC = nullptr; + myClickedJunction = nullptr; + myClickedEdge = nullptr; + myClickedLane = nullptr; + myClickedCrossing = nullptr; + myClickedConnection = nullptr; + myClickedShape = nullptr; + myClickedTAZElement = nullptr; + myClickedAdditional = nullptr; + myClickedDemandElement = nullptr; + myClickedDataSet = nullptr; + myClickedDataInterval = nullptr; + myClickedGenericData = nullptr; + // hide myTreeListDinamic + myTreeListDinamic->hide(); + // hide modul + hide(); +} + + +void +GNEFrameModules::HierarchicalElementTree::refreshHierarchicalElementTree() { + // clear items + myTreeListDinamic->clearItems(); + myTreeItemToACMap.clear(); + myTreeItemsConnections.clear(); + // show children of myHE + if (myHE) { + showHierarchicalElementChildren(myHE, showAttributeCarrierParents()); + } +} + + +void +GNEFrameModules::HierarchicalElementTree::removeCurrentEditedAttributeCarrier(const GNEAttributeCarrier* AC) { + // simply check if AC is the same of myHE + if (AC == myHE) { + myHE = nullptr; + } +} + + +long +GNEFrameModules::HierarchicalElementTree::onCmdShowChildMenu(FXObject*, FXSelector, void* eventData) { + // Obtain event + FXEvent* e = (FXEvent*)eventData; + // obtain FXTreeItem in the given position + FXTreeItem* item = myTreeListDinamic->getItemAt(e->win_x, e->win_y); + // open Pop-up if FXTreeItem has a Attribute Carrier vinculated + if (item && (myTreeItemsConnections.find(item) == myTreeItemsConnections.end())) { + createPopUpMenu(e->root_x, e->root_y, myTreeItemToACMap[item]); + } + return 1; +} + + +long +GNEFrameModules::HierarchicalElementTree::onCmdCenterItem(FXObject*, FXSelector, void*) { + // Center item + if (myClickedJunction) { + myFrameParent->myViewNet->centerTo(myClickedJunction->getGlID(), true, -1); + } else if (myClickedEdge) { + myFrameParent->myViewNet->centerTo(myClickedEdge->getGlID(), true, -1); + } else if (myClickedLane) { + myFrameParent->myViewNet->centerTo(myClickedLane->getGlID(), true, -1); + } else if (myClickedCrossing) { + myFrameParent->myViewNet->centerTo(myClickedCrossing->getGlID(), true, -1); + } else if (myClickedConnection) { + myFrameParent->myViewNet->centerTo(myClickedConnection->getGlID(), true, -1); + } else if (myClickedAdditional) { + myFrameParent->myViewNet->centerTo(myClickedAdditional->getGlID(), true, -1); + } else if (myClickedShape) { + myFrameParent->myViewNet->centerTo(myClickedShape->getGlID(), true, -1); + } else if (myClickedTAZElement) { + myFrameParent->myViewNet->centerTo(myClickedTAZElement->getGlID(), true, -1); + } else if (myClickedDemandElement) { + myFrameParent->myViewNet->centerTo(myClickedDemandElement->getGlID(), true, -1); + } else if (myClickedGenericData) { + myFrameParent->myViewNet->centerTo(myClickedGenericData->getGlID(), true, -1); + } + // update view after centering + myFrameParent->myViewNet->updateViewNet(); + return 1; +} + + +long +GNEFrameModules::HierarchicalElementTree::onCmdInspectItem(FXObject*, FXSelector, void*) { + if ((myHE != nullptr) && (myClickedAC != nullptr)) { + myFrameParent->myViewNet->getViewParent()->getInspectorFrame()->inspectChild(myClickedAC, myHE); + } + return 1; +} + + +long +GNEFrameModules::HierarchicalElementTree::onCmdDeleteItem(FXObject*, FXSelector, void*) { + // Remove Attribute Carrier + if (myClickedJunction) { + myFrameParent->myViewNet->getNet()->deleteJunction(myClickedJunction, myFrameParent->myViewNet->getUndoList()); + } else if (myClickedEdge) { + myFrameParent->myViewNet->getNet()->deleteEdge(myClickedEdge, myFrameParent->myViewNet->getUndoList(), false); + } else if (myClickedLane) { + myFrameParent->myViewNet->getNet()->deleteLane(myClickedLane, myFrameParent->myViewNet->getUndoList(), false); + } else if (myClickedCrossing) { + myFrameParent->myViewNet->getNet()->deleteCrossing(myClickedCrossing, myFrameParent->myViewNet->getUndoList()); + } else if (myClickedConnection) { + myFrameParent->myViewNet->getNet()->deleteConnection(myClickedConnection, myFrameParent->myViewNet->getUndoList()); + } else if (myClickedAdditional) { + myFrameParent->myViewNet->getNet()->deleteAdditional(myClickedAdditional, myFrameParent->myViewNet->getUndoList()); + } else if (myClickedShape) { + myFrameParent->myViewNet->getNet()->deleteShape(myClickedShape, myFrameParent->myViewNet->getUndoList()); + } else if (myClickedTAZElement) { + myFrameParent->myViewNet->getNet()->deleteTAZElement(myClickedTAZElement, myFrameParent->myViewNet->getUndoList()); + } else if (myClickedDemandElement) { + // check that default VTypes aren't removed + if ((myClickedDemandElement->getTagProperty().getTag() == SUMO_TAG_VTYPE) && (GNEAttributeCarrier::parse(myClickedDemandElement->getAttribute(GNE_ATTR_DEFAULT_VTYPE)))) { + WRITE_WARNING("Default Vehicle Type '" + myClickedDemandElement->getAttribute(SUMO_ATTR_ID) + "' cannot be removed"); + return 1; + } else if (myClickedDemandElement->getTagProperty().isPersonPlan() && (myClickedDemandElement->getParentDemandElements().front()->getChildDemandElements().size() == 1)) { + // we need to check if we're removing the last person plan of a person. + myFrameParent->myViewNet->getNet()->deleteDemandElement(myClickedDemandElement->getParentDemandElements().front(), myFrameParent->myViewNet->getUndoList()); + } else { + myFrameParent->myViewNet->getNet()->deleteDemandElement(myClickedDemandElement, myFrameParent->myViewNet->getUndoList()); + } + } else if (myClickedDataSet) { + myFrameParent->myViewNet->getNet()->deleteDataSet(myClickedDataSet, myFrameParent->myViewNet->getUndoList()); + } else if (myClickedDataInterval) { + // check if we have to remove data Set + if (myClickedDataInterval->getDataSetParent()->getDataIntervalChildren().size() == 1) { + myFrameParent->myViewNet->getNet()->deleteDataSet(myClickedDataInterval->getDataSetParent(), myFrameParent->myViewNet->getUndoList()); + } else { + myFrameParent->myViewNet->getNet()->deleteDataInterval(myClickedDataInterval, myFrameParent->myViewNet->getUndoList()); + } + } else if (myClickedGenericData) { + // check if we have to remove interval + if (myClickedGenericData->getDataIntervalParent()->getGenericDataChildren().size() == 1) { + // check if we have to remove data Set + if (myClickedGenericData->getDataIntervalParent()->getDataSetParent()->getDataIntervalChildren().size() == 1) { + myFrameParent->myViewNet->getNet()->deleteDataSet(myClickedGenericData->getDataIntervalParent()->getDataSetParent(), myFrameParent->myViewNet->getUndoList()); + } else { + myFrameParent->myViewNet->getNet()->deleteDataInterval(myClickedGenericData->getDataIntervalParent(), myFrameParent->myViewNet->getUndoList()); + } + } else { + myFrameParent->myViewNet->getNet()->deleteGenericData(myClickedGenericData, myFrameParent->myViewNet->getUndoList()); + } + } + // update net + myFrameParent->myViewNet->updateViewNet(); + // refresh AC Hierarchy + refreshHierarchicalElementTree(); + // check if inspector frame has to be shown again + if (myFrameParent->myViewNet->getInspectedAttributeCarriers().size() == 1) { + if (myFrameParent->myViewNet->getInspectedAttributeCarriers().front() != myClickedAC) { + myFrameParent->myViewNet->getViewParent()->getInspectorFrame()->inspectSingleElement(myFrameParent->myViewNet->getInspectedAttributeCarriers().front()); + } else { + // inspect a nullprt element to reset inspector frame + myFrameParent->myViewNet->getViewParent()->getInspectorFrame()->inspectSingleElement(nullptr); + } + } + return 1; +} + + +long +GNEFrameModules::HierarchicalElementTree::onCmdMoveItemUp(FXObject*, FXSelector, void*) { + // currently only children of demand elements can be moved + if (myClickedDemandElement) { + myFrameParent->myViewNet->getUndoList()->begin(myClickedDemandElement->getTagProperty().getGUIIcon(), ("moving up " + myClickedDemandElement->getTagStr()).c_str()); + // move element one position back + myFrameParent->myViewNet->getUndoList()->add(new GNEChange_Children(myClickedDemandElement->getParentDemandElements().at(0), myClickedDemandElement, + GNEChange_Children::Operation::MOVE_BACK), true); + myFrameParent->myViewNet->getUndoList()->end(); + } + // refresh after moving child + refreshHierarchicalElementTree(); + return 1; +} + + +long +GNEFrameModules::HierarchicalElementTree::onCmdMoveItemDown(FXObject*, FXSelector, void*) { + // currently only children of demand elements can be moved + if (myClickedDemandElement) { + myFrameParent->myViewNet->getUndoList()->begin(myClickedDemandElement->getTagProperty().getGUIIcon(), ("moving down " + myClickedDemandElement->getTagStr()).c_str()); + // move element one position front + myFrameParent->myViewNet->getUndoList()->add(new GNEChange_Children(myClickedDemandElement->getParentDemandElements().at(0), myClickedDemandElement, + GNEChange_Children::Operation::MOVE_FRONT), true); + myFrameParent->myViewNet->getUndoList()->end(); + } + // refresh after moving child + refreshHierarchicalElementTree(); + return 1; +} + + +void +GNEFrameModules::HierarchicalElementTree::createPopUpMenu(int X, int Y, GNEAttributeCarrier* clickedAC) { + // get attributeCarrirs + const auto& attributeCarriers = myFrameParent->myViewNet->getNet()->getAttributeCarriers(); + // first check that AC exist + if (clickedAC) { + // set current clicked AC + myClickedAC = clickedAC; + // cast all elements + myClickedJunction = attributeCarriers->retrieveJunction(clickedAC->getID(), false); + myClickedEdge = attributeCarriers->retrieveEdge(clickedAC->getID(), false); + myClickedLane = attributeCarriers->retrieveLane(clickedAC, false); + myClickedCrossing = attributeCarriers->retrieveCrossing(clickedAC, false); + myClickedConnection = attributeCarriers->retrieveConnection(clickedAC, false); + myClickedShape = attributeCarriers->retrieveShape(clickedAC, false); + myClickedTAZElement = attributeCarriers->retrieveTAZElement(clickedAC, false); + myClickedAdditional = attributeCarriers->retrieveAdditional(clickedAC, false); + myClickedDemandElement = attributeCarriers->retrieveDemandElement(clickedAC, false); + myClickedDataSet = attributeCarriers->retrieveDataSet(clickedAC, false); + myClickedDataInterval = attributeCarriers->retrieveDataInterval(clickedAC, false); + myClickedGenericData = attributeCarriers->retrieveGenericData(clickedAC, false); + // create FXMenuPane + FXMenuPane* pane = new FXMenuPane(myTreeListDinamic); + // set item name and icon + new MFXMenuHeader(pane, myFrameParent->myViewNet->getViewParent()->getGUIMainWindow()->getBoldFont(), myClickedAC->getPopUpID().c_str(), myClickedAC->getIcon()); + // insert separator + new FXMenuSeparator(pane); + // create center menu command + FXMenuCommand* centerMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Center", GUIIconSubSys::getIcon(GUIIcon::RECENTERVIEW), this, MID_GNE_CENTER); + // disable Centering for Vehicle Types, data sets and data intervals + if (myClickedAC->getTagProperty().isVehicleType() || (myClickedAC->getTagProperty().getTag() == SUMO_TAG_DATASET) || + (myClickedAC->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL)) { + centerMenuCommand->disable(); + } + // create inspect and delete menu commands + FXMenuCommand* inspectMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Inspect", GUIIconSubSys::getIcon(GUIIcon::MODEINSPECT), this, MID_GNE_INSPECT); + FXMenuCommand* deleteMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Delete", GUIIconSubSys::getIcon(GUIIcon::MODEDELETE), this, MID_GNE_DELETE); + // check if inspect and delete menu commands has to be disabled + if (GNEFrameAttributeModules::isSupermodeValid(myFrameParent->myViewNet, myClickedAC) == false) { + inspectMenuCommand->disable(); + deleteMenuCommand->disable(); + } + // now chec if given AC support manually moving of their item up and down (Currently only for certain demand elements) + /* if (myClickedDemandElement && myClickedAC->getTagProperty().canBeSortedManually()) { + // insert separator + new FXMenuSeparator(pane); + // create both moving menu commands + FXMenuCommand* moveUpMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Move up", GUIIconSubSys::getIcon(GUIIcon::ARROW_UP), this, MID_GNE_ACHIERARCHY_MOVEUP); + FXMenuCommand* moveDownMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Move down", GUIIconSubSys::getIcon(GUIIcon::ARROW_DOWN), this, MID_GNE_ACHIERARCHY_MOVEDOWN); + // check if both commands has to be disabled + if (myClickedDemandElement->getTagProperty().isStopPerson()) { + moveUpMenuCommand->setText("Move up (Stops cannot be moved)"); + moveDownMenuCommand->setText("Move down (Stops cannot be moved)"); + moveUpMenuCommand->disable(); + moveDownMenuCommand->disable(); + } else { + // check if moveUpMenuCommand has to be disabled + if (myClickedDemandElement->getParentDemandElements().front()->getChildDemandElements().front() == myClickedDemandElement) { + moveUpMenuCommand->setText("Move up (It's already the first element)"); + moveUpMenuCommand->disable(); + } else if (myClickedDemandElement->getParentDemandElements().front()->getPreviousChildDemandElement(myClickedDemandElement)->getTagProperty().isStopPerson()) { + moveUpMenuCommand->setText("Move up (Previous element is a Stop)"); + moveUpMenuCommand->disable(); + } + // check if moveDownMenuCommand has to be disabled + if (myClickedDemandElement->getParentDemandElements().front()->getChildDemandElements().back() == myClickedDemandElement) { + moveDownMenuCommand->setText("Move down (It's already the last element)"); + moveDownMenuCommand->disable(); + } else if (myClickedDemandElement->getParentDemandElements().front()->getNextChildDemandElement(myClickedDemandElement)->getTagProperty().isStopPerson()) { + moveDownMenuCommand->setText("Move down (Next element is a Stop)"); + moveDownMenuCommand->disable(); + } + } + } */ + // Center in the mouse position and create pane + pane->setX(X); + pane->setY(Y); + pane->create(); + pane->show(); + } else { + // set all clicked elements to null + myClickedAC = nullptr; + myClickedJunction = nullptr; + myClickedEdge = nullptr; + myClickedLane = nullptr; + myClickedCrossing = nullptr; + myClickedConnection = nullptr; + myClickedShape = nullptr; + myClickedTAZElement = nullptr; + myClickedAdditional = nullptr; + myClickedDemandElement = nullptr; + myClickedDataSet = nullptr; + myClickedDataInterval = nullptr; + myClickedGenericData = nullptr; + } +} + + +FXTreeItem* +GNEFrameModules::HierarchicalElementTree::showAttributeCarrierParents() { + // get attributeCarrirs + const auto& attributeCarriers = myFrameParent->myViewNet->getNet()->getAttributeCarriers(); + // check tags + if (myHE->getTagProperty().isNetworkElement()) { + // check demand element type + switch (myHE->getTagProperty().getTag()) { + case SUMO_TAG_EDGE: { + // obtain Edge + GNEEdge* edge = attributeCarriers->retrieveEdge(myHE->getID(), false); + if (edge) { + // insert Junctions of edge in tree (Pararell because a edge has always two Junctions) + FXTreeItem* junctionSourceItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " origin").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon()); + FXTreeItem* junctionDestinyItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " destiny").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon()); + junctionDestinyItem->setExpanded(true); + // Save items in myTreeItemToACMap + myTreeItemToACMap[junctionSourceItem] = edge->getFromJunction(); + myTreeItemToACMap[junctionDestinyItem] = edge->getToJunction(); + // return junction destiny Item + return junctionDestinyItem; + } else { + return nullptr; + } + } + case SUMO_TAG_LANE: { + // obtain lane + GNELane* lane = attributeCarriers->retrieveLane(myHE->getID(), false); + if (lane) { + // obtain parent edge + GNEEdge* edge = attributeCarriers->retrieveEdge(lane->getParentEdge()->getID()); + //inser Junctions of lane of edge in tree (Pararell because a edge has always two Junctions) + FXTreeItem* junctionSourceItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " origin").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon()); + FXTreeItem* junctionDestinyItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " destiny").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon()); + junctionDestinyItem->setExpanded(true); + // Create edge item + FXTreeItem* edgeItem = myTreeListDinamic->insertItem(nullptr, junctionDestinyItem, edge->getHierarchyName().c_str(), edge->getIcon(), edge->getIcon()); + edgeItem->setExpanded(true); + // Save items in myTreeItemToACMap + myTreeItemToACMap[junctionSourceItem] = edge->getFromJunction(); + myTreeItemToACMap[junctionDestinyItem] = edge->getToJunction(); + myTreeItemToACMap[edgeItem] = edge; + // return edge item + return edgeItem; + } else { + return nullptr; + } + } + case SUMO_TAG_CROSSING: { + // obtain crossing parent junction + GNEJunction* junction = attributeCarriers->retrieveCrossing(myHE)->getParentJunction(); + // create junction item + FXTreeItem* junctionItem = myTreeListDinamic->insertItem(nullptr, nullptr, junction->getHierarchyName().c_str(), junction->getIcon(), junction->getIcon()); + junctionItem->setExpanded(true); + // Save items in myTreeItemToACMap + myTreeItemToACMap[junctionItem] = junction; + // return junction Item + return junctionItem; + } + case SUMO_TAG_CONNECTION: { + // obtain Connection + GNEConnection* connection = attributeCarriers->retrieveConnection(myHE->getID(), false); + if (connection) { + // create edge from item + FXTreeItem* edgeFromItem = myTreeListDinamic->insertItem(nullptr, nullptr, connection->getEdgeFrom()->getHierarchyName().c_str(), connection->getEdgeFrom()->getIcon(), connection->getEdgeFrom()->getIcon()); + edgeFromItem->setExpanded(true); + // create edge to item + FXTreeItem* edgeToItem = myTreeListDinamic->insertItem(nullptr, nullptr, connection->getEdgeTo()->getHierarchyName().c_str(), connection->getEdgeTo()->getIcon(), connection->getEdgeTo()->getIcon()); + edgeToItem->setExpanded(true); + // create connection item + FXTreeItem* connectionItem = myTreeListDinamic->insertItem(nullptr, edgeToItem, connection->getHierarchyName().c_str(), connection->getIcon(), connection->getIcon()); + connectionItem->setExpanded(true); + // Save items in myTreeItemToACMap + myTreeItemToACMap[edgeFromItem] = connection->getEdgeFrom(); + myTreeItemToACMap[edgeToItem] = connection->getEdgeTo(); + myTreeItemToACMap[connectionItem] = connection; + // return connection item + return connectionItem; + } else { + return nullptr; + } + } + default: + break; + } + } else if (myHE->getTagProperty().getTag() == GNE_TAG_POILANE) { + // Obtain POILane + const GNEShape* POILane = myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveShape(myHE); + // obtain parent lane + GNELane* lane = attributeCarriers->retrieveLane(POILane->getParentLanes().at(0)->getID()); + // obtain parent edge + GNEEdge* edge = attributeCarriers->retrieveEdge(lane->getParentEdge()->getID()); + //inser Junctions of lane of edge in tree (Pararell because a edge has always two Junctions) + FXTreeItem* junctionSourceItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " origin").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon()); + FXTreeItem* junctionDestinyItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " destiny").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon()); + junctionDestinyItem->setExpanded(true); + // Create edge item + FXTreeItem* edgeItem = myTreeListDinamic->insertItem(nullptr, junctionDestinyItem, edge->getHierarchyName().c_str(), edge->getIcon(), edge->getIcon()); + edgeItem->setExpanded(true); + // Create lane item + FXTreeItem* laneItem = myTreeListDinamic->insertItem(nullptr, edgeItem, lane->getHierarchyName().c_str(), lane->getIcon(), lane->getIcon()); + laneItem->setExpanded(true); + // Save items in myTreeItemToACMap + myTreeItemToACMap[junctionSourceItem] = edge->getFromJunction(); + myTreeItemToACMap[junctionDestinyItem] = edge->getToJunction(); + myTreeItemToACMap[edgeItem] = edge; + myTreeItemToACMap[laneItem] = lane; + // return Lane item + return laneItem; + } else if (myHE->getTagProperty().isAdditionalElement()) { + // Obtain Additional + const GNEAdditional* additional = attributeCarriers->retrieveAdditional(myHE); + // declare auxiliar FXTreeItem, due a demand element can have multiple "roots" + FXTreeItem* root = nullptr; + // check if there is demand elements parents + if (additional->getParentAdditionals().size() > 0) { + // check if we have more than one edge + if (additional->getParentAdditionals().size() > 1) { + // insert first item + addListItem(additional->getParentAdditionals().front()); + // insert "spacer" + if (additional->getParentAdditionals().size() > 2) { + addListItem(nullptr, ("..." + toString((int)additional->getParentAdditionals().size() - 2) + " additionals...").c_str(), 0, false); + } + } + // return last inserted item + root = addListItem(additional->getParentAdditionals().back()); + } + // check if there is parent demand elements + if (additional->getParentDemandElements().size() > 0) { + // check if we have more than one demand element + if (additional->getParentDemandElements().size() > 1) { + // insert first item + addListItem(additional->getParentDemandElements().front()); + // insert "spacer" + if (additional->getParentDemandElements().size() > 2) { + addListItem(nullptr, ("..." + toString((int)additional->getParentDemandElements().size() - 2) + " demand elements...").c_str(), 0, false); + } + } + // return last inserted item + root = addListItem(additional->getParentDemandElements().back()); + } + // check if there is parent edges + if (additional->getParentEdges().size() > 0) { + // check if we have more than one edge + if (additional->getParentEdges().size() > 1) { + // insert first item + addListItem(additional->getParentEdges().front()); + // insert "spacer" + if (additional->getParentEdges().size() > 2) { + addListItem(nullptr, ("..." + toString((int)additional->getParentEdges().size() - 2) + " edges...").c_str(), 0, false); + } + } + // return last inserted item + root = addListItem(additional->getParentEdges().back()); + } + // check if there is parent lanes + if (additional->getParentLanes().size() > 0) { + // check if we have more than one parent lane + if (additional->getParentLanes().size() > 1) { + // insert first item + addListItem(additional->getParentLanes().front()); + // insert "spacer" + if (additional->getParentLanes().size() > 2) { + addListItem(nullptr, ("..." + toString((int)additional->getParentLanes().size() - 2) + " lanes...").c_str(), 0, false); + } + } + // return last inserted item + root = addListItem(additional->getParentLanes().back()); + } + // return last inserted list item + return root; + } else if (myHE->getTagProperty().isTAZElement()) { + // Obtain TAZElement + const GNETAZElement* TAZElement = myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveTAZElement(myHE); + // declare auxiliar FXTreeItem, due a demand element can have multiple "roots" + FXTreeItem* root = nullptr; + // check if there is demand elements parents + if (TAZElement->getParentTAZElements().size() > 0) { + // check if we have more than one edge + if (TAZElement->getParentTAZElements().size() > 1) { + // insert first item + addListItem(TAZElement->getParentTAZElements().front()); + // insert "spacer" + if (TAZElement->getParentTAZElements().size() > 2) { + addListItem(nullptr, ("..." + toString((int)TAZElement->getParentTAZElements().size() - 2) + " TAZElements...").c_str(), 0, false); + } + } + // return last inserted item + root = addListItem(TAZElement->getParentTAZElements().back()); + } + // check if there is parent demand elements + if (TAZElement->getParentDemandElements().size() > 0) { + // check if we have more than one demand element + if (TAZElement->getParentDemandElements().size() > 1) { + // insert first item + addListItem(TAZElement->getParentDemandElements().front()); + // insert "spacer" + if (TAZElement->getParentDemandElements().size() > 2) { + addListItem(nullptr, ("..." + toString((int)TAZElement->getParentDemandElements().size() - 2) + " demand elements...").c_str(), 0, false); + } + } + // return last inserted item + root = addListItem(TAZElement->getParentDemandElements().back()); + } + // check if there is parent edges + if (TAZElement->getParentEdges().size() > 0) { + // check if we have more than one edge + if (TAZElement->getParentEdges().size() > 1) { + // insert first item + addListItem(TAZElement->getParentEdges().front()); + // insert "spacer" + if (TAZElement->getParentEdges().size() > 2) { + addListItem(nullptr, ("..." + toString((int)TAZElement->getParentEdges().size() - 2) + " edges...").c_str(), 0, false); + } + } + // return last inserted item + root = addListItem(TAZElement->getParentEdges().back()); + } + // check if there is parent lanes + if (TAZElement->getParentLanes().size() > 0) { + // check if we have more than one parent lane + if (TAZElement->getParentLanes().size() > 1) { + // insert first item + addListItem(TAZElement->getParentLanes().front()); + // insert "spacer" + if (TAZElement->getParentLanes().size() > 2) { + addListItem(nullptr, ("..." + toString((int)TAZElement->getParentLanes().size() - 2) + " lanes...").c_str(), 0, false); + } + } + // return last inserted item + root = addListItem(TAZElement->getParentLanes().back()); + } + // return last inserted list item + return root; + } else if (myHE->getTagProperty().isDemandElement()) { + // Obtain DemandElement + GNEDemandElement* demandElement = myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveDemandElement(myHE); + // declare auxiliar FXTreeItem, due a demand element can have multiple "roots" + FXTreeItem* root = nullptr; + // check if there are demand element parents + if (demandElement->getParentAdditionals().size() > 0) { + // check if we have more than one edge + if (demandElement->getParentAdditionals().size() > 1) { + // insert first item + addListItem(demandElement->getParentAdditionals().front()); + // insert "spacer" + if (demandElement->getParentAdditionals().size() > 2) { + addListItem(nullptr, ("..." + toString((int)demandElement->getParentAdditionals().size() - 2) + " additionals...").c_str(), 0, false); + } + } + // return last inserted item + root = addListItem(demandElement->getParentAdditionals().back()); + } + // check if there is parent demand elements + if (demandElement->getParentDemandElements().size() > 0) { + // check if we have more than one demand element + if (demandElement->getParentDemandElements().size() > 1) { + // insert first item + addListItem(demandElement->getParentDemandElements().front()); + // insert "spacer" + if (demandElement->getParentDemandElements().size() > 2) { + addListItem(nullptr, ("..." + toString((int)demandElement->getParentDemandElements().size() - 2) + " demand elements...").c_str(), 0, false); + } + } + // return last inserted item + root = addListItem(demandElement->getParentDemandElements().back()); + } + // check if there is parent edges + if (demandElement->getParentEdges().size() > 0) { + // check if we have more than one edge + if (demandElement->getParentEdges().size() > 1) { + // insert first item + addListItem(demandElement->getParentEdges().front()); + // insert "spacer" + if (demandElement->getParentEdges().size() > 2) { + addListItem(nullptr, ("..." + toString((int)demandElement->getParentEdges().size() - 2) + " edges...").c_str(), 0, false); + } + } + // return last inserted item + root = addListItem(demandElement->getParentEdges().back()); + } + // check if there is parent lanes + if (demandElement->getParentLanes().size() > 0) { + // check if we have more than one parent lane + if (demandElement->getParentLanes().size() > 1) { + // insert first item + addListItem(demandElement->getParentLanes().front()); + // insert "spacer" + if (demandElement->getParentLanes().size() > 2) { + addListItem(nullptr, ("..." + toString((int)demandElement->getParentLanes().size() - 2) + " lanes...").c_str(), 0, false); + } + } + // return last inserted item + root = addListItem(demandElement->getParentLanes().back()); + } + // return last inserted list item + return root; + } else if (myHE->getTagProperty().isDataElement()) { + // check if is a GNEDataInterval or a GNEGenericData + if (myHE->getTagProperty().getTag() == SUMO_TAG_DATASET) { + return nullptr; + } else if (myHE->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) { + return addListItem(myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveDataSet(myHE->getID())); + } else { + // Obtain DataElement + GNEGenericData* dataElement = dynamic_cast(myHE); + if (dataElement) { + // declare auxiliar FXTreeItem, due a data element can have multiple "roots" + FXTreeItem* root = nullptr; + // set dataset + addListItem(dataElement->getDataIntervalParent()->getDataSetParent()); + // set data interval + addListItem(dataElement->getDataIntervalParent()); + // check if there is data elements parents + if (dataElement->getParentAdditionals().size() > 0) { + // check if we have more than one edge + if (dataElement->getParentAdditionals().size() > 1) { + // insert first item + addListItem(dataElement->getParentAdditionals().front()); + // insert "spacer" + if (dataElement->getParentAdditionals().size() > 2) { + addListItem(nullptr, ("..." + toString((int)dataElement->getParentAdditionals().size() - 2) + " additionals...").c_str(), 0, false); + } + } + // return last inserted item + root = addListItem(dataElement->getParentAdditionals().back()); + } + // check if there is parent demand elements + if (dataElement->getParentDemandElements().size() > 0) { + // check if we have more than one demand element + if (dataElement->getParentDemandElements().size() > 1) { + // insert first item + addListItem(dataElement->getParentDemandElements().front()); + // insert "spacer" + if (dataElement->getParentDemandElements().size() > 2) { + addListItem(nullptr, ("..." + toString((int)dataElement->getParentDemandElements().size() - 2) + " demand elements...").c_str(), 0, false); + } + } + // return last inserted item + root = addListItem(dataElement->getParentDemandElements().back()); + } + // check if there is parent edges + if (dataElement->getParentEdges().size() > 0) { + // check if we have more than one edge + if (dataElement->getParentEdges().size() > 1) { + // insert first ege + if (dataElement->getTagProperty().getTag() == SUMO_TAG_EDGEREL) { + addListItem(dataElement->getParentEdges().front(), nullptr, "from "); + } else { + addListItem(dataElement->getParentEdges().front()); + } + // insert "spacer" + if (dataElement->getParentEdges().size() > 2) { + addListItem(nullptr, ("..." + toString((int)dataElement->getParentEdges().size() - 2) + " edges...").c_str(), 0, false); + } + } + // insert last ege + if (dataElement->getTagProperty().getTag() == SUMO_TAG_EDGEREL) { + addListItem(dataElement->getParentEdges().back(), nullptr, "to "); + } else { + addListItem(dataElement->getParentEdges().back()); + } + } + // check if there is parent lanes + if (dataElement->getParentLanes().size() > 0) { + // check if we have more than one parent lane + if (dataElement->getParentLanes().size() > 1) { + // insert first item + addListItem(dataElement->getParentLanes().front()); + // insert "spacer" + if (dataElement->getParentLanes().size() > 2) { + addListItem(nullptr, ("..." + toString((int)dataElement->getParentLanes().size() - 2) + " lanes...").c_str(), 0, false); + } + } + // return last inserted item + root = addListItem(dataElement->getParentLanes().back()); + } + // return last inserted list item + return root; + } + } + } + // there aren't parents + return nullptr; +} + + +void +GNEFrameModules::HierarchicalElementTree::showHierarchicalElementChildren(GNEHierarchicalElement* HE, FXTreeItem* itemParent) { + if (HE->getTagProperty().isNetworkElement()) { + // Switch gl type of ac + switch (HE->getTagProperty().getTag()) { + case SUMO_TAG_JUNCTION: { + // retrieve junction + GNEJunction* junction = myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveJunction(HE->getID(), false); + if (junction) { + // insert junction item + FXTreeItem* junctionItem = addListItem(HE, itemParent); + // insert edges + for (const auto& edge : junction->getChildEdges()) { + showHierarchicalElementChildren(edge, junctionItem); + } + // insert crossings + for (const auto& crossing : junction->getGNECrossings()) { + showHierarchicalElementChildren(crossing, junctionItem); + } + } + break; + } + case SUMO_TAG_EDGE: { + // retrieve edge + GNEEdge* edge = myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveEdge(HE->getID(), false); + if (edge) { + // insert edge item + FXTreeItem* edgeItem = addListItem(HE, itemParent); + // insert lanes + for (const auto& lane : edge->getLanes()) { + showHierarchicalElementChildren(lane, edgeItem); + } + // insert child additional + for (const auto& additional : edge->getChildAdditionals()) { + showHierarchicalElementChildren(additional, edgeItem); + } + // insert child shapes + for (const auto& shape : edge->getChildShapes()) { + showHierarchicalElementChildren(shape, edgeItem); + } + // insert child TAZElements + for (const auto& TAZElement : edge->getChildTAZElements()) { + // use addListItem because TAZElement doesn't have children + addListItem(TAZElement, edgeItem); + } + // insert child demand elements + for (const auto& demandElement : edge->getChildDemandElements()) { + showHierarchicalElementChildren(demandElement, edgeItem); + } + /* + CHECK THIS + + // insert demand elements children (note: use getChildDemandElementsSortedByType to avoid duplicated elements) + for (const auto& route : edge->getChildDemandElementsByType(SUMO_TAG_ROUTE)) { + showHierarchicalElementChildren(route, edgeItem); + } + for (const auto& trip : edge->getChildDemandElementsByType(SUMO_TAG_TRIP)) { + showHierarchicalElementChildren(trip, edgeItem); + } + for (const auto& flow : edge->getChildDemandElementsByType(SUMO_TAG_FLOW)) { + showHierarchicalElementChildren(flow, edgeItem); + } + */ + // show data elements + for (const auto& genericDatas : edge->getChildGenericDatas()) { + showHierarchicalElementChildren(genericDatas, edgeItem); + } + } + break; + } + case SUMO_TAG_LANE: { + // retrieve lane + GNELane* lane = myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveLane(HE->getID(), false); + if (lane) { + // insert lane item + FXTreeItem* laneItem = addListItem(HE, itemParent); + // insert child additional + for (const auto& additional : lane->getChildAdditionals()) { + showHierarchicalElementChildren(additional, laneItem); + } + // insert child shapes + for (const auto& shape : lane->getChildShapes()) { + showHierarchicalElementChildren(shape, laneItem); + } + // insert child TAZElements + for (const auto& TAZElement : lane->getChildTAZElements()) { + // use addListItem because TAZElement doesn't have children + addListItem(TAZElement, laneItem); + } + // insert demand elements children + for (const auto& demandElement : lane->getChildDemandElements()) { + showHierarchicalElementChildren(demandElement, laneItem); + } + // insert incoming connections of lanes (by default isn't expanded) + if (lane->getGNEIncomingConnections().size() > 0) { + std::vector incomingLaneConnections = lane->getGNEIncomingConnections(); + // insert intermediate list item + FXTreeItem* incomingConnections = addListItem(laneItem, "Incomings", incomingLaneConnections.front()->getIcon(), false); + // insert incoming connections + for (const auto& connection : incomingLaneConnections) { + showHierarchicalElementChildren(connection, incomingConnections); + } + } + // insert outcoming connections of lanes (by default isn't expanded) + if (lane->getGNEOutcomingConnections().size() > 0) { + std::vector outcomingLaneConnections = lane->getGNEOutcomingConnections(); + // insert intermediate list item + FXTreeItem* outgoingConnections = addListItem(laneItem, "Outgoing", outcomingLaneConnections.front()->getIcon(), false); + // insert outcoming connections + for (const auto& connection : outcomingLaneConnections) { + showHierarchicalElementChildren(connection, outgoingConnections); + } + } + } + break; + } + case SUMO_TAG_CROSSING: + case SUMO_TAG_CONNECTION: { + // insert connection item + addListItem(HE, itemParent); + break; + } + default: + break; + } + } else if (HE->getTagProperty().isAdditionalElement() || HE->getTagProperty().isShape() || HE->getTagProperty().isTAZElement() || HE->getTagProperty().isDemandElement()) { + // insert additional item + FXTreeItem* treeItem = addListItem(HE, itemParent); + // insert child edges + for (const auto& edge : HE->getChildEdges()) { + showHierarchicalElementChildren(edge, treeItem); + } + // insert child lanes + for (const auto& lane : HE->getChildLanes()) { + showHierarchicalElementChildren(lane, treeItem); + } + // insert additional symbols + std::vector symbols; + for (const auto& additional : HE->getChildAdditionals()) { + if (additional->getTagProperty().isSymbol()) { + symbols.push_back(additional); + } + } + if (symbols.size() > 0) { + // insert intermediate list item + const auto additionalParent = symbols.front()->getParentAdditionals().front(); + const std::string symbolType = additionalParent->getTagProperty().hasAttribute(SUMO_ATTR_EDGES) ? "Edges" : "Lanes"; + GUIIcon symbolIcon = additionalParent->getTagProperty().hasAttribute(SUMO_ATTR_EDGES) ? GUIIcon::EDGE : GUIIcon::LANE; + FXTreeItem* symbolListItem = addListItem(treeItem, symbolType, GUIIconSubSys::getIcon(symbolIcon), false); + // insert symbols + for (const auto& symbol : symbols) { + showHierarchicalElementChildren(symbol, symbolListItem); + } + } + // insert additional children + for (const auto& additional : HE->getChildAdditionals()) { + if (!additional->getTagProperty().isSymbol()) { + showHierarchicalElementChildren(additional, treeItem); + } + } + // insert child shapes + for (const auto& shape : HE->getChildShapes()) { + showHierarchicalElementChildren(shape, treeItem); + } + // insert TAZElements children + for (const auto& TAZElement : HE->getChildTAZElements()) { + // use addListItem because TAZElement doesn't have children + addListItem(TAZElement, treeItem); + } + // insert child demand elements + for (const auto& demandElement : HE->getChildDemandElements()) { + showHierarchicalElementChildren(demandElement, treeItem); + } + } else if (HE->getTagProperty().isDataElement()) { + // insert data item + FXTreeItem* dataElementItem = addListItem(HE, itemParent); + // insert intervals + if (HE->getTagProperty().getTag() == SUMO_TAG_DATASET) { + GNEDataSet* dataSet = myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveDataSet(HE->getID()); + // iterate over intevals + for (const auto& interval : dataSet->getDataIntervalChildren()) { + showHierarchicalElementChildren(interval.second, dataElementItem); + } + } else if (HE->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) { + GNEDataInterval* dataInterval = dynamic_cast(HE); + // iterate over generic datas + for (const auto& genericData : dataInterval->getGenericDataChildren()) { + showHierarchicalElementChildren(genericData, dataElementItem); + } + } + } +} + + +FXTreeItem* +GNEFrameModules::HierarchicalElementTree::addListItem(GNEAttributeCarrier* AC, FXTreeItem* itemParent, std::string prefix, std::string sufix) { + // insert item in Tree list + FXTreeItem* item = myTreeListDinamic->insertItem(nullptr, itemParent, (prefix + AC->getHierarchyName() + sufix).c_str(), AC->getIcon(), AC->getIcon()); + // insert item in map + myTreeItemToACMap[item] = AC; + // by default item is expanded + item->setExpanded(true); + // return created FXTreeItem + return item; +} + + +FXTreeItem* +GNEFrameModules::HierarchicalElementTree::addListItem(FXTreeItem* itemParent, const std::string& text, FXIcon* icon, bool expanded) { + // insert item in Tree list + FXTreeItem* item = myTreeListDinamic->insertItem(nullptr, itemParent, text.c_str(), icon, icon); + // expand item depending of flag expanded + item->setExpanded(expanded); + // return created FXTreeItem + return item; +} + +// --------------------------------------------------------------------------- +// GNEFrameModules::DrawingShape - methods +// --------------------------------------------------------------------------- + +GNEFrameModules::DrawingShape::DrawingShape(GNEFrame* frameParent) : + FXGroupBoxModule(frameParent->myContentFrame, "Drawing"), + myFrameParent(frameParent), + myDeleteLastCreatedPoint(false) { + // create start and stop buttons + myStartDrawingButton = new FXButton(getCollapsableFrame(), "Start drawing", 0, this, MID_GNE_STARTDRAWING, GUIDesignButton); + myStopDrawingButton = new FXButton(getCollapsableFrame(), "Stop drawing", 0, this, MID_GNE_STOPDRAWING, GUIDesignButton); + myAbortDrawingButton = new FXButton(getCollapsableFrame(), "Abort drawing", 0, this, MID_GNE_ABORTDRAWING, GUIDesignButton); + // create information label + std::ostringstream information; + information + << "- 'Start drawing' or ENTER\n" + << " to create shape.\n" + << "- 'Stop drawing' or ENTER to\n" + << " finish shape creation.\n" + << "- 'Abort drawing' or ESC to\n" + << " abort shape creation.\n" + << "- 'Shift + Click' to remove\n" + << " last inserted point."; + myInformationLabel = new FXLabel(getCollapsableFrame(), information.str().c_str(), 0, GUIDesignLabelFrameInformation); + // disable stop and abort functions as init + myStopDrawingButton->disable(); + myAbortDrawingButton->disable(); +} + + +GNEFrameModules::DrawingShape::~DrawingShape() {} + + +void GNEFrameModules::DrawingShape::showDrawingShape() { + // abort current drawing before show + abortDrawing(); + // show FXGroupBoxModule + FXGroupBoxModule::show(); +} + + +void GNEFrameModules::DrawingShape::hideDrawingShape() { + // abort current drawing before hide + abortDrawing(); + // show FXGroupBoxModule + FXGroupBoxModule::hide(); +} + + +void +GNEFrameModules::DrawingShape::startDrawing() { + // Only start drawing if DrawingShape modul is shown + if (shown()) { + // change buttons + myStartDrawingButton->disable(); + myStopDrawingButton->enable(); + myAbortDrawingButton->enable(); + } +} + + +void +GNEFrameModules::DrawingShape::stopDrawing() { + // try to build shape + if (myFrameParent->shapeDrawed()) { + // clear created points + myTemporalShape.clear(); + // change buttons + myStartDrawingButton->enable(); + myStopDrawingButton->disable(); + myAbortDrawingButton->disable(); + } else { + // abort drawing if shape cannot be created + abortDrawing(); + } +} + + +void +GNEFrameModules::DrawingShape::abortDrawing() { + // clear created points + myTemporalShape.clear(); + // change buttons + myStartDrawingButton->enable(); + myStopDrawingButton->disable(); + myAbortDrawingButton->disable(); +} + + +void +GNEFrameModules::DrawingShape::addNewPoint(const Position& P) { + if (myStopDrawingButton->isEnabled()) { + myTemporalShape.push_back(P); + } else { + throw ProcessError("A new point cannot be added if drawing wasn't started"); + } +} + + +void +GNEFrameModules::DrawingShape::removeLastPoint() { + if (myTemporalShape.size() > 1) { + myTemporalShape.pop_back(); + } +} + + +const PositionVector& +GNEFrameModules::DrawingShape::getTemporalShape() const { + return myTemporalShape; +} + + +bool +GNEFrameModules::DrawingShape::isDrawing() const { + return myStopDrawingButton->isEnabled(); +} + + +void +GNEFrameModules::DrawingShape::setDeleteLastCreatedPoint(bool value) { + myDeleteLastCreatedPoint = value; +} + + +bool +GNEFrameModules::DrawingShape::getDeleteLastCreatedPoint() { + return myDeleteLastCreatedPoint; +} + + +long +GNEFrameModules::DrawingShape::onCmdStartDrawing(FXObject*, FXSelector, void*) { + startDrawing(); + return 0; +} + + +long +GNEFrameModules::DrawingShape::onCmdStopDrawing(FXObject*, FXSelector, void*) { + stopDrawing(); + return 0; +} + + +long +GNEFrameModules::DrawingShape::onCmdAbortDrawing(FXObject*, FXSelector, void*) { + abortDrawing(); + return 0; +} + +// --------------------------------------------------------------------------- +// GNEFrameModules::SelectorParent - methods +// --------------------------------------------------------------------------- + +GNEFrameModules::SelectorParent::SelectorParent(GNEFrame* frameParent) : + FXGroupBoxModule(frameParent->myContentFrame, "Parent selector"), + myFrameParent(frameParent) { + // Create label with the type of SelectorParent + myParentsLabel = new FXLabel(getCollapsableFrame(), "No additional selected", nullptr, GUIDesignLabelLeftThick); + // Create list + myParentsList = new FXList(getCollapsableFrame(), this, MID_GNE_SET_TYPE, GUIDesignListSingleElementFixedHeight); + // Hide List + hideSelectorParentModule(); +} + + +GNEFrameModules::SelectorParent::~SelectorParent() {} + + +std::string +GNEFrameModules::SelectorParent::getIdSelected() const { + for (int i = 0; i < myParentsList->getNumItems(); i++) { + if (myParentsList->isItemSelected(i)) { + return myParentsList->getItem(i)->getText().text(); + } + } + return ""; +} + + +void +GNEFrameModules::SelectorParent::setIDSelected(const std::string& id) { + // first unselect all + for (int i = 0; i < myParentsList->getNumItems(); i++) { + myParentsList->getItem(i)->setSelected(false); + } + // select element if correspond to given ID + for (int i = 0; i < myParentsList->getNumItems(); i++) { + if (myParentsList->getItem(i)->getText().text() == id) { + myParentsList->getItem(i)->setSelected(true); + } + } + // recalc myFirstParentsList + myParentsList->recalc(); +} + + +bool +GNEFrameModules::SelectorParent::showSelectorParentModule(const std::vector& additionalTypeParents) { + // make sure that we're editing an additional tag + const auto listOfTags = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::TagType::ADDITIONALELEMENT); + for (const auto& tagIt : listOfTags) { + if (std::find(additionalTypeParents.begin(), additionalTypeParents.end(), tagIt.getTag()) != additionalTypeParents.end()) { + myParentTags = additionalTypeParents; + myParentsLabel->setText(("Parent type: " + tagIt.getFieldString()).c_str()); + refreshSelectorParentModule(); + show(); + return true; + } + } + return false; +} + + +void +GNEFrameModules::SelectorParent::hideSelectorParentModule() { + myParentTags.clear(); + hide(); +} + + +void +GNEFrameModules::SelectorParent::refreshSelectorParentModule() { + // save current edited elements + std::set selectedItems; + for (int i = 0; i < myParentsList->getNumItems(); i++) { + if (myParentsList->isItemSelected(i)) { + selectedItems.insert(myParentsList->getItem(i)->getText().text()); + } + } + myParentsList->clearItems(); + if (myParentTags.size() > 0) { + // insert additionals sorted + std::set IDs; + // fill list with IDs of additionals + for (const auto& parentTag : myParentTags) { + for (const auto& additional : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getAdditionals().at(parentTag)) { + IDs.insert(additional->getID().c_str()); + } + } + // fill list with IDs of additionals + for (const auto& ID : IDs) { + const int item = myParentsList->appendItem(ID.c_str()); + if (selectedItems.find(ID) != selectedItems.end()) { + myParentsList->selectItem(item); + } + } + } +} + +// --------------------------------------------------------------------------- +// GNEFrameModules::OverlappedInspection - methods +// --------------------------------------------------------------------------- + +GNEFrameModules::OverlappedInspection::OverlappedInspection(GNEFrame* frameParent) : + FXGroupBoxModule(frameParent->myContentFrame, "Overlapped elements"), + myFrameParent(frameParent), + myFilteredTag(SUMO_TAG_NOTHING), + myItemIndex(0) { + // build elements + buildFXElements(); +} + + +GNEFrameModules::OverlappedInspection::OverlappedInspection(GNEFrame* frameParent, const SumoXMLTag filteredTag) : + FXGroupBoxModule(frameParent->myContentFrame, ("Overlapped " + toString(filteredTag) + "s").c_str()), + myFrameParent(frameParent), + myFilteredTag(filteredTag), + myItemIndex(0) { + // build elements + buildFXElements(); +} + + +GNEFrameModules::OverlappedInspection::~OverlappedInspection() {} + + +void +GNEFrameModules::OverlappedInspection::showOverlappedInspection(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const Position& clickedPosition) { + // first clear myOverlappedACs + myOverlappedACs.clear(); + // reserve + myOverlappedACs.reserve(objectsUnderCursor.getClickedAttributeCarriers().size()); + // iterate over objects under cursor + for (const auto& AC : objectsUnderCursor.getClickedAttributeCarriers()) { + bool insert = true; + // check supermode demand + if (myFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand() && + !AC->getTagProperty().isDemandElement()) { + insert = false; + } + // check supermode data + if (myFrameParent->getViewNet()->getEditModes().isCurrentSupermodeData() && + !AC->getTagProperty().isGenericData()) { + insert = false; + } + // check filter + if ((myFilteredTag != SUMO_TAG_NOTHING) && (AC->getTagProperty().getTag() != myFilteredTag)) { + insert = false; + } + if (insert) { + myOverlappedACs.push_back(AC); + } + } + // continue depending of number of myOverlappedACs + if (myOverlappedACs.size() > 1) { + mySavedClickedPosition = clickedPosition; + // by default we inspect first element + myItemIndex = 0; + // update text of current index button + myCurrentIndexButton->setText(("1 / " + toString(myOverlappedACs.size())).c_str()); + // clear and fill list again + myOverlappedElementList->clearItems(); + for (int i = 0; i < (int)myOverlappedACs.size(); i++) { + myOverlappedElementList->insertItem(i, myOverlappedACs.at(i)->getID().c_str(), myOverlappedACs.at(i)->getIcon()); + } + // set first element as selected element + myOverlappedElementList->getItem(0)->setSelected(TRUE); + // by default list hidden + myOverlappedElementList->hide(); + // show OverlappedInspection modul + show(); + } else { + // hide OverlappedInspection modul + hide(); + } +} + + +void +GNEFrameModules::OverlappedInspection::hideOverlappedInspection() { + // hide OverlappedInspection modul + hide(); +} + + +bool +GNEFrameModules::OverlappedInspection::overlappedInspectionShown() const { + // show OverlappedInspection modul + return shown(); +} + + +int +GNEFrameModules::OverlappedInspection::getNumberOfOverlappedACs() const { + return (int)myOverlappedACs.size(); +} + + +bool +GNEFrameModules::OverlappedInspection::checkSavedPosition(const Position& clickedPosition) const { + return (mySavedClickedPosition.distanceSquaredTo2D(clickedPosition) < 0.25); +} + + +bool +GNEFrameModules::OverlappedInspection::nextElement(const Position& clickedPosition) { + // first check if OverlappedInspection is shown + if (shown()) { + // check if given position is near saved position + if (checkSavedPosition(clickedPosition)) { + // inspect next element + onCmdNextElement(0, 0, 0); + return true; + } else { + return false; + } + } else { + return false; + } +} + + +bool +GNEFrameModules::OverlappedInspection::previousElement(const Position& clickedPosition) { + // first check if OverlappedInspection is shown + if (shown()) { + // check if given position is near saved position + if (checkSavedPosition(clickedPosition)) { + // inspect previousElement + onCmdPreviousElement(0, 0, 0); + return true; + } else { + return false; + } + } else { + return false; + } +} + + +long +GNEFrameModules::OverlappedInspection::onCmdPreviousElement(FXObject*, FXSelector, void*) { + // check if there is items + if (myOverlappedElementList->getNumItems() > 0) { + // unselect current list element + myOverlappedElementList->getItem((int)myItemIndex)->setSelected(FALSE); + // set index (it works as a ring) + if (myItemIndex > 0) { + myItemIndex--; + } else { + myItemIndex = (myOverlappedACs.size() - 1); + } + // selected current list element + myOverlappedElementList->getItem((int)myItemIndex)->setSelected(TRUE); + myOverlappedElementList->update(); + // update current index button + myCurrentIndexButton->setText((toString(myItemIndex + 1) + " / " + toString(myOverlappedACs.size())).c_str()); + // inspect overlapped attribute carrier + myFrameParent->selectedOverlappedElement(myOverlappedACs.at(myItemIndex)); + // show OverlappedInspection again (because it's hidden in inspectSingleElement) + show(); + } + return 1; +} + + +long +GNEFrameModules::OverlappedInspection::onCmdNextElement(FXObject*, FXSelector, void*) { + // check if there is items + if (myOverlappedElementList->getNumItems() > 0) { + // unselect current list element + myOverlappedElementList->getItem((int)myItemIndex)->setSelected(FALSE); + // set index (it works as a ring) + myItemIndex = (myItemIndex + 1) % myOverlappedACs.size(); + // selected current list element + myOverlappedElementList->getItem((int)myItemIndex)->setSelected(TRUE); + myOverlappedElementList->update(); + // update current index button + myCurrentIndexButton->setText((toString(myItemIndex + 1) + " / " + toString(myOverlappedACs.size())).c_str()); + // inspect overlapped attribute carrier + myFrameParent->selectedOverlappedElement(myOverlappedACs.at(myItemIndex)); + // show OverlappedInspection again (because it's hidden in inspectSingleElement) + show(); + } + return 1; +} + + +long +GNEFrameModules::OverlappedInspection::onCmdShowList(FXObject*, FXSelector, void*) { + // show or hidde element list + if (myOverlappedElementList->shown()) { + myOverlappedElementList->hide(); + } else { + myOverlappedElementList->show(); + } + if (myOverlappedElementList->getNumItems() <= 10) { + myOverlappedElementList->setHeight(23 * myOverlappedElementList->getNumItems()); + } else { + myOverlappedElementList->setHeight(230); + } + myOverlappedElementList->recalc(); + // recalc and update frame + recalc(); + return 1; +} + +long +GNEFrameModules::OverlappedInspection::onCmdListItemSelected(FXObject*, FXSelector, void*) { + for (int i = 0; i < myOverlappedElementList->getNumItems(); i++) { + if (myOverlappedElementList->getItem(i)->isSelected()) { + myItemIndex = i; + // update current index button + myCurrentIndexButton->setText((toString(myItemIndex + 1) + " / " + toString(myOverlappedACs.size())).c_str()); + // inspect overlapped attribute carrier + myFrameParent->selectedOverlappedElement(myOverlappedACs.at(myItemIndex)); + // show OverlappedInspection again (because it's hidden in inspectSingleElement) + show(); + return 1; + } + } + return 0; +} + + +long +GNEFrameModules::OverlappedInspection::onCmdOverlappingHelp(FXObject*, FXSelector, void*) { + FXDialogBox* helpDialog = new FXDialogBox(getCollapsableFrame(), "GEO attributes Help", GUIDesignDialogBox); + std::ostringstream help; + help + << " - Click in the same position\n" + << " for inspect next element\n" + << " - Shift + Click in the same\n" + << " position for inspect\n" + << " previous element"; + new FXLabel(helpDialog, help.str().c_str(), nullptr, GUIDesignLabelFrameInformation); + // "OK" + new FXButton(helpDialog, "OK\t\tclose", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), helpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK); + helpDialog->create(); + helpDialog->show(); + return 1; +} + + +GNEFrameModules::OverlappedInspection::OverlappedInspection() : + myFrameParent(nullptr), + myPreviousElement(nullptr), + myCurrentIndexButton(nullptr), + myNextElement(nullptr), + myOverlappedElementList(nullptr), + myHelpButton(nullptr), + myFilteredTag(SUMO_TAG_NOTHING), + myItemIndex(0) { +} + + +void +GNEFrameModules::OverlappedInspection::buildFXElements() { + FXHorizontalFrame* frameButtons = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + // Create previous Item Button + myPreviousElement = new FXButton(frameButtons, "", GUIIconSubSys::getIcon(GUIIcon::BIGARROWLEFT), this, MID_GNE_OVERLAPPED_PREVIOUS, GUIDesignButtonIconRectangular); + // create current index button + myCurrentIndexButton = new FXButton(frameButtons, "", nullptr, this, MID_GNE_OVERLAPPED_SHOWLIST, GUIDesignButton); + // Create next Item Button + myNextElement = new FXButton(frameButtons, "", GUIIconSubSys::getIcon(GUIIcon::BIGARROWRIGHT), this, MID_GNE_OVERLAPPED_NEXT, GUIDesignButtonIconRectangular); + // Create list of overlapped elements (by default hidden) + myOverlappedElementList = new FXList(getCollapsableFrame(), this, MID_GNE_OVERLAPPED_ITEMSELECTED, GUIDesignListFixedHeight); + // by default list of overlapped elements is hidden) + myOverlappedElementList->hide(); + // Create help button + myHelpButton = new FXButton(getCollapsableFrame(), "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); +} + +// --------------------------------------------------------------------------- +// GNEFrameModules::PathCreator - methods +// --------------------------------------------------------------------------- + +GNEFrameModules::PathCreator::Path::Path(const SUMOVehicleClass vClass, GNEEdge* edge) : + mySubPath({edge}), + myFromBusStop(nullptr), + myToBusStop(nullptr), + myConflictVClass(false), +myConflictDisconnected(false) { + // check if we have to change vClass flag + if (edge->getNBEdge()->getNumLanesThatAllow(vClass) == 0) { + myConflictVClass = true; + } +} + + +GNEFrameModules::PathCreator::Path::Path(GNEViewNet* viewNet, const SUMOVehicleClass vClass, GNEEdge* edgeFrom, GNEEdge* edgeTo) : + myFromBusStop(nullptr), + myToBusStop(nullptr), + myConflictVClass(false), + myConflictDisconnected(false) { + // calculate subpath + mySubPath = viewNet->getNet()->getPathManager()->getPathCalculator()->calculateDijkstraPath(vClass, {edgeFrom, edgeTo}); + // if subPath is empty, try it with pedestrian (i.e. ignoring vCass) + if (mySubPath.empty()) { + mySubPath = viewNet->getNet()->getPathManager()->getPathCalculator()->calculateDijkstraPath(SVC_PEDESTRIAN, {edgeFrom, edgeTo}); + if (mySubPath.empty()) { + mySubPath = { edgeFrom, edgeTo }; + myConflictDisconnected = true; + } else { + myConflictVClass = true; + } + } +} + + +const std::vector& +GNEFrameModules::PathCreator::Path::getSubPath() const { + return mySubPath; +} + + +GNEAdditional* GNEFrameModules::PathCreator::Path::getFromBusStop() const { + return myFromBusStop; +} + + +GNEAdditional* GNEFrameModules::PathCreator::Path::getToBusStop() const { + return myToBusStop; +} + + +bool +GNEFrameModules::PathCreator::Path::isConflictVClass() const { + return myConflictVClass; +} + + +bool +GNEFrameModules::PathCreator::Path::isConflictDisconnected() const { + return myConflictDisconnected; +} + + +GNEFrameModules::PathCreator::Path::Path() : + myFromBusStop(nullptr), + myToBusStop(nullptr), + myConflictVClass(false), + myConflictDisconnected(false) { +} + + +GNEFrameModules::PathCreator::PathCreator(GNEFrame* frameParent) : + FXGroupBoxModule(frameParent->myContentFrame, "Route creator"), + myFrameParent(frameParent), + myVClass(SVC_PASSENGER), + myCreationMode(0), + myToStoppingPlace(nullptr), + myRoute(nullptr) { + // create label for route info + myInfoRouteLabel = new FXLabel(getCollapsableFrame(), "No edges selected", 0, GUIDesignLabelFrameThicked); + // create button for finish route creation + myFinishCreationButton = new FXButton(getCollapsableFrame(), "Finish route creation", nullptr, this, MID_GNE_EDGEPATH_FINISH, GUIDesignButton); + myFinishCreationButton->disable(); + // create button for abort route creation + myAbortCreationButton = new FXButton(getCollapsableFrame(), "Abort route creation", nullptr, this, MID_GNE_EDGEPATH_ABORT, GUIDesignButton); + myAbortCreationButton->disable(); + // create button for remove last inserted edge + myRemoveLastInsertedElement = new FXButton(getCollapsableFrame(), "Remove last inserted edge", nullptr, this, MID_GNE_EDGEPATH_REMOVELAST, GUIDesignButton); + myRemoveLastInsertedElement->disable(); + // create check button + myShowCandidateEdges = new FXCheckButton(getCollapsableFrame(), "Show candidate edges", this, MID_GNE_EDGEPATH_SHOWCANDIDATES, GUIDesignCheckButton); + myShowCandidateEdges->setCheck(TRUE); + // create shift label + myShiftLabel = new FXLabel(this, + "SHIFT-click: ignore vClass", + 0, GUIDesignLabelFrameInformation); + // create control label + myControlLabel = new FXLabel(this, + "CTRL-click: add disconnected", + 0, GUIDesignLabelFrameInformation); + // create backspace label (always shown) + new FXLabel(this, + "BACKSPACE: undo click", + 0, GUIDesignLabelFrameInformation); +} + + +GNEFrameModules::PathCreator::~PathCreator() {} + + +void +GNEFrameModules::PathCreator::showPathCreatorModule(SumoXMLTag element, const bool firstElement, const bool consecutives) { + // declare flag + bool showPathCreator = true; + // first abort creation + abortPathCreation(); + // disable buttons + myFinishCreationButton->disable(); + myAbortCreationButton->disable(); + myRemoveLastInsertedElement->disable(); + // reset creation mode + myCreationMode = 0; + // set first element + if (firstElement) { + myCreationMode |= REQUIRE_FIRSTELEMENT; + } + // set consecutive or non consecuives + if (consecutives) { + myCreationMode |= CONSECUTIVE_EDGES; + } else { + myCreationMode |= NONCONSECUTIVE_EDGES; + } + // set specific mode depending of tag + switch (element) { + // routes + case SUMO_TAG_ROUTE: + case GNE_TAG_ROUTE_EMBEDDED: + myCreationMode |= SHOW_CANDIDATE_EDGES; + myCreationMode |= START_EDGE; + myCreationMode |= END_EDGE; + break; + // vehicles + case SUMO_TAG_VEHICLE: + case GNE_TAG_FLOW_ROUTE: + case GNE_TAG_WALK_ROUTE: + myCreationMode |= SINGLE_ELEMENT; + myCreationMode |= ROUTE; + break; + case SUMO_TAG_TRIP: + case SUMO_TAG_FLOW: + case GNE_TAG_VEHICLE_WITHROUTE: + case GNE_TAG_FLOW_WITHROUTE: + myCreationMode |= SHOW_CANDIDATE_EDGES; + myCreationMode |= START_EDGE; + myCreationMode |= END_EDGE; + break; + case GNE_TAG_TRIP_JUNCTIONS: + case GNE_TAG_FLOW_JUNCTIONS: + myCreationMode |= START_JUNCTION; + myCreationMode |= END_JUNCTION; + myCreationMode |= ONLY_FROMTO; + break; + // walk edges + case GNE_TAG_WALK_EDGES: + myCreationMode |= SHOW_CANDIDATE_EDGES; + myCreationMode |= START_EDGE; + myCreationMode |= END_EDGE; + break; + // edge->edge + case GNE_TAG_PERSONTRIP_EDGE: + case GNE_TAG_RIDE_EDGE: + case GNE_TAG_WALK_EDGE: + myCreationMode |= SHOW_CANDIDATE_EDGES; + myCreationMode |= ONLY_FROMTO; + myCreationMode |= START_EDGE; + myCreationMode |= END_EDGE; + break; + // edge->busStop + case GNE_TAG_PERSONTRIP_BUSSTOP: + case GNE_TAG_RIDE_BUSSTOP: + case GNE_TAG_WALK_BUSSTOP: + myCreationMode |= SHOW_CANDIDATE_EDGES; + myCreationMode |= ONLY_FROMTO; + myCreationMode |= END_BUSSTOP; + break; + // junction->junction + case GNE_TAG_PERSONTRIP_JUNCTIONS: + case GNE_TAG_WALK_JUNCTIONS: + myCreationMode |= START_JUNCTION; + myCreationMode |= END_JUNCTION; + myCreationMode |= ONLY_FROMTO; + break; + // stops + case GNE_TAG_STOPPERSON_BUSSTOP: + myCreationMode |= SINGLE_ELEMENT; + myCreationMode |= END_BUSSTOP; + break; + case GNE_TAG_STOPPERSON_EDGE: + myCreationMode |= SINGLE_ELEMENT; + myCreationMode |= START_EDGE; + break; + // generic datas + case SUMO_TAG_EDGEREL: + myCreationMode |= ONLY_FROMTO; + myCreationMode |= START_EDGE; + myCreationMode |= END_EDGE; + break; + default: + showPathCreator = false; + break; + } + // check if show path creator + if (showPathCreator) { + // update colors + if (myCreationMode & SHOW_CANDIDATE_EDGES) { + updateEdgeColors(); + } + if (myCreationMode & START_JUNCTION) { + updateEdgeColors(); + } + // recalc before show (to avoid graphic problems) + recalc(); + // show modul + show(); + } else { + // hide modul + hide(); + } +} + + +void +GNEFrameModules::PathCreator::hidePathCreatorModule() { + // clear path + clearPath(); + // hide modul + hide(); +} + + +SUMOVehicleClass +GNEFrameModules::PathCreator::getVClass() const { + return myVClass; +} + + +void +GNEFrameModules::PathCreator::setVClass(SUMOVehicleClass vClass) { + myVClass = vClass; + // update edge colors + updateEdgeColors(); +} + + +bool +GNEFrameModules::PathCreator::addJunction(GNEJunction* junction, const bool /* shiftKeyPressed */, const bool /* controlKeyPressed */) { + // check if junctions are allowed + if (((myCreationMode & START_JUNCTION) + (myCreationMode & END_JUNCTION)) == 0) { + return false; + } + // check if only an junction is allowed + if ((myCreationMode & SINGLE_ELEMENT) && (mySelectedJunctions.size() == 1)) { + return false; + } + // continue depending of number of selected edge + if (mySelectedJunctions.size() > 0) { + // check double junctions + if (mySelectedJunctions.back() == junction) { + // Write warning + WRITE_WARNING("Double junctions aren't allowed"); + // abort add junction + return false; + } + } + // check number of junctions + if (mySelectedJunctions.size() == 2 && (myCreationMode & Mode::ONLY_FROMTO)) { + // Write warning + WRITE_WARNING("Only two junctions are allowed"); + // abort add junction + return false; + } + // All checks ok, then add it in selected elements + mySelectedJunctions.push_back(junction); + // enable abort route button + myAbortCreationButton->enable(); + // enable finish button + myFinishCreationButton->enable(); + // disable undo/redo + myFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->disableUndoRedo("route creation"); + // enable or disable remove last junction button + if (mySelectedJunctions.size() > 1) { + myRemoveLastInsertedElement->enable(); + } else { + myRemoveLastInsertedElement->disable(); + } + // recalculate path + recalculatePath(); + // update info route label + updateInfoRouteLabel(); + // update junction colors + updateJunctionColors(); + return true; +} + + +bool +GNEFrameModules::PathCreator::addEdge(GNEEdge* edge, const bool shiftKeyPressed, const bool controlKeyPressed) { + // check if edges are allowed + if (((myCreationMode & CONSECUTIVE_EDGES) + (myCreationMode & NONCONSECUTIVE_EDGES) + + (myCreationMode & START_EDGE) + (myCreationMode & END_EDGE)) == 0) { + return false; + } + // check if only an edge is allowed + if ((myCreationMode & SINGLE_ELEMENT) && (mySelectedEdges.size() == 1)) { + return false; + } + // continue depending of number of selected eges + if (mySelectedEdges.size() > 0) { + // check double edges + if (mySelectedEdges.back() == edge) { + // Write warning + WRITE_WARNING("Double edges aren't allowed"); + // abort add edge + return false; + } + // check consecutive edges + if (myCreationMode & Mode::CONSECUTIVE_EDGES) { + // check that new edge is consecutive + const auto& outgoingEdges = mySelectedEdges.back()->getToJunction()->getGNEOutgoingEdges(); + if (std::find(outgoingEdges.begin(), outgoingEdges.end(), edge) == outgoingEdges.end()) { + // Write warning + WRITE_WARNING("Only consecutives edges are allowed"); + // abort add edge + return false; + } + } + } + // check number of edges + if (mySelectedEdges.size() == 2 && (myCreationMode & Mode::ONLY_FROMTO)) { + // Write warning + WRITE_WARNING("Only two edges are allowed"); + // abort add edge + return false; + } + // check candidate edge + if ((myShowCandidateEdges->getCheck() == TRUE) && !edge->isPossibleCandidate()) { + if (edge->isSpecialCandidate()) { + if (!shiftKeyPressed) { + // Write warning + WRITE_WARNING("Invalid edge (SHIFT + click to add an invalid vClass edge)"); + // abort add edge + return false; + } + } else if (edge->isConflictedCandidate()) { + if (!controlKeyPressed) { + // Write warning + WRITE_WARNING("Invalid edge (CONTROL + click to add a disconnected edge)"); + // abort add edge + return false; + } + } + } + // All checks ok, then add it in selected elements + mySelectedEdges.push_back(edge); + // enable abort route button + myAbortCreationButton->enable(); + // enable finish button + myFinishCreationButton->enable(); + // disable undo/redo + myFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->disableUndoRedo("route creation"); + // enable or disable remove last edge button + if (mySelectedEdges.size() > 1) { + myRemoveLastInsertedElement->enable(); + } else { + myRemoveLastInsertedElement->disable(); + } + // recalculate path + recalculatePath(); + // update info route label + updateInfoRouteLabel(); + // update edge colors + updateEdgeColors(); + return true; +} + + +const std::vector& +GNEFrameModules::PathCreator::getSelectedEdges() const { + return mySelectedEdges; +} + + +const std::vector& +GNEFrameModules::PathCreator::getSelectedJunctions() const { + return mySelectedJunctions; +} + + +bool +GNEFrameModules::PathCreator::addStoppingPlace(GNEAdditional* stoppingPlace, const bool /*shiftKeyPressed*/, const bool /*controlKeyPressed*/) { + // check if stoppingPlaces aren allowed + if ((myCreationMode & END_BUSSTOP) == 0) { + return false; + } + // check if previously stopping place from was set + if (myToStoppingPlace) { + return false; + } else { + myToStoppingPlace = stoppingPlace; + } + // enable abort route button + myAbortCreationButton->enable(); + // enable finish button + myFinishCreationButton->enable(); + // disable undo/redo + myFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->disableUndoRedo("route creation"); + // enable or disable remove last stoppingPlace button + if (myToStoppingPlace) { + myRemoveLastInsertedElement->enable(); + } else { + myRemoveLastInsertedElement->disable(); + } + // recalculate path + recalculatePath(); + // update info route label + updateInfoRouteLabel(); + // update stoppingPlace colors + updateEdgeColors(); + return true; +} + + +GNEAdditional* +GNEFrameModules::PathCreator::getToStoppingPlace(SumoXMLTag expectedTag) const { + if (myToStoppingPlace && (myToStoppingPlace->getTagProperty().getTag() == expectedTag)) { + return myToStoppingPlace; + } else { + return nullptr; + } +} + + +bool +GNEFrameModules::PathCreator::addRoute(GNEDemandElement* route, const bool /*shiftKeyPressed*/, const bool /*controlKeyPressed*/) { + // check if routes aren allowed + if ((myCreationMode & ROUTE) == 0) { + return false; + } + // check if previously a route was added + if (myRoute) { + return false; + } + // set route + myRoute = route; + // recalculate path + recalculatePath(); + updateInfoRouteLabel(); + updateEdgeColors(); + return true; +} + + +void +GNEFrameModules::PathCreator::removeRoute() { + // set route + myRoute = nullptr; + // recalculate path + recalculatePath(); + updateInfoRouteLabel(); + updateEdgeColors(); +} + + +GNEDemandElement* +GNEFrameModules::PathCreator::getRoute() const { + return myRoute; +} + + +const std::vector& +GNEFrameModules::PathCreator::getPath() const { + return myPath; +} + + +bool +GNEFrameModules::PathCreator::drawCandidateEdgesWithSpecialColor() const { + return (myShowCandidateEdges->getCheck() == TRUE); +} + + +void +GNEFrameModules::PathCreator::updateJunctionColors() { + // reset all flags + for (const auto& junction : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getJunctions()) { + junction.second->resetCandidateFlags(); + junction.second->setPossibleCandidate(true); + } + // set selected junctions + if (mySelectedJunctions.size() > 0) { + // mark selected eges + for (const auto& junction : mySelectedJunctions) { + junction->resetCandidateFlags(); + junction->setSourceCandidate(true); + } + // finally mark last selected element as target + mySelectedJunctions.back()->resetCandidateFlags(); + mySelectedJunctions.back()->setTargetCandidate(true); + } + // update view net + myFrameParent->myViewNet->updateViewNet(); +} + + +void +GNEFrameModules::PathCreator::updateEdgeColors() { + // reset all flags + clearEdgeColors(); + // set reachability + if (mySelectedEdges.size() > 0) { + // only coloring edges if checkbox "show candidate edges" is enabled + if ((myShowCandidateEdges->getCheck() == TRUE) && (myCreationMode & SHOW_CANDIDATE_EDGES)) { + // mark all edges as conflicted (to mark special candidates) + for (const auto& edge : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) { + edge.second->setConflictedCandidate(true); + } + // set special candidates (Edges that are connected but aren't compatibles with current vClass + setSpecialCandidates(mySelectedEdges.back()); + // mark again all edges as conflicted (to mark possible candidates) + for (const auto& edge : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) { + edge.second->setConflictedCandidate(true); + } + // set possible candidates (Edges that are connected AND are compatibles with current vClass + setPossibleCandidates(mySelectedEdges.back(), myVClass); + } + // now mark selected eges + for (const auto& edge : mySelectedEdges) { + edge->resetCandidateFlags(); + edge->setSourceCandidate(true); + } + // finally mark last selected element as target + mySelectedEdges.back()->resetCandidateFlags(); + mySelectedEdges.back()->setTargetCandidate(true); + } else if (myShowCandidateEdges->getCheck() == TRUE && (myCreationMode & SHOW_CANDIDATE_EDGES)) { + // mark all edges that have at least one lane that allow given vClass + for (const auto& edge : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) { + if (edge.second->getNBEdge()->getNumLanesThatAllow(myVClass) > 0) { + edge.second->setPossibleCandidate(true); + } else { + edge.second->setSpecialCandidate(true); + } + } + } + // update view net + myFrameParent->myViewNet->updateViewNet(); +} + + +void +GNEFrameModules::PathCreator::clearJunctionColors() { + // reset all junction flags + for (const auto& junction : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getJunctions()) { + junction.second->resetCandidateFlags(); + } +} + + +void +GNEFrameModules::PathCreator::clearEdgeColors() { + // reset all junction flags + for (const auto& edge : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) { + edge.second->resetCandidateFlags(); + } +} + + +void +GNEFrameModules::PathCreator::drawTemporalRoute(const GUIVisualizationSettings& s) const { + const double lineWidth = 0.35; + const double lineWidthin = 0.25; + // Add a draw matrix + GLHelper::pushMatrix(); + // Start with the drawing of the area traslating matrix to origin + glTranslated(0, 0, GLO_MAX - 0.1); + // check if draw bewteen junction or edges + if (myPath.size() > 0) { + // set first color + GLHelper::setColor(RGBColor::GREY); + // iterate over path + for (int i = 0; i < (int)myPath.size(); i++) { + // get path + const GNEFrameModules::PathCreator::Path& path = myPath.at(i); + // draw line over + for (int j = 0; j < (int)path.getSubPath().size(); j++) { + const GNELane* lane = path.getSubPath().at(j)->getLanes().back(); + if (((i == 0) && (j == 0)) || (j > 0)) { + GLHelper::drawBoxLines(lane->getLaneShape(), lineWidth); + } + // draw connection between lanes + if ((j + 1) < (int)path.getSubPath().size()) { + const GNELane* nextLane = path.getSubPath().at(j + 1)->getLanes().back(); + if (lane->getLane2laneConnections().exist(nextLane)) { + GLHelper::drawBoxLines(lane->getLane2laneConnections().getLane2laneGeometry(nextLane).getShape(), lineWidth); + } else { + GLHelper::drawBoxLines({lane->getLaneShape().back(), nextLane->getLaneShape().front()}, lineWidth); + } + } + } + } + glTranslated(0, 0, 0.1); + // iterate over path again + for (int i = 0; i < (int)myPath.size(); i++) { + // get path + const GNEFrameModules::PathCreator::Path& path = myPath.at(i); + // set path color color + if ((myCreationMode & SHOW_CANDIDATE_EDGES) == 0) { + GLHelper::setColor(RGBColor::ORANGE); + } else if (path.isConflictDisconnected()) { + GLHelper::setColor(s.candidateColorSettings.conflict); + } else if (path.isConflictVClass()) { + GLHelper::setColor(s.candidateColorSettings.special); + } else { + GLHelper::setColor(RGBColor::ORANGE); + } + // draw line over + for (int j = 0; j < (int)path.getSubPath().size(); j++) { + const GNELane* lane = path.getSubPath().at(j)->getLanes().back(); + if (((i == 0) && (j == 0)) || (j > 0)) { + GLHelper::drawBoxLines(lane->getLaneShape(), lineWidthin); + } + // draw connection between lanes + if ((j + 1) < (int)path.getSubPath().size()) { + const GNELane* nextLane = path.getSubPath().at(j + 1)->getLanes().back(); + if (lane->getLane2laneConnections().exist(nextLane)) { + GLHelper::drawBoxLines(lane->getLane2laneConnections().getLane2laneGeometry(nextLane).getShape(), lineWidthin); + } else { + GLHelper::drawBoxLines({ lane->getLaneShape().back(), nextLane->getLaneShape().front() }, lineWidthin); + } + } + } + } + } else if (mySelectedJunctions.size() > 0) { + // set color + GLHelper::setColor(RGBColor::ORANGE); + // draw line between junctions + for (int i = 0; i < (int)mySelectedJunctions.size() - 1; i++) { + // get two points + const Position posA = mySelectedJunctions.at(i)->getPositionInView(); + const Position posB = mySelectedJunctions.at(i + 1)->getPositionInView(); + const double rot = ((double)atan2((posB.x() - posA.x()), (posA.y() - posB.y())) * (double) 180.0 / (double)M_PI); + const double len = posA.distanceTo2D(posB); + // draw line + GLHelper::drawBoxLine(posA, rot, len, 0.25); + } + } + // Pop last matrix + GLHelper::popMatrix(); +} + + +void +GNEFrameModules::PathCreator::createPath() { + // call create path implemented in frame parent + myFrameParent->createPath(); +} + + +void +GNEFrameModules::PathCreator::abortPathCreation() { + // first check that there is elements + if ((mySelectedJunctions.size() > 0) || (mySelectedEdges.size() > 0) || myToStoppingPlace || myRoute) { + // unblock undo/redo + myFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->enableUndoRedo(); + // clear edges + clearPath(); + // disable buttons + myFinishCreationButton->disable(); + myAbortCreationButton->disable(); + myRemoveLastInsertedElement->disable(); + // update info route label + updateInfoRouteLabel(); + // update junction colors + updateJunctionColors(); + // update edge colors + updateEdgeColors(); + // update view (to see the new route) + myFrameParent->getViewNet()->updateViewNet(); + } +} + + +void +GNEFrameModules::PathCreator::removeLastElement() { + if (mySelectedEdges.size() > 1) { + // remove special color of last selected edge + mySelectedEdges.back()->resetCandidateFlags(); + // remove last edge + mySelectedEdges.pop_back(); + // change last edge flag + if ((mySelectedEdges.size() > 0) && mySelectedEdges.back()->isSourceCandidate()) { + mySelectedEdges.back()->setSourceCandidate(false); + mySelectedEdges.back()->setTargetCandidate(true); + } + // enable or disable remove last edge button + if (mySelectedEdges.size() > 1) { + myRemoveLastInsertedElement->enable(); + } else { + myRemoveLastInsertedElement->disable(); + } + // recalculate path + recalculatePath(); + // update info route label + updateInfoRouteLabel(); + // update junction colors + updateJunctionColors(); + // update edge colors + updateEdgeColors(); + // update view + myFrameParent->myViewNet->updateViewNet(); + } +} + + +long +GNEFrameModules::PathCreator::onCmdCreatePath(FXObject*, FXSelector, void*) { + // just call create path + createPath(); + return 1; +} + + +long +GNEFrameModules::PathCreator::onCmdAbortPathCreation(FXObject*, FXSelector, void*) { + // just call abort path creation + abortPathCreation(); + return 1; +} + + +long +GNEFrameModules::PathCreator::onCmdRemoveLastElement(FXObject*, FXSelector, void*) { + // just call remove last element + removeLastElement(); + return 1; +} + + +long +GNEFrameModules::PathCreator::onCmdShowCandidateEdges(FXObject*, FXSelector, void*) { + // update labels + if (myShowCandidateEdges->getCheck() == TRUE) { + myShiftLabel->show(); + myControlLabel->show(); + } else { + myShiftLabel->hide(); + myControlLabel->hide(); + } + // recalc frame + recalc(); + // update edge colors (view will be updated within function) + updateEdgeColors(); + return 1; +} + + +void +GNEFrameModules::PathCreator::updateInfoRouteLabel() { + if (myPath.size() > 0) { + // declare variables for route info + double length = 0; + double speed = 0; + int pathSize = 0; + for (const auto& path : myPath) { + for (const auto& edge : path.getSubPath()) { + length += edge->getNBEdge()->getLength(); + speed += edge->getNBEdge()->getSpeed(); + } + pathSize += (int)path.getSubPath().size(); + } + // declare ostringstream for label and fill it + std::ostringstream information; + information + << "- Selected edges: " << toString(mySelectedEdges.size()) << "\n" + << "- Path edges: " << toString(pathSize) << "\n" + << "- Length: " << toString(length) << "\n" + << "- Average speed: " << toString(speed / pathSize); + // set new label + myInfoRouteLabel->setText(information.str().c_str()); + } else { + myInfoRouteLabel->setText("No edges selected"); + } +} + + +void +GNEFrameModules::PathCreator::clearPath() { + /// reset flags + clearJunctionColors(); + clearEdgeColors(); + // clear junction, edges, additionals and route + mySelectedJunctions.clear(); + mySelectedEdges.clear(); + myToStoppingPlace = nullptr; + myRoute = nullptr; + // clear path + myPath.clear(); + // update info route label + updateInfoRouteLabel(); +} + + +void +GNEFrameModules::PathCreator::recalculatePath() { + // first clear path + myPath.clear(); + // set edges + std::vector edges; + // add route edges + if (myRoute) { + edges = myRoute->getParentEdges(); + } else { + // add selected edges + for (const auto& edge : mySelectedEdges) { + edges.push_back(edge); + } + // add to stopping place edge + if (myToStoppingPlace) { + edges.push_back(myToStoppingPlace->getParentLanes().front()->getParentEdge()); + } + } + // fill paths + if (edges.size() == 1) { + myPath.push_back(Path(myVClass, edges.front())); + } else { + // add every segment + for (int i = 1; i < (int)edges.size(); i++) { + myPath.push_back(Path(myFrameParent->getViewNet(), myVClass, edges.at(i - 1), edges.at(i))); + } + } +} + + +void +GNEFrameModules::PathCreator::setSpecialCandidates(GNEEdge* originEdge) { + // first calculate reachability for pedestrians (we use it, because pedestran can walk in almost all edges) + myFrameParent->getViewNet()->getNet()->getPathManager()->getPathCalculator()->calculateReachability(SVC_PEDESTRIAN, originEdge); + // change flags + for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) { + for (const auto& lane : edge.second->getLanes()) { + if (lane->getReachability() > 0) { + lane->getParentEdge()->resetCandidateFlags(); + lane->getParentEdge()->setSpecialCandidate(true); + } + } + } +} + +void +GNEFrameModules::PathCreator::setPossibleCandidates(GNEEdge* originEdge, const SUMOVehicleClass vClass) { + // first calculate reachability for pedestrians + myFrameParent->getViewNet()->getNet()->getPathManager()->getPathCalculator()->calculateReachability(vClass, originEdge); + // change flags + for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) { + for (const auto& lane : edge.second->getLanes()) { + if (lane->getReachability() > 0) { + lane->getParentEdge()->resetCandidateFlags(); + lane->getParentEdge()->setPossibleCandidate(true); + } + } + } +} + +// --------------------------------------------------------------------------- +// GNERouteFrame::Legend - methods +// --------------------------------------------------------------------------- + +GNEFrameModules::PathLegend::PathLegend(GNEFrame* frameParent) : + FXGroupBoxModule(frameParent->myContentFrame, "Information") { + // declare label + FXLabel* legendLabel = nullptr; + // edge candidate + legendLabel = new FXLabel(getCollapsableFrame(), " edge candidate", 0, GUIDesignLabelLeft); + legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.possible)); + legendLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE)); + // last edge selected + legendLabel = new FXLabel(getCollapsableFrame(), " last edge selected", 0, GUIDesignLabelLeft); + legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.target)); + // edge selected + legendLabel = new FXLabel(getCollapsableFrame(), " edge selected", 0, GUIDesignLabelLeft); + legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.source)); + // edge conflict (vClass) + legendLabel = new FXLabel(getCollapsableFrame(), " edge conflict (vClass)", 0, GUIDesignLabelLeft); + legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.special)); + // edge disconnected + legendLabel = new FXLabel(getCollapsableFrame(), " edge disconnected", 0, GUIDesignLabelLeft); + legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.conflict)); +} + + +GNEFrameModules::PathLegend::~PathLegend() {} + + +void +GNEFrameModules::PathLegend::showPathLegendModule() { + show(); +} + +void +GNEFrameModules::PathLegend::hidePathLegendModule() { + hide(); +} + +// --------------------------------------------------------------------------- +// GNEFrameModules - methods +// --------------------------------------------------------------------------- + +FXLabel* +GNEFrameModules::buildRainbow(FXComposite* parent) { + // create label for color information + FXLabel* label = new FXLabel(parent, "Scale: Min -> Max", nullptr, GUIDesignLabelCenterThick); + // create frame for color scale + FXHorizontalFrame* horizontalFrameColors = new FXHorizontalFrame(parent, GUIDesignAuxiliarHorizontalFrame); + for (const auto& color : GNEViewNetHelper::getRainbowScaledColors()) { + FXLabel* colorLabel = new FXLabel(horizontalFrameColors, "", nullptr, GUIDesignLabelLeft); + colorLabel->setBackColor(MFXUtils::getFXColor(color)); + } + // return label + return label; +} + +/****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/frames/GNEFrameModules.h sumo-1.12.0/src/netedit/frames/GNEFrameModules.h --- sumo-1.11.0/src/netedit/frames/GNEFrameModules.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/GNEFrameModules.h 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,808 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2022 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 GNEFrameModules.h +/// @author Pablo Alvarez Lopez +/// @date Aug 2019 +/// +// Auxiliar class for GNEFrame Modules +/****************************************************************************/ +#pragma once +#include + +#include +#include +#include +#include +#include + +// =========================================================================== +// class declaration +// =========================================================================== + +class GNEFrame; +class GNEDataSet; +class GNEDataInterval; + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNEFrameModules { + +public: + // =========================================================================== + // class TagSelector + // =========================================================================== + + class TagSelector : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNEFrameModules::TagSelector) + + public: + /// @brief constructor + TagSelector(GNEFrame* frameParent, GNETagProperties::TagType type, SumoXMLTag tag, bool onlyDrawables = true); + + /// @brief destructor + ~TagSelector(); + + /// @brief show item selector + void showTagSelector(); + + /// @brief hide item selector + void hideTagSelector(); + + /// @brief get templateAC + GNEAttributeCarrier* getTemplateAC(SumoXMLTag ACTag) const; + + /// @brief get current templateAC + GNEAttributeCarrier* getCurrentTemplateAC() const; + + /// @brief set current type manually + void setCurrentTagType(GNETagProperties::TagType tagType, const bool onlyDrawables, const bool notifyFrameParent = true); + + /// @brief set current type manually + void setCurrentTag(SumoXMLTag newTag, const bool notifyFrameParent = true); + + /// @brief refresh tagSelector (used when frameParent is show) + void refreshTagSelector(); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user select an elementin ComboBox + long onCmdSelectTag(FXObject*, FXSelector, void*); + /// @} + + protected: + /// @brief FOX need this + FOX_CONSTRUCTOR(TagSelector) + + private: + class ACTemplate { + + public: + /// @brief constructor + ACTemplate(GNENet* net, const GNETagProperties tagProperty); + + /// @brief destructor + ~ACTemplate(); + + /// @brief get template AC + GNEAttributeCarrier* getAC() const; + + private: + /// @brief editedAC + GNEAttributeCarrier* myAC; + + /// @brief Invalidated copy constructor. + ACTemplate(const ACTemplate&) = delete; + + /// @brief Invalidated assignment operator + ACTemplate& operator=(const ACTemplate& src) = delete; + }; + + /// @brief pointer to Frame Parent + GNEFrame* myFrameParent; + + /// @brief current tagType + GNETagProperties::TagType myTagType; + + /// @brief comboBox with the tags + MFXIconComboBox* myTagsMatchBox; + + /// @brief current templateAC; + GNEAttributeCarrier* myCurrentTemplateAC; + + /// @brief list with ACTemplates + std::vector myACTemplates; + }; + + // =========================================================================== + // class DemandElementSelector + // =========================================================================== + + class DemandElementSelector : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNEFrameModules::DemandElementSelector) + + public: + /// @brief constructor with a single tag + DemandElementSelector(GNEFrame* frameParent, SumoXMLTag demandElementTag, GNEDemandElement* defaultElement = nullptr); + + /// @brief constructor with tag type + DemandElementSelector(GNEFrame* frameParent, const std::vector& tagTypes); + + /// @brief destructor + ~DemandElementSelector(); + + /// @brief get current demand element + GNEDemandElement* getCurrentDemandElement() const; + + // @brief obtain allowed tags (derived from tagTypes) + const std::vector& getAllowedTags() const; + + /// @brief set current demand element + void setDemandElement(GNEDemandElement* demandElement); + + /// @brief show demand element selector + void showDemandElementSelector(); + + /// @brief hide demand element selector + void hideDemandElementSelector(); + + /// @brief check if demand element selector is shown + bool isDemandElementSelectorShown() const; + + /// @brief refresh demand element selector + void refreshDemandElementSelector(); + + /// @brief get previous edge for the current person plan + GNEEdge* getPersonPlanPreviousEdge() const; + + /// @brief get previous edge for the current container plan + GNEEdge* getContainerPlanPreviousEdge() const; + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user select another demand elementelement in ComboBox + long onCmdSelectDemandElement(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(DemandElementSelector) + + private: + /// @brief pointer to frame Parent + GNEFrame* myFrameParent; + + /// @brief comboBox with the list of elements type + MFXIconComboBox* myDemandElementsMatchBox; + + /// @brief current demand element + GNEDemandElement* myCurrentDemandElement; + + /// @brief demand element tags + std::vector myDemandElementTags; + }; + + // =========================================================================== + // class HierarchicalElementTree + // =========================================================================== + + class HierarchicalElementTree : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNEFrameModules::HierarchicalElementTree) + + public: + /// @brief constructor + HierarchicalElementTree(GNEFrame* frameParent); + + /// @brief destructor + ~HierarchicalElementTree(); + + /// @brief show HierarchicalElementTree + void showHierarchicalElementTree(GNEAttributeCarrier* AC); + + /// @brief hide HierarchicalElementTree + void hideHierarchicalElementTree(); + + /// @brief refresh HierarchicalElementTree + void refreshHierarchicalElementTree(); + + /// @brief if given AttributeCarrier is the same of myHE, set it as nullptr + void removeCurrentEditedAttributeCarrier(const GNEAttributeCarrier* HE); + + /// @name FOX-callbacks + /// @{ + /// @brief called when user press right click over an item of list of children + long onCmdShowChildMenu(FXObject*, FXSelector, void* data); + + /// @brief called when user click over option "center" of child Menu + long onCmdCenterItem(FXObject*, FXSelector, void*); + + /// @brief called when user click over option "inspect" of child menu + long onCmdInspectItem(FXObject*, FXSelector, void*); + + /// @brief called when user click over option "delete" of child menu + long onCmdDeleteItem(FXObject*, FXSelector, void*); + + /// @brief called when user click over option "Move up" of child menu + long onCmdMoveItemUp(FXObject*, FXSelector, void*); + + /// @brief called when user click over option "Move down" of child menu + long onCmdMoveItemDown(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(HierarchicalElementTree) + + // @brief create pop-up menu in the positions X-Y for the clicked attribute carrier + void createPopUpMenu(int X, int Y, GNEAttributeCarrier* clickedAC); + + /// @brief show child of current attributeCarrier + FXTreeItem* showAttributeCarrierParents(); + + /// @brief show children of given hierarchical element + void showHierarchicalElementChildren(GNEHierarchicalElement* HE, FXTreeItem* itemParent); + + /// @brief add item into list + FXTreeItem* addListItem(GNEAttributeCarrier* AC, FXTreeItem* itemParent = nullptr, std::string prefix = "", std::string sufix = ""); + + /// @brief add item into list + FXTreeItem* addListItem(FXTreeItem* itemParent, const std::string& text, FXIcon* icon, bool expanded); + + private: + /// @brief frame Parent + GNEFrame* myFrameParent; + + /// @brief hierarchical element + GNEHierarchicalElement* myHE; + + /// @brief pointer to current clicked Attribute Carrier + GNEAttributeCarrier* myClickedAC; + + /// @brief junction (casted from myClickedAC) + GNEJunction* myClickedJunction; + + /// @brief edge (casted from myClickedAC) + GNEEdge* myClickedEdge; + + /// @brief lane (casted from myClickedAC) + GNELane* myClickedLane; + + /// @brief crossing (casted from myClickedAC) + GNECrossing* myClickedCrossing; + + /// @brief junction (casted from myClickedAC) + GNEConnection* myClickedConnection; + + /// @brief shape (casted from myClickedAC) + GNEShape* myClickedShape; + + /// @brief TAZElement (casted from myClickedAC) + GNETAZElement* myClickedTAZElement; + + /// @brief additional (casted from myClickedAC) + GNEAdditional* myClickedAdditional; + + /// @brief demand element (casted from myClickedAC) + GNEDemandElement* myClickedDemandElement; + + /// @brief data set element (casted from myClickedAC) + GNEDataSet* myClickedDataSet; + + /// @brief data interval element (casted from myClickedAC) + GNEDataInterval* myClickedDataInterval; + + /// @brief generic data element (casted from myClickedAC) + GNEGenericData* myClickedGenericData; + + /// @brief tree list dinamic to show the children of the element to erase + FXTreeListDinamic* myTreeListDinamic = nullptr; + + /// @brief map used to save the FXTreeItems items with their vinculated AC + std::map myTreeItemToACMap; + + /// @brief set used to save tree items without AC assigned, the Incoming/Outcoming connections + std::set myTreeItemsConnections; + }; + + // =========================================================================== + // class DrawingShape + // =========================================================================== + + class DrawingShape : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNEFrameModules::DrawingShape) + + public: + /// @brief constructor + DrawingShape(GNEFrame* frameParent); + + /// @brief destructor + ~DrawingShape(); + + /// @brief show Drawing mode + void showDrawingShape(); + + /// @brief hide Drawing mode + void hideDrawingShape(); + + /// @brief start drawing + void startDrawing(); + + /// @brief stop drawing and check if shape can be created + void stopDrawing(); + + /// @brief abort drawing + void abortDrawing(); + + /// @brief add new point to temporal shape + void addNewPoint(const Position& P); + + /// @brief remove last added point + void removeLastPoint(); + + /// @brief get Temporal shape + const PositionVector& getTemporalShape() const; + + /// @brief return true if currently a shape is drawed + bool isDrawing() const; + + /// @brief enable or disable delete last created point + void setDeleteLastCreatedPoint(bool value); + + /// @brief get flag delete last created point + bool getDeleteLastCreatedPoint(); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user press start drawing button + long onCmdStartDrawing(FXObject*, FXSelector, void*); + + /// @brief Called when the user press stop drawing button + long onCmdStopDrawing(FXObject*, FXSelector, void*); + + /// @brief Called when the user press abort drawing button + long onCmdAbortDrawing(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(DrawingShape) + + private: + /// @brief pointer to frame parent + GNEFrame* myFrameParent; + + /// @brief flag to enable/disable delete point mode + bool myDeleteLastCreatedPoint; + + /// @brief current drawed shape + PositionVector myTemporalShape; + + /// @brief button for start drawing + FXButton* myStartDrawingButton; + + /// @brief button for stop drawing + FXButton* myStopDrawingButton; + + /// @brief button for abort drawing + FXButton* myAbortDrawingButton; + + /// @brief Label with information + FXLabel* myInformationLabel; + }; + + // =========================================================================== + // class SelectorParent + // =========================================================================== + + class SelectorParent : public FXGroupBoxModule { + public: + /// @brief constructor + SelectorParent(GNEFrame* frameParent); + + /// @brief destructor + ~SelectorParent(); + + /// @brief get currently parent additional selected + std::string getIdSelected() const; + + /// @brief select manually a element of the list + void setIDSelected(const std::string& id); + + /// @brief Show list of SelectorParent Module + bool showSelectorParentModule(const std::vector& additionalTypeParents); + + /// @brief hide SelectorParent Module + void hideSelectorParentModule(); + + /// @brief Refresh list of Additional Parents Module + void refreshSelectorParentModule(); + + private: + /// @brief pointer to Frame Parent + GNEFrame* myFrameParent; + + /// @brief current parent additional tag + std::vector myParentTags; + + /// @brief Label with parent name + FXLabel* myParentsLabel; + + /// @brief List of parents + FXList* myParentsList; + }; + + // =========================================================================== + // class OverlappedInspection + // =========================================================================== + + class OverlappedInspection : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNEFrameModules::OverlappedInspection) + + public: + /// @brief constructor + OverlappedInspection(GNEFrame* frameParent); + + /// @brief constructor (used for filter objects under cusor + OverlappedInspection(GNEFrame* frameParent, const SumoXMLTag filteredTag); + + /// @brief destructor + ~OverlappedInspection(); + + /// @brief show template editor + void showOverlappedInspection(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const Position& clickedPosition); + + /// @brief hide template editor + void hideOverlappedInspection(); + + /// @brief check if overlappedInspection modul is shown + bool overlappedInspectionShown() const; + + /// @brief get number of overlapped ACSs + int getNumberOfOverlappedACs() const; + + /// @brief check if given position is near to saved position + bool checkSavedPosition(const Position& clickedPosition) const; + + /// @brief try to go to next element if clicked position is near to saved position + bool nextElement(const Position& clickedPosition); + + /// @brief try to go to previous element if clicked position is near to saved position + bool previousElement(const Position& clickedPosition); + + /// @name FOX-callbacks + /// @{ + + /// @brief Inspect next Element (from top to bot) + long onCmdNextElement(FXObject*, FXSelector, void*); + + /// @brief Inspect previous element (from top to bot) + long onCmdPreviousElement(FXObject*, FXSelector, void*); + + /// @brief show list of overlapped elements + long onCmdShowList(FXObject*, FXSelector, void*); + + /// @brief called when a list item is selected + long onCmdListItemSelected(FXObject*, FXSelector, void*); + + /// @brief Called when user press the help button + long onCmdOverlappingHelp(FXObject*, FXSelector, void*); + /// @} + + protected: + /// @brief FOX needs this + OverlappedInspection(); + + /// @brief build Fox Toolkit elemements + void buildFXElements(); + + private: + /// @brief current frame parent + GNEFrame* myFrameParent; + + /// @brief Previous element button + FXButton* myPreviousElement; + + /// @brief Button for current index + FXButton* myCurrentIndexButton; + + /// @brief Next element button + FXButton* myNextElement; + + /// @brief list of overlapped elements + FXList* myOverlappedElementList; + + /// @brief button for help + FXButton* myHelpButton; + + /// @brief filtered tag + const SumoXMLTag myFilteredTag; + + /// @brief objects under cursor + std::vector myOverlappedACs; + + /// @brief current index item + size_t myItemIndex; + + /// @brief saved clicked position + Position mySavedClickedPosition; + }; + + // =========================================================================== + // class PathCreator + // =========================================================================== + + class PathCreator : public FXGroupBoxModule { + /// @brief FOX-declaration + FXDECLARE(GNEFrameModules::PathCreator) + + public: + /// @brief class for path + class Path { + + public: + /// @brief constructor for single edge + Path(const SUMOVehicleClass vClass, GNEEdge* edge); + + /// @brief constructor for multiple edges + Path(GNEViewNet* viewNet, const SUMOVehicleClass vClass, GNEEdge* edgeFrom, GNEEdge* edgeTo); + + /// @brief get sub path + const std::vector& getSubPath() const; + + /// @brief get from additional + GNEAdditional* getFromBusStop() const; + + /// @brief to additional + GNEAdditional* getToBusStop() const; + + /// @brief check if current path is conflict due vClass + bool isConflictVClass() const; + + /// @brief check if current path is conflict due is disconnected + bool isConflictDisconnected() const; + + protected: + /// @brief sub path + std::vector mySubPath; + + /// @brief from additional (usually a busStop) + GNEAdditional* myFromBusStop; + + /// @brief to additional (usually a busStop) + GNEAdditional* myToBusStop; + + /// @brief flag to mark this path as conflicted + bool myConflictVClass; + + /// @brief flag to mark this path as disconnected + bool myConflictDisconnected; + + private: + /// @brief default constructor + Path(); + + /// @brief Invalidated copy constructor. + Path(Path*) = delete; + + /// @brief Invalidated assignment operator. + Path& operator=(Path*) = delete; + }; + + /// @brief default constructor + PathCreator(GNEFrame* frameParent); + + /// @brief destructor + ~PathCreator(); + + /// @brief show PathCreator for the given tag + void showPathCreatorModule(SumoXMLTag element, const bool firstElement, const bool consecutives); + + /// @brief show PathCreator + void hidePathCreatorModule(); + + /// @brief get vClass + SUMOVehicleClass getVClass() const; + + /// @brief set vClass + void setVClass(SUMOVehicleClass vClass); + + /// @brief add junction + bool addJunction(GNEJunction* junction, const bool shiftKeyPressed, const bool controlKeyPressed); + + /// @brief add edge + bool addEdge(GNEEdge* edge, const bool shiftKeyPressed, const bool controlKeyPressed); + + /// @brief get current selected edges + const std::vector& getSelectedEdges() const; + + /// @brief get current selected junctions + const std::vector& getSelectedJunctions() const; + + /// @brief add stoppingPlace + bool addStoppingPlace(GNEAdditional* stoppingPlace, const bool shiftKeyPressed, const bool controlKeyPressed); + + /// @brief get to stoppingPlace + GNEAdditional* getToStoppingPlace(SumoXMLTag expectedTag) const; + + /// @brief add route + bool addRoute(GNEDemandElement* route, const bool shiftKeyPressed, const bool controlKeyPressed); + + /// @brief get route + GNEDemandElement* getRoute() const; + + /// @brief remove route + void removeRoute(); + + /// @brief get path route + const std::vector& getPath() const; + + /// @brief draw candidate edges with special color (Only for candidates, special and conflicted) + bool drawCandidateEdgesWithSpecialColor() const; + + /// @brief update junction colors + void updateJunctionColors(); + + /// @brief update edge colors + void updateEdgeColors(); + + /// @brief clear junction colors + void clearJunctionColors(); + + /// @brief clear edge colors + void clearEdgeColors(); + + /// @brief draw temporal route + void drawTemporalRoute(const GUIVisualizationSettings& s) const; + + /// @brief create path + void createPath(); + + /// @brief abort path creation + void abortPathCreation(); + + /// @brief remove path element + void removeLastElement(); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user click over button "Finish route creation" + long onCmdCreatePath(FXObject*, FXSelector, void*); + + /// @brief Called when the user click over button "Abort route creation" + long onCmdAbortPathCreation(FXObject*, FXSelector, void*); + + /// @brief Called when the user click over button "Remove las inserted edge" + long onCmdRemoveLastElement(FXObject*, FXSelector, void*); + + /// @brief Called when the user click over check button "show candidate edges" + long onCmdShowCandidateEdges(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(PathCreator) + + // @brief creation mode + enum Mode { + CONSECUTIVE_EDGES = 1 << 0, // Path's edges are consecutives + NONCONSECUTIVE_EDGES = 1 << 1, // Path's edges aren't consecutives + START_EDGE = 1 << 2, // Path begins in an edge + END_EDGE = 1 << 3, // Path ends in an edge + START_JUNCTION = 1 << 4, // Path begins in an edge + END_JUNCTION = 1 << 5, // Path ends in an edge + SINGLE_ELEMENT = 1 << 6, // Path only had one element + ONLY_FROMTO = 1 << 7, // Path only had two elements (first and last) + END_BUSSTOP = 1 << 8, // Path ends in a busStop + ROUTE = 1 << 9, // Path uses a route + REQUIRE_FIRSTELEMENT = 1 << 10, // Path start always in a previous element + SHOW_CANDIDATE_EDGES = 1 << 11, // disable candidate edges + }; + + /// @brief update InfoRouteLabel + void updateInfoRouteLabel(); + + /// @brief clear edges (and restore colors) + void clearPath(); + + /// @brief recalculate path + void recalculatePath(); + + /// @brief set special candidates (This function will be called recursively) + void setSpecialCandidates(GNEEdge* originEdge); + + /// @brief set edgereachability (This function will be called recursively) + void setPossibleCandidates(GNEEdge* originEdge, const SUMOVehicleClass vClass); + + /// @brief current frame parent + GNEFrame* myFrameParent; + + /// @brief current vClass + SUMOVehicleClass myVClass; + + /// @brief current creation mode + int myCreationMode; + + /// @brief vector with selected junctions + std::vector mySelectedJunctions; + + /// @brief vector with selected edges + std::vector mySelectedEdges; + + /// @brief to additional (usually a busStop) + GNEAdditional* myToStoppingPlace; + + /// @brief route (usually a busStop) + GNEDemandElement* myRoute; + + /// @brief vector with current path + std::vector myPath; + + /// @brief label with route info + FXLabel* myInfoRouteLabel; + + /// @brief button for finish route creation + FXButton* myFinishCreationButton; + + /// @brief button for abort route creation + FXButton* myAbortCreationButton; + + /// @brief button for removing last inserted element + FXButton* myRemoveLastInsertedElement; + + /// @brief CheckBox for show candidate edges + FXCheckButton* myShowCandidateEdges; + + /// @brief label for shift information + FXLabel* myShiftLabel; + + /// @brief label for control information + FXLabel* myControlLabel; + + private: + /// @brief Invalidated copy constructor. + PathCreator(PathCreator*) = delete; + + /// @brief Invalidated assignment operator. + PathCreator& operator=(PathCreator*) = delete; + }; + + // =========================================================================== + // class PathLegend + // =========================================================================== + + class PathLegend : public FXGroupBoxModule { + + public: + /// @brief constructor + PathLegend(GNEFrame* frameParent); + + /// @brief destructor + ~PathLegend(); + + /// @brief show Legend modul + void showPathLegendModule(); + + /// @brief hide Legend modul + void hidePathLegendModule(); + }; + + // =========================================================================== + // Functions + // =========================================================================== + + /// @brief build rainbow in frame modul + static FXLabel* buildRainbow(FXComposite* parent); +}; diff -Nru sumo-1.11.0/src/netedit/frames/GNEFrameModuls.cpp sumo-1.12.0/src/netedit/frames/GNEFrameModuls.cpp --- sumo-1.11.0/src/netedit/frames/GNEFrameModuls.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/GNEFrameModuls.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,2892 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GNEFrameModuls.cpp -/// @author Pablo Alvarez Lopez -/// @date Aug 2019 -/// -// Auxiliar class for GNEFrame Moduls -/****************************************************************************/ -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEFrameModuls.h" - - -// =========================================================================== -// FOX callback mapping -// =========================================================================== - -FXDEFMAP(GNEFrameModuls::TagSelector) TagSelectorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_TAGTYPE_SELECTED, GNEFrameModuls::TagSelector::onCmdSelectTagType), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TAG_SELECTED, GNEFrameModuls::TagSelector::onCmdSelectTag) -}; - -FXDEFMAP(GNEFrameModuls::DemandElementSelector) DemandElementSelectorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_TYPE, GNEFrameModuls::DemandElementSelector::onCmdSelectDemandElement), -}; - -FXDEFMAP(GNEFrameModuls::HierarchicalElementTree) HierarchicalElementTreeMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_CENTER, GNEFrameModuls::HierarchicalElementTree::onCmdCenterItem), - FXMAPFUNC(SEL_COMMAND, MID_GNE_INSPECT, GNEFrameModuls::HierarchicalElementTree::onCmdInspectItem), - FXMAPFUNC(SEL_COMMAND, MID_GNE_DELETE, GNEFrameModuls::HierarchicalElementTree::onCmdDeleteItem), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ACHIERARCHY_MOVEUP, GNEFrameModuls::HierarchicalElementTree::onCmdMoveItemUp), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ACHIERARCHY_MOVEDOWN, GNEFrameModuls::HierarchicalElementTree::onCmdMoveItemDown), - FXMAPFUNC(SEL_RIGHTBUTTONRELEASE, MID_GNE_ACHIERARCHY_SHOWCHILDMENU, GNEFrameModuls::HierarchicalElementTree::onCmdShowChildMenu) -}; - -FXDEFMAP(GNEFrameModuls::DrawingShape) DrawingShapeMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_STARTDRAWING, GNEFrameModuls::DrawingShape::onCmdStartDrawing), - FXMAPFUNC(SEL_COMMAND, MID_GNE_STOPDRAWING, GNEFrameModuls::DrawingShape::onCmdStopDrawing), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ABORTDRAWING, GNEFrameModuls::DrawingShape::onCmdAbortDrawing) -}; - -FXDEFMAP(GNEFrameModuls::OverlappedInspection) OverlappedInspectionMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_OVERLAPPED_NEXT, GNEFrameModuls::OverlappedInspection::onCmdNextElement), - FXMAPFUNC(SEL_COMMAND, MID_GNE_OVERLAPPED_PREVIOUS, GNEFrameModuls::OverlappedInspection::onCmdPreviousElement), - FXMAPFUNC(SEL_COMMAND, MID_GNE_OVERLAPPED_SHOWLIST, GNEFrameModuls::OverlappedInspection::onCmdShowList), - FXMAPFUNC(SEL_COMMAND, MID_GNE_OVERLAPPED_ITEMSELECTED, GNEFrameModuls::OverlappedInspection::onCmdListItemSelected), - FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEFrameModuls::OverlappedInspection::onCmdOverlappingHelp) -}; - -FXDEFMAP(GNEFrameModuls::PathCreator) PathCreatorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_ABORT, GNEFrameModuls::PathCreator::onCmdAbortPathCreation), - FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_FINISH, GNEFrameModuls::PathCreator::onCmdCreatePath), - FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_REMOVELAST, GNEFrameModuls::PathCreator::onCmdRemoveLastElement), - FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_SHOWCANDIDATES, GNEFrameModuls::PathCreator::onCmdShowCandidateEdges) -}; - - -// Object implementation -FXIMPLEMENT(GNEFrameModuls::TagSelector, FXGroupBox, TagSelectorMap, ARRAYNUMBER(TagSelectorMap)) -FXIMPLEMENT(GNEFrameModuls::DemandElementSelector, FXGroupBox, DemandElementSelectorMap, ARRAYNUMBER(DemandElementSelectorMap)) -FXIMPLEMENT(GNEFrameModuls::HierarchicalElementTree, FXGroupBox, HierarchicalElementTreeMap, ARRAYNUMBER(HierarchicalElementTreeMap)) -FXIMPLEMENT(GNEFrameModuls::DrawingShape, FXGroupBox, DrawingShapeMap, ARRAYNUMBER(DrawingShapeMap)) -FXIMPLEMENT(GNEFrameModuls::OverlappedInspection, FXGroupBox, OverlappedInspectionMap, ARRAYNUMBER(OverlappedInspectionMap)) -FXIMPLEMENT(GNEFrameModuls::PathCreator, FXGroupBox, PathCreatorMap, ARRAYNUMBER(PathCreatorMap)) - - -// =========================================================================== -// method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNEFrameModuls::TagSelector - methods -// --------------------------------------------------------------------------- - -GNEFrameModuls::TagSelector::TagSelector(GNEFrame* frameParent, GNETagProperties::TagType type, bool onlyDrawables) : - FXGroupBox(frameParent->myContentFrame, "Element", GUIDesignGroupBoxFrame), - myFrameParent(frameParent) { - // first check that property is valid - switch (type) { - case GNETagProperties::TagType::NETWORKELEMENT: - setText("network elements"); - break; - case GNETagProperties::TagType::ADDITIONALELEMENT: - setText("Additional elements"); - break; - case GNETagProperties::TagType::SHAPE: - setText("Shape elements"); - break; - case GNETagProperties::TagType::TAZELEMENT: - setText("TAZ elements"); - break; - case GNETagProperties::TagType::VEHICLE: - setText("Vehicles"); - break; - case GNETagProperties::TagType::STOP: - setText("Stops"); - break; - case GNETagProperties::TagType::PERSON: - setText("Persons"); - break; - case GNETagProperties::TagType::PERSONPLAN: - setText("Person plans"); - // person plan type has four sub-groups - myTagTypes.push_back(TagType("person trips", GNETagProperties::TagType::PERSONTRIP, GUIIcon::PERSONTRIP_FROMTO)); - myTagTypes.push_back(TagType("walks", GNETagProperties::TagType::WALK, GUIIcon::WALK_FROMTO)); - myTagTypes.push_back(TagType("rides", GNETagProperties::TagType::RIDE, GUIIcon::RIDE_FROMTO)); - myTagTypes.push_back(TagType("stops", GNETagProperties::TagType::STOPPERSON, GUIIcon::STOPELEMENT)); - break; - case GNETagProperties::TagType::CONTAINER: - setText("Container"); - break; - case GNETagProperties::TagType::CONTAINERPLAN: - setText("Container plans"); - // container plan type has four sub-groups - myTagTypes.push_back(TagType("transport", GNETagProperties::TagType::TRANSPORT, GUIIcon::TRANSHIP_FROMTO)); - myTagTypes.push_back(TagType("tranship", GNETagProperties::TagType::TRANSHIP, GUIIcon::TRANSHIP_FROMTO)); - myTagTypes.push_back(TagType("stops", GNETagProperties::TagType::STOPCONTAINER, GUIIcon::STOPELEMENT)); - break; - case GNETagProperties::TagType::PERSONTRIP: - setText("Person trips"); - break; - case GNETagProperties::TagType::WALK: - setText("Walks"); - break; - case GNETagProperties::TagType::RIDE: - setText("Rides"); - break; - case GNETagProperties::TagType::STOPPERSON: - setText("Person stops"); - break; - default: - throw ProcessError("invalid tag property"); - } - // Create FXComboBox - myTagTypesMatchBox = new MFXIconComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_TAGTYPE_SELECTED, GUIDesignComboBox); - // Create FXComboBox - myTagsMatchBox = new MFXIconComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_TAG_SELECTED, GUIDesignComboBox); - // Fill comboBox depending of myTagTypes - if (myTagTypes.size() > 0) { - // fill myTypeMatchBox with list of tags - for (const auto& tagType : myTagTypes) { - myTagTypesMatchBox->appendIconItem(tagType.tag.c_str(), GUIIconSubSys::getIcon(tagType.icon)); - } - // Set visible items - myTagTypesMatchBox->setNumVisible((int)myTagTypesMatchBox->getNumItems()); - // fill myTagPropertiesString with personTrips (the first Tag Type) - myTagPropertiesString = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(type, onlyDrawables); - } else { - myTagTypesMatchBox->hide(); - // fill myTagPropertiesString - myTagPropertiesString = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(type, onlyDrawables); - } - // fill myTypeMatchBox with list of tags - for (const auto& tagIt : myTagPropertiesString) { - myTagsMatchBox->appendIconItem(tagIt.second.c_str(), GUIIconSubSys::getIcon(tagIt.first.getGUIIcon()), tagIt.first.getBackGroundColor()); - } - // Set visible items - myTagsMatchBox->setNumVisible((int)myTagsMatchBox->getNumItems()); - // TagSelector is always shown - show(); -} - - -GNEFrameModuls::TagSelector::~TagSelector() {} - - -void -GNEFrameModuls::TagSelector::showTagSelector() { - show(); -} - - -void -GNEFrameModuls::TagSelector::hideTagSelector() { - hide(); -} - - -const GNETagProperties& -GNEFrameModuls::TagSelector::getCurrentTagProperties() const { - return myCurrentTagProperties; -} - - -void -GNEFrameModuls::TagSelector::setCurrentTagType(GNETagProperties::TagType tagType) { - // set empty tag properties - myCurrentTagProperties = GNETagProperties(); - // make sure that tag is in myTypeMatchBox - for (int i = 0; i < (int)myTagsMatchBox->getNumItems(); i++) { - if (myTagsMatchBox->getItem(i).text() == toString(tagType)) { - myTagsMatchBox->setCurrentItem(i); - // fill myTagPropertiesString with personTrips (the first Tag Type) - myTagPropertiesString = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(tagType, true); - // clear myTagsMatchBox - myTagsMatchBox->clearItems(); - // fill myTypeMatchBox with list of tags - for (const auto& tagIt : myTagPropertiesString) { - myTagsMatchBox->appendIconItem(tagIt.second.c_str(), GUIIconSubSys::getIcon(tagIt.first.getGUIIcon()), tagIt.first.getBackGroundColor()); - } - // Set visible items - myTagsMatchBox->setNumVisible((int)myTagsMatchBox->getNumItems()); - } - } - // call tag selected function - myFrameParent->tagSelected(); -} - - -void -GNEFrameModuls::TagSelector::setCurrentTag(SumoXMLTag newTag) { - // set empty tag properties - myCurrentTagProperties = GNETagProperties(); - // make sure that tag is in myTypeMatchBox - for (int i = 0; i < (int)myTagsMatchBox->getNumItems(); i++) { - if (myTagsMatchBox->getItem(i).text() == toString(newTag)) { - myTagsMatchBox->setCurrentItem(i); - // Set new current type - myCurrentTagProperties = GNEAttributeCarrier::getTagProperties(newTag); - } - } - // call tag selected function - myFrameParent->tagSelected(); -} - - -void -GNEFrameModuls::TagSelector::refreshTagProperties() { - // simply call onCmdSelectItem (to avoid duplicated code) - onCmdSelectTag(0, 0, 0); -} - - -long GNEFrameModuls::TagSelector::onCmdSelectTagType(FXObject*, FXSelector, void*) { - // Check if value of myTypeMatchBox correspond of an allowed additional tags - for (const auto& tagType : myTagTypes) { - if (tagType.tag == myTagTypesMatchBox->getText().text()) { - // set color of myTagTypesMatchBox to black (valid) - myTagTypesMatchBox->setTextColor(FXRGB(0, 0, 0)); - // fill myTagPropertiesString with personTrips (the first Tag Type) - myTagPropertiesString = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(tagType.tagType, true); - // show and clear myTagsMatchBox - myTagsMatchBox->show(); - myTagsMatchBox->clearItems(); - // fill myTypeMatchBox with list of tags - for (const auto& tagIt : myTagPropertiesString) { - myTagsMatchBox->appendIconItem(tagIt.second.c_str(), GUIIconSubSys::getIcon(tagIt.first.getGUIIcon()), tagIt.first.getBackGroundColor()); - } - // Set visible items - myTagsMatchBox->setNumVisible((int)myTagsMatchBox->getNumItems()); - // Write Warning in console if we're in testing mode - WRITE_DEBUG(("Selected item '" + myTagsMatchBox->getText() + "' in TagTypeSelector").text()); - // call onCmdSelectTag - return onCmdSelectTag(nullptr, 0, nullptr); - } - } - // if TagType isn't valid, hide myTagsMatchBox - myTagsMatchBox->hide(); - // if additional name isn't correct, set SUMO_TAG_NOTHING as current type - myCurrentTagProperties = myInvalidTagProperty; - // call tag selected function - myFrameParent->tagSelected(); - // set color of myTagTypesMatchBox to red (invalid) - myTagTypesMatchBox->setTextColor(FXRGB(255, 0, 0)); - // Write Warning in console if we're in testing mode - WRITE_DEBUG("Selected invalid item in TagTypeSelector"); - return 1; -} - - -long -GNEFrameModuls::TagSelector::onCmdSelectTag(FXObject*, FXSelector, void*) { - // Check if value of myTypeMatchBox correspond of an allowed additional tags - for (const auto& tagProperty : myTagPropertiesString) { - if (tagProperty.second == myTagsMatchBox->getText().text()) { - // set color of myTypeMatchBox to black (valid) - myTagsMatchBox->setTextColor(FXRGB(0, 0, 0)); - // Set new current type - myCurrentTagProperties = tagProperty.first; - // call tag selected function - myFrameParent->tagSelected(); - // Write Warning in console if we're in testing mode - WRITE_DEBUG(("Selected item '" + myTagsMatchBox->getText() + "' in TagSelector").text()); - return 1; - } - } - // if additional name isn't correct, set SUMO_TAG_NOTHING as current type - myCurrentTagProperties = myInvalidTagProperty; - // call tag selected function - myFrameParent->tagSelected(); - // set color of myTypeMatchBox to red (invalid) - myTagsMatchBox->setTextColor(FXRGB(255, 0, 0)); - // Write Warning in console if we're in testing mode - WRITE_DEBUG("Selected invalid item in TagSelector"); - return 1; -} - - -GNEFrameModuls::TagSelector::TagType::TagType(std::string _tag, GNETagProperties::TagType _tagType, GUIIcon _icon) : - tag(_tag), - tagType(_tagType), - icon(_icon) { -} - -// --------------------------------------------------------------------------- -// GNEFrameModuls::DemandElementSelector - methods -// --------------------------------------------------------------------------- - -GNEFrameModuls::DemandElementSelector::DemandElementSelector(GNEFrame* frameParent, SumoXMLTag demandElementTag) : - FXGroupBox(frameParent->myContentFrame, ("Parent " + toString(demandElementTag)).c_str(), GUIDesignGroupBoxFrame), - myFrameParent(frameParent), - myCurrentDemandElement(nullptr), - myDemandElementTags({demandElementTag}) { - // Create MFXIconComboBox - myDemandElementsMatchBox = new MFXIconComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SET_TYPE, GUIDesignComboBox); - // refresh demand element MatchBox - refreshDemandElementSelector(); - // shown after creation - show(); -} - - -GNEFrameModuls::DemandElementSelector::DemandElementSelector(GNEFrame* frameParent, const std::vector& tagTypes) : - FXGroupBox(frameParent->myContentFrame, "Parent element", GUIDesignGroupBoxFrame), - myFrameParent(frameParent), - myCurrentDemandElement(nullptr) { - // fill myDemandElementTags - for (const auto& tagType : tagTypes) { - const auto tagProperties = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(tagType, false); - for (const auto& tagProperty : tagProperties) { - myDemandElementTags.push_back(tagProperty.first.getTag()); - } - } - // Create MFXIconComboBox - myDemandElementsMatchBox = new MFXIconComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SET_TYPE, GUIDesignComboBox); - // refresh demand element MatchBox - refreshDemandElementSelector(); - // shown after creation - show(); -} - - -GNEFrameModuls::DemandElementSelector::~DemandElementSelector() {} - - -GNEDemandElement* -GNEFrameModuls::DemandElementSelector::getCurrentDemandElement() const { - return myCurrentDemandElement; -} - - -const std::vector& -GNEFrameModuls::DemandElementSelector::getAllowedTags() const { - return myDemandElementTags; -} - - -void -GNEFrameModuls::DemandElementSelector::setDemandElement(GNEDemandElement* demandElement) { - // first check that demandElement tag correspond to a tag of myDemandElementTags - if (std::find(myDemandElementTags.begin(), myDemandElementTags.end(), demandElement->getTagProperty().getTag()) != myDemandElementTags.end()) { - // update text of myDemandElementsMatchBox - myDemandElementsMatchBox->setItem(demandElement->getID().c_str(), demandElement->getIcon()); - // Set new current demand element - myCurrentDemandElement = demandElement; - // call demandElementSelected function - myFrameParent->demandElementSelected(); - } -} - - -void -GNEFrameModuls::DemandElementSelector::showDemandElementSelector() { - // first refresh modul - refreshDemandElementSelector(); - // if current selected item isn't valid, set DEFAULT_VTYPE_ID or DEFAULT_PEDTYPE_ID - if (myCurrentDemandElement) { - myDemandElementsMatchBox->setItem(myCurrentDemandElement->getID().c_str(), myCurrentDemandElement->getIcon()); - } else if (myDemandElementTags.size() == 1) { - if (myDemandElementTags.at(0) == SUMO_TAG_VTYPE) { - const auto defaultVType = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID); - myDemandElementsMatchBox->setItem(defaultVType->getID().c_str(), defaultVType->getIcon()); - } else if (myDemandElementTags.at(0) == SUMO_TAG_PTYPE) { - const auto defaultPType = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_PEDTYPE_ID); - myDemandElementsMatchBox->setItem(defaultPType->getID().c_str(), defaultPType->getIcon()); - } - } - onCmdSelectDemandElement(nullptr, 0, nullptr); - show(); -} - - -void -GNEFrameModuls::DemandElementSelector::hideDemandElementSelector() { - hide(); -} - - -bool -GNEFrameModuls::DemandElementSelector::isDemandElementSelectorShown() const { - return shown(); -} - - -void -GNEFrameModuls::DemandElementSelector::refreshDemandElementSelector() { - // get demand elemenst container - const auto& demandElements = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements(); - // clear demand elements comboBox - myDemandElementsMatchBox->clearItems(); - // fill myTypeMatchBox with list of demand elements - for (const auto& demandElementTag : myDemandElementTags) { - // special case for VTypes and PTypes - if (demandElementTag == SUMO_TAG_VTYPE) { - // add default Vehicle an Bike types in the first and second positions - myDemandElementsMatchBox->appendIconItem(DEFAULT_VTYPE_ID.c_str(), GUIIconSubSys::getIcon(GUIIcon::VTYPE)); - myDemandElementsMatchBox->appendIconItem(DEFAULT_BIKETYPE_ID.c_str(), GUIIconSubSys::getIcon(GUIIcon::VTYPE)); - // add rest of vTypes - for (const auto& vType : demandElements.at(demandElementTag)) { - // avoid insert duplicated default vType - if ((vType->getID() != DEFAULT_VTYPE_ID) && (vType->getID() != DEFAULT_BIKETYPE_ID)) { - myDemandElementsMatchBox->appendIconItem(vType->getID().c_str(), vType->getIcon()); - } - } - } else if (demandElementTag == SUMO_TAG_PTYPE) { - // add default Person type in the firs - myDemandElementsMatchBox->appendIconItem(DEFAULT_PEDTYPE_ID.c_str(), GUIIconSubSys::getIcon(GUIIcon::PTYPE)); - // add rest of pTypes - for (const auto& pType : demandElements.at(demandElementTag)) { - // avoid insert duplicated default pType - if (pType->getID() != DEFAULT_PEDTYPE_ID) { - myDemandElementsMatchBox->appendIconItem(pType->getID().c_str(), pType->getIcon()); - } - } - } else { - // insert all Ids - for (const auto& demandElement : demandElements.at(demandElementTag)) { - myDemandElementsMatchBox->appendIconItem(demandElement->getID().c_str(), demandElement->getIcon()); - } - } - } - // Set number of items (maximum 10) - if (myDemandElementsMatchBox->getNumItems() < 10) { - myDemandElementsMatchBox->setNumVisible((int)myDemandElementsMatchBox->getNumItems()); - } else { - myDemandElementsMatchBox->setNumVisible(10); - } - // update myCurrentDemandElement - if (myDemandElementsMatchBox->getNumItems() == 0) { - myCurrentDemandElement = nullptr; - } else if (myCurrentDemandElement) { - for (int i = 0; i < myDemandElementsMatchBox->getNumItems(); i++) { - if (myDemandElementsMatchBox->getItem(i).text() == myCurrentDemandElement->getID()) { - myDemandElementsMatchBox->setCurrentItem(i, FALSE); - } - } - } else { - // set first element in the list as myCurrentDemandElement (Special case for default person and vehicle type) - if (myDemandElementsMatchBox->getItem(0).text() == DEFAULT_VTYPE_ID) { - myCurrentDemandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDefaultVType(); - } else if (myDemandElementsMatchBox->getItem(0).text() == DEFAULT_PEDTYPE_ID) { - myCurrentDemandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDefaultPType(); - } else { - // disable myCurrentDemandElement - myCurrentDemandElement = nullptr; - // update myCurrentDemandElement with the first allowed element - for (auto i = myDemandElementTags.begin(); (i != myDemandElementTags.end()) && (myCurrentDemandElement == nullptr); i++) { - if (demandElements.at(*i).size() > 0) { - myCurrentDemandElement = *demandElements.at(*i).begin(); - } - } - } - } -} - - -GNEEdge* -GNEFrameModuls::DemandElementSelector::getPersonPlanPreviousEdge() const { - if (myCurrentDemandElement == nullptr) { - return nullptr; - } - if (!myCurrentDemandElement->getTagProperty().isPerson()) { - return nullptr; - } - if (myCurrentDemandElement->getChildDemandElements().empty()) { - return nullptr; - } - // get last person plan - const GNEDemandElement* lastPersonPlan = myCurrentDemandElement->getChildDemandElements().back(); - // check tag - switch (lastPersonPlan->getTagProperty().getTag()) { - // person trips - case GNE_TAG_PERSONTRIP_EDGE: - // rides - case GNE_TAG_RIDE_EDGE: - // walks - case GNE_TAG_WALK_EDGE: - case GNE_TAG_WALK_EDGES: - // stops - case GNE_TAG_STOPPERSON_EDGE: - return lastPersonPlan->getParentEdges().back(); - // person trips - case GNE_TAG_PERSONTRIP_BUSSTOP: - // person trips - case GNE_TAG_RIDE_BUSSTOP: - // walks - case GNE_TAG_WALK_BUSSTOP: - // stops - case GNE_TAG_STOPPERSON_BUSSTOP: - return lastPersonPlan->getParentAdditionals().back()->getParentLanes().front()->getParentEdge(); - // route walks - case GNE_TAG_WALK_ROUTE: - return lastPersonPlan->getParentDemandElements().back()->getParentEdges().back(); - default: - return nullptr; - } -} - - -GNEEdge* -GNEFrameModuls::DemandElementSelector::getContainerPlanPreviousEdge() const { - if (myCurrentDemandElement == nullptr) { - return nullptr; - } - if (!myCurrentDemandElement->getTagProperty().isContainer()) { - return nullptr; - } - if (myCurrentDemandElement->getChildDemandElements().empty()) { - return nullptr; - } - // get last container plan - const GNEDemandElement* lastContainerPlan = myCurrentDemandElement->getChildDemandElements().back(); - // check tag - switch (lastContainerPlan->getTagProperty().getTag()) { - // transport - case GNE_TAG_TRANSPORT_EDGE: - // tranship - case GNE_TAG_TRANSHIP_EDGE: - case GNE_TAG_TRANSHIP_EDGES: - // stop - case GNE_TAG_STOPCONTAINER_EDGE: - return lastContainerPlan->getParentEdges().back(); - // transport - case GNE_TAG_TRANSPORT_CONTAINERSTOP: - // tranship - case GNE_TAG_TRANSHIP_CONTAINERSTOP: - // stop - case GNE_TAG_STOPCONTAINER_CONTAINERSTOP: - return lastContainerPlan->getParentAdditionals().back()->getParentLanes().front()->getParentEdge(); - default: - return nullptr; - } -} - - -long -GNEFrameModuls::DemandElementSelector::onCmdSelectDemandElement(FXObject*, FXSelector, void*) { - // Check if value of myTypeMatchBox correspond to a demand element - for (const auto& demandElementTag : myDemandElementTags) { - for (const auto& demandElement : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(demandElementTag)) { - if (demandElement->getID() == myDemandElementsMatchBox->getText().text()) { - // set color of myTypeMatchBox to black (valid) - myDemandElementsMatchBox->setTextColor(FXRGB(0, 0, 0)); - // Set new current demand element - myCurrentDemandElement = demandElement; - // call demandElementSelected function - myFrameParent->demandElementSelected(); - // Write Warning in console if we're in testing mode - WRITE_DEBUG(("Selected item '" + myDemandElementsMatchBox->getText() + "' in DemandElementSelector").text()); - return 1; - } - } - } - // if demand element selected is invalid, set demand element as null - myCurrentDemandElement = nullptr; - // call demandElementSelected function - myFrameParent->demandElementSelected(); - // change color of myDemandElementsMatchBox to red (invalid) - myDemandElementsMatchBox->setTextColor(FXRGB(255, 0, 0)); - // Write Warning in console if we're in testing mode - WRITE_DEBUG("Selected invalid item in DemandElementSelector"); - return 1; -} - -// --------------------------------------------------------------------------- -// GNEFrameModuls::HierarchicalElementTree - methods -// --------------------------------------------------------------------------- - -GNEFrameModuls::HierarchicalElementTree::HierarchicalElementTree(GNEFrame* frameParent) : - FXGroupBox(frameParent->myContentFrame, "Hierarchy", GUIDesignGroupBoxFrame), - myFrameParent(frameParent), - myHE(nullptr), - myClickedAC(nullptr), - myClickedJunction(nullptr), - myClickedEdge(nullptr), - myClickedLane(nullptr), - myClickedCrossing(nullptr), - myClickedConnection(nullptr), - myClickedShape(nullptr), - myClickedTAZElement(nullptr), - myClickedAdditional(nullptr), - myClickedDemandElement(nullptr), - myClickedDataSet(nullptr), - myClickedDataInterval(nullptr), - myClickedGenericData(nullptr) { - // Create three list - myTreeListDinamic = new FXTreeListDinamic(this, this, MID_GNE_ACHIERARCHY_SHOWCHILDMENU, GUIDesignTreeListDinamic); - hide(); -} - - -GNEFrameModuls::HierarchicalElementTree::~HierarchicalElementTree() {} - - -void -GNEFrameModuls::HierarchicalElementTree::showHierarchicalElementTree(GNEAttributeCarrier* AC) { - myHE = dynamic_cast(AC); - // show HierarchicalElementTree and refresh HierarchicalElementTree - if (myHE) { - // refresh HierarchicalElementTree - refreshHierarchicalElementTree(); - // show myTreeListDinamic - myTreeListDinamic->show(); - //show modul - show(); - } -} - - -void -GNEFrameModuls::HierarchicalElementTree::hideHierarchicalElementTree() { - // set all pointers null - myHE = nullptr; - myClickedAC = nullptr; - myClickedJunction = nullptr; - myClickedEdge = nullptr; - myClickedLane = nullptr; - myClickedCrossing = nullptr; - myClickedConnection = nullptr; - myClickedShape = nullptr; - myClickedTAZElement = nullptr; - myClickedAdditional = nullptr; - myClickedDemandElement = nullptr; - myClickedDataSet = nullptr; - myClickedDataInterval = nullptr; - myClickedGenericData = nullptr; - // hide myTreeListDinamic - myTreeListDinamic->hide(); - // hide modul - hide(); -} - - -void -GNEFrameModuls::HierarchicalElementTree::refreshHierarchicalElementTree() { - // clear items - myTreeListDinamic->clearItems(); - myTreeItemToACMap.clear(); - myTreeItemsConnections.clear(); - // show children of myHE - if (myHE) { - showHierarchicalElementChildren(myHE, showAttributeCarrierParents()); - } -} - - -void -GNEFrameModuls::HierarchicalElementTree::removeCurrentEditedAttributeCarrier(const GNEAttributeCarrier* AC) { - // simply check if AC is the same of myHE - if (AC == myHE) { - myHE = nullptr; - } -} - - -long -GNEFrameModuls::HierarchicalElementTree::onCmdShowChildMenu(FXObject*, FXSelector, void* eventData) { - // Obtain event - FXEvent* e = (FXEvent*)eventData; - // obtain FXTreeItem in the given position - FXTreeItem* item = myTreeListDinamic->getItemAt(e->win_x, e->win_y); - // open Pop-up if FXTreeItem has a Attribute Carrier vinculated - if (item && (myTreeItemsConnections.find(item) == myTreeItemsConnections.end())) { - createPopUpMenu(e->root_x, e->root_y, myTreeItemToACMap[item]); - } - return 1; -} - - -long -GNEFrameModuls::HierarchicalElementTree::onCmdCenterItem(FXObject*, FXSelector, void*) { - // Center item - if (myClickedJunction) { - myFrameParent->myViewNet->centerTo(myClickedJunction->getGlID(), true, -1); - } else if (myClickedEdge) { - myFrameParent->myViewNet->centerTo(myClickedEdge->getGlID(), true, -1); - } else if (myClickedLane) { - myFrameParent->myViewNet->centerTo(myClickedLane->getGlID(), true, -1); - } else if (myClickedCrossing) { - myFrameParent->myViewNet->centerTo(myClickedCrossing->getGlID(), true, -1); - } else if (myClickedConnection) { - myFrameParent->myViewNet->centerTo(myClickedConnection->getGlID(), true, -1); - } else if (myClickedAdditional) { - myFrameParent->myViewNet->centerTo(myClickedAdditional->getGlID(), true, -1); - } else if (myClickedShape) { - myFrameParent->myViewNet->centerTo(myClickedShape->getGlID(), true, -1); - } else if (myClickedTAZElement) { - myFrameParent->myViewNet->centerTo(myClickedTAZElement->getGlID(), true, -1); - } else if (myClickedDemandElement) { - myFrameParent->myViewNet->centerTo(myClickedDemandElement->getGlID(), true, -1); - } else if (myClickedGenericData) { - myFrameParent->myViewNet->centerTo(myClickedGenericData->getGlID(), true, -1); - } - // update view after centering - myFrameParent->myViewNet->updateViewNet(); - return 1; -} - - -long -GNEFrameModuls::HierarchicalElementTree::onCmdInspectItem(FXObject*, FXSelector, void*) { - if ((myHE != nullptr) && (myClickedAC != nullptr)) { - myFrameParent->myViewNet->getViewParent()->getInspectorFrame()->inspectChild(myClickedAC, myHE); - } - return 1; -} - - -long -GNEFrameModuls::HierarchicalElementTree::onCmdDeleteItem(FXObject*, FXSelector, void*) { - // Remove Attribute Carrier - if (myClickedJunction) { - myFrameParent->myViewNet->getNet()->deleteJunction(myClickedJunction, myFrameParent->myViewNet->getUndoList()); - } else if (myClickedEdge) { - myFrameParent->myViewNet->getNet()->deleteEdge(myClickedEdge, myFrameParent->myViewNet->getUndoList(), false); - } else if (myClickedLane) { - myFrameParent->myViewNet->getNet()->deleteLane(myClickedLane, myFrameParent->myViewNet->getUndoList(), false); - } else if (myClickedCrossing) { - myFrameParent->myViewNet->getNet()->deleteCrossing(myClickedCrossing, myFrameParent->myViewNet->getUndoList()); - } else if (myClickedConnection) { - myFrameParent->myViewNet->getNet()->deleteConnection(myClickedConnection, myFrameParent->myViewNet->getUndoList()); - } else if (myClickedAdditional) { - myFrameParent->myViewNet->getNet()->deleteAdditional(myClickedAdditional, myFrameParent->myViewNet->getUndoList()); - } else if (myClickedShape) { - myFrameParent->myViewNet->getNet()->deleteShape(myClickedShape, myFrameParent->myViewNet->getUndoList()); - } else if (myClickedTAZElement) { - myFrameParent->myViewNet->getNet()->deleteTAZElement(myClickedTAZElement, myFrameParent->myViewNet->getUndoList()); - } else if (myClickedDemandElement) { - // check that default VTypes aren't removed - if ((myClickedDemandElement->getTagProperty().getTag() == SUMO_TAG_VTYPE) && (GNEAttributeCarrier::parse(myClickedDemandElement->getAttribute(GNE_ATTR_DEFAULT_VTYPE)))) { - WRITE_WARNING("Default Vehicle Type '" + myClickedDemandElement->getAttribute(SUMO_ATTR_ID) + "' cannot be removed"); - return 1; - } else if (myClickedDemandElement->getTagProperty().isPersonPlan() && (myClickedDemandElement->getParentDemandElements().front()->getChildDemandElements().size() == 1)) { - // we need to check if we're removing the last person plan of a person. - myFrameParent->myViewNet->getNet()->deleteDemandElement(myClickedDemandElement->getParentDemandElements().front(), myFrameParent->myViewNet->getUndoList()); - } else { - myFrameParent->myViewNet->getNet()->deleteDemandElement(myClickedDemandElement, myFrameParent->myViewNet->getUndoList()); - } - } else if (myClickedDataSet) { - myFrameParent->myViewNet->getNet()->deleteDataSet(myClickedDataSet, myFrameParent->myViewNet->getUndoList()); - } else if (myClickedDataInterval) { - // check if we have to remove data Set - if (myClickedDataInterval->getDataSetParent()->getDataIntervalChildren().size() == 1) { - myFrameParent->myViewNet->getNet()->deleteDataSet(myClickedDataInterval->getDataSetParent(), myFrameParent->myViewNet->getUndoList()); - } else { - myFrameParent->myViewNet->getNet()->deleteDataInterval(myClickedDataInterval, myFrameParent->myViewNet->getUndoList()); - } - } else if (myClickedGenericData) { - // check if we have to remove interval - if (myClickedGenericData->getDataIntervalParent()->getGenericDataChildren().size() == 1) { - // check if we have to remove data Set - if (myClickedGenericData->getDataIntervalParent()->getDataSetParent()->getDataIntervalChildren().size() == 1) { - myFrameParent->myViewNet->getNet()->deleteDataSet(myClickedGenericData->getDataIntervalParent()->getDataSetParent(), myFrameParent->myViewNet->getUndoList()); - } else { - myFrameParent->myViewNet->getNet()->deleteDataInterval(myClickedGenericData->getDataIntervalParent(), myFrameParent->myViewNet->getUndoList()); - } - } else { - myFrameParent->myViewNet->getNet()->deleteGenericData(myClickedGenericData, myFrameParent->myViewNet->getUndoList()); - } - } - // update net - myFrameParent->myViewNet->updateViewNet(); - // refresh AC Hierarchy - refreshHierarchicalElementTree(); - // check if inspector frame has to be shown again - if (myFrameParent->myViewNet->getInspectedAttributeCarriers().size() == 1) { - if (myFrameParent->myViewNet->getInspectedAttributeCarriers().front() != myClickedAC) { - myFrameParent->myViewNet->getViewParent()->getInspectorFrame()->inspectSingleElement(myFrameParent->myViewNet->getInspectedAttributeCarriers().front()); - } else { - // inspect a nullprt element to reset inspector frame - myFrameParent->myViewNet->getViewParent()->getInspectorFrame()->inspectSingleElement(nullptr); - } - } - return 1; -} - - -long -GNEFrameModuls::HierarchicalElementTree::onCmdMoveItemUp(FXObject*, FXSelector, void*) { - // currently only children of demand elements can be moved - if (myClickedDemandElement) { - myFrameParent->myViewNet->getUndoList()->begin(myClickedDemandElement->getTagProperty().getGUIIcon(), ("moving up " + myClickedDemandElement->getTagStr()).c_str()); - // move element one position back - myFrameParent->myViewNet->getUndoList()->add(new GNEChange_Children(myClickedDemandElement->getParentDemandElements().at(0), myClickedDemandElement, - GNEChange_Children::Operation::MOVE_BACK), true); - myFrameParent->myViewNet->getUndoList()->end(); - } - // refresh after moving child - refreshHierarchicalElementTree(); - return 1; -} - - -long -GNEFrameModuls::HierarchicalElementTree::onCmdMoveItemDown(FXObject*, FXSelector, void*) { - // currently only children of demand elements can be moved - if (myClickedDemandElement) { - myFrameParent->myViewNet->getUndoList()->begin(myClickedDemandElement->getTagProperty().getGUIIcon(), ("moving down " + myClickedDemandElement->getTagStr()).c_str()); - // move element one position front - myFrameParent->myViewNet->getUndoList()->add(new GNEChange_Children(myClickedDemandElement->getParentDemandElements().at(0), myClickedDemandElement, - GNEChange_Children::Operation::MOVE_FRONT), true); - myFrameParent->myViewNet->getUndoList()->end(); - } - // refresh after moving child - refreshHierarchicalElementTree(); - return 1; -} - - -void -GNEFrameModuls::HierarchicalElementTree::createPopUpMenu(int X, int Y, GNEAttributeCarrier* clickedAC) { - // get attributeCarrirs - const auto& attributeCarriers = myFrameParent->myViewNet->getNet()->getAttributeCarriers(); - // first check that AC exist - if (clickedAC) { - // set current clicked AC - myClickedAC = clickedAC; - // cast all elements - myClickedJunction = attributeCarriers->retrieveJunction(clickedAC->getID(), false); - myClickedEdge = attributeCarriers->retrieveEdge(clickedAC->getID(), false); - myClickedLane = attributeCarriers->retrieveLane(clickedAC, false); - myClickedCrossing = attributeCarriers->retrieveCrossing(clickedAC, false); - myClickedConnection = attributeCarriers->retrieveConnection(clickedAC, false); - myClickedShape = attributeCarriers->retrieveShape(clickedAC, false); - myClickedTAZElement = attributeCarriers->retrieveTAZElement(clickedAC, false); - myClickedAdditional = attributeCarriers->retrieveAdditional(clickedAC, false); - myClickedDemandElement = attributeCarriers->retrieveDemandElement(clickedAC, false); - myClickedDataSet = attributeCarriers->retrieveDataSet(clickedAC, false); - myClickedDataInterval = attributeCarriers->retrieveDataInterval(clickedAC, false); - myClickedGenericData = attributeCarriers->retrieveGenericData(clickedAC, false); - // create FXMenuPane - FXMenuPane* pane = new FXMenuPane(myTreeListDinamic); - // set item name and icon - new MFXMenuHeader(pane, myFrameParent->myViewNet->getViewParent()->getGUIMainWindow()->getBoldFont(), myClickedAC->getPopUpID().c_str(), myClickedAC->getIcon()); - // insert separator - new FXMenuSeparator(pane); - // create center menu command - FXMenuCommand* centerMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Center", GUIIconSubSys::getIcon(GUIIcon::RECENTERVIEW), this, MID_GNE_CENTER); - // disable Centering for Vehicle Types, data sets and data intervals - if (myClickedAC->getTagProperty().isVehicleType() || (myClickedAC->getTagProperty().getTag() == SUMO_TAG_DATASET) || - (myClickedAC->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL)) { - centerMenuCommand->disable(); - } - // create inspect and delete menu commands - FXMenuCommand* inspectMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Inspect", GUIIconSubSys::getIcon(GUIIcon::MODEINSPECT), this, MID_GNE_INSPECT); - FXMenuCommand* deleteMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Delete", GUIIconSubSys::getIcon(GUIIcon::MODEDELETE), this, MID_GNE_DELETE); - // check if inspect and delete menu commands has to be disabled - if (GNEFrameAttributesModuls::isSupermodeValid(myFrameParent->myViewNet, myClickedAC) == false) { - inspectMenuCommand->disable(); - deleteMenuCommand->disable(); - } - // now chec if given AC support manually moving of their item up and down (Currently only for certain demand elements) - /* if (myClickedDemandElement && myClickedAC->getTagProperty().canBeSortedManually()) { - // insert separator - new FXMenuSeparator(pane); - // create both moving menu commands - FXMenuCommand* moveUpMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Move up", GUIIconSubSys::getIcon(GUIIcon::ARROW_UP), this, MID_GNE_ACHIERARCHY_MOVEUP); - FXMenuCommand* moveDownMenuCommand = GUIDesigns::buildFXMenuCommand(pane, "Move down", GUIIconSubSys::getIcon(GUIIcon::ARROW_DOWN), this, MID_GNE_ACHIERARCHY_MOVEDOWN); - // check if both commands has to be disabled - if (myClickedDemandElement->getTagProperty().isStopPerson()) { - moveUpMenuCommand->setText("Move up (Stops cannot be moved)"); - moveDownMenuCommand->setText("Move down (Stops cannot be moved)"); - moveUpMenuCommand->disable(); - moveDownMenuCommand->disable(); - } else { - // check if moveUpMenuCommand has to be disabled - if (myClickedDemandElement->getParentDemandElements().front()->getChildDemandElements().front() == myClickedDemandElement) { - moveUpMenuCommand->setText("Move up (It's already the first element)"); - moveUpMenuCommand->disable(); - } else if (myClickedDemandElement->getParentDemandElements().front()->getPreviousChildDemandElement(myClickedDemandElement)->getTagProperty().isStopPerson()) { - moveUpMenuCommand->setText("Move up (Previous element is a Stop)"); - moveUpMenuCommand->disable(); - } - // check if moveDownMenuCommand has to be disabled - if (myClickedDemandElement->getParentDemandElements().front()->getChildDemandElements().back() == myClickedDemandElement) { - moveDownMenuCommand->setText("Move down (It's already the last element)"); - moveDownMenuCommand->disable(); - } else if (myClickedDemandElement->getParentDemandElements().front()->getNextChildDemandElement(myClickedDemandElement)->getTagProperty().isStopPerson()) { - moveDownMenuCommand->setText("Move down (Next element is a Stop)"); - moveDownMenuCommand->disable(); - } - } - } */ - // Center in the mouse position and create pane - pane->setX(X); - pane->setY(Y); - pane->create(); - pane->show(); - } else { - // set all clicked elements to null - myClickedAC = nullptr; - myClickedJunction = nullptr; - myClickedEdge = nullptr; - myClickedLane = nullptr; - myClickedCrossing = nullptr; - myClickedConnection = nullptr; - myClickedShape = nullptr; - myClickedTAZElement = nullptr; - myClickedAdditional = nullptr; - myClickedDemandElement = nullptr; - myClickedDataSet = nullptr; - myClickedDataInterval = nullptr; - myClickedGenericData = nullptr; - } -} - - -FXTreeItem* -GNEFrameModuls::HierarchicalElementTree::showAttributeCarrierParents() { - // get attributeCarrirs - const auto& attributeCarriers = myFrameParent->myViewNet->getNet()->getAttributeCarriers(); - // check tags - if (myHE->getTagProperty().isNetworkElement()) { - // check demand element type - switch (myHE->getTagProperty().getTag()) { - case SUMO_TAG_EDGE: { - // obtain Edge - GNEEdge* edge = attributeCarriers->retrieveEdge(myHE->getID(), false); - if (edge) { - // insert Junctions of edge in tree (Pararell because a edge has always two Junctions) - FXTreeItem* junctionSourceItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " origin").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon()); - FXTreeItem* junctionDestinyItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " destiny").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon()); - junctionDestinyItem->setExpanded(true); - // Save items in myTreeItemToACMap - myTreeItemToACMap[junctionSourceItem] = edge->getFromJunction(); - myTreeItemToACMap[junctionDestinyItem] = edge->getToJunction(); - // return junction destiny Item - return junctionDestinyItem; - } else { - return nullptr; - } - } - case SUMO_TAG_LANE: { - // obtain lane - GNELane* lane = attributeCarriers->retrieveLane(myHE->getID(), false); - if (lane) { - // obtain parent edge - GNEEdge* edge = attributeCarriers->retrieveEdge(lane->getParentEdge()->getID()); - //inser Junctions of lane of edge in tree (Pararell because a edge has always two Junctions) - FXTreeItem* junctionSourceItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " origin").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon()); - FXTreeItem* junctionDestinyItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " destiny").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon()); - junctionDestinyItem->setExpanded(true); - // Create edge item - FXTreeItem* edgeItem = myTreeListDinamic->insertItem(nullptr, junctionDestinyItem, edge->getHierarchyName().c_str(), edge->getIcon(), edge->getIcon()); - edgeItem->setExpanded(true); - // Save items in myTreeItemToACMap - myTreeItemToACMap[junctionSourceItem] = edge->getFromJunction(); - myTreeItemToACMap[junctionDestinyItem] = edge->getToJunction(); - myTreeItemToACMap[edgeItem] = edge; - // return edge item - return edgeItem; - } else { - return nullptr; - } - } - case SUMO_TAG_CROSSING: { - // obtain crossing parent junction - GNEJunction* junction = attributeCarriers->retrieveCrossing(myHE)->getParentJunction(); - // create junction item - FXTreeItem* junctionItem = myTreeListDinamic->insertItem(nullptr, nullptr, junction->getHierarchyName().c_str(), junction->getIcon(), junction->getIcon()); - junctionItem->setExpanded(true); - // Save items in myTreeItemToACMap - myTreeItemToACMap[junctionItem] = junction; - // return junction Item - return junctionItem; - } - case SUMO_TAG_CONNECTION: { - // obtain Connection - GNEConnection* connection = attributeCarriers->retrieveConnection(myHE->getID(), false); - if (connection) { - // create edge from item - FXTreeItem* edgeFromItem = myTreeListDinamic->insertItem(nullptr, nullptr, connection->getEdgeFrom()->getHierarchyName().c_str(), connection->getEdgeFrom()->getIcon(), connection->getEdgeFrom()->getIcon()); - edgeFromItem->setExpanded(true); - // create edge to item - FXTreeItem* edgeToItem = myTreeListDinamic->insertItem(nullptr, nullptr, connection->getEdgeTo()->getHierarchyName().c_str(), connection->getEdgeTo()->getIcon(), connection->getEdgeTo()->getIcon()); - edgeToItem->setExpanded(true); - // create connection item - FXTreeItem* connectionItem = myTreeListDinamic->insertItem(nullptr, edgeToItem, connection->getHierarchyName().c_str(), connection->getIcon(), connection->getIcon()); - connectionItem->setExpanded(true); - // Save items in myTreeItemToACMap - myTreeItemToACMap[edgeFromItem] = connection->getEdgeFrom(); - myTreeItemToACMap[edgeToItem] = connection->getEdgeTo(); - myTreeItemToACMap[connectionItem] = connection; - // return connection item - return connectionItem; - } else { - return nullptr; - } - } - default: - break; - } - } else if (myHE->getTagProperty().getTag() == GNE_TAG_POILANE) { - // Obtain POILane - const GNEShape* POILane = myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveShape(myHE); - // obtain parent lane - GNELane* lane = attributeCarriers->retrieveLane(POILane->getParentLanes().at(0)->getID()); - // obtain parent edge - GNEEdge* edge = attributeCarriers->retrieveEdge(lane->getParentEdge()->getID()); - //inser Junctions of lane of edge in tree (Pararell because a edge has always two Junctions) - FXTreeItem* junctionSourceItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " origin").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon()); - FXTreeItem* junctionDestinyItem = myTreeListDinamic->insertItem(nullptr, nullptr, (edge->getFromJunction()->getHierarchyName() + " destiny").c_str(), edge->getFromJunction()->getIcon(), edge->getFromJunction()->getIcon()); - junctionDestinyItem->setExpanded(true); - // Create edge item - FXTreeItem* edgeItem = myTreeListDinamic->insertItem(nullptr, junctionDestinyItem, edge->getHierarchyName().c_str(), edge->getIcon(), edge->getIcon()); - edgeItem->setExpanded(true); - // Create lane item - FXTreeItem* laneItem = myTreeListDinamic->insertItem(nullptr, edgeItem, lane->getHierarchyName().c_str(), lane->getIcon(), lane->getIcon()); - laneItem->setExpanded(true); - // Save items in myTreeItemToACMap - myTreeItemToACMap[junctionSourceItem] = edge->getFromJunction(); - myTreeItemToACMap[junctionDestinyItem] = edge->getToJunction(); - myTreeItemToACMap[edgeItem] = edge; - myTreeItemToACMap[laneItem] = lane; - // return Lane item - return laneItem; - } else if (myHE->getTagProperty().isAdditionalElement()) { - // Obtain Additional - const GNEAdditional* additional = attributeCarriers->retrieveAdditional(myHE); - // declare auxiliar FXTreeItem, due a demand element can have multiple "roots" - FXTreeItem* root = nullptr; - // check if there is demand elements parents - if (additional->getParentAdditionals().size() > 0) { - // check if we have more than one edge - if (additional->getParentAdditionals().size() > 1) { - // insert first item - addListItem(additional->getParentAdditionals().front()); - // insert "spacer" - if (additional->getParentAdditionals().size() > 2) { - addListItem(nullptr, ("..." + toString((int)additional->getParentAdditionals().size() - 2) + " additionals...").c_str(), 0, false); - } - } - // return last inserted item - root = addListItem(additional->getParentAdditionals().back()); - } - // check if there is parent demand elements - if (additional->getParentDemandElements().size() > 0) { - // check if we have more than one demand element - if (additional->getParentDemandElements().size() > 1) { - // insert first item - addListItem(additional->getParentDemandElements().front()); - // insert "spacer" - if (additional->getParentDemandElements().size() > 2) { - addListItem(nullptr, ("..." + toString((int)additional->getParentDemandElements().size() - 2) + " demand elements...").c_str(), 0, false); - } - } - // return last inserted item - root = addListItem(additional->getParentDemandElements().back()); - } - // check if there is parent edges - if (additional->getParentEdges().size() > 0) { - // check if we have more than one edge - if (additional->getParentEdges().size() > 1) { - // insert first item - addListItem(additional->getParentEdges().front()); - // insert "spacer" - if (additional->getParentEdges().size() > 2) { - addListItem(nullptr, ("..." + toString((int)additional->getParentEdges().size() - 2) + " edges...").c_str(), 0, false); - } - } - // return last inserted item - root = addListItem(additional->getParentEdges().back()); - } - // check if there is parent lanes - if (additional->getParentLanes().size() > 0) { - // check if we have more than one parent lane - if (additional->getParentLanes().size() > 1) { - // insert first item - addListItem(additional->getParentLanes().front()); - // insert "spacer" - if (additional->getParentLanes().size() > 2) { - addListItem(nullptr, ("..." + toString((int)additional->getParentLanes().size() - 2) + " lanes...").c_str(), 0, false); - } - } - // return last inserted item - root = addListItem(additional->getParentLanes().back()); - } - // return last inserted list item - return root; - } else if (myHE->getTagProperty().isTAZElement()) { - // Obtain TAZElement - const GNETAZElement* TAZElement = myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveTAZElement(myHE); - // declare auxiliar FXTreeItem, due a demand element can have multiple "roots" - FXTreeItem* root = nullptr; - // check if there is demand elements parents - if (TAZElement->getParentTAZElements().size() > 0) { - // check if we have more than one edge - if (TAZElement->getParentTAZElements().size() > 1) { - // insert first item - addListItem(TAZElement->getParentTAZElements().front()); - // insert "spacer" - if (TAZElement->getParentTAZElements().size() > 2) { - addListItem(nullptr, ("..." + toString((int)TAZElement->getParentTAZElements().size() - 2) + " TAZElements...").c_str(), 0, false); - } - } - // return last inserted item - root = addListItem(TAZElement->getParentTAZElements().back()); - } - // check if there is parent demand elements - if (TAZElement->getParentDemandElements().size() > 0) { - // check if we have more than one demand element - if (TAZElement->getParentDemandElements().size() > 1) { - // insert first item - addListItem(TAZElement->getParentDemandElements().front()); - // insert "spacer" - if (TAZElement->getParentDemandElements().size() > 2) { - addListItem(nullptr, ("..." + toString((int)TAZElement->getParentDemandElements().size() - 2) + " demand elements...").c_str(), 0, false); - } - } - // return last inserted item - root = addListItem(TAZElement->getParentDemandElements().back()); - } - // check if there is parent edges - if (TAZElement->getParentEdges().size() > 0) { - // check if we have more than one edge - if (TAZElement->getParentEdges().size() > 1) { - // insert first item - addListItem(TAZElement->getParentEdges().front()); - // insert "spacer" - if (TAZElement->getParentEdges().size() > 2) { - addListItem(nullptr, ("..." + toString((int)TAZElement->getParentEdges().size() - 2) + " edges...").c_str(), 0, false); - } - } - // return last inserted item - root = addListItem(TAZElement->getParentEdges().back()); - } - // check if there is parent lanes - if (TAZElement->getParentLanes().size() > 0) { - // check if we have more than one parent lane - if (TAZElement->getParentLanes().size() > 1) { - // insert first item - addListItem(TAZElement->getParentLanes().front()); - // insert "spacer" - if (TAZElement->getParentLanes().size() > 2) { - addListItem(nullptr, ("..." + toString((int)TAZElement->getParentLanes().size() - 2) + " lanes...").c_str(), 0, false); - } - } - // return last inserted item - root = addListItem(TAZElement->getParentLanes().back()); - } - // return last inserted list item - return root; - } else if (myHE->getTagProperty().isDemandElement()) { - // Obtain DemandElement - GNEDemandElement* demandElement = myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveDemandElement(myHE); - // declare auxiliar FXTreeItem, due a demand element can have multiple "roots" - FXTreeItem* root = nullptr; - // check if there are demand element parents - if (demandElement->getParentAdditionals().size() > 0) { - // check if we have more than one edge - if (demandElement->getParentAdditionals().size() > 1) { - // insert first item - addListItem(demandElement->getParentAdditionals().front()); - // insert "spacer" - if (demandElement->getParentAdditionals().size() > 2) { - addListItem(nullptr, ("..." + toString((int)demandElement->getParentAdditionals().size() - 2) + " additionals...").c_str(), 0, false); - } - } - // return last inserted item - root = addListItem(demandElement->getParentAdditionals().back()); - } - // check if there is parent demand elements - if (demandElement->getParentDemandElements().size() > 0) { - // check if we have more than one demand element - if (demandElement->getParentDemandElements().size() > 1) { - // insert first item - addListItem(demandElement->getParentDemandElements().front()); - // insert "spacer" - if (demandElement->getParentDemandElements().size() > 2) { - addListItem(nullptr, ("..." + toString((int)demandElement->getParentDemandElements().size() - 2) + " demand elements...").c_str(), 0, false); - } - } - // return last inserted item - root = addListItem(demandElement->getParentDemandElements().back()); - } - // check if there is parent edges - if (demandElement->getParentEdges().size() > 0) { - // check if we have more than one edge - if (demandElement->getParentEdges().size() > 1) { - // insert first item - addListItem(demandElement->getParentEdges().front()); - // insert "spacer" - if (demandElement->getParentEdges().size() > 2) { - addListItem(nullptr, ("..." + toString((int)demandElement->getParentEdges().size() - 2) + " edges...").c_str(), 0, false); - } - } - // return last inserted item - root = addListItem(demandElement->getParentEdges().back()); - } - // check if there is parent lanes - if (demandElement->getParentLanes().size() > 0) { - // check if we have more than one parent lane - if (demandElement->getParentLanes().size() > 1) { - // insert first item - addListItem(demandElement->getParentLanes().front()); - // insert "spacer" - if (demandElement->getParentLanes().size() > 2) { - addListItem(nullptr, ("..." + toString((int)demandElement->getParentLanes().size() - 2) + " lanes...").c_str(), 0, false); - } - } - // return last inserted item - root = addListItem(demandElement->getParentLanes().back()); - } - // return last inserted list item - return root; - } else if (myHE->getTagProperty().isDataElement()) { - // check if is a GNEDataInterval or a GNEGenericData - if (myHE->getTagProperty().getTag() == SUMO_TAG_DATASET) { - return nullptr; - } else if (myHE->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) { - return addListItem(myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveDataSet(myHE->getID())); - } else { - // Obtain DataElement - GNEGenericData* dataElement = dynamic_cast(myHE); - if (dataElement) { - // declare auxiliar FXTreeItem, due a data element can have multiple "roots" - FXTreeItem* root = nullptr; - // set dataset - addListItem(dataElement->getDataIntervalParent()->getDataSetParent()); - // set data interval - addListItem(dataElement->getDataIntervalParent()); - // check if there is data elements parents - if (dataElement->getParentAdditionals().size() > 0) { - // check if we have more than one edge - if (dataElement->getParentAdditionals().size() > 1) { - // insert first item - addListItem(dataElement->getParentAdditionals().front()); - // insert "spacer" - if (dataElement->getParentAdditionals().size() > 2) { - addListItem(nullptr, ("..." + toString((int)dataElement->getParentAdditionals().size() - 2) + " additionals...").c_str(), 0, false); - } - } - // return last inserted item - root = addListItem(dataElement->getParentAdditionals().back()); - } - // check if there is parent demand elements - if (dataElement->getParentDemandElements().size() > 0) { - // check if we have more than one demand element - if (dataElement->getParentDemandElements().size() > 1) { - // insert first item - addListItem(dataElement->getParentDemandElements().front()); - // insert "spacer" - if (dataElement->getParentDemandElements().size() > 2) { - addListItem(nullptr, ("..." + toString((int)dataElement->getParentDemandElements().size() - 2) + " demand elements...").c_str(), 0, false); - } - } - // return last inserted item - root = addListItem(dataElement->getParentDemandElements().back()); - } - // check if there is parent edges - if (dataElement->getParentEdges().size() > 0) { - // check if we have more than one edge - if (dataElement->getParentEdges().size() > 1) { - // insert first ege - if (dataElement->getTagProperty().getTag() == SUMO_TAG_EDGEREL) { - addListItem(dataElement->getParentEdges().front(), nullptr, "from "); - } else { - addListItem(dataElement->getParentEdges().front()); - } - // insert "spacer" - if (dataElement->getParentEdges().size() > 2) { - addListItem(nullptr, ("..." + toString((int)dataElement->getParentEdges().size() - 2) + " edges...").c_str(), 0, false); - } - } - // insert last ege - if (dataElement->getTagProperty().getTag() == SUMO_TAG_EDGEREL) { - addListItem(dataElement->getParentEdges().back(), nullptr, "to "); - } else { - addListItem(dataElement->getParentEdges().back()); - } - } - // check if there is parent lanes - if (dataElement->getParentLanes().size() > 0) { - // check if we have more than one parent lane - if (dataElement->getParentLanes().size() > 1) { - // insert first item - addListItem(dataElement->getParentLanes().front()); - // insert "spacer" - if (dataElement->getParentLanes().size() > 2) { - addListItem(nullptr, ("..." + toString((int)dataElement->getParentLanes().size() - 2) + " lanes...").c_str(), 0, false); - } - } - // return last inserted item - root = addListItem(dataElement->getParentLanes().back()); - } - // return last inserted list item - return root; - } - } - } - // there aren't parents - return nullptr; -} - - -void -GNEFrameModuls::HierarchicalElementTree::showHierarchicalElementChildren(GNEHierarchicalElement* HE, FXTreeItem* itemParent) { - if (HE->getTagProperty().isNetworkElement()) { - // Switch gl type of ac - switch (HE->getTagProperty().getTag()) { - case SUMO_TAG_JUNCTION: { - // retrieve junction - GNEJunction* junction = myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveJunction(HE->getID(), false); - if (junction) { - // insert junction item - FXTreeItem* junctionItem = addListItem(HE, itemParent); - // insert edges - for (const auto& edge : junction->getChildEdges()) { - showHierarchicalElementChildren(edge, junctionItem); - } - // insert crossings - for (const auto& crossing : junction->getGNECrossings()) { - showHierarchicalElementChildren(crossing, junctionItem); - } - } - break; - } - case SUMO_TAG_EDGE: { - // retrieve edge - GNEEdge* edge = myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveEdge(HE->getID(), false); - if (edge) { - // insert edge item - FXTreeItem* edgeItem = addListItem(HE, itemParent); - // insert lanes - for (const auto& lane : edge->getLanes()) { - showHierarchicalElementChildren(lane, edgeItem); - } - // insert child additional - for (const auto& additional : edge->getChildAdditionals()) { - showHierarchicalElementChildren(additional, edgeItem); - } - // insert child shapes - for (const auto& shape : edge->getChildShapes()) { - showHierarchicalElementChildren(shape, edgeItem); - } - // insert child TAZElements - for (const auto& TAZElement : edge->getChildTAZElements()) { - // use addListItem because TAZElement doesn't have children - addListItem(TAZElement, edgeItem); - } - // insert child demand elements - for (const auto& demandElement : edge->getChildDemandElements()) { - showHierarchicalElementChildren(demandElement, edgeItem); - } - /* - CHECK THIS - - // insert demand elements children (note: use getChildDemandElementsSortedByType to avoid duplicated elements) - for (const auto& route : edge->getChildDemandElementsByType(SUMO_TAG_ROUTE)) { - showHierarchicalElementChildren(route, edgeItem); - } - for (const auto& trip : edge->getChildDemandElementsByType(SUMO_TAG_TRIP)) { - showHierarchicalElementChildren(trip, edgeItem); - } - for (const auto& flow : edge->getChildDemandElementsByType(SUMO_TAG_FLOW)) { - showHierarchicalElementChildren(flow, edgeItem); - } - */ - // show data elements - for (const auto& genericDatas : edge->getChildGenericDatas()) { - showHierarchicalElementChildren(genericDatas, edgeItem); - } - } - break; - } - case SUMO_TAG_LANE: { - // retrieve lane - GNELane* lane = myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveLane(HE->getID(), false); - if (lane) { - // insert lane item - FXTreeItem* laneItem = addListItem(HE, itemParent); - // insert child additional - for (const auto& additional : lane->getChildAdditionals()) { - showHierarchicalElementChildren(additional, laneItem); - } - // insert child shapes - for (const auto& shape : lane->getChildShapes()) { - showHierarchicalElementChildren(shape, laneItem); - } - // insert child TAZElements - for (const auto& TAZElement : lane->getChildTAZElements()) { - // use addListItem because TAZElement doesn't have children - addListItem(TAZElement, laneItem); - } - // insert demand elements children - for (const auto& demandElement : lane->getChildDemandElements()) { - showHierarchicalElementChildren(demandElement, laneItem); - } - // insert incoming connections of lanes (by default isn't expanded) - if (lane->getGNEIncomingConnections().size() > 0) { - std::vector incomingLaneConnections = lane->getGNEIncomingConnections(); - // insert intermediate list item - FXTreeItem* incomingConnections = addListItem(laneItem, "Incomings", incomingLaneConnections.front()->getIcon(), false); - // insert incoming connections - for (const auto& connection : incomingLaneConnections) { - showHierarchicalElementChildren(connection, incomingConnections); - } - } - // insert outcoming connections of lanes (by default isn't expanded) - if (lane->getGNEOutcomingConnections().size() > 0) { - std::vector outcomingLaneConnections = lane->getGNEOutcomingConnections(); - // insert intermediate list item - FXTreeItem* outgoingConnections = addListItem(laneItem, "Outgoing", outcomingLaneConnections.front()->getIcon(), false); - // insert outcoming connections - for (const auto& connection : outcomingLaneConnections) { - showHierarchicalElementChildren(connection, outgoingConnections); - } - } - } - break; - } - case SUMO_TAG_CROSSING: - case SUMO_TAG_CONNECTION: { - // insert connection item - addListItem(HE, itemParent); - break; - } - default: - break; - } - } else if (HE->getTagProperty().isAdditionalElement() || HE->getTagProperty().isShape() || HE->getTagProperty().isTAZElement() || HE->getTagProperty().isDemandElement()) { - // insert additional item - FXTreeItem* treeItem = addListItem(HE, itemParent); - // insert child edges - for (const auto& edge : HE->getChildEdges()) { - showHierarchicalElementChildren(edge, treeItem); - } - // insert child lanes - for (const auto& lane : HE->getChildLanes()) { - showHierarchicalElementChildren(lane, treeItem); - } - // insert additional symbols - std::vector symbols; - for (const auto& additional : HE->getChildAdditionals()) { - if (additional->getTagProperty().isSymbol()) { - symbols.push_back(additional); - } - } - if (symbols.size() > 0) { - // insert intermediate list item - const auto additionalParent = symbols.front()->getParentAdditionals().front(); - const std::string symbolType = additionalParent->getTagProperty().hasAttribute(SUMO_ATTR_EDGES) ? "Edges" : "Lanes"; - GUIIcon symbolIcon = additionalParent->getTagProperty().hasAttribute(SUMO_ATTR_EDGES) ? GUIIcon::EDGE : GUIIcon::LANE; - FXTreeItem* symbolListItem = addListItem(treeItem, symbolType, GUIIconSubSys::getIcon(symbolIcon), false); - // insert symbols - for (const auto& symbol : symbols) { - showHierarchicalElementChildren(symbol, symbolListItem); - } - } - // insert additional children - for (const auto& additional : HE->getChildAdditionals()) { - if (!additional->getTagProperty().isSymbol()) { - showHierarchicalElementChildren(additional, treeItem); - } - } - // insert child shapes - for (const auto& shape : HE->getChildShapes()) { - showHierarchicalElementChildren(shape, treeItem); - } - // insert TAZElements children - for (const auto& TAZElement : HE->getChildTAZElements()) { - // use addListItem because TAZElement doesn't have children - addListItem(TAZElement, treeItem); - } - // insert child demand elements - for (const auto& demandElement : HE->getChildDemandElements()) { - showHierarchicalElementChildren(demandElement, treeItem); - } - } else if (HE->getTagProperty().isDataElement()) { - // insert data item - FXTreeItem* dataElementItem = addListItem(HE, itemParent); - // insert intervals - if (HE->getTagProperty().getTag() == SUMO_TAG_DATASET) { - GNEDataSet* dataSet = myFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveDataSet(HE->getID()); - // iterate over intevals - for (const auto& interval : dataSet->getDataIntervalChildren()) { - showHierarchicalElementChildren(interval.second, dataElementItem); - } - } else if (HE->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) { - GNEDataInterval* dataInterval = dynamic_cast(HE); - // iterate over generic datas - for (const auto& genericData : dataInterval->getGenericDataChildren()) { - showHierarchicalElementChildren(genericData, dataElementItem); - } - } - } -} - - -FXTreeItem* -GNEFrameModuls::HierarchicalElementTree::addListItem(GNEAttributeCarrier* AC, FXTreeItem* itemParent, std::string prefix, std::string sufix) { - // insert item in Tree list - FXTreeItem* item = myTreeListDinamic->insertItem(nullptr, itemParent, (prefix + AC->getHierarchyName() + sufix).c_str(), AC->getIcon(), AC->getIcon()); - // insert item in map - myTreeItemToACMap[item] = AC; - // by default item is expanded - item->setExpanded(true); - // return created FXTreeItem - return item; -} - - -FXTreeItem* -GNEFrameModuls::HierarchicalElementTree::addListItem(FXTreeItem* itemParent, const std::string& text, FXIcon* icon, bool expanded) { - // insert item in Tree list - FXTreeItem* item = myTreeListDinamic->insertItem(nullptr, itemParent, text.c_str(), icon, icon); - // expand item depending of flag expanded - item->setExpanded(expanded); - // return created FXTreeItem - return item; -} - -// --------------------------------------------------------------------------- -// GNEFrameModuls::DrawingShape - methods -// --------------------------------------------------------------------------- - -GNEFrameModuls::DrawingShape::DrawingShape(GNEFrame* frameParent) : - FXGroupBox(frameParent->myContentFrame, "Drawing", GUIDesignGroupBoxFrame), - myFrameParent(frameParent), - myDeleteLastCreatedPoint(false) { - // create start and stop buttons - myStartDrawingButton = new FXButton(this, "Start drawing", 0, this, MID_GNE_STARTDRAWING, GUIDesignButton); - myStopDrawingButton = new FXButton(this, "Stop drawing", 0, this, MID_GNE_STOPDRAWING, GUIDesignButton); - myAbortDrawingButton = new FXButton(this, "Abort drawing", 0, this, MID_GNE_ABORTDRAWING, GUIDesignButton); - // create information label - std::ostringstream information; - information - << "- 'Start drawing' or ENTER\n" - << " to create shape.\n" - << "- 'Stop drawing' or ENTER to\n" - << " finish shape creation.\n" - << "- 'Abort drawing' or ESC to\n" - << " abort shape creation.\n" - << "- 'Shift + Click' to remove\n" - << " last inserted point."; - myInformationLabel = new FXLabel(this, information.str().c_str(), 0, GUIDesignLabelFrameInformation); - // disable stop and abort functions as init - myStopDrawingButton->disable(); - myAbortDrawingButton->disable(); -} - - -GNEFrameModuls::DrawingShape::~DrawingShape() {} - - -void GNEFrameModuls::DrawingShape::showDrawingShape() { - // abort current drawing before show - abortDrawing(); - // show FXGroupBox - FXGroupBox::show(); -} - - -void GNEFrameModuls::DrawingShape::hideDrawingShape() { - // abort current drawing before hide - abortDrawing(); - // show FXGroupBox - FXGroupBox::hide(); -} - - -void -GNEFrameModuls::DrawingShape::startDrawing() { - // Only start drawing if DrawingShape modul is shown - if (shown()) { - // change buttons - myStartDrawingButton->disable(); - myStopDrawingButton->enable(); - myAbortDrawingButton->enable(); - } -} - - -void -GNEFrameModuls::DrawingShape::stopDrawing() { - // try to build shape - if (myFrameParent->shapeDrawed()) { - // clear created points - myTemporalShape.clear(); - // change buttons - myStartDrawingButton->enable(); - myStopDrawingButton->disable(); - myAbortDrawingButton->disable(); - } else { - // abort drawing if shape cannot be created - abortDrawing(); - } -} - - -void -GNEFrameModuls::DrawingShape::abortDrawing() { - // clear created points - myTemporalShape.clear(); - // change buttons - myStartDrawingButton->enable(); - myStopDrawingButton->disable(); - myAbortDrawingButton->disable(); -} - - -void -GNEFrameModuls::DrawingShape::addNewPoint(const Position& P) { - if (myStopDrawingButton->isEnabled()) { - myTemporalShape.push_back(P); - } else { - throw ProcessError("A new point cannot be added if drawing wasn't started"); - } -} - - -void -GNEFrameModuls::DrawingShape::removeLastPoint() { - if (myTemporalShape.size() > 1) { - myTemporalShape.pop_back(); - } -} - - -const PositionVector& -GNEFrameModuls::DrawingShape::getTemporalShape() const { - return myTemporalShape; -} - - -bool -GNEFrameModuls::DrawingShape::isDrawing() const { - return myStopDrawingButton->isEnabled(); -} - - -void -GNEFrameModuls::DrawingShape::setDeleteLastCreatedPoint(bool value) { - myDeleteLastCreatedPoint = value; -} - - -bool -GNEFrameModuls::DrawingShape::getDeleteLastCreatedPoint() { - return myDeleteLastCreatedPoint; -} - - -long -GNEFrameModuls::DrawingShape::onCmdStartDrawing(FXObject*, FXSelector, void*) { - startDrawing(); - return 0; -} - - -long -GNEFrameModuls::DrawingShape::onCmdStopDrawing(FXObject*, FXSelector, void*) { - stopDrawing(); - return 0; -} - - -long -GNEFrameModuls::DrawingShape::onCmdAbortDrawing(FXObject*, FXSelector, void*) { - abortDrawing(); - return 0; -} - -// --------------------------------------------------------------------------- -// GNEFrameModuls::SelectorParent - methods -// --------------------------------------------------------------------------- - -GNEFrameModuls::SelectorParent::SelectorParent(GNEFrame* frameParent) : - FXGroupBox(frameParent->myContentFrame, "Parent selector", GUIDesignGroupBoxFrame), - myFrameParent(frameParent) { - // Create label with the type of SelectorParent - myParentsLabel = new FXLabel(this, "No additional selected", nullptr, GUIDesignLabelLeftThick); - // Create list - myParentsList = new FXList(this, this, MID_GNE_SET_TYPE, GUIDesignListSingleElementFixedHeight); - // Hide List - hideSelectorParentModul(); -} - - -GNEFrameModuls::SelectorParent::~SelectorParent() {} - - -std::string -GNEFrameModuls::SelectorParent::getIdSelected() const { - for (int i = 0; i < myParentsList->getNumItems(); i++) { - if (myParentsList->isItemSelected(i)) { - return myParentsList->getItem(i)->getText().text(); - } - } - return ""; -} - - -void -GNEFrameModuls::SelectorParent::setIDSelected(const std::string& id) { - // first unselect all - for (int i = 0; i < myParentsList->getNumItems(); i++) { - myParentsList->getItem(i)->setSelected(false); - } - // select element if correspond to given ID - for (int i = 0; i < myParentsList->getNumItems(); i++) { - if (myParentsList->getItem(i)->getText().text() == id) { - myParentsList->getItem(i)->setSelected(true); - } - } - // recalc myFirstParentsList - myParentsList->recalc(); -} - - -bool -GNEFrameModuls::SelectorParent::showSelectorParentModul(const std::vector& additionalTypeParents) { - // make sure that we're editing an additional tag - const auto listOfTags = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::TagType::ADDITIONALELEMENT, false); - for (const auto& tagIt : listOfTags) { - if (std::find(additionalTypeParents.begin(), additionalTypeParents.end(), tagIt.first.getTag()) != additionalTypeParents.end()) { - myParentTags = additionalTypeParents; - myParentsLabel->setText(("Parent type: " + tagIt.second).c_str()); - refreshSelectorParentModul(); - show(); - return true; - } - } - return false; -} - - -void -GNEFrameModuls::SelectorParent::hideSelectorParentModul() { - myParentTags.clear(); - hide(); -} - - -void -GNEFrameModuls::SelectorParent::refreshSelectorParentModul() { - // save current edited elements - std::set selectedItems; - for (int i = 0; i < myParentsList->getNumItems(); i++) { - if (myParentsList->isItemSelected(i)) { - selectedItems.insert(myParentsList->getItem(i)->getText().text()); - } - } - myParentsList->clearItems(); - if (myParentTags.size() > 0) { - // insert additionals sorted - std::set IDs; - // fill list with IDs of additionals - for (const auto& parentTag : myParentTags) { - for (const auto& additional : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getAdditionals().at(parentTag)) { - IDs.insert(additional->getID().c_str()); - } - } - // fill list with IDs of additionals - for (const auto& ID : IDs) { - const int item = myParentsList->appendItem(ID.c_str()); - if (selectedItems.find(ID) != selectedItems.end()) { - myParentsList->selectItem(item); - } - } - } -} - -// --------------------------------------------------------------------------- -// GNEFrameModuls::OverlappedInspection - methods -// --------------------------------------------------------------------------- - -GNEFrameModuls::OverlappedInspection::OverlappedInspection(GNEFrame* frameParent) : - FXGroupBox(frameParent->myContentFrame, "Overlapped elements", GUIDesignGroupBoxFrame), - myFrameParent(frameParent), - myFilteredTag(SUMO_TAG_NOTHING), - myItemIndex(0) { - // build elements - buildFXElements(); -} - - -GNEFrameModuls::OverlappedInspection::OverlappedInspection(GNEFrame* frameParent, const SumoXMLTag filteredTag) : - FXGroupBox(frameParent->myContentFrame, ("Overlapped " + toString(filteredTag) + "s").c_str(), GUIDesignGroupBoxFrame), - myFrameParent(frameParent), - myFilteredTag(filteredTag), - myItemIndex(0) { - // build elements - buildFXElements(); -} - - -GNEFrameModuls::OverlappedInspection::~OverlappedInspection() {} - - -void -GNEFrameModuls::OverlappedInspection::showOverlappedInspection(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const Position& clickedPosition) { - // first clear myOverlappedACs - myOverlappedACs.clear(); - // reserve - myOverlappedACs.reserve(objectsUnderCursor.getClickedAttributeCarriers().size()); - // iterate over objects under cursor - for (const auto& AC : objectsUnderCursor.getClickedAttributeCarriers()) { - bool insert = true; - // check supermode demand - if (myFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand() && - !AC->getTagProperty().isDemandElement()) { - insert = false; - } - // check supermode data - if (myFrameParent->getViewNet()->getEditModes().isCurrentSupermodeData() && - !AC->getTagProperty().isGenericData()) { - insert = false; - } - // check filter - if ((myFilteredTag != SUMO_TAG_NOTHING) && (AC->getTagProperty().getTag() != myFilteredTag)) { - insert = false; - } - if (insert) { - myOverlappedACs.push_back(AC); - } - } - // continue depending of number of myOverlappedACs - if (myOverlappedACs.size() > 1) { - mySavedClickedPosition = clickedPosition; - // by default we inspect first element - myItemIndex = 0; - // update text of current index button - myCurrentIndexButton->setText(("1 / " + toString(myOverlappedACs.size())).c_str()); - // clear and fill list again - myOverlappedElementList->clearItems(); - for (int i = 0; i < (int)myOverlappedACs.size(); i++) { - myOverlappedElementList->insertItem(i, myOverlappedACs.at(i)->getID().c_str(), myOverlappedACs.at(i)->getIcon()); - } - // set first element as selected element - myOverlappedElementList->getItem(0)->setSelected(TRUE); - // by default list hidden - myOverlappedElementList->hide(); - // show OverlappedInspection modul - show(); - } else { - // hide OverlappedInspection modul - hide(); - } -} - - -void -GNEFrameModuls::OverlappedInspection::hideOverlappedInspection() { - // hide OverlappedInspection modul - hide(); -} - - -bool -GNEFrameModuls::OverlappedInspection::overlappedInspectionShown() const { - // show OverlappedInspection modul - return shown(); -} - - -int -GNEFrameModuls::OverlappedInspection::getNumberOfOverlappedACs() const { - return (int)myOverlappedACs.size(); -} - - -bool -GNEFrameModuls::OverlappedInspection::checkSavedPosition(const Position& clickedPosition) const { - return (mySavedClickedPosition.distanceSquaredTo2D(clickedPosition) < 0.25); -} - - -bool -GNEFrameModuls::OverlappedInspection::nextElement(const Position& clickedPosition) { - // first check if OverlappedInspection is shown - if (shown()) { - // check if given position is near saved position - if (checkSavedPosition(clickedPosition)) { - // inspect next element - onCmdNextElement(0, 0, 0); - return true; - } else { - return false; - } - } else { - return false; - } -} - - -bool -GNEFrameModuls::OverlappedInspection::previousElement(const Position& clickedPosition) { - // first check if OverlappedInspection is shown - if (shown()) { - // check if given position is near saved position - if (checkSavedPosition(clickedPosition)) { - // inspect previousElement - onCmdPreviousElement(0, 0, 0); - return true; - } else { - return false; - } - } else { - return false; - } -} - - -long -GNEFrameModuls::OverlappedInspection::onCmdPreviousElement(FXObject*, FXSelector, void*) { - // check if there is items - if (myOverlappedElementList->getNumItems() > 0) { - // unselect current list element - myOverlappedElementList->getItem((int)myItemIndex)->setSelected(FALSE); - // set index (it works as a ring) - if (myItemIndex > 0) { - myItemIndex--; - } else { - myItemIndex = (myOverlappedACs.size() - 1); - } - // selected current list element - myOverlappedElementList->getItem((int)myItemIndex)->setSelected(TRUE); - myOverlappedElementList->update(); - // update current index button - myCurrentIndexButton->setText((toString(myItemIndex + 1) + " / " + toString(myOverlappedACs.size())).c_str()); - // inspect overlapped attribute carrier - myFrameParent->selectedOverlappedElement(myOverlappedACs.at(myItemIndex)); - // show OverlappedInspection again (because it's hidden in inspectSingleElement) - show(); - } - return 1; -} - - -long -GNEFrameModuls::OverlappedInspection::onCmdNextElement(FXObject*, FXSelector, void*) { - // check if there is items - if (myOverlappedElementList->getNumItems() > 0) { - // unselect current list element - myOverlappedElementList->getItem((int)myItemIndex)->setSelected(FALSE); - // set index (it works as a ring) - myItemIndex = (myItemIndex + 1) % myOverlappedACs.size(); - // selected current list element - myOverlappedElementList->getItem((int)myItemIndex)->setSelected(TRUE); - myOverlappedElementList->update(); - // update current index button - myCurrentIndexButton->setText((toString(myItemIndex + 1) + " / " + toString(myOverlappedACs.size())).c_str()); - // inspect overlapped attribute carrier - myFrameParent->selectedOverlappedElement(myOverlappedACs.at(myItemIndex)); - // show OverlappedInspection again (because it's hidden in inspectSingleElement) - show(); - } - return 1; -} - - -long -GNEFrameModuls::OverlappedInspection::onCmdShowList(FXObject*, FXSelector, void*) { - // show or hidde element list - if (myOverlappedElementList->shown()) { - myOverlappedElementList->hide(); - } else { - myOverlappedElementList->show(); - } - if (myOverlappedElementList->getNumItems() <= 10) { - myOverlappedElementList->setHeight(23 * myOverlappedElementList->getNumItems()); - } else { - myOverlappedElementList->setHeight(230); - } - myOverlappedElementList->recalc(); - // recalc and update frame - recalc(); - return 1; -} - -long -GNEFrameModuls::OverlappedInspection::onCmdListItemSelected(FXObject*, FXSelector, void*) { - for (int i = 0; i < myOverlappedElementList->getNumItems(); i++) { - if (myOverlappedElementList->getItem(i)->isSelected()) { - myItemIndex = i; - // update current index button - myCurrentIndexButton->setText((toString(myItemIndex + 1) + " / " + toString(myOverlappedACs.size())).c_str()); - // inspect overlapped attribute carrier - myFrameParent->selectedOverlappedElement(myOverlappedACs.at(myItemIndex)); - // show OverlappedInspection again (because it's hidden in inspectSingleElement) - show(); - return 1; - } - } - return 0; -} - - -long -GNEFrameModuls::OverlappedInspection::onCmdOverlappingHelp(FXObject*, FXSelector, void*) { - FXDialogBox* helpDialog = new FXDialogBox(this, "GEO attributes Help", GUIDesignDialogBox); - std::ostringstream help; - help - << " - Click in the same position\n" - << " for inspect next element\n" - << " - Shift + Click in the same\n" - << " position for inspect\n" - << " previous element"; - new FXLabel(helpDialog, help.str().c_str(), nullptr, GUIDesignLabelFrameInformation); - // "OK" - new FXButton(helpDialog, "OK\t\tclose", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), helpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK); - helpDialog->create(); - helpDialog->show(); - return 1; -} - - -GNEFrameModuls::OverlappedInspection::OverlappedInspection() : - myFrameParent(nullptr), - myPreviousElement(nullptr), - myCurrentIndexButton(nullptr), - myNextElement(nullptr), - myOverlappedElementList(nullptr), - myHelpButton(nullptr), - myFilteredTag(SUMO_TAG_NOTHING), - myItemIndex(0) { -} - - -void -GNEFrameModuls::OverlappedInspection::buildFXElements() { - FXHorizontalFrame* frameButtons = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - // Create previous Item Button - myPreviousElement = new FXButton(frameButtons, "", GUIIconSubSys::getIcon(GUIIcon::BIGARROWLEFT), this, MID_GNE_OVERLAPPED_PREVIOUS, GUIDesignButtonIconRectangular); - // create current index button - myCurrentIndexButton = new FXButton(frameButtons, "", nullptr, this, MID_GNE_OVERLAPPED_SHOWLIST, GUIDesignButton); - // Create next Item Button - myNextElement = new FXButton(frameButtons, "", GUIIconSubSys::getIcon(GUIIcon::BIGARROWRIGHT), this, MID_GNE_OVERLAPPED_NEXT, GUIDesignButtonIconRectangular); - // Create list of overlapped elements (by default hidden) - myOverlappedElementList = new FXList(this, this, MID_GNE_OVERLAPPED_ITEMSELECTED, GUIDesignListFixedHeight); - // by default list of overlapped elements is hidden) - myOverlappedElementList->hide(); - // Create help button - myHelpButton = new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); -} - -// --------------------------------------------------------------------------- -// GNEFrameModuls::PathCreator - methods -// --------------------------------------------------------------------------- - -GNEFrameModuls::PathCreator::Path::Path(const SUMOVehicleClass vClass, GNEEdge* edge) : - mySubPath({edge}), - myFromBusStop(nullptr), - myToBusStop(nullptr), - myConflictVClass(false), -myConflictDisconnected(false) { - // check if we have to change vClass flag - if (edge->getNBEdge()->getNumLanesThatAllow(vClass) == 0) { - myConflictVClass = true; - } -} - - -GNEFrameModuls::PathCreator::Path::Path(GNEViewNet* viewNet, const SUMOVehicleClass vClass, GNEEdge* edgeFrom, GNEEdge* edgeTo) : - myFromBusStop(nullptr), - myToBusStop(nullptr), - myConflictVClass(false), - myConflictDisconnected(false) { - // calculate subpath - mySubPath = viewNet->getNet()->getPathManager()->getPathCalculator()->calculateDijkstraPath(vClass, {edgeFrom, edgeTo}); - // if subPath is empty, try it with pedestrian (i.e. ignoring vCass) - if (mySubPath.empty()) { - mySubPath = viewNet->getNet()->getPathManager()->getPathCalculator()->calculateDijkstraPath(SVC_PEDESTRIAN, {edgeFrom, edgeTo}); - if (mySubPath.empty()) { - mySubPath = { edgeFrom, edgeTo }; - myConflictDisconnected = true; - } else { - myConflictVClass = true; - } - } -} - - -const std::vector& -GNEFrameModuls::PathCreator::Path::getSubPath() const { - return mySubPath; -} - - -GNEAdditional* GNEFrameModuls::PathCreator::Path::getFromBusStop() const { - return myFromBusStop; -} - - -GNEAdditional* GNEFrameModuls::PathCreator::Path::getToBusStop() const { - return myToBusStop; -} - - -bool -GNEFrameModuls::PathCreator::Path::isConflictVClass() const { - return myConflictVClass; -} - - -bool -GNEFrameModuls::PathCreator::Path::isConflictDisconnected() const { - return myConflictDisconnected; -} - - -GNEFrameModuls::PathCreator::Path::Path() : - myFromBusStop(nullptr), - myToBusStop(nullptr), - myConflictVClass(false), - myConflictDisconnected(false) { -} - - -GNEFrameModuls::PathCreator::PathCreator(GNEFrame* frameParent) : - FXGroupBox(frameParent->myContentFrame, "Route creator", GUIDesignGroupBoxFrame), - myFrameParent(frameParent), - myVClass(SVC_PASSENGER), - myCreationMode(0), - myToStoppingPlace(nullptr), - myRoute(nullptr) { - // create label for route info - myInfoRouteLabel = new FXLabel(this, "No edges selected", 0, GUIDesignLabelFrameThicked); - // create button for finish route creation - myFinishCreationButton = new FXButton(this, "Finish route creation", nullptr, this, MID_GNE_EDGEPATH_FINISH, GUIDesignButton); - myFinishCreationButton->disable(); - // create button for abort route creation - myAbortCreationButton = new FXButton(this, "Abort route creation", nullptr, this, MID_GNE_EDGEPATH_ABORT, GUIDesignButton); - myAbortCreationButton->disable(); - // create button for remove last inserted edge - myRemoveLastInsertedElement = new FXButton(this, "Remove last inserted edge", nullptr, this, MID_GNE_EDGEPATH_REMOVELAST, GUIDesignButton); - myRemoveLastInsertedElement->disable(); - // create check button - myShowCandidateEdges = new FXCheckButton(this, "Show candidate edges", this, MID_GNE_EDGEPATH_SHOWCANDIDATES, GUIDesignCheckButton); - myShowCandidateEdges->setCheck(TRUE); - // create shift label - myShiftLabel = new FXLabel(this, - "SHIFT-click: ignore vClass", - 0, GUIDesignLabelFrameInformation); - // create control label - myControlLabel = new FXLabel(this, - "CTRL-click: add disconnected", - 0, GUIDesignLabelFrameInformation); - // create backspace label (always shown) - new FXLabel(this, - "BACKSPACE: undo click", - 0, GUIDesignLabelFrameInformation); -} - - -GNEFrameModuls::PathCreator::~PathCreator() {} - - -void -GNEFrameModuls::PathCreator::showPathCreatorModul(SumoXMLTag element, const bool firstElement, const bool consecutives) { - // declare flag - bool showPathCreator = true; - // first abort creation - abortPathCreation(); - // disable buttons - myFinishCreationButton->disable(); - myAbortCreationButton->disable(); - myRemoveLastInsertedElement->disable(); - // reset creation mode - myCreationMode = 0; - // set first element - if (firstElement) { - myCreationMode |= REQUIRE_FIRSTELEMENT; - } - // set consecutive or non consecuives - if (consecutives) { - myCreationMode |= CONSECUTIVE_EDGES; - } else { - myCreationMode |= NONCONSECUTIVE_EDGES; - } - // set specific mode depending of tag - switch (element) { - // routes - case SUMO_TAG_ROUTE: - case GNE_TAG_ROUTE_EMBEDDED: - myCreationMode |= SHOW_CANDIDATE_EDGES; - myCreationMode |= START_EDGE; - myCreationMode |= END_EDGE; - break; - // vehicles - case SUMO_TAG_VEHICLE: - case GNE_TAG_FLOW_ROUTE: - case GNE_TAG_WALK_ROUTE: - myCreationMode |= SINGLE_ELEMENT; - myCreationMode |= ROUTE; - break; - case SUMO_TAG_TRIP: - case SUMO_TAG_FLOW: - case GNE_TAG_VEHICLE_WITHROUTE: - case GNE_TAG_FLOW_WITHROUTE: - myCreationMode |= SHOW_CANDIDATE_EDGES; - myCreationMode |= START_EDGE; - myCreationMode |= END_EDGE; - break; - // walk edges - case GNE_TAG_WALK_EDGES: - myCreationMode |= SHOW_CANDIDATE_EDGES; - myCreationMode |= START_EDGE; - myCreationMode |= END_EDGE; - break; - // edge->edge - case GNE_TAG_PERSONTRIP_EDGE: - case GNE_TAG_RIDE_EDGE: - case GNE_TAG_WALK_EDGE: - myCreationMode |= SHOW_CANDIDATE_EDGES; - myCreationMode |= ONLY_FROMTO; - myCreationMode |= START_EDGE; - myCreationMode |= END_EDGE; - break; - // edge->busStop - case GNE_TAG_PERSONTRIP_BUSSTOP: - case GNE_TAG_RIDE_BUSSTOP: - case GNE_TAG_WALK_BUSSTOP: - myCreationMode |= SHOW_CANDIDATE_EDGES; - myCreationMode |= ONLY_FROMTO; - myCreationMode |= END_BUSSTOP; - break; - // stops - case GNE_TAG_STOPPERSON_BUSSTOP: - myCreationMode |= SINGLE_ELEMENT; - myCreationMode |= END_BUSSTOP; - break; - case GNE_TAG_STOPPERSON_EDGE: - myCreationMode |= SINGLE_ELEMENT; - myCreationMode |= START_EDGE; - break; - // generic datas - case SUMO_TAG_EDGEREL: - myCreationMode |= ONLY_FROMTO; - myCreationMode |= START_EDGE; - myCreationMode |= END_EDGE; - break; - default: - showPathCreator = false; - break; - } - // check if show path creator - if (showPathCreator) { - // update edge colors - updateEdgeColors(); - // recalc before show (to avoid graphic problems) - recalc(); - // show modul - show(); - } else { - // hide modul - hide(); - } -} - - -void -GNEFrameModuls::PathCreator::hidePathCreatorModul() { - // clear path - clearPath(); - // hide modul - hide(); -} - - -SUMOVehicleClass -GNEFrameModuls::PathCreator::getVClass() const { - return myVClass; -} - - -void -GNEFrameModuls::PathCreator::setVClass(SUMOVehicleClass vClass) { - myVClass = vClass; - // update edge colors - updateEdgeColors(); -} - - -bool -GNEFrameModuls::PathCreator::addEdge(GNEEdge* edge, const bool shiftKeyPressed, const bool controlKeyPressed) { - // check if edges are allowed - if (((myCreationMode & CONSECUTIVE_EDGES) + (myCreationMode & NONCONSECUTIVE_EDGES) + - (myCreationMode & START_EDGE) + (myCreationMode & END_EDGE)) == 0) { - return false; - } - // check if only an edge is allowed - if ((myCreationMode & SINGLE_ELEMENT) && (mySelectedEdges.size() == 1)) { - return false; - } - // continue depending of number of selected eges - if (mySelectedEdges.size() > 0) { - // check double edges - if (mySelectedEdges.back() == edge) { - // Write warning - WRITE_WARNING("Double edges aren't allowed"); - // abort add edge - return false; - } - // check consecutive edges - if (myCreationMode & Mode::CONSECUTIVE_EDGES) { - // check that new edge is consecutive - const auto& outgoingEdges = mySelectedEdges.back()->getToJunction()->getGNEOutgoingEdges(); - if (std::find(outgoingEdges.begin(), outgoingEdges.end(), edge) == outgoingEdges.end()) { - // Write warning - WRITE_WARNING("Only consecutives edges are allowed"); - // abort add edge - return false; - } - } - } - // check number of edges - if (mySelectedEdges.size() == 2 && (myCreationMode & Mode::ONLY_FROMTO)) { - // Write warning - WRITE_WARNING("Only two edges are allowed"); - // abort add edge - return false; - } - // check candidate edge - if ((myShowCandidateEdges->getCheck() == TRUE) && !edge->isPossibleCandidate()) { - if (edge->isSpecialCandidate()) { - if (!shiftKeyPressed) { - // Write warning - WRITE_WARNING("Invalid edge (SHIFT + click to add an invalid vClass edge)"); - // abort add edge - return false; - } - } else if (edge->isConflictedCandidate()) { - if (!controlKeyPressed) { - // Write warning - WRITE_WARNING("Invalid edge (CONTROL + click to add a disconnected edge)"); - // abort add edge - return false; - } - } - } - // All checks ok, then add it in selected elements - mySelectedEdges.push_back(edge); - // enable abort route button - myAbortCreationButton->enable(); - // enable finish button - myFinishCreationButton->enable(); - // disable undo/redo - myFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->disableUndoRedo("route creation"); - // enable or disable remove last edge button - if (mySelectedEdges.size() > 1) { - myRemoveLastInsertedElement->enable(); - } else { - myRemoveLastInsertedElement->disable(); - } - // recalculate path - recalculatePath(); - // update info route label - updateInfoRouteLabel(); - // update edge colors - updateEdgeColors(); - return true; -} - - -std::vector -GNEFrameModuls::PathCreator::getSelectedEdges() const { - return mySelectedEdges; -} - - -bool -GNEFrameModuls::PathCreator::addStoppingPlace(GNEAdditional* stoppingPlace, const bool /*shiftKeyPressed*/, const bool /*controlKeyPressed*/) { - // check if stoppingPlaces aren allowed - if ((myCreationMode & END_BUSSTOP) == 0) { - return false; - } - // check if previously stopping place from was set - if (myToStoppingPlace) { - return false; - } else { - myToStoppingPlace = stoppingPlace; - } - // enable abort route button - myAbortCreationButton->enable(); - // enable finish button - myFinishCreationButton->enable(); - // disable undo/redo - myFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->disableUndoRedo("route creation"); - // enable or disable remove last stoppingPlace button - if (myToStoppingPlace) { - myRemoveLastInsertedElement->enable(); - } else { - myRemoveLastInsertedElement->disable(); - } - // recalculate path - recalculatePath(); - // update info route label - updateInfoRouteLabel(); - // update stoppingPlace colors - updateEdgeColors(); - return true; -} - - -GNEAdditional* -GNEFrameModuls::PathCreator::getToStoppingPlace(SumoXMLTag expectedTag) const { - if (myToStoppingPlace && (myToStoppingPlace->getTagProperty().getTag() == expectedTag)) { - return myToStoppingPlace; - } else { - return nullptr; - } -} - - -bool -GNEFrameModuls::PathCreator::addRoute(GNEDemandElement* route, const bool /*shiftKeyPressed*/, const bool /*controlKeyPressed*/) { - // check if routes aren allowed - if ((myCreationMode & ROUTE) == 0) { - return false; - } - // check if previously a route was added - if (myRoute) { - return false; - } - // set route - myRoute = route; - // recalculate path - recalculatePath(); - updateInfoRouteLabel(); - updateEdgeColors(); - return true; -} - - -void -GNEFrameModuls::PathCreator::removeRoute() { - // set route - myRoute = nullptr; - // recalculate path - recalculatePath(); - updateInfoRouteLabel(); - updateEdgeColors(); -} - - -GNEDemandElement* -GNEFrameModuls::PathCreator::getRoute() const { - return myRoute; -} - - -const std::vector& -GNEFrameModuls::PathCreator::getPath() const { - return myPath; -} - - -bool -GNEFrameModuls::PathCreator::drawCandidateEdgesWithSpecialColor() const { - return (myShowCandidateEdges->getCheck() == TRUE); -} - - -void -GNEFrameModuls::PathCreator::updateEdgeColors() { - // reset all flags - for (const auto& edge : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) { - edge.second->resetCandidateFlags(); - } - // set reachability - if (mySelectedEdges.size() > 0) { - // only coloring edges if checkbox "show candidate edges" is enabled - if ((myShowCandidateEdges->getCheck() == TRUE) && (myCreationMode & SHOW_CANDIDATE_EDGES)) { - // mark all edges as conflicted (to mark special candidates) - for (const auto& edge : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) { - edge.second->setConflictedCandidate(true); - } - // set special candidates (Edges that are connected but aren't compatibles with current vClass - setSpecialCandidates(mySelectedEdges.back()); - // mark again all edges as conflicted (to mark possible candidates) - for (const auto& edge : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) { - edge.second->setConflictedCandidate(true); - } - // set possible candidates (Edges that are connected AND are compatibles with current vClass - setPossibleCandidates(mySelectedEdges.back(), myVClass); - } - // now mark selected eges - for (const auto& edge : mySelectedEdges) { - edge->resetCandidateFlags(); - edge->setSourceCandidate(true); - } - // finally mark last selected element as target - mySelectedEdges.back()->resetCandidateFlags(); - mySelectedEdges.back()->setTargetCandidate(true); - } else if (myShowCandidateEdges->getCheck() == TRUE && (myCreationMode & SHOW_CANDIDATE_EDGES)) { - // mark all edges that have at least one lane that allow given vClass - for (const auto& edge : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) { - if (edge.second->getNBEdge()->getNumLanesThatAllow(myVClass) > 0) { - edge.second->setPossibleCandidate(true); - } else { - edge.second->setSpecialCandidate(true); - } - } - } - // update view net - myFrameParent->myViewNet->updateViewNet(); -} - - -#if defined(_MSC_VER) && _MSC_VER == 1800 -#pragma warning(push) -#pragma warning(disable: 4100) // do not warn about "unused" parameters which get optimized away -#endif -void -GNEFrameModuls::PathCreator::drawTemporalRoute(const GUIVisualizationSettings& s) const { - if (myPath.size() > 0) { - const double lineWidth = 0.35; - const double lineWidthin = 0.25; - // Add a draw matrix - GLHelper::pushMatrix(); - // Start with the drawing of the area traslating matrix to origin - glTranslated(0, 0, GLO_MAX - 0.1); - // set first color - GLHelper::setColor(RGBColor::GREY); - // iterate over path - for (int i = 0; i < (int)myPath.size(); i++) { - // get path - const GNEFrameModuls::PathCreator::Path& path = myPath.at(i); - // draw line over - for (int j = 0; j < (int)path.getSubPath().size(); j++) { - const GNELane* lane = path.getSubPath().at(j)->getLanes().back(); - if (((i == 0) && (j == 0)) || (j > 0)) { - GLHelper::drawBoxLines(lane->getLaneShape(), lineWidth); - } - // draw connection between lanes - if ((j + 1) < (int)path.getSubPath().size()) { - const GNELane* nextLane = path.getSubPath().at(j + 1)->getLanes().back(); - if (lane->getLane2laneConnections().exist(nextLane)) { - GLHelper::drawBoxLines(lane->getLane2laneConnections().getLane2laneGeometry(nextLane).getShape(), lineWidth); - } else { - GLHelper::drawBoxLines({lane->getLaneShape().back(), nextLane->getLaneShape().front()}, lineWidth); - } - } - } - } - glTranslated(0, 0, 0.1); - // iterate over path again - for (int i = 0; i < (int)myPath.size(); i++) { - // get path - const GNEFrameModuls::PathCreator::Path& path = myPath.at(i); - // set path color color - if ((myCreationMode & SHOW_CANDIDATE_EDGES) == 0) { - GLHelper::setColor(RGBColor::ORANGE); - } else if (path.isConflictDisconnected()) { - GLHelper::setColor(s.candidateColorSettings.conflict); - } else if (path.isConflictVClass()) { - GLHelper::setColor(s.candidateColorSettings.special); - } else { - GLHelper::setColor(RGBColor::ORANGE); - } - // draw line over - for (int j = 0; j < (int)path.getSubPath().size(); j++) { - const GNELane* lane = path.getSubPath().at(j)->getLanes().back(); - if (((i == 0) && (j == 0)) || (j > 0)) { - GLHelper::drawBoxLines(lane->getLaneShape(), lineWidthin); - } - // draw connection between lanes - if ((j + 1) < (int)path.getSubPath().size()) { - const GNELane* nextLane = path.getSubPath().at(j + 1)->getLanes().back(); - if (lane->getLane2laneConnections().exist(nextLane)) { - GLHelper::drawBoxLines(lane->getLane2laneConnections().getLane2laneGeometry(nextLane).getShape(), lineWidthin); - } else { - GLHelper::drawBoxLines({ lane->getLaneShape().back(), nextLane->getLaneShape().front() }, lineWidthin); - } - } - } - } - // Pop last matrix - GLHelper::popMatrix(); - } -} -#if defined(_MSC_VER) && _MSC_VER == 1800 -#pragma warning(pop) -#endif - - -void -GNEFrameModuls::PathCreator::createPath() { - // call create path implemented in frame parent - myFrameParent->createPath(); -} - - -void -GNEFrameModuls::PathCreator::abortPathCreation() { - // first check that there is elements - if ((mySelectedEdges.size() > 0) || myToStoppingPlace || myRoute) { - // unblock undo/redo - myFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->enableUndoRedo(); - // clear edges - clearPath(); - // disable buttons - myFinishCreationButton->disable(); - myAbortCreationButton->disable(); - myRemoveLastInsertedElement->disable(); - // update info route label - updateInfoRouteLabel(); - // update reachability - updateEdgeColors(); - // update view (to see the new route) - myFrameParent->getViewNet()->updateViewNet(); - } -} - - -void -GNEFrameModuls::PathCreator::removeLastElement() { - if (mySelectedEdges.size() > 1) { - // remove special color of last selected edge - mySelectedEdges.back()->resetCandidateFlags(); - // remove last edge - mySelectedEdges.pop_back(); - // change last edge flag - if ((mySelectedEdges.size() > 0) && mySelectedEdges.back()->isSourceCandidate()) { - mySelectedEdges.back()->setSourceCandidate(false); - mySelectedEdges.back()->setTargetCandidate(true); - } - // enable or disable remove last edge button - if (mySelectedEdges.size() > 1) { - myRemoveLastInsertedElement->enable(); - } else { - myRemoveLastInsertedElement->disable(); - } - // recalculate path - recalculatePath(); - // update info route label - updateInfoRouteLabel(); - // update reachability - updateEdgeColors(); - // update view - myFrameParent->myViewNet->updateViewNet(); - } -} - - -long -GNEFrameModuls::PathCreator::onCmdCreatePath(FXObject*, FXSelector, void*) { - // just call create path - createPath(); - return 1; -} - - -long -GNEFrameModuls::PathCreator::onCmdAbortPathCreation(FXObject*, FXSelector, void*) { - // just call abort path creation - abortPathCreation(); - return 1; -} - - -long -GNEFrameModuls::PathCreator::onCmdRemoveLastElement(FXObject*, FXSelector, void*) { - // just call remove last element - removeLastElement(); - return 1; -} - - -long -GNEFrameModuls::PathCreator::onCmdShowCandidateEdges(FXObject*, FXSelector, void*) { - // update labels - if (myShowCandidateEdges->getCheck() == TRUE) { - myShiftLabel->show(); - myControlLabel->show(); - } else { - myShiftLabel->hide(); - myControlLabel->hide(); - } - // recalc frame - recalc(); - // update edge colors (view will be updated within function) - updateEdgeColors(); - return 1; -} - - -void -GNEFrameModuls::PathCreator::updateInfoRouteLabel() { - if (myPath.size() > 0) { - // declare variables for route info - double length = 0; - double speed = 0; - int pathSize = 0; - for (const auto& path : myPath) { - for (const auto& edge : path.getSubPath()) { - length += edge->getNBEdge()->getLength(); - speed += edge->getNBEdge()->getSpeed(); - } - pathSize += (int)path.getSubPath().size(); - } - // declare ostringstream for label and fill it - std::ostringstream information; - information - << "- Selected edges: " << toString(mySelectedEdges.size()) << "\n" - << "- Path edges: " << toString(pathSize) << "\n" - << "- Length: " << toString(length) << "\n" - << "- Average speed: " << toString(speed / pathSize); - // set new label - myInfoRouteLabel->setText(information.str().c_str()); - } else { - myInfoRouteLabel->setText("No edges selected"); - } -} - - -void -GNEFrameModuls::PathCreator::clearPath() { - // reset all flags - for (const auto& edge : myFrameParent->myViewNet->getNet()->getAttributeCarriers()->getEdges()) { - edge.second->resetCandidateFlags(); - } - // clear edges, additionals and route - mySelectedEdges.clear(); - myToStoppingPlace = nullptr; - myRoute = nullptr; - // clear path - myPath.clear(); - // update info route label - updateInfoRouteLabel(); -} - - -void -GNEFrameModuls::PathCreator::recalculatePath() { - // first clear path - myPath.clear(); - // set edges - std::vector edges; - // add route edges - if (myRoute) { - edges = myRoute->getParentEdges(); - } else { - // add selected edges - for (const auto& edge : mySelectedEdges) { - edges.push_back(edge); - } - // add to stopping place edge - if (myToStoppingPlace) { - edges.push_back(myToStoppingPlace->getParentLanes().front()->getParentEdge()); - } - } - // fill paths - if (edges.size() == 1) { - myPath.push_back(Path(myVClass, edges.front())); - } else { - // add every segment - for (int i = 1; i < (int)edges.size(); i++) { - myPath.push_back(Path(myFrameParent->getViewNet(), myVClass, edges.at(i - 1), edges.at(i))); - } - } -} - - -void -GNEFrameModuls::PathCreator::setSpecialCandidates(GNEEdge* originEdge) { - // first calculate reachability for pedestrians (we use it, because pedestran can walk in almost all edges) - myFrameParent->getViewNet()->getNet()->getPathManager()->getPathCalculator()->calculateReachability(SVC_PEDESTRIAN, originEdge); - // change flags - for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) { - for (const auto& lane : edge.second->getLanes()) { - if (lane->getReachability() > 0) { - lane->getParentEdge()->resetCandidateFlags(); - lane->getParentEdge()->setSpecialCandidate(true); - } - } - } -} - -void -GNEFrameModuls::PathCreator::setPossibleCandidates(GNEEdge* originEdge, const SUMOVehicleClass vClass) { - // first calculate reachability for pedestrians - myFrameParent->getViewNet()->getNet()->getPathManager()->getPathCalculator()->calculateReachability(vClass, originEdge); - // change flags - for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) { - for (const auto& lane : edge.second->getLanes()) { - if (lane->getReachability() > 0) { - lane->getParentEdge()->resetCandidateFlags(); - lane->getParentEdge()->setPossibleCandidate(true); - } - } - } -} - -// --------------------------------------------------------------------------- -// GNERouteFrame::Legend - methods -// --------------------------------------------------------------------------- - -GNEFrameModuls::PathLegend::PathLegend(GNEFrame* frameParent) : - FXGroupBox(frameParent->myContentFrame, "Legend", GUIDesignGroupBoxFrame) { - // declare label - FXLabel* legendLabel = nullptr; - // edge candidate - legendLabel = new FXLabel(this, " edge candidate", 0, GUIDesignLabelLeft); - legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.possible)); - legendLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE)); - // last edge selected - legendLabel = new FXLabel(this, " last edge selected", 0, GUIDesignLabelLeft); - legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.target)); - // edge selected - legendLabel = new FXLabel(this, " edge selected", 0, GUIDesignLabelLeft); - legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.source)); - // edge conflict (vClass) - legendLabel = new FXLabel(this, " edge conflict (vClass)", 0, GUIDesignLabelLeft); - legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.special)); - // edge disconnected - legendLabel = new FXLabel(this, " edge disconnected", 0, GUIDesignLabelLeft); - legendLabel->setBackColor(MFXUtils::getFXColor(frameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.conflict)); -} - - -GNEFrameModuls::PathLegend::~PathLegend() {} - - -void -GNEFrameModuls::PathLegend::showPathLegendModul() { - show(); -} - -void -GNEFrameModuls::PathLegend::hidePathLegendModul() { - hide(); -} - -// --------------------------------------------------------------------------- -// GNEFrameModuls - methods -// --------------------------------------------------------------------------- - -FXLabel* -GNEFrameModuls::buildRainbow(FXComposite* parent) { - // create label for color information - FXLabel* label = new FXLabel(parent, "Scale: Min -> Max", nullptr, GUIDesignLabelCenterThick); - // create frame for color scale - FXHorizontalFrame* horizontalFrameColors = new FXHorizontalFrame(parent, GUIDesignAuxiliarHorizontalFrame); - for (const auto& color : GNEViewNetHelper::getRainbowScaledColors()) { - FXLabel* colorLabel = new FXLabel(horizontalFrameColors, "", nullptr, GUIDesignLabelLeft); - colorLabel->setBackColor(MFXUtils::getFXColor(color)); - } - // return label - return label; -} - -/****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/frames/GNEFrameModuls.h sumo-1.12.0/src/netedit/frames/GNEFrameModuls.h --- sumo-1.11.0/src/netedit/frames/GNEFrameModuls.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/GNEFrameModuls.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,784 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GNEFrameModuls.h -/// @author Pablo Alvarez Lopez -/// @date Aug 2019 -/// -// Auxiliar class for GNEFrame Moduls -/****************************************************************************/ -#pragma once -#include - -#include -#include -#include -#include - -// =========================================================================== -// class declaration -// =========================================================================== - -class GNEFrame; -class GNEDataSet; -class GNEDataInterval; - -// =========================================================================== -// class definitions -// =========================================================================== - -class GNEFrameModuls { - -public: - // =========================================================================== - // class TagSelector - // =========================================================================== - - class TagSelector : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEFrameModuls::TagSelector) - - public: - /// @brief constructor - TagSelector(GNEFrame* frameParent, GNETagProperties::TagType type, bool onlyDrawables = true); - - /// @brief destructor - ~TagSelector(); - - /// @brief show item selector - void showTagSelector(); - - /// @brief hide item selector - void hideTagSelector(); - - /// @brief get current type tag - const GNETagProperties& getCurrentTagProperties() const; - - /// @brief set current type manually - void setCurrentTagType(GNETagProperties::TagType tagType); - - /// @brief set current type manually - void setCurrentTag(SumoXMLTag newTag); - - /// @brief due myCurrentTagProperties is a Reference, we need to refresh it when frameParent is show - void refreshTagProperties(); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user select an group in ComboBox - long onCmdSelectTagType(FXObject*, FXSelector, void*); - - /// @brief Called when the user select an elementin ComboBox - long onCmdSelectTag(FXObject*, FXSelector, void*); - /// @} - - protected: - /// @brief FOX need this - FOX_CONSTRUCTOR(TagSelector) - - private: - struct TagType { - /// @brief constructor - TagType(std::string _tag, GNETagProperties::TagType _tagType, GUIIcon _icon); - - // @brief tag in string format - const std::string tag; - - /// @brief tag type - const GNETagProperties::TagType tagType; - - /// @brief icon - const GUIIcon icon; - }; - - /// @brief pointer to Frame Parent - GNEFrame* myFrameParent; - - /// @brief comboBox with tag type - MFXIconComboBox* myTagTypesMatchBox; - - /// @brief comboBox with the list of tags - MFXIconComboBox* myTagsMatchBox; - - /// @brief current tag properties - GNETagProperties myCurrentTagProperties; - - /// @brief list of tags types that will be shown in Match Box - std::vector myTagTypes; - - /// @brief list of tags that will be shown in Match Box - std::vector > myTagPropertiesString; - - /// @brief dummy tag properties used if user select an invalid tag - GNETagProperties myInvalidTagProperty; - }; - - // =========================================================================== - // class DemandElementSelector - // =========================================================================== - - class DemandElementSelector : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEFrameModuls::DemandElementSelector) - - public: - /// @brief constructor with a single tag - DemandElementSelector(GNEFrame* frameParent, SumoXMLTag demandElementTag); - - /// @brief constructor with tag type - DemandElementSelector(GNEFrame* frameParent, const std::vector& tagTypes); - - /// @brief destructor - ~DemandElementSelector(); - - /// @brief get current demand element - GNEDemandElement* getCurrentDemandElement() const; - - // @brief obtain allowed tags (derived from tagTypes) - const std::vector& getAllowedTags() const; - - /// @brief set current demand element - void setDemandElement(GNEDemandElement* demandElement); - - /// @brief show demand element selector - void showDemandElementSelector(); - - /// @brief hide demand element selector - void hideDemandElementSelector(); - - /// @brief check if demand element selector is shown - bool isDemandElementSelectorShown() const; - - /// @brief refresh demand element selector - void refreshDemandElementSelector(); - - /// @brief get previous edge for the current person plan - GNEEdge* getPersonPlanPreviousEdge() const; - - /// @brief get previous edge for the current container plan - GNEEdge* getContainerPlanPreviousEdge() const; - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user select another demand elementelement in ComboBox - long onCmdSelectDemandElement(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(DemandElementSelector) - - private: - /// @brief pointer to frame Parent - GNEFrame* myFrameParent; - - /// @brief comboBox with the list of elements type - MFXIconComboBox* myDemandElementsMatchBox; - - /// @brief current demand element - GNEDemandElement* myCurrentDemandElement; - - /// @brief demand element tags - std::vector myDemandElementTags; - }; - - // =========================================================================== - // class HierarchicalElementTree - // =========================================================================== - - class HierarchicalElementTree : private FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEFrameModuls::HierarchicalElementTree) - - public: - /// @brief constructor - HierarchicalElementTree(GNEFrame* frameParent); - - /// @brief destructor - ~HierarchicalElementTree(); - - /// @brief show HierarchicalElementTree - void showHierarchicalElementTree(GNEAttributeCarrier* AC); - - /// @brief hide HierarchicalElementTree - void hideHierarchicalElementTree(); - - /// @brief refresh HierarchicalElementTree - void refreshHierarchicalElementTree(); - - /// @brief if given AttributeCarrier is the same of myHE, set it as nullptr - void removeCurrentEditedAttributeCarrier(const GNEAttributeCarrier* HE); - - /// @name FOX-callbacks - /// @{ - /// @brief called when user press right click over an item of list of children - long onCmdShowChildMenu(FXObject*, FXSelector, void* data); - - /// @brief called when user click over option "center" of child Menu - long onCmdCenterItem(FXObject*, FXSelector, void*); - - /// @brief called when user click over option "inspect" of child menu - long onCmdInspectItem(FXObject*, FXSelector, void*); - - /// @brief called when user click over option "delete" of child menu - long onCmdDeleteItem(FXObject*, FXSelector, void*); - - /// @brief called when user click over option "Move up" of child menu - long onCmdMoveItemUp(FXObject*, FXSelector, void*); - - /// @brief called when user click over option "Move down" of child menu - long onCmdMoveItemDown(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(HierarchicalElementTree) - - // @brief create pop-up menu in the positions X-Y for the clicked attribute carrier - void createPopUpMenu(int X, int Y, GNEAttributeCarrier* clickedAC); - - /// @brief show child of current attributeCarrier - FXTreeItem* showAttributeCarrierParents(); - - /// @brief show children of given hierarchical element - void showHierarchicalElementChildren(GNEHierarchicalElement* HE, FXTreeItem* itemParent); - - /// @brief add item into list - FXTreeItem* addListItem(GNEAttributeCarrier* AC, FXTreeItem* itemParent = nullptr, std::string prefix = "", std::string sufix = ""); - - /// @brief add item into list - FXTreeItem* addListItem(FXTreeItem* itemParent, const std::string& text, FXIcon* icon, bool expanded); - - private: - /// @brief frame Parent - GNEFrame* myFrameParent; - - /// @brief hierarchical element - GNEHierarchicalElement* myHE; - - /// @brief pointer to current clicked Attribute Carrier - GNEAttributeCarrier* myClickedAC; - - /// @brief junction (casted from myClickedAC) - GNEJunction* myClickedJunction; - - /// @brief edge (casted from myClickedAC) - GNEEdge* myClickedEdge; - - /// @brief lane (casted from myClickedAC) - GNELane* myClickedLane; - - /// @brief crossing (casted from myClickedAC) - GNECrossing* myClickedCrossing; - - /// @brief junction (casted from myClickedAC) - GNEConnection* myClickedConnection; - - /// @brief shape (casted from myClickedAC) - GNEShape* myClickedShape; - - /// @brief TAZElement (casted from myClickedAC) - GNETAZElement* myClickedTAZElement; - - /// @brief additional (casted from myClickedAC) - GNEAdditional* myClickedAdditional; - - /// @brief demand element (casted from myClickedAC) - GNEDemandElement* myClickedDemandElement; - - /// @brief data set element (casted from myClickedAC) - GNEDataSet* myClickedDataSet; - - /// @brief data interval element (casted from myClickedAC) - GNEDataInterval* myClickedDataInterval; - - /// @brief generic data element (casted from myClickedAC) - GNEGenericData* myClickedGenericData; - - /// @brief tree list dinamic to show the children of the element to erase - FXTreeListDinamic* myTreeListDinamic = nullptr; - - /// @brief map used to save the FXTreeItems items with their vinculated AC - std::map myTreeItemToACMap; - - /// @brief set used to save tree items without AC assigned, the Incoming/Outcoming connections - std::set myTreeItemsConnections; - }; - - // =========================================================================== - // class DrawingShape - // =========================================================================== - - class DrawingShape : private FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEFrameModuls::DrawingShape) - - public: - /// @brief constructor - DrawingShape(GNEFrame* frameParent); - - /// @brief destructor - ~DrawingShape(); - - /// @brief show Drawing mode - void showDrawingShape(); - - /// @brief hide Drawing mode - void hideDrawingShape(); - - /// @brief start drawing - void startDrawing(); - - /// @brief stop drawing and check if shape can be created - void stopDrawing(); - - /// @brief abort drawing - void abortDrawing(); - - /// @brief add new point to temporal shape - void addNewPoint(const Position& P); - - /// @brief remove last added point - void removeLastPoint(); - - /// @brief get Temporal shape - const PositionVector& getTemporalShape() const; - - /// @brief return true if currently a shape is drawed - bool isDrawing() const; - - /// @brief enable or disable delete last created point - void setDeleteLastCreatedPoint(bool value); - - /// @brief get flag delete last created point - bool getDeleteLastCreatedPoint(); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user press start drawing button - long onCmdStartDrawing(FXObject*, FXSelector, void*); - - /// @brief Called when the user press stop drawing button - long onCmdStopDrawing(FXObject*, FXSelector, void*); - - /// @brief Called when the user press abort drawing button - long onCmdAbortDrawing(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(DrawingShape) - - private: - /// @brief pointer to frame parent - GNEFrame* myFrameParent; - - /// @brief flag to enable/disable delete point mode - bool myDeleteLastCreatedPoint; - - /// @brief current drawed shape - PositionVector myTemporalShape; - - /// @brief button for start drawing - FXButton* myStartDrawingButton; - - /// @brief button for stop drawing - FXButton* myStopDrawingButton; - - /// @brief button for abort drawing - FXButton* myAbortDrawingButton; - - /// @brief Label with information - FXLabel* myInformationLabel; - }; - - // =========================================================================== - // class SelectorParent - // =========================================================================== - - class SelectorParent : protected FXGroupBox { - public: - /// @brief constructor - SelectorParent(GNEFrame* frameParent); - - /// @brief destructor - ~SelectorParent(); - - /// @brief get currently parent additional selected - std::string getIdSelected() const; - - /// @brief select manually a element of the list - void setIDSelected(const std::string& id); - - /// @brief Show list of SelectorParent Modul - bool showSelectorParentModul(const std::vector& additionalTypeParents); - - /// @brief hide SelectorParent Modul - void hideSelectorParentModul(); - - /// @brief Refresh list of Additional Parents Modul - void refreshSelectorParentModul(); - - private: - /// @brief pointer to Frame Parent - GNEFrame* myFrameParent; - - /// @brief current parent additional tag - std::vector myParentTags; - - /// @brief Label with parent name - FXLabel* myParentsLabel; - - /// @brief List of parents - FXList* myParentsList; - }; - - // =========================================================================== - // class OverlappedInspection - // =========================================================================== - - class OverlappedInspection : private FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEFrameModuls::OverlappedInspection) - - public: - /// @brief constructor - OverlappedInspection(GNEFrame* frameParent); - - /// @brief constructor (used for filter objects under cusor - OverlappedInspection(GNEFrame* frameParent, const SumoXMLTag filteredTag); - - /// @brief destructor - ~OverlappedInspection(); - - /// @brief show template editor - void showOverlappedInspection(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const Position& clickedPosition); - - /// @brief hide template editor - void hideOverlappedInspection(); - - /// @brief check if overlappedInspection modul is shown - bool overlappedInspectionShown() const; - - /// @brief get number of overlapped ACSs - int getNumberOfOverlappedACs() const; - - /// @brief check if given position is near to saved position - bool checkSavedPosition(const Position& clickedPosition) const; - - /// @brief try to go to next element if clicked position is near to saved position - bool nextElement(const Position& clickedPosition); - - /// @brief try to go to previous element if clicked position is near to saved position - bool previousElement(const Position& clickedPosition); - - /// @name FOX-callbacks - /// @{ - - /// @brief Inspect next Element (from top to bot) - long onCmdNextElement(FXObject*, FXSelector, void*); - - /// @brief Inspect previous element (from top to bot) - long onCmdPreviousElement(FXObject*, FXSelector, void*); - - /// @brief show list of overlapped elements - long onCmdShowList(FXObject*, FXSelector, void*); - - /// @brief called when a list item is selected - long onCmdListItemSelected(FXObject*, FXSelector, void*); - - /// @brief Called when user press the help button - long onCmdOverlappingHelp(FXObject*, FXSelector, void*); - /// @} - - protected: - /// @brief FOX needs this - OverlappedInspection(); - - /// @brief build Fox Toolkit elemements - void buildFXElements(); - - private: - /// @brief current frame parent - GNEFrame* myFrameParent; - - /// @brief Previous element button - FXButton* myPreviousElement; - - /// @brief Button for current index - FXButton* myCurrentIndexButton; - - /// @brief Next element button - FXButton* myNextElement; - - /// @brief list of overlapped elements - FXList* myOverlappedElementList; - - /// @brief button for help - FXButton* myHelpButton; - - /// @brief filtered tag - const SumoXMLTag myFilteredTag; - - /// @brief objects under cursor - std::vector myOverlappedACs; - - /// @brief current index item - size_t myItemIndex; - - /// @brief saved clicked position - Position mySavedClickedPosition; - }; - - // =========================================================================== - // class PathCreator - // =========================================================================== - - class PathCreator : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEFrameModuls::PathCreator) - - public: - /// @brief class for path - class Path { - - public: - /// @brief constructor for single edge - Path(const SUMOVehicleClass vClass, GNEEdge* edge); - - /// @brief constructor for multiple edges - Path(GNEViewNet* viewNet, const SUMOVehicleClass vClass, GNEEdge* edgeFrom, GNEEdge* edgeTo); - - /// @brief get sub path - const std::vector& getSubPath() const; - - /// @brief get from additional - GNEAdditional* getFromBusStop() const; - - /// @brief to additional - GNEAdditional* getToBusStop() const; - - /// @brief check if current path is conflict due vClass - bool isConflictVClass() const; - - /// @brief check if current path is conflict due is disconnected - bool isConflictDisconnected() const; - - protected: - /// @brief sub path - std::vector mySubPath; - - /// @brief from additional (usually a busStop) - GNEAdditional* myFromBusStop; - - /// @brief to additional (usually a busStop) - GNEAdditional* myToBusStop; - - /// @brief flag to mark this path as conflicted - bool myConflictVClass; - - /// @brief flag to mark this path as disconnected - bool myConflictDisconnected; - - private: - /// @brief default constructor - Path(); - - /// @brief Invalidated copy constructor. - Path(Path*) = delete; - - /// @brief Invalidated assignment operator. - Path& operator=(Path*) = delete; - }; - - /// @brief default constructor - PathCreator(GNEFrame* frameParent); - - /// @brief destructor - ~PathCreator(); - - /// @brief show PathCreator for the given tag - void showPathCreatorModul(SumoXMLTag element, const bool firstElement, const bool consecutives); - - /// @brief show PathCreator - void hidePathCreatorModul(); - - /// @brief get vClass - SUMOVehicleClass getVClass() const; - - /// @brief set vClass - void setVClass(SUMOVehicleClass vClass); - - /// @brief add edge - bool addEdge(GNEEdge* edge, const bool shiftKeyPressed, const bool controlKeyPressed); - - /// @brief get current selected additionals - std::vector getSelectedEdges() const; - - /// @brief add stoppingPlace - bool addStoppingPlace(GNEAdditional* stoppingPlace, const bool shiftKeyPressed, const bool controlKeyPressed); - - /// @brief get to stoppingPlace - GNEAdditional* getToStoppingPlace(SumoXMLTag expectedTag) const; - - /// @brief add route - bool addRoute(GNEDemandElement* route, const bool shiftKeyPressed, const bool controlKeyPressed); - - /// @brief get route - GNEDemandElement* getRoute() const; - - /// @brief remove route - void removeRoute(); - - /// @brief get path route - const std::vector& getPath() const; - - /// @brief draw candidate edges with special color (Only for candidates, special and conflicted) - bool drawCandidateEdgesWithSpecialColor() const; - - /// @brief update edge colors - void updateEdgeColors(); - - /// @brief draw temporal route - void drawTemporalRoute(const GUIVisualizationSettings& s) const; - - /// @brief create path - void createPath(); - - /// @brief abort path creation - void abortPathCreation(); - - /// @brief remove path element - void removeLastElement(); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user click over button "Finish route creation" - long onCmdCreatePath(FXObject*, FXSelector, void*); - - /// @brief Called when the user click over button "Abort route creation" - long onCmdAbortPathCreation(FXObject*, FXSelector, void*); - - /// @brief Called when the user click over button "Remove las inserted edge" - long onCmdRemoveLastElement(FXObject*, FXSelector, void*); - - /// @brief Called when the user click over check button "show candidate edges" - long onCmdShowCandidateEdges(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(PathCreator) - - // @brief creation mode - enum Mode { - CONSECUTIVE_EDGES = 1 << 0, // Path's edges are consecutives - NONCONSECUTIVE_EDGES = 1 << 1, // Path's edges aren't consecutives - START_EDGE = 1 << 2, // Path begins in an edge - END_EDGE = 1 << 3, // Path ends in an edge - SINGLE_ELEMENT = 1 << 4, // Path only had one element - ONLY_FROMTO = 1 << 5, // Path only had two elements (first and last) - END_BUSSTOP = 1 << 6, // Path ends in a busStop - ROUTE = 1 << 7, // Path uses a route - REQUIRE_FIRSTELEMENT = 1 << 8, // Path start always in a previous element - SHOW_CANDIDATE_EDGES = 1 << 9, // disable candidate edges - }; - - /// @brief update InfoRouteLabel - void updateInfoRouteLabel(); - - /// @brief clear edges (and restore colors) - void clearPath(); - - /// @brief recalculate path - void recalculatePath(); - - /// @brief set special candidates (This function will be called recursively) - void setSpecialCandidates(GNEEdge* originEdge); - - /// @brief set edgereachability (This function will be called recursively) - void setPossibleCandidates(GNEEdge* originEdge, const SUMOVehicleClass vClass); - - /// @brief current frame parent - GNEFrame* myFrameParent; - - /// @brief current vClass - SUMOVehicleClass myVClass; - - /// @brief current creation mode - int myCreationMode; - - /// @brief vector with selected edges - std::vector mySelectedEdges; - - /// @brief to additional (usually a busStop) - GNEAdditional* myToStoppingPlace; - - /// @brief route (usually a busStop) - GNEDemandElement* myRoute; - - /// @brief vector with current path - std::vector myPath; - - /// @brief label with route info - FXLabel* myInfoRouteLabel; - - /// @brief button for finish route creation - FXButton* myFinishCreationButton; - - /// @brief button for abort route creation - FXButton* myAbortCreationButton; - - /// @brief button for removing last inserted element - FXButton* myRemoveLastInsertedElement; - - /// @brief CheckBox for show candidate edges - FXCheckButton* myShowCandidateEdges; - - /// @brief label for shift information - FXLabel* myShiftLabel; - - /// @brief label for control information - FXLabel* myControlLabel; - - private: - /// @brief Invalidated copy constructor. - PathCreator(PathCreator*) = delete; - - /// @brief Invalidated assignment operator. - PathCreator& operator=(PathCreator*) = delete; - }; - - // =========================================================================== - // class PathLegend - // =========================================================================== - - class PathLegend : protected FXGroupBox { - - public: - /// @brief constructor - PathLegend(GNEFrame* frameParent); - - /// @brief destructor - ~PathLegend(); - - /// @brief show Legend modul - void showPathLegendModul(); - - /// @brief hide Legend modul - void hidePathLegendModul(); - }; - - // =========================================================================== - // Functions - // =========================================================================== - - /// @brief build rainbow in frame modul - static FXLabel* buildRainbow(FXComposite* parent); -}; diff -Nru sumo-1.11.0/src/netedit/frames/network/GNEAdditionalFrame.cpp sumo-1.12.0/src/netedit/frames/network/GNEAdditionalFrame.cpp --- sumo-1.11.0/src/netedit/frames/network/GNEAdditionalFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNEAdditionalFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -68,10 +68,10 @@ }; // Object implementation -FXIMPLEMENT(GNEAdditionalFrame::SelectorParentLanes, FXGroupBox, ConsecutiveLaneSelectorMap, ARRAYNUMBER(ConsecutiveLaneSelectorMap)) -FXIMPLEMENT(GNEAdditionalFrame::SelectorChildEdges, FXGroupBox, SelectorParentEdgesMap, ARRAYNUMBER(SelectorParentEdgesMap)) -FXIMPLEMENT(GNEAdditionalFrame::SelectorChildLanes, FXGroupBox, SelectorParentLanesMap, ARRAYNUMBER(SelectorParentLanesMap)) -FXIMPLEMENT(GNEAdditionalFrame::E2MultilaneLaneSelector, FXGroupBox, E2MultilaneLaneSelectorMap, ARRAYNUMBER(E2MultilaneLaneSelectorMap)) +FXIMPLEMENT(GNEAdditionalFrame::SelectorParentLanes, FXGroupBoxModule, ConsecutiveLaneSelectorMap, ARRAYNUMBER(ConsecutiveLaneSelectorMap)) +FXIMPLEMENT(GNEAdditionalFrame::SelectorChildEdges, FXGroupBoxModule, SelectorParentEdgesMap, ARRAYNUMBER(SelectorParentEdgesMap)) +FXIMPLEMENT(GNEAdditionalFrame::SelectorChildLanes, FXGroupBoxModule, SelectorParentLanesMap, ARRAYNUMBER(SelectorParentLanesMap)) +FXIMPLEMENT(GNEAdditionalFrame::E2MultilaneLaneSelector, FXGroupBoxModule, E2MultilaneLaneSelectorMap, ARRAYNUMBER(E2MultilaneLaneSelectorMap)) // --------------------------------------------------------------------------- @@ -79,11 +79,11 @@ // --------------------------------------------------------------------------- GNEAdditionalFrame::SelectorParentLanes::SelectorParentLanes(GNEAdditionalFrame* additionalFrameParent) : - FXGroupBox(additionalFrameParent->myContentFrame, "Lane Selector", GUIDesignGroupBoxFrame), + FXGroupBoxModule(additionalFrameParent->myContentFrame, "Lane Selector"), myAdditionalFrameParent(additionalFrameParent) { // create start and stop buttons - myStopSelectingButton = new FXButton(this, "Stop selecting", nullptr, this, MID_GNE_ADDITIONALFRAME_STOPSELECTION, GUIDesignButton); - myAbortSelectingButton = new FXButton(this, "Abort selecting", nullptr, this, MID_GNE_ADDITIONALFRAME_ABORTSELECTION, GUIDesignButton); + myStopSelectingButton = new FXButton(getCollapsableFrame(), "Stop selecting", nullptr, this, MID_GNE_ADDITIONALFRAME_STOPSELECTION, GUIDesignButton); + myAbortSelectingButton = new FXButton(getCollapsableFrame(), "Abort selecting", nullptr, this, MID_GNE_ADDITIONALFRAME_ABORTSELECTION, GUIDesignButton); // disable stop and abort functions as init myStopSelectingButton->disable(); myAbortSelectingButton->disable(); @@ -94,20 +94,20 @@ void -GNEAdditionalFrame::SelectorParentLanes::showSelectorParentLanesModul() { +GNEAdditionalFrame::SelectorParentLanes::showSelectorParentLanesModule() { // abort current selection before show abortConsecutiveLaneSelector(); - // show FXGroupBox - FXGroupBox::show(); + // show FXGroupBoxModule + FXGroupBoxModule::show(); } void -GNEAdditionalFrame::SelectorParentLanes::hideSelectorParentLanesModul() { +GNEAdditionalFrame::SelectorParentLanes::hideSelectorParentLanesModule() { // abort current selection before hide abortConsecutiveLaneSelector(); - // hide FXGroupBox - FXGroupBox::hide(); + // hide FXGroupBoxModule + FXGroupBoxModule::hide(); } @@ -127,10 +127,10 @@ bool GNEAdditionalFrame::SelectorParentLanes::stopConsecutiveLaneSelector() { // obtain tagproperty (only for improve code legibility) - const auto& tagProperties = myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTagProperties(); + const auto& tagProperties = myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty(); // abort if there isn't at least two lanes if (mySelectedLanes.size() < 2) { - WRITE_WARNING(myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTagProperties().getTagStr() + " requires at least two lanes."); + WRITE_WARNING(myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty().getTagStr() + " requires at least two lanes."); // abort consecutive lane selector abortConsecutiveLaneSelector(); return false; @@ -145,12 +145,12 @@ myAdditionalFrameParent->myNeteditAttributes->getNeteditAttributesAndValues(myAdditionalFrameParent->myBaseAdditional, nullptr); // Check if ID has to be generated if (!myAdditionalFrameParent->myBaseAdditional->hasStringAttribute(SUMO_ATTR_ID)) { - myAdditionalFrameParent->myBaseAdditional->addStringAttribute(SUMO_ATTR_ID, myAdditionalFrameParent->generateID(nullptr)); + myAdditionalFrameParent->myBaseAdditional->addStringAttribute(SUMO_ATTR_ID, myAdditionalFrameParent->getViewNet()->getNet()->getAttributeCarriers()->generateAdditionalID(tagProperties.getTag())); } // obtain lane IDs std::vector laneIDs; - for (auto i : mySelectedLanes) { - laneIDs.push_back(i.first->getID()); + for (const auto& selectedlane : mySelectedLanes) { + laneIDs.push_back(selectedlane.first->getID()); } myAdditionalFrameParent->myBaseAdditional->addStringListAttribute(SUMO_ATTR_LANES, laneIDs); // Obtain clicked position over first lane @@ -173,7 +173,7 @@ // abort consecutive lane selector abortConsecutiveLaneSelector(); // refresh additional attributes - myAdditionalFrameParent->myAdditionalAttributes->refreshRows(); + myAdditionalFrameParent->myAdditionalAttributes->refreshAttributesCreator(); return true; } } @@ -306,19 +306,19 @@ // --------------------------------------------------------------------------- GNEAdditionalFrame::SelectorChildEdges::SelectorChildEdges(GNEAdditionalFrame* additionalFrameParent) : - FXGroupBox(additionalFrameParent->myContentFrame, "Edges", GUIDesignGroupBoxFrame), + FXGroupBoxModule(additionalFrameParent->myContentFrame, "Edges"), myAdditionalFrameParent(additionalFrameParent) { // Create menuCheck for selected edges - myUseSelectedEdgesCheckButton = new FXCheckButton(this, ("Use selected " + toString(SUMO_TAG_EDGE) + "s").c_str(), this, MID_GNE_ADDITIONALFRAME_USESELECTED, GUIDesignCheckButton); + myUseSelectedEdgesCheckButton = new FXCheckButton(getCollapsableFrame(), ("Use selected " + toString(SUMO_TAG_EDGE) + "s").c_str(), this, MID_GNE_ADDITIONALFRAME_USESELECTED, GUIDesignCheckButton); // Create search box - myEdgesSearch = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_ADDITIONALFRAME_SEARCH, GUIDesignTextField); + myEdgesSearch = new FXTextField(getCollapsableFrame(), GUIDesignTextFieldNCol, this, MID_GNE_ADDITIONALFRAME_SEARCH, GUIDesignTextField); // Create list - myList = new FXList(this, this, MID_GNE_ADDITIONALFRAME_SELECT, GUIDesignListFixedHeight, 0, 0, 0, 100); + myList = new FXList(getCollapsableFrame(), this, MID_GNE_ADDITIONALFRAME_SELECT, GUIDesignListFixedHeight, 0, 0, 0, 100); // Create horizontal frame - FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); // Create button for clear selection myClearEdgesSelection = new FXButton(buttonsFrame, "Clear", nullptr, this, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GUIDesignButtonRectangular); @@ -327,7 +327,7 @@ myInvertEdgesSelection = new FXButton(buttonsFrame, "Invert", nullptr, this, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GUIDesignButtonRectangular); // Hide List - hideSelectorChildEdgesModul(); + hideSelectorChildEdgesModule(); } @@ -357,7 +357,7 @@ void -GNEAdditionalFrame::SelectorChildEdges::showSelectorChildEdgesModul(std::string search) { +GNEAdditionalFrame::SelectorChildEdges::showSelectorChildEdgesModule(std::string search) { // clear list of egdge ids myList->clearItems(); // iterate over edges of net @@ -379,8 +379,8 @@ void -GNEAdditionalFrame::SelectorChildEdges::hideSelectorChildEdgesModul() { - FXGroupBox::hide(); +GNEAdditionalFrame::SelectorChildEdges::hideSelectorChildEdgesModule() { + FXGroupBoxModule::hide(); } @@ -419,7 +419,7 @@ long GNEAdditionalFrame::SelectorChildEdges::onCmdTypeInSearchBox(FXObject*, FXSelector, void*) { // Show only Id's of SelectorChildEdges that contains the searched string - showSelectorChildEdgesModul(myEdgesSearch->getText().text()); + showSelectorChildEdgesModule(myEdgesSearch->getText().text()); return 1; } @@ -458,19 +458,19 @@ // --------------------------------------------------------------------------- GNEAdditionalFrame::SelectorChildLanes::SelectorChildLanes(GNEAdditionalFrame* additionalFrameParent) : - FXGroupBox(additionalFrameParent->myContentFrame, "Lanes", GUIDesignGroupBoxFrame), + FXGroupBoxModule(additionalFrameParent->myContentFrame, "Lanes"), myAdditionalFrameParent(additionalFrameParent) { // Create CheckBox for selected lanes - myUseSelectedLanesCheckButton = new FXCheckButton(this, ("Use selected " + toString(SUMO_TAG_LANE) + "s").c_str(), this, MID_GNE_ADDITIONALFRAME_USESELECTED, GUIDesignCheckButton); + myUseSelectedLanesCheckButton = new FXCheckButton(getCollapsableFrame(), ("Use selected " + toString(SUMO_TAG_LANE) + "s").c_str(), this, MID_GNE_ADDITIONALFRAME_USESELECTED, GUIDesignCheckButton); // Create search box - myLanesSearch = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_ADDITIONALFRAME_SEARCH, GUIDesignTextField); + myLanesSearch = new FXTextField(getCollapsableFrame(), GUIDesignTextFieldNCol, this, MID_GNE_ADDITIONALFRAME_SEARCH, GUIDesignTextField); // Create list - myList = new FXList(this, this, MID_GNE_ADDITIONALFRAME_SELECT, GUIDesignListFixedHeight, 0, 0, 0, 100); + myList = new FXList(getCollapsableFrame(), this, MID_GNE_ADDITIONALFRAME_SELECT, GUIDesignListFixedHeight, 0, 0, 0, 100); // Create horizontal frame - FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); // Create button for clear selection clearLanesSelection = new FXButton(buttonsFrame, "clear", nullptr, this, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GUIDesignButtonRectangular); @@ -479,7 +479,7 @@ invertLanesSelection = new FXButton(buttonsFrame, "invert", nullptr, this, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GUIDesignButtonRectangular); // Hide List - hideSelectorChildLanesModul(); + hideSelectorChildLanesModule(); } @@ -509,7 +509,7 @@ void -GNEAdditionalFrame::SelectorChildLanes::showSelectorChildLanesModul(std::string search) { +GNEAdditionalFrame::SelectorChildLanes::showSelectorChildLanesModule(std::string search) { myList->clearItems(); // add all network lanes for (const auto& lane : myAdditionalFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getLanes()) { @@ -525,8 +525,8 @@ void -GNEAdditionalFrame::SelectorChildLanes::hideSelectorChildLanesModul() { - FXGroupBox::hide(); +GNEAdditionalFrame::SelectorChildLanes::hideSelectorChildLanesModule() { + FXGroupBoxModule::hide(); } @@ -565,7 +565,7 @@ long GNEAdditionalFrame::SelectorChildLanes::onCmdTypeInSearchBox(FXObject*, FXSelector, void*) { // Show only Id's of SelectorChildLanes that contains the searched string - showSelectorChildLanesModul(myLanesSearch->getText().text()); + showSelectorChildLanesModule(myLanesSearch->getText().text()); return 1; } @@ -604,21 +604,21 @@ // --------------------------------------------------------------------------- GNEAdditionalFrame::E2MultilaneLaneSelector::E2MultilaneLaneSelector(GNEAdditionalFrame* additionalFrameParent) : - FXGroupBox(additionalFrameParent->myContentFrame, "E2Multilane lane selector", GUIDesignGroupBoxFrame), + FXGroupBoxModule(additionalFrameParent->myContentFrame, "E2Multilane lane selector"), myAdditionalFrameParent(additionalFrameParent) { // create label for route info - myInfoRouteLabel = new FXLabel(this, "No lanes selected", 0, GUIDesignLabelFrameThicked); + myInfoRouteLabel = new FXLabel(getCollapsableFrame(), "No lanes selected", 0, GUIDesignLabelFrameThicked); // create button for finish route creation - myFinishCreationButton = new FXButton(this, "Finish route creation", nullptr, this, MID_GNE_LANEPATH_FINISH, GUIDesignButton); + myFinishCreationButton = new FXButton(getCollapsableFrame(), "Finish route creation", nullptr, this, MID_GNE_LANEPATH_FINISH, GUIDesignButton); myFinishCreationButton->disable(); // create button for abort route creation - myAbortCreationButton = new FXButton(this, "Abort route creation", nullptr, this, MID_GNE_LANEPATH_ABORT, GUIDesignButton); + myAbortCreationButton = new FXButton(getCollapsableFrame(), "Abort route creation", nullptr, this, MID_GNE_LANEPATH_ABORT, GUIDesignButton); myAbortCreationButton->disable(); // create button for remove last inserted lane - myRemoveLastInsertedElement = new FXButton(this, "Remove last inserted lane", nullptr, this, MID_GNE_LANEPATH_REMOVELAST, GUIDesignButton); + myRemoveLastInsertedElement = new FXButton(getCollapsableFrame(), "Remove last inserted lane", nullptr, this, MID_GNE_LANEPATH_REMOVELAST, GUIDesignButton); myRemoveLastInsertedElement->disable(); // create check button - myShowCandidateLanes = new FXCheckButton(this, "Show candidate lanes", this, MID_GNE_LANEPATH_SHOWCANDIDATES, GUIDesignCheckButton); + myShowCandidateLanes = new FXCheckButton(getCollapsableFrame(), "Show candidate lanes", this, MID_GNE_LANEPATH_SHOWCANDIDATES, GUIDesignCheckButton); myShowCandidateLanes->setCheck(TRUE); // create backspace label (always shown) new FXLabel(this, @@ -631,7 +631,7 @@ void -GNEAdditionalFrame::E2MultilaneLaneSelector::showE2MultilaneLaneSelectorModul() { +GNEAdditionalFrame::E2MultilaneLaneSelector::showE2MultilaneLaneSelectorModule() { // first abort creation abortPathCreation(); // disable buttons @@ -648,7 +648,7 @@ void -GNEAdditionalFrame::E2MultilaneLaneSelector::hideE2MultilaneLaneSelectorModul() { +GNEAdditionalFrame::E2MultilaneLaneSelector::hideE2MultilaneLaneSelectorModule() { // clear path clearPath(); // hide modul @@ -824,7 +824,7 @@ bool GNEAdditionalFrame::E2MultilaneLaneSelector::createPath() { // obtain tagproperty (only for improve code legibility) - const auto& tagProperties = myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTagProperties(); + const auto& tagProperties = myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty(); // first check that current tag is valid if (tagProperties.getTag() != GNE_TAG_E2DETECTOR_MULTILANE) { return false; @@ -858,7 +858,7 @@ myAdditionalFrameParent->myBaseAdditional->addDoubleAttribute(SUMO_ATTR_POSITION, myLanePath.front().second); myAdditionalFrameParent->myBaseAdditional->addDoubleAttribute(SUMO_ATTR_ENDPOS, myLanePath.back().second); // parse common attributes - if (!myAdditionalFrameParent->buildAdditionalCommonAttributes(myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTagProperties())) { + if (!myAdditionalFrameParent->buildAdditionalCommonAttributes(myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty())) { return false; } // show warning dialogbox and stop check if input parameters are valid @@ -871,11 +871,11 @@ // build additional additionalHandler.parseSumoBaseObject(myAdditionalFrameParent->myBaseAdditional); // Refresh additional Parent Selector (For additionals that have a limited number of children) - myAdditionalFrameParent->mySelectorAdditionalParent->refreshSelectorParentModul(); + myAdditionalFrameParent->mySelectorAdditionalParent->refreshSelectorParentModule(); // abort E2 creation abortPathCreation(); // refresh additional attributes - myAdditionalFrameParent->myAdditionalAttributes->refreshRows(); + myAdditionalFrameParent->myAdditionalAttributes->refreshAttributesCreator(); return true; } @@ -1008,19 +1008,19 @@ myBaseAdditional(nullptr) { // create item Selector modul for additionals - myAdditionalTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::ADDITIONALELEMENT); + myAdditionalTagSelector = new GNEFrameModules::TagSelector(this, GNETagProperties::TagType::ADDITIONALELEMENT, SUMO_TAG_BUS_STOP); // Create additional parameters - myAdditionalAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + myAdditionalAttributes = new GNEFrameAttributeModules::AttributesCreator(this); // Create Netedit parameter - myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); + myNeteditAttributes = new GNEFrameAttributeModules::NeteditAttributes(this); // Create consecutive Lane Selector mySelectorLaneParents = new SelectorParentLanes(this); // Create selector parent - mySelectorAdditionalParent = new GNEFrameModuls::SelectorParent(this); + mySelectorAdditionalParent = new GNEFrameModules::SelectorParent(this); // Create selector child edges mySelectorChildEdges = new SelectorChildEdges(this); @@ -1030,9 +1030,6 @@ // Create list for E2Multilane lane selector myE2MultilaneLaneSelector = new E2MultilaneLaneSelector(this); - - // set BusStop as default additional - myAdditionalTagSelector->setCurrentTag(SUMO_TAG_BUS_STOP); } @@ -1046,8 +1043,8 @@ void GNEAdditionalFrame::show() { - // refresh item selector - myAdditionalTagSelector->refreshTagProperties(); + // refresh tag selector + myAdditionalTagSelector->refreshTagSelector(); // show frame GNEFrame::show(); } @@ -1056,7 +1053,7 @@ bool GNEAdditionalFrame::addAdditional(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { // first check that current selected additional is valid - if (myAdditionalTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_NOTHING) { + if (myAdditionalTagSelector->getCurrentTemplateAC() == nullptr) { myViewNet->setStatusBarText("Current selected additional isn't valid."); return false; } @@ -1066,7 +1063,7 @@ return false; } // obtain tagproperty (only for improve code legibility) - const auto& tagProperties = myAdditionalTagSelector->getCurrentTagProperties(); + const auto& tagProperties = myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty(); // create base additional if (!createBaseAdditionalObject(tagProperties)) { return false; @@ -1091,7 +1088,7 @@ void -GNEAdditionalFrame::showSelectorChildLanesModul() { +GNEAdditionalFrame::showSelectorChildLanesModule() { // Show frame GNEFrame::show(); // Update UseSelectedLane CheckBox @@ -1115,53 +1112,53 @@ void GNEAdditionalFrame::tagSelected() { - if (myAdditionalTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + if (myAdditionalTagSelector->getCurrentTemplateAC()) { // show additional attributes modul - myAdditionalAttributes->showAttributesCreatorModul(myAdditionalTagSelector->getCurrentTagProperties(), {}); + myAdditionalAttributes->showAttributesCreatorModule(myAdditionalTagSelector->getCurrentTemplateAC(), {}); // show netedit attributes - myNeteditAttributes->showNeteditAttributesModul(myAdditionalTagSelector->getCurrentTagProperties()); + myNeteditAttributes->showNeteditAttributesModule(myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty()); // Show myAdditionalFrameParent if we're adding an slave element - if (myAdditionalTagSelector->getCurrentTagProperties().isChild()) { - mySelectorAdditionalParent->showSelectorParentModul(myAdditionalTagSelector->getCurrentTagProperties().getParentTags()); + if (myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty().isChild()) { + mySelectorAdditionalParent->showSelectorParentModule(myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty().getParentTags()); } else { - mySelectorAdditionalParent->hideSelectorParentModul(); + mySelectorAdditionalParent->hideSelectorParentModule(); } // Show SelectorChildEdges if we're adding an additional that own the attribute SUMO_ATTR_EDGES - if (myAdditionalTagSelector->getCurrentTagProperties().hasAttribute(SUMO_ATTR_EDGES)) { - mySelectorChildEdges->showSelectorChildEdgesModul(); + if (myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty().hasAttribute(SUMO_ATTR_EDGES)) { + mySelectorChildEdges->showSelectorChildEdgesModule(); } else { - mySelectorChildEdges->hideSelectorChildEdgesModul(); + mySelectorChildEdges->hideSelectorChildEdgesModule(); } // check if we must show E2 multilane lane selector - if (myAdditionalTagSelector->getCurrentTagProperties().getTag() == GNE_TAG_E2DETECTOR_MULTILANE) { - myE2MultilaneLaneSelector->showE2MultilaneLaneSelectorModul(); - } else if (myAdditionalTagSelector->getCurrentTagProperties().hasAttribute(SUMO_ATTR_LANES)) { - myE2MultilaneLaneSelector->hideE2MultilaneLaneSelectorModul(); + if (myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() == GNE_TAG_E2DETECTOR_MULTILANE) { + myE2MultilaneLaneSelector->showE2MultilaneLaneSelectorModule(); + } else if (myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty().hasAttribute(SUMO_ATTR_LANES)) { + myE2MultilaneLaneSelector->hideE2MultilaneLaneSelectorModule(); // Show SelectorChildLanes or consecutive lane selector if we're adding an additional that own the attribute SUMO_ATTR_LANES - if (myAdditionalTagSelector->getCurrentTagProperties().isChild() && - (myAdditionalTagSelector->getCurrentTagProperties().getParentTags().front() == SUMO_TAG_LANE)) { + if (myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty().isChild() && + (myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty().getParentTags().front() == SUMO_TAG_LANE)) { // show selector parent lane and hide selector child lane - mySelectorLaneParents->showSelectorParentLanesModul(); - mySelectorChildLanes->hideSelectorChildLanesModul(); + mySelectorLaneParents->showSelectorParentLanesModule(); + mySelectorChildLanes->hideSelectorChildLanesModule(); } else { // show selector child lane and hide selector parent lane - mySelectorChildLanes->showSelectorChildLanesModul(); - mySelectorLaneParents->hideSelectorParentLanesModul(); + mySelectorChildLanes->showSelectorChildLanesModule(); + mySelectorLaneParents->hideSelectorParentLanesModule(); } } else { - myE2MultilaneLaneSelector->hideE2MultilaneLaneSelectorModul(); - mySelectorChildLanes->hideSelectorChildLanesModul(); - mySelectorLaneParents->hideSelectorParentLanesModul(); + myE2MultilaneLaneSelector->hideE2MultilaneLaneSelectorModule(); + mySelectorChildLanes->hideSelectorChildLanesModule(); + mySelectorLaneParents->hideSelectorParentLanesModule(); } } else { // hide all moduls if additional isn't valid - myAdditionalAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - mySelectorAdditionalParent->hideSelectorParentModul(); - mySelectorChildEdges->hideSelectorChildEdgesModul(); - mySelectorChildLanes->hideSelectorChildLanesModul(); - mySelectorLaneParents->hideSelectorParentLanesModul(); - myE2MultilaneLaneSelector->hideE2MultilaneLaneSelectorModul(); + myAdditionalAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); + mySelectorAdditionalParent->hideSelectorParentModule(); + mySelectorChildEdges->hideSelectorChildEdgesModule(); + mySelectorChildLanes->hideSelectorChildLanesModule(); + mySelectorLaneParents->hideSelectorParentLanesModule(); + myE2MultilaneLaneSelector->hideE2MultilaneLaneSelectorModule(); } } @@ -1198,7 +1195,7 @@ } // stop if currently there isn't a valid selected parent if (mySelectorAdditionalParent->getIdSelected().empty()) { - myAdditionalAttributes->showWarningMessage("A " + toString(tagProperty.getParentTags().front()) + " must be selected before insertion of " + myAdditionalTagSelector->getCurrentTagProperties().getTagStr() + "."); + myAdditionalAttributes->showWarningMessage("A " + toString(tagProperty.getParentTags().front()) + " must be selected before insertion of " + myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty().getTagStr() + "."); return false; } else { // create baseAdditional parent @@ -1221,36 +1218,6 @@ } -std::string -GNEAdditionalFrame::generateID(GNENetworkElement* networkElement) const { - // obtain current number of additionals to generate a new index faster - int additionalIndex = (int)myViewNet->getNet()->getAttributeCarriers()->getAdditionals().at(myAdditionalTagSelector->getCurrentTagProperties().getTag()).size(); - // obtain tag Properties (only for improve code legilibility - const auto& tagProperties = myAdditionalTagSelector->getCurrentTagProperties(); - // get attribute carriers - const auto& attributeCarriers = myViewNet->getNet()->getAttributeCarriers(); - if (networkElement) { - // special case for vaporizers - if (tagProperties.getTag() == SUMO_TAG_VAPORIZER) { - return networkElement->getID(); - } else { - // generate ID using networkElement - while (attributeCarriers->retrieveAdditional(tagProperties.getTag(), tagProperties.getTagStr() + "_" + networkElement->getID() + "_" + toString(additionalIndex), false) != nullptr) { - additionalIndex++; - } - return tagProperties.getTagStr() + "_" + networkElement->getID() + "_" + toString(additionalIndex); - } - } else { - // generate ID without networkElement - while (attributeCarriers->retrieveAdditional(tagProperties.getTag(), tagProperties.getTagStr() + "_" + toString(additionalIndex), false) != nullptr) { - additionalIndex++; - } - return tagProperties.getTagStr() + "_" + toString(additionalIndex); - } -} - - - bool GNEAdditionalFrame::buildAdditionalCommonAttributes(const GNETagProperties& tagProperties) { // If additional has a interval defined by a begin or end, check that is valid @@ -1264,7 +1231,7 @@ } // If additional own the attribute SUMO_ATTR_FILE but was't defined, will defined as .xml if (tagProperties.hasAttribute(SUMO_ATTR_FILE) && myBaseAdditional->getStringAttribute(SUMO_ATTR_FILE).empty()) { - if ((myAdditionalTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_CALIBRATOR) && (myAdditionalTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_REROUTER)) { + if ((myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() != SUMO_TAG_CALIBRATOR) && (myAdditionalTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() != SUMO_TAG_REROUTER)) { // SUMO_ATTR_FILE is optional for calibrators and rerouters (fails to load in sumo when given and the file does not exist) myBaseAdditional->addStringAttribute(SUMO_ATTR_FILE, myBaseAdditional->getStringAttribute(SUMO_ATTR_ID) + ".xml"); } @@ -1302,7 +1269,7 @@ myBaseAdditional->addStringAttribute(SUMO_ATTR_EDGE, lane->getParentEdge()->getID()); // Check if ID has to be generated if (!myBaseAdditional->hasStringAttribute(SUMO_ATTR_ID)) { - myBaseAdditional->addStringAttribute(SUMO_ATTR_ID, generateID(lane->getParentEdge())); + myBaseAdditional->addStringAttribute(SUMO_ATTR_ID, myViewNet->getNet()->getAttributeCarriers()->generateAdditionalID(tagProperties.getTag())); } } else { return false; @@ -1321,12 +1288,12 @@ // build additional additionalHandler.parseSumoBaseObject(myBaseAdditional); // Refresh additional Parent Selector (For additionals that have a limited number of children) - mySelectorAdditionalParent->refreshSelectorParentModul(); + mySelectorAdditionalParent->refreshSelectorParentModule(); // clear selected eddges and lanes mySelectorChildEdges->onCmdClearSelection(nullptr, 0, nullptr); mySelectorChildLanes->onCmdClearSelection(nullptr, 0, nullptr); // refresh additional attributes - myAdditionalAttributes->refreshRows(); + myAdditionalAttributes->refreshAttributesCreator(); return true; } } @@ -1340,7 +1307,7 @@ myBaseAdditional->addStringAttribute(SUMO_ATTR_LANE, lane->getID()); // Check if ID has to be generated if (!myBaseAdditional->hasStringAttribute(SUMO_ATTR_ID)) { - myBaseAdditional->addStringAttribute(SUMO_ATTR_ID, generateID(lane)); + myBaseAdditional->addStringAttribute(SUMO_ATTR_ID, myViewNet->getNet()->getAttributeCarriers()->generateAdditionalID(tagProperties.getTag())); } } else { return false; @@ -1363,12 +1330,12 @@ // build additional additionalHandler.parseSumoBaseObject(myBaseAdditional); // Refresh additional Parent Selector (For additionals that have a limited number of children) - mySelectorAdditionalParent->refreshSelectorParentModul(); + mySelectorAdditionalParent->refreshSelectorParentModule(); // clear selected eddges and lanes mySelectorChildEdges->onCmdClearSelection(nullptr, 0, nullptr); mySelectorChildLanes->onCmdClearSelection(nullptr, 0, nullptr); // refresh additional attributes - myAdditionalAttributes->refreshRows(); + myAdditionalAttributes->refreshAttributesCreator(); return true; } } @@ -1376,9 +1343,24 @@ bool GNEAdditionalFrame::buildAdditionalOverView(const GNETagProperties& tagProperties) { + // disable intervals (temporal) + if ((tagProperties.getTag() == SUMO_TAG_INTERVAL) || + (tagProperties.getTag() == SUMO_TAG_DEST_PROB_REROUTE) || + (tagProperties.getTag() == SUMO_TAG_CLOSING_REROUTE) || + (tagProperties.getTag() == SUMO_TAG_CLOSING_LANE_REROUTE) || + (tagProperties.getTag() == SUMO_TAG_ROUTE_PROB_REROUTE) || + (tagProperties.getTag() == SUMO_TAG_PARKING_AREA_REROUTE)) { + WRITE_WARNING("Currently unsuported. Create rerouter elements using rerouter dialog"); + return false; + } + // disable intervals (temporal) + if (tagProperties.getTag() == SUMO_TAG_STEP) { + WRITE_WARNING("Currently unsuported. Create VSS steps elements using VSS dialog"); + return false; + } // Check if ID has to be generated if (!myBaseAdditional->hasStringAttribute(SUMO_ATTR_ID)) { - myBaseAdditional->addStringAttribute(SUMO_ATTR_ID, generateID(nullptr)); + myBaseAdditional->addStringAttribute(SUMO_ATTR_ID, myViewNet->getNet()->getAttributeCarriers()->generateAdditionalID(tagProperties.getTag())); } // Obtain position as the clicked position over view const Position viewPos = myViewNet->snapToActiveGrid(myViewNet->getPositionInformation()); @@ -1420,12 +1402,12 @@ // build additional additionalHandler.parseSumoBaseObject(myBaseAdditional); // Refresh additional Parent Selector (For additionals that have a limited number of children) - mySelectorAdditionalParent->refreshSelectorParentModul(); + mySelectorAdditionalParent->refreshSelectorParentModule(); // clear selected eddges and lanes mySelectorChildEdges->onCmdClearSelection(nullptr, 0, nullptr); mySelectorChildLanes->onCmdClearSelection(nullptr, 0, nullptr); // refresh additional attributes - myAdditionalAttributes->refreshRows(); + myAdditionalAttributes->refreshAttributesCreator(); return true; } } diff -Nru sumo-1.11.0/src/netedit/frames/network/GNEAdditionalFrame.h sumo-1.12.0/src/netedit/frames/network/GNEAdditionalFrame.h --- sumo-1.11.0/src/netedit/frames/network/GNEAdditionalFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNEAdditionalFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -21,6 +21,7 @@ #include #include +#include // =========================================================================== @@ -38,7 +39,7 @@ // class SelectorParentLanes // =========================================================================== - class SelectorParentLanes : protected FXGroupBox { + class SelectorParentLanes : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEAdditionalFrame::SelectorParentLanes) public: @@ -49,10 +50,10 @@ ~SelectorParentLanes(); /// @brief show SelectorParentLanes modul - void showSelectorParentLanesModul(); + void showSelectorParentLanesModule(); /// @brief hide SelectorParentLanes - void hideSelectorParentLanesModul(); + void hideSelectorParentLanesModule(); /// @brief start selection of consecutive lanes void startConsecutiveLaneSelector(GNELane* lane, const Position& clickedPosition); @@ -114,7 +115,7 @@ // class SelectorChildEdges // =========================================================================== - class SelectorChildEdges : protected FXGroupBox { + class SelectorChildEdges : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEAdditionalFrame::SelectorChildEdges) @@ -128,11 +129,11 @@ /// @brief get list of selecte id's in string format std::vector getEdgeIdsSelected() const; - /// @brief Show SelectorChildEdges Modul - void showSelectorChildEdgesModul(std::string search = ""); + /// @brief Show SelectorChildEdges Module + void showSelectorChildEdgesModule(std::string search = ""); - /// @brief hide SelectorChildEdges Modul - void hideSelectorChildEdgesModul(); + /// @brief hide SelectorChildEdges Module + void hideSelectorChildEdgesModule(); /// @brief Update use selectedEdges void updateUseSelectedEdges(); @@ -182,7 +183,7 @@ // class SelectorChildLanes // =========================================================================== - class SelectorChildLanes : protected FXGroupBox { + class SelectorChildLanes : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEAdditionalFrame::SelectorChildLanes) @@ -196,11 +197,11 @@ /// @brief get list of selecte lane ids in string format std::vector getLaneIdsSelected() const; - /// @brief Show list of SelectorChildLanes Modul - void showSelectorChildLanesModul(std::string search = ""); + /// @brief Show list of SelectorChildLanes Module + void showSelectorChildLanesModule(std::string search = ""); - /// @brief hide SelectorChildLanes Modul - void hideSelectorChildLanesModul(); + /// @brief hide SelectorChildLanes Module + void hideSelectorChildLanesModule(); // @brief Update use selectedLanes void updateUseSelectedLanes(); @@ -250,7 +251,7 @@ // class E2MultilaneLaneSelector // =========================================================================== - class E2MultilaneLaneSelector : protected FXGroupBox { + class E2MultilaneLaneSelector : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEAdditionalFrame::E2MultilaneLaneSelector) @@ -262,10 +263,10 @@ ~E2MultilaneLaneSelector(); /// @brief show E2MultilaneLaneSelector - void showE2MultilaneLaneSelectorModul(); + void showE2MultilaneLaneSelectorModule(); /// @brief show E2MultilaneLaneSelector - void hideE2MultilaneLaneSelectorModul(); + void hideE2MultilaneLaneSelectorModule(); /// @brief add lane bool addLane(GNELane* lane); @@ -361,7 +362,7 @@ bool addAdditional(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); /// @brief show selector child lane and update use selected edges/lanes - void showSelectorChildLanesModul(); + void showSelectorChildLanesModule(); /// @brief get consecutive Lane Selector GNEAdditionalFrame::SelectorParentLanes* getConsecutiveLaneSelector() const; @@ -380,9 +381,6 @@ // @brief create baseAdditionalObject bool createBaseAdditionalObject(const GNETagProperties& tagProperty); - /// @brief generate a ID for an additiona element - std::string generateID(GNENetworkElement* networkElement) const; - /// @brief build common additional attributes bool buildAdditionalCommonAttributes(const GNETagProperties& tagValues); @@ -396,26 +394,26 @@ bool buildAdditionalOverView(const GNETagProperties& tagValues); /// @brief item selector - GNEFrameModuls::TagSelector* myAdditionalTagSelector; + GNEFrameModules::TagSelector* myAdditionalTagSelector; /// @brief internal additional attributes - GNEFrameAttributesModuls::AttributesCreator* myAdditionalAttributes; + GNEFrameAttributeModules::AttributesCreator* myAdditionalAttributes; /// @brief Netedit parameter - GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; + GNEFrameAttributeModules::NeteditAttributes* myNeteditAttributes; - /// @brief Modul for select parent lanes (currently only consecutives) + /// @brief Module for select parent lanes (currently only consecutives) SelectorParentLanes* mySelectorLaneParents; - /// @brief Modul for select a single parent additional - GNEFrameModuls::SelectorParent* mySelectorAdditionalParent; + /// @brief Module for select a single parent additional + GNEFrameModules::SelectorParent* mySelectorAdditionalParent; - /// @brief Modul for select child edges + /// @brief Module for select child edges SelectorChildEdges* mySelectorChildEdges; - /// @brief Modul for select child lanes + /// @brief Module for select child lanes SelectorChildLanes* mySelectorChildLanes; - /// @brief Modul for E2Multilane lane selector + /// @brief Module for E2Multilane lane selector E2MultilaneLaneSelector* myE2MultilaneLaneSelector; }; diff -Nru sumo-1.11.0/src/netedit/frames/network/GNEConnectorFrame.cpp sumo-1.12.0/src/netedit/frames/network/GNEConnectorFrame.cpp --- sumo-1.11.0/src/netedit/frames/network/GNEConnectorFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNEConnectorFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2011-2022 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/ @@ -51,8 +51,8 @@ }; // Object implementation -FXIMPLEMENT(GNEConnectorFrame::ConnectionModifications, FXGroupBox, ConnectionModificationsMap, ARRAYNUMBER(ConnectionModificationsMap)) -FXIMPLEMENT(GNEConnectorFrame::ConnectionOperations, FXGroupBox, ConnectionOperationsMap, ARRAYNUMBER(ConnectionOperationsMap)) +FXIMPLEMENT(GNEConnectorFrame::ConnectionModifications, FXGroupBoxModule, ConnectionModificationsMap, ARRAYNUMBER(ConnectionModificationsMap)) +FXIMPLEMENT(GNEConnectorFrame::ConnectionOperations, FXGroupBoxModule, ConnectionOperationsMap, ARRAYNUMBER(ConnectionOperationsMap)) // =========================================================================== @@ -64,9 +64,9 @@ // --------------------------------------------------------------------------- GNEConnectorFrame::CurrentLane::CurrentLane(GNEConnectorFrame* connectorFrameParent) : - FXGroupBox(connectorFrameParent->myContentFrame, "Lane", GUIDesignGroupBoxFrame) { + FXGroupBoxModule(connectorFrameParent->myContentFrame, "Lane") { // create lane label - myCurrentLaneLabel = new FXLabel(this, "No lane selected", 0, GUIDesignLabelLeft); + myCurrentLaneLabel = new FXLabel(getCollapsableFrame(), "No lane selected", 0, GUIDesignLabelLeft); } @@ -87,18 +87,18 @@ // --------------------------------------------------------------------------- GNEConnectorFrame::ConnectionModifications::ConnectionModifications(GNEConnectorFrame* connectorFrameParent) : - FXGroupBox(connectorFrameParent->myContentFrame, "Modifications", GUIDesignGroupBoxFrame), + FXGroupBoxModule(connectorFrameParent->myContentFrame, "Modifications"), myConnectorFrameParent(connectorFrameParent) { // Create "Cancel" button - myCancelButton = new FXButton(this, "Cancel\t\tDiscard connection modifications (Esc)", + myCancelButton = new FXButton(getCollapsableFrame(), "Cancel\t\tDiscard connection modifications (Esc)", GUIIconSubSys::getIcon(GUIIcon::CANCEL), this, MID_CANCEL, GUIDesignButton); // Create "OK" button - mySaveButton = new FXButton(this, "OK\t\tSave connection modifications (Enter)", + mySaveButton = new FXButton(getCollapsableFrame(), "OK\t\tSave connection modifications (Enter)", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), this, MID_OK, GUIDesignButton); // Create checkbox for protect routes - myProtectRoutesCheckBox = new FXCheckButton(this, "Protect routes", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + myProtectRoutesCheckBox = new FXCheckButton(getCollapsableFrame(), "Protect routes", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); } @@ -125,7 +125,7 @@ // check if routes has to be protected if (myProtectRoutesCheckBox->isEnabled() && (myProtectRoutesCheckBox->getCheck() == TRUE)) { for (const auto& i : myConnectorFrameParent->myCurrentEditedLane->getParentEdge()->getChildDemandElements()) { - if (!i->isDemandElementValid()) { + if (i->isDemandElementValid() != GNEDemandElement::Problem::OK) { FXMessageBox::warning(getApp(), MBOX_OK, "Error saving connection operations", "%s", ("Connection edition cannot be saved because route '" + i->getID() + "' is broken.").c_str()); @@ -149,26 +149,26 @@ // --------------------------------------------------------------------------- GNEConnectorFrame::ConnectionOperations::ConnectionOperations(GNEConnectorFrame* connectorFrameParent) : - FXGroupBox(connectorFrameParent->myContentFrame, "Operations", GUIDesignGroupBoxFrame), + FXGroupBoxModule(connectorFrameParent->myContentFrame, "Operations"), myConnectorFrameParent(connectorFrameParent) { // Create "Select Dead Ends" button - mySelectDeadEndsButton = new FXButton(this, "Select Dead Ends\t\tSelects all lanes that have no outgoing connection (clears previous selection)", + mySelectDeadEndsButton = new FXButton(getCollapsableFrame(), "Select Dead Ends\t\tSelects all lanes that have no outgoing connection (clears previous selection)", 0, this, MID_GNE_CONNECTORFRAME_SELECTDEADENDS, GUIDesignButton); // Create "Select Dead Starts" button - mySelectDeadStartsButton = new FXButton(this, "Select Dead Starts\t\tSelects all lanes that have no incoming connection (clears previous selection)", + mySelectDeadStartsButton = new FXButton(getCollapsableFrame(), "Select Dead Starts\t\tSelects all lanes that have no incoming connection (clears previous selection)", 0, this, MID_GNE_CONNECTORFRAME_SELECTDEADSTARTS, GUIDesignButton); // Create "Select Conflicts" button - mySelectConflictsButton = new FXButton(this, "Select Conflicts\t\tSelects all lanes with more than one incoming connection from the same edge (clears previous selection)", + mySelectConflictsButton = new FXButton(getCollapsableFrame(), "Select Conflicts\t\tSelects all lanes with more than one incoming connection from the same edge (clears previous selection)", 0, this, MID_GNE_CONNECTORFRAME_SELECTCONFLICTS, GUIDesignButton); // Create "Select Edges which may always pass" button - mySelectPassingButton = new FXButton(this, "Select Passing\t\tSelects all lanes with a connection that has has the 'pass' attribute set", + mySelectPassingButton = new FXButton(getCollapsableFrame(), "Select Passing\t\tSelects all lanes with a connection that has has the 'pass' attribute set", 0, this, MID_GNE_CONNECTORFRAME_SELECTPASS, GUIDesignButton); // Create "Clear Selected" button - myClearSelectedButton = new FXButton(this, "Clear Selected\t\tClears all connections of all selected objects", + myClearSelectedButton = new FXButton(getCollapsableFrame(), "Clear Selected\t\tClears all connections of all selected objects", 0, this, MID_CHOOSEN_CLEAR, GUIDesignButton); // Create "Reset Selected" button - myResetSelectedButton = new FXButton(this, "Reset Selected\t\tRecomputes connections at all selected junctions", + myResetSelectedButton = new FXButton(getCollapsableFrame(), "Reset Selected\t\tRecomputes connections at all selected junctions", 0, this, MID_CHOOSEN_RESET, GUIDesignButton); } @@ -306,10 +306,10 @@ // --------------------------------------------------------------------------- GNEConnectorFrame::ConnectionSelection::ConnectionSelection(GNEConnectorFrame* connectorFrameParent) : - FXGroupBox(connectorFrameParent->myContentFrame, "Selection", GUIDesignGroupBoxFrame) { + FXGroupBoxModule(connectorFrameParent->myContentFrame, "Selection") { // create Selection Hint - myHoldShiftLabel = new FXLabel(this, "Hold while clicking\nto create unyielding\nconnections (pass=true).", 0, GUIDesignLabelFrameInformation); - myHoldControlLabel = new FXLabel(this, "Hold while clicking\nto create conflicting\nconnections (i.e. at zipper\nnodes or with incompatible\npermissions)", 0, GUIDesignLabelFrameInformation); + myHoldShiftLabel = new FXLabel(getCollapsableFrame(), "Hold while clicking\nto create unyielding\nconnections (pass=true).", 0, GUIDesignLabelFrameInformation); + myHoldControlLabel = new FXLabel(getCollapsableFrame(), "Hold while clicking\nto create conflicting\nconnections (i.e. at zipper\nnodes or with incompatible\npermissions)", 0, GUIDesignLabelFrameInformation); } @@ -319,33 +319,33 @@ // GNEConnectorFrame::ConnectionLegend - methods // --------------------------------------------------------------------------- -GNEConnectorFrame::ConnectionLegend::ConnectionLegend(GNEConnectorFrame* connectorFrameParent) : - FXGroupBox(connectorFrameParent->myContentFrame, "Legend", GUIDesignGroupBoxFrame) { +GNEConnectorFrame::Legend::Legend(GNEConnectorFrame* connectorFrameParent) : + FXGroupBoxModule(connectorFrameParent->myContentFrame, "Information") { // create possible target label - FXLabel* possibleTargetLabel = new FXLabel(this, "Possible Target", 0, GUIDesignLabelLeft); + FXLabel* possibleTargetLabel = new FXLabel(getCollapsableFrame(), "Possible Target", 0, GUIDesignLabelLeft); possibleTargetLabel->setBackColor(MFXUtils::getFXColor(connectorFrameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.possible)); possibleTargetLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE)); // create source label - FXLabel* sourceLabel = new FXLabel(this, "Source lane", 0, GUIDesignLabelLeft); + FXLabel* sourceLabel = new FXLabel(getCollapsableFrame(), "Source lane", 0, GUIDesignLabelLeft); sourceLabel->setBackColor(MFXUtils::getFXColor(connectorFrameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.source)); // create target label - FXLabel* targetLabel = new FXLabel(this, "Target lane", 0, GUIDesignLabelLeft); + FXLabel* targetLabel = new FXLabel(getCollapsableFrame(), "Target lane", 0, GUIDesignLabelLeft); targetLabel->setBackColor(MFXUtils::getFXColor(connectorFrameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.target)); // create target (pass) label - FXLabel* targetPassLabel = new FXLabel(this, "Target (pass)", 0, GUIDesignLabelLeft); + FXLabel* targetPassLabel = new FXLabel(getCollapsableFrame(), "Target (pass)", 0, GUIDesignLabelLeft); targetPassLabel->setBackColor(MFXUtils::getFXColor(connectorFrameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.special)); // create conflict label - FXLabel* conflictLabel = new FXLabel(this, "Conflict", 0, GUIDesignLabelLeft); + FXLabel* conflictLabel = new FXLabel(getCollapsableFrame(), "Conflict", 0, GUIDesignLabelLeft); conflictLabel->setBackColor(MFXUtils::getFXColor(connectorFrameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.conflict)); } -GNEConnectorFrame::ConnectionLegend::~ConnectionLegend() {} +GNEConnectorFrame::Legend::~Legend() {} // --------------------------------------------------------------------------- // GNEConnectorFrame - methods @@ -368,7 +368,7 @@ myConnectionSelection = new ConnectionSelection(this); // create connection legend modul - myConnectionLegend = new ConnectionLegend(this); + myLegend = new Legend(this); } diff -Nru sumo-1.11.0/src/netedit/frames/network/GNEConnectorFrame.h sumo-1.12.0/src/netedit/frames/network/GNEConnectorFrame.h --- sumo-1.11.0/src/netedit/frames/network/GNEConnectorFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNEConnectorFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -40,7 +40,7 @@ // class CurrentLane // =========================================================================== - class CurrentLane : protected FXGroupBox { + class CurrentLane : public FXGroupBoxModule { public: /// @brief constructor @@ -61,7 +61,7 @@ // class ConnectionModifications // =========================================================================== - class ConnectionModifications : protected FXGroupBox { + class ConnectionModifications : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEConnectorFrame::ConnectionModifications) @@ -103,7 +103,7 @@ // class ConnectionOperations // =========================================================================== - class ConnectionOperations : protected FXGroupBox { + class ConnectionOperations : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEConnectorFrame::ConnectionOperations) @@ -166,7 +166,7 @@ // class ConnectionSelection // =========================================================================== - class ConnectionSelection : protected FXGroupBox { + class ConnectionSelection : public FXGroupBoxModule { public: /// @brief constructor @@ -184,17 +184,17 @@ }; // =========================================================================== - // class ConnectionLegend + // class Legend // =========================================================================== - class ConnectionLegend : protected FXGroupBox { + class Legend : public FXGroupBoxModule { public: /// @brief constructor - ConnectionLegend(GNEConnectorFrame* connectorFrameParent); + Legend(GNEConnectorFrame* connectorFrameParent); /// @brief destructor - ~ConnectionLegend(); + ~Legend(); private: }; @@ -249,16 +249,16 @@ CurrentLane* myCurrentLane; /// @brief ConnectionModifications modul - ConnectionModifications* myConnectionModifications; + GNEConnectorFrame::ConnectionModifications* myConnectionModifications = nullptr; /// @brief ConnectionOperations modul - ConnectionOperations* myConnectionOperations; + GNEConnectorFrame::ConnectionOperations* myConnectionOperations = nullptr; /// @brief ConnectionSelection modul - ConnectionSelection* myConnectionSelection; + GNEConnectorFrame::ConnectionSelection* myConnectionSelection = nullptr; - /// @brief ConnectionLegend modul - ConnectionLegend* myConnectionLegend; + /// @brief Legend modul + GNEConnectorFrame::Legend* myLegend = nullptr; /// @brief the lane of which connections are to be modified GNELane* myCurrentEditedLane; diff -Nru sumo-1.11.0/src/netedit/frames/network/GNECreateEdgeFrame.cpp sumo-1.12.0/src/netedit/frames/network/GNECreateEdgeFrame.cpp --- sumo-1.11.0/src/netedit/frames/network/GNECreateEdgeFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNECreateEdgeFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -25,11 +25,12 @@ #include #include #include -#include #include #include #include #include +#include +#include #include #include #include @@ -45,28 +46,21 @@ FXDEFMAP(GNECreateEdgeFrame::EdgeTypeSelector) EdgeTypeSelectorMap[] = { FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATEEDGEFRAME_SELECTRADIOBUTTON, GNECreateEdgeFrame::EdgeTypeSelector::onCmdRadioButton), - FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATEEDGEFRAME_ADDEDGETYPE, GNECreateEdgeFrame::EdgeTypeSelector::onCmdAddEdgeType), - FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATEEDGEFRAME_DELETEEDGETYPE, GNECreateEdgeFrame::EdgeTypeSelector::onCmdDeleteEdgeType), - FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATEEDGEFRAME_RESETEDGETYPE, GNECreateEdgeFrame::EdgeTypeSelector::onCmdResetEdgeType), - FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATEEDGEFRAME_SELECTEDGETYPE, GNECreateEdgeFrame::EdgeTypeSelector::onCmdSelectEdgeType), + FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATEEDGEFRAME_ADD, GNECreateEdgeFrame::EdgeTypeSelector::onCmdAddEdgeType), + FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATEEDGEFRAME_DELETE, GNECreateEdgeFrame::EdgeTypeSelector::onCmdDeleteEdgeType), + FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATEEDGEFRAME_SELECT, GNECreateEdgeFrame::EdgeTypeSelector::onCmdSelectEdgeType), + FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATEEDGEFRAME_CREATEFROMTEMPLATE, GNECreateEdgeFrame::EdgeTypeSelector::onCmdCreateFromTemplate), }; -FXDEFMAP(GNECreateEdgeFrame::LaneTypeParameters) LaneTypeParametersMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNECreateEdgeFrame::LaneTypeParameters::onCmdSetAttribute), - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_DIALOG, GNECreateEdgeFrame::LaneTypeParameters::onCmdOpenAttributeDialog), - FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATEEDGEFRAME_DELETELANETYPE, GNECreateEdgeFrame::LaneTypeParameters::onCmdDeleteLaneType), - FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATEEDGEFRAME_RESETLANETYPE, GNECreateEdgeFrame::LaneTypeParameters::onCmdResetLaneType), -}; - -FXDEFMAP(GNECreateEdgeFrame::EdgeTypeParameters) EdgeTypeParametersMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNECreateEdgeFrame::EdgeTypeParameters::onCmdSetAttribute), - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_DIALOG, GNECreateEdgeFrame::EdgeTypeParameters::onCmdOpenAttributeDialog), +FXDEFMAP(GNECreateEdgeFrame::LaneTypeSelector) LaneTypeSelectorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATEEDGEFRAME_ADD, GNECreateEdgeFrame::LaneTypeSelector::onCmdAddLaneType), + FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATEEDGEFRAME_DELETE, GNECreateEdgeFrame::LaneTypeSelector::onCmdDeleteLaneType), + FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATEEDGEFRAME_SELECT, GNECreateEdgeFrame::LaneTypeSelector::onCmdSelectLaneType), }; // Object implementation -FXIMPLEMENT(GNECreateEdgeFrame::EdgeTypeSelector, FXGroupBox, EdgeTypeSelectorMap, ARRAYNUMBER(EdgeTypeSelectorMap)) -FXIMPLEMENT(GNECreateEdgeFrame::LaneTypeParameters, FXGroupBox, LaneTypeParametersMap, ARRAYNUMBER(LaneTypeParametersMap)) -FXIMPLEMENT(GNECreateEdgeFrame::EdgeTypeParameters, FXGroupBox, EdgeTypeParametersMap, ARRAYNUMBER(EdgeTypeParametersMap)) +FXIMPLEMENT(GNECreateEdgeFrame::EdgeTypeSelector, FXGroupBoxModule, EdgeTypeSelectorMap, ARRAYNUMBER(EdgeTypeSelectorMap)) +FXIMPLEMENT(GNECreateEdgeFrame::LaneTypeSelector, FXGroupBoxModule, LaneTypeSelectorMap, ARRAYNUMBER(LaneTypeSelectorMap)) // =========================================================================== @@ -78,29 +72,28 @@ // --------------------------------------------------------------------------- GNECreateEdgeFrame::EdgeTypeSelector::EdgeTypeSelector(GNECreateEdgeFrame* createEdgeFrameParent) : - FXGroupBox(createEdgeFrameParent->myContentFrame, "Template selector", GUIDesignGroupBoxFrame), + FXGroupBoxModule(createEdgeFrameParent->myContentFrame, "Template selector"), myCreateEdgeFrameParent(createEdgeFrameParent), - myEdgeTypeSelected(nullptr), - myDefaultEdgeType(new GNEEdgeType(createEdgeFrameParent)) { + myDefaultEdgeType(new GNEEdgeType(createEdgeFrameParent)), + myCurrentIndex(0) { // default edge radio button - myUseDefaultEdgeType = new FXRadioButton(this, - "Create default edge", this, MID_GNE_CREATEEDGEFRAME_SELECTRADIOBUTTON, GUIDesignRadioButton); + myUseDefaultEdgeType = new FXRadioButton(getCollapsableFrame(), "Create default edge", this, MID_GNE_CREATEEDGEFRAME_SELECTRADIOBUTTON, GUIDesignRadioButton); // use custom edge radio button - myUseCustomEdgeType = new FXRadioButton(this, - "Use edgeType/template", this, MID_GNE_CREATEEDGEFRAME_SELECTRADIOBUTTON, GUIDesignRadioButton); + myUseCustomEdgeType = new FXRadioButton(getCollapsableFrame(), "Use edgeType/template", this, MID_GNE_CREATEEDGEFRAME_SELECTRADIOBUTTON, GUIDesignRadioButton); // edge types combo box - myEdgeTypesComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_CREATEEDGEFRAME_SELECTEDGETYPE, GUIDesignComboBoxAttribute); + myEdgeTypesComboBox = new FXComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_CREATEEDGEFRAME_SELECT, GUIDesignComboBoxAttribute); // create horizontal frame - FXHorizontalFrame* horizontalFrameButtons = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* horizontalFrameButtons = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); // create new edge type button - myAddEdgeTypeButton = new FXButton(horizontalFrameButtons, - "add\t\add edge type", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_CREATEEDGEFRAME_ADDEDGETYPE, GUIDesignButton); + myAddEdgeTypeButton = new FXButton(horizontalFrameButtons, "Add\t\tAdd edge type", GUIIconSubSys::getIcon(GUIIcon::ADD), + this, MID_GNE_CREATEEDGEFRAME_ADD, GUIDesignButton); // create delete edge type button - myDeleteEdgeTypeButton = new FXButton(horizontalFrameButtons, - "delete\t\tdelete edge type", GUIIconSubSys::getIcon(GUIIcon::REMOVE), this, MID_GNE_CREATEEDGEFRAME_DELETEEDGETYPE, GUIDesignButton); - // create reset edge type button - myResetEdgeTypeButton = new FXButton(horizontalFrameButtons, - "reset\t\treset edge type", GUIIconSubSys::getIcon(GUIIcon::RESET), this, MID_GNE_CREATEEDGEFRAME_RESETEDGETYPE, GUIDesignButton); + myDeleteEdgeTypeButton = new FXButton(horizontalFrameButtons, "Delete\t\tDelete edge type", GUIIconSubSys::getIcon(GUIIcon::REMOVE), + this, MID_GNE_CREATEEDGEFRAME_DELETE, GUIDesignButton); + + // create delete edge type button + myCreateFromTemplate = new FXButton(getCollapsableFrame(), "Create from template\t\tCreate edgeType from template", GUIIconSubSys::getIcon(GUIIcon::EDGE), + this, MID_GNE_CREATEEDGEFRAME_CREATEFROMTEMPLATE, GUIDesignButton); // by default, create custom edge myUseDefaultEdgeType->setCheck(TRUE); } @@ -112,103 +105,91 @@ void -GNECreateEdgeFrame::EdgeTypeSelector::refreshEdgeTypeSelector(const bool show) { +GNECreateEdgeFrame::EdgeTypeSelector::refreshEdgeTypeSelector() { // get template editor const GNEInspectorFrame::TemplateEditor* templateEditor = myCreateEdgeFrameParent->getViewNet()->getViewParent()->getInspectorFrame()->getTemplateEditor(); - // get edge types - const auto& edgeTypes = myCreateEdgeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdgeTypes(); - // get flag for number of items - const bool thereAreItems = (templateEditor->hasTemplate() || (edgeTypes.size() > 0)); - // first fill combo box + // get current item + const int index = myEdgeTypesComboBox->getCurrentItem(); + // fill combo box fillComboBox(); - // show parameter fields - myCreateEdgeFrameParent->myEdgeTypeParameters->showEdgeTypeParameters(); - // check conditions - if (show && templateEditor->hasTemplate()) { - // set buttons - myUseDefaultEdgeType->setCheck(FALSE); - myUseCustomEdgeType->setCheck(TRUE); - // set template as current item - myEdgeTypesComboBox->setCurrentItem(0); - // update edge parameters (using template - myCreateEdgeFrameParent->myEdgeTypeParameters->setTemplateValues(); - // disable delete edge type button (because templates cannot be removed) - myDeleteEdgeTypeButton->disable(); - myResetEdgeTypeButton->disable(); - // disable parameter fields (because templates cannot be edited) - myCreateEdgeFrameParent->myEdgeTypeParameters->disableEdgeTypeParameters(); - } else if (myUseDefaultEdgeType->getCheck() == TRUE) { + // set default edgeType + if (myUseDefaultEdgeType->getCheck()) { + // disable create from template + myCreateFromTemplate->disable(); // disable comboBox myEdgeTypesComboBox->disable(); // disable buttons myAddEdgeTypeButton->disable(); myDeleteEdgeTypeButton->disable(); - // enable parameter fields (because default edge can be edited) - myCreateEdgeFrameParent->myEdgeTypeParameters->enableEdgeTypeParameters(); - // set default parameters - myCreateEdgeFrameParent->myEdgeTypeParameters->setEdgeType(myDefaultEdgeType, false); - } else if (thereAreItems) { - // enable add button + // show default edgeType attributes + myCreateEdgeFrameParent->myEdgeTypeAttributes->showAttributesCreatorModule(myDefaultEdgeType, {SUMO_ATTR_ID}); + // show lane attributes + myCreateEdgeFrameParent->myLaneTypeSelector->showLaneTypeSelector(); + } else if (myUseCustomEdgeType->getCheck()) { + // enable buttons myAddEdgeTypeButton->enable(); - // enable combo box - myEdgeTypesComboBox->enable(); - // myEdgeTypesComboBox - if (myEdgeTypeSelected) { - // declare index - int index = 0; - // search index of current selectedEdgeType - for (int i = 0; i < myEdgeTypesComboBox->getNumItems(); i++) { - if (myEdgeTypeSelected->getID() == myEdgeTypesComboBox->getItem(i).text()) { - index = i; - } - } - // set current item - myEdgeTypesComboBox->setCurrentItem(index); - // enable delete edge type button - myDeleteEdgeTypeButton->enable(); - // update edge parameters - myCreateEdgeFrameParent->myEdgeTypeParameters->setEdgeType(myEdgeTypeSelected, true); - // enable parameter fields - myCreateEdgeFrameParent->myEdgeTypeParameters->enableEdgeTypeParameters(); - } else if (templateEditor->hasTemplate()) { - // set template as current item - myEdgeTypesComboBox->setCurrentItem(0); - // update edge parameters (using template - myCreateEdgeFrameParent->myEdgeTypeParameters->setTemplateValues(); - // disable delete edge type button (because templates cannot be removed) + myDeleteEdgeTypeButton->enable(); + // check conditions + if (myEdgeTypesComboBox->getNumItems() == 0) { + // disable comboBox and edgeType + myEdgeTypesComboBox->disable(); + myDeleteEdgeTypeButton->disable(); + // hide attributes creators + myCreateEdgeFrameParent->myEdgeTypeAttributes->hideAttributesCreatorModule(); + myCreateEdgeFrameParent->myLaneTypeSelector->hideLaneTypeSelector(); + } else if (templateEditor->getEdgeTemplate() && (index == 0)) { + // enable create from template + myCreateFromTemplate->enable(); + // enable comboBox + myEdgeTypesComboBox->enable(); + // disable delete edge type button (because templates cannot be deleted) myDeleteEdgeTypeButton->disable(); - myResetEdgeTypeButton->disable(); - // disable parameter fields (because templates cannot be edited) - myCreateEdgeFrameParent->myEdgeTypeParameters->disableEdgeTypeParameters(); - } else if (edgeTypes.size() > 0) { - // set myEdgeTypeSelected - myEdgeTypeSelected = edgeTypes.begin()->second; - // set current item - myEdgeTypesComboBox->setCurrentItem(0); - // enable delete edge type button - myDeleteEdgeTypeButton->enable(); - // update edge parameters - myCreateEdgeFrameParent->myEdgeTypeParameters->setEdgeType(myEdgeTypeSelected, true); - // enable parameter fields (because edgeTypes can be edited) - myCreateEdgeFrameParent->myEdgeTypeParameters->enableEdgeTypeParameters(); + // show edgeType attributes and disable + myCreateEdgeFrameParent->myEdgeTypeAttributes->showAttributesCreatorModule(templateEditor->getEdgeTemplate(), {SUMO_ATTR_ID}); + myCreateEdgeFrameParent->myEdgeTypeAttributes->disableAttributesCreator(); + // show lane attributes (will be automatic disabled) + myCreateEdgeFrameParent->myLaneTypeSelector->showLaneTypeSelector(); + } else { + // disable create from template + myCreateFromTemplate->disable(); + // enable comboBox + myEdgeTypesComboBox->enable(); + // get edgeType + myEdgeTypeSelected = myCreateEdgeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveEdgeType(myEdgeTypesComboBox->getText().text(), false); + // check if exist + if (myEdgeTypeSelected) { + // show edgeType attributes + myCreateEdgeFrameParent->myEdgeTypeAttributes->showAttributesCreatorModule(myEdgeTypeSelected, {}); + // show lane attributes + myCreateEdgeFrameParent->myLaneTypeSelector->showLaneTypeSelector(); + } else { + // hide edgeType attributes + myCreateEdgeFrameParent->myEdgeTypeAttributes->hideAttributesCreatorModule(); + // hide lane attributes + myCreateEdgeFrameParent->myLaneTypeSelector->hideLaneTypeSelector(); + // set comboBox text + myEdgeTypesComboBox->setTextColor(FXRGB(255, 0, 0)); + } } - } else { - // hide parameter fields - myCreateEdgeFrameParent->myEdgeTypeParameters->hideEdgeTypeParameters(); - // disable add and delete buttons - myAddEdgeTypeButton->enable(); - myDeleteEdgeTypeButton->disable(); - // disable combo box - myEdgeTypesComboBox->disable(); } // recalc recalc(); } +void +GNECreateEdgeFrame::EdgeTypeSelector::updateIDinComboBox(const std::string& oldID, const std::string& newID) { + for (int i = 0; i < myEdgeTypesComboBox->getNumItems(); i++) { + if (myEdgeTypesComboBox->getItem(i).text() == oldID) { + myEdgeTypesComboBox->setItemText(i, newID.c_str()); + } + } +} + + bool GNECreateEdgeFrame::EdgeTypeSelector::useEdgeTemplate() const { - if (myCreateEdgeFrameParent->getViewNet()->getViewParent()->getInspectorFrame()->getTemplateEditor()->hasTemplate()) { + if (myCreateEdgeFrameParent->getViewNet()->getViewParent()->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) { if ((myUseCustomEdgeType->getCheck() == TRUE) && (myEdgeTypesComboBox->getCurrentItem() == 0)) { return true; } else { @@ -234,32 +215,60 @@ GNEEdgeType* GNECreateEdgeFrame::EdgeTypeSelector::getEdgeTypeSelected() const { - return myEdgeTypeSelected; + if (myUseDefaultEdgeType->getCheck() == TRUE) { + return myDefaultEdgeType; + } else { + return myEdgeTypeSelected; + } } void GNECreateEdgeFrame::EdgeTypeSelector::clearEdgeTypeSelected() { myEdgeTypeSelected = nullptr; + myCurrentIndex--; + if (myCurrentIndex < 0) { + myCurrentIndex = 0; + } +} + + +void +GNECreateEdgeFrame::EdgeTypeSelector::setCurrentEdgeType(const GNEEdgeType* edgeType) { + for (int i = 0; i < myEdgeTypesComboBox->getNumItems(); i++) { + if (myEdgeTypesComboBox->getItem(i).text() == edgeType->getID()) { + // set current item and index + myEdgeTypesComboBox->setCurrentItem(i); + myCurrentIndex = i; + // set buttons + myUseDefaultEdgeType->setCheck(FALSE); + myUseCustomEdgeType->setCheck(TRUE); + // refresh + refreshEdgeTypeSelector(); + } + } } + void GNECreateEdgeFrame::EdgeTypeSelector::useTemplate() { - myUseCustomEdgeType->setCheck(TRUE, FALSE); + myUseDefaultEdgeType->setCheck(FALSE); + myUseCustomEdgeType->setCheck(TRUE); refreshEdgeTypeSelector(); } + long GNECreateEdgeFrame::EdgeTypeSelector::onCmdRadioButton(FXObject* obj, FXSelector, void*) { // check what object was pressed if (obj == myUseDefaultEdgeType) { // update radio buttons - myUseDefaultEdgeType->setCheck(TRUE, FALSE); - myUseCustomEdgeType->setCheck(FALSE, FALSE); + myUseDefaultEdgeType->setCheck(TRUE); + myUseCustomEdgeType->setCheck(FALSE); } else { // update radio buttons - myUseDefaultEdgeType->setCheck(FALSE, FALSE); - myUseCustomEdgeType->setCheck(TRUE, FALSE); + myUseDefaultEdgeType->setCheck(FALSE); + myUseCustomEdgeType->setCheck(TRUE); } // refresh template selector refreshEdgeTypeSelector(); @@ -271,15 +280,14 @@ GNECreateEdgeFrame::EdgeTypeSelector::onCmdAddEdgeType(FXObject*, FXSelector, void*) { // create new edge type GNEEdgeType* edgeType = new GNEEdgeType(myCreateEdgeFrameParent->getViewNet()->getNet()); - // also create a new laneType - GNELaneType* laneType = new GNELaneType(edgeType); // add it using undoList myCreateEdgeFrameParent->getViewNet()->getUndoList()->begin(GUIIcon::EDGE, "create new edge type"); myCreateEdgeFrameParent->getViewNet()->getUndoList()->add(new GNEChange_EdgeType(edgeType, true), true); - myCreateEdgeFrameParent->getViewNet()->getUndoList()->add(new GNEChange_LaneType(laneType, 0, true), true); myCreateEdgeFrameParent->getViewNet()->getUndoList()->end(); // update myEdgeTypeSelected myEdgeTypeSelected = edgeType; + // select last item + myCurrentIndex = (myEdgeTypesComboBox->getNumItems() - 1); // refresh EdgeTypeSelector refreshEdgeTypeSelector(); return 0; @@ -295,11 +303,7 @@ // get edgeType to remove GNEEdgeType* edgeType = myCreateEdgeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveEdgeType(myEdgeTypesComboBox->getText().text()); // remove it using undoList - myCreateEdgeFrameParent->getViewNet()->getUndoList()->begin(GUIIcon::EDGE, "create new edge type"); - // iterate over all laneType - for (int i = 0; i < (int)edgeType->getLaneTypes().size(); i++) { - myCreateEdgeFrameParent->getViewNet()->getUndoList()->add(new GNEChange_LaneType(edgeType->getLaneTypes().at(i), i, false), true); - } + myCreateEdgeFrameParent->getViewNet()->getUndoList()->begin(GUIIcon::EDGE, "delete edge type"); myCreateEdgeFrameParent->getViewNet()->getUndoList()->add(new GNEChange_EdgeType(edgeType, false), true); myCreateEdgeFrameParent->getViewNet()->getUndoList()->end(); // refresh EdgeTypeSelector @@ -309,95 +313,32 @@ long -GNECreateEdgeFrame::EdgeTypeSelector::onCmdResetEdgeType(FXObject*, FXSelector, void*) { - // get options - const OptionsCont& oc = OptionsCont::getOptions(); - // get undoList - GNEUndoList* undoList = myCreateEdgeFrameParent->getViewNet()->getUndoList(); - // check if we're editing an existent edgeType - if (useDefaultEdgeType()) { - // reset speed - myDefaultEdgeType->setAttribute(SUMO_ATTR_SPEED, toString(oc.getFloat("default.speed"))); - // reset lanes - while (myDefaultEdgeType->getLaneTypes().size() > 1) { - myDefaultEdgeType->removeLaneType(myDefaultEdgeType->getLaneTypes().back()); - } - // reset disallow (and allow) - myDefaultEdgeType->setAttribute(SUMO_ATTR_DISALLOW, oc.getString("default.disallow")); - // reset spreadType - myDefaultEdgeType->setAttribute(SUMO_ATTR_SPREADTYPE, "right"); - // reset width - myDefaultEdgeType->setAttribute(SUMO_ATTR_WIDTH, toString(NBEdge::UNSPECIFIED_WIDTH)); - // reset parameters - myDefaultEdgeType->setAttribute(GNE_ATTR_PARAMETERS, ""); - } else if (myEdgeTypeSelected) { - // begin undoList - undoList->begin(GUIIcon::EDGE, "reset edgeType '" + myDefaultEdgeType->getID() + "'"); - // reset lanes - while (myEdgeTypeSelected->getLaneTypes().size() > 1) { - myEdgeTypeSelected->removeLaneType((int)myEdgeTypeSelected->getLaneTypes().size() - 1, undoList); - } - // reset speed - myEdgeTypeSelected->setAttribute(SUMO_ATTR_SPEED, toString(oc.getFloat("default.speed")), undoList); - // reset disallow (and allow) - myEdgeTypeSelected->setAttribute(SUMO_ATTR_DISALLOW, oc.getString("default.disallow")); - // reset spreadType - myEdgeTypeSelected->setAttribute(SUMO_ATTR_SPREADTYPE, "right"); - // reset width - myEdgeTypeSelected->setAttribute(SUMO_ATTR_WIDTH, toString(NBEdge::UNSPECIFIED_WIDTH), undoList); - // reset parameters - myEdgeTypeSelected->setAttribute(GNE_ATTR_PARAMETERS, "", undoList); - // end undoList - undoList->end(); - } - // refresh EdgeTypeSelector +GNECreateEdgeFrame::EdgeTypeSelector::onCmdSelectEdgeType(FXObject*, FXSelector, void*) { + // update current index + myCurrentIndex = myEdgeTypesComboBox->getCurrentItem(); + // refresh edgeType selector refreshEdgeTypeSelector(); return 0; } long -GNECreateEdgeFrame::EdgeTypeSelector::onCmdSelectEdgeType(FXObject*, FXSelector, void*) { - // get template editor - const GNEInspectorFrame::TemplateEditor* templateEditor = myCreateEdgeFrameParent->getViewNet()->getViewParent()->getInspectorFrame()->getTemplateEditor(); - // get edge types - const auto& edgeTypes = myCreateEdgeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdgeTypes(); - // reset myEdgeTypeSelected - myEdgeTypeSelected = nullptr; - // check if we selected template - if (templateEditor->hasTemplate() && myEdgeTypesComboBox->getCurrentItem() == 0) { - // set valid color - myEdgeTypesComboBox->setTextColor(FXRGB(0, 0, 0)); - myEdgeTypesComboBox->killFocus(); - // disable delete edge type button (because templates cannot be edited) - myDeleteEdgeTypeButton->disable(); - // show parameter fields - myCreateEdgeFrameParent->myEdgeTypeParameters->showEdgeTypeParameters(); - // disable parameter fields (because templantes cannot be edited) - myCreateEdgeFrameParent->myEdgeTypeParameters->disableEdgeTypeParameters(); - // set edge template in myEdgeTypeParameters - myCreateEdgeFrameParent->myEdgeTypeParameters->setTemplateValues(); - } else if (edgeTypes.count(myEdgeTypesComboBox->getText().text()) > 0) { - // set valid color - myEdgeTypesComboBox->setTextColor(FXRGB(0, 0, 0)); - myEdgeTypesComboBox->killFocus(); - // enable delete edge type button - myDeleteEdgeTypeButton->enable(); - // show parameter fields - myCreateEdgeFrameParent->myEdgeTypeParameters->showEdgeTypeParameters(); - // enable parameter fields - myCreateEdgeFrameParent->myEdgeTypeParameters->enableEdgeTypeParameters(); - // set myEdgeTypeSelected - myEdgeTypeSelected = myCreateEdgeFrameParent->myViewNet->getNet()->getAttributeCarriers()->retrieveEdgeType(myEdgeTypesComboBox->getText().text()); - // set edgeType in myEdgeTypeParameters - myCreateEdgeFrameParent->myEdgeTypeParameters->setEdgeType(myEdgeTypeSelected, true); - } else { - // set invalid color - myEdgeTypesComboBox->setTextColor(FXRGB(255, 0, 0)); - // disable delete edge type button - myDeleteEdgeTypeButton->disable(); - // hide parameter fields - myCreateEdgeFrameParent->myEdgeTypeParameters->hideEdgeTypeParameters(); +GNECreateEdgeFrame::EdgeTypeSelector::onCmdCreateFromTemplate(FXObject*, FXSelector, void*) { + if (myCreateEdgeFrameParent->getViewNet()->getViewParent()->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()) { + // create new edge type + GNEEdgeType* edgeType = new GNEEdgeType(myCreateEdgeFrameParent->getViewNet()->getNet()); + // copy all template values + edgeType->copyTemplate(myCreateEdgeFrameParent->getViewNet()->getViewParent()->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate()); + // add it using undoList + myCreateEdgeFrameParent->getViewNet()->getUndoList()->begin(GUIIcon::EDGE, "create new edge type"); + myCreateEdgeFrameParent->getViewNet()->getUndoList()->add(new GNEChange_EdgeType(edgeType, true), true); + myCreateEdgeFrameParent->getViewNet()->getUndoList()->end(); + // update myEdgeTypeSelected + myEdgeTypeSelected = edgeType; + // select last item + myCurrentIndex = (myEdgeTypesComboBox->getNumItems() - 1); + // refresh EdgeTypeSelector + refreshEdgeTypeSelector(); } return 0; } @@ -411,9 +352,11 @@ const auto& edgeTypes = myCreateEdgeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdgeTypes(); // clear edge types myEdgeTypesComboBox->clearItems(); + // set comboBox text color + myEdgeTypesComboBox->setTextColor(FXRGB(0, 0, 0)); // add template - if (templateEditor->hasTemplate()) { - myEdgeTypesComboBox->appendItem(("template: " + templateEditor->getEdgeTemplate().edgeParameters.at(SUMO_ATTR_ID)).c_str(), nullptr); + if (templateEditor->getEdgeTemplate()) { + myEdgeTypesComboBox->appendItem(("template: " + templateEditor->getEdgeTemplate()->getID()).c_str(), nullptr); } // add edge types for (const auto& edgeType : edgeTypes) { @@ -425,926 +368,169 @@ } else { myEdgeTypesComboBox->setNumVisible(10); } -} - - -void -GNECreateEdgeFrame::EdgeTypeSelector::fillDefaultParameters() { - // set numLanes - myDefaultEdgeType->setAttribute(SUMO_ATTR_NUMLANES, "1"); - // set speed - myDefaultEdgeType->setAttribute(SUMO_ATTR_SPEED, "13.89"); - // set allow - myDefaultEdgeType->setAttribute(SUMO_ATTR_ALLOW, "all"); - // set disallow - myDefaultEdgeType->setAttribute(SUMO_ATTR_DISALLOW, ""); - // set spreadType - myDefaultEdgeType->setAttribute(SUMO_ATTR_SPREADTYPE, ""); - // set width - myDefaultEdgeType->setAttribute(SUMO_ATTR_WIDTH, "-1.00"); - // set parameters - myDefaultEdgeType->setAttribute(GNE_ATTR_PARAMETERS, ""); + // set current item + if ((myCurrentIndex < 0) || (myCurrentIndex >= myEdgeTypesComboBox->getNumItems())) { + myCurrentIndex = myEdgeTypesComboBox->getNumItems() - 1; + } + myEdgeTypesComboBox->setCurrentItem(myCurrentIndex); } // --------------------------------------------------------------------------- -// GNECreateEdgeFrame::LaneTypeParameters - methods +// GNECreateEdgeFrame::LaneTypeSelector - methods // --------------------------------------------------------------------------- -GNECreateEdgeFrame::LaneTypeParameters::LaneTypeParameters(GNECreateEdgeFrame* createEdgeFrameParent) : - FXGroupBox(createEdgeFrameParent->myContentFrame, "Lane parameters", GUIDesignGroupBoxFrame), - myCreateEdgeFrameParent(createEdgeFrameParent) { - // declare horizontalFrameAttribute - FXHorizontalFrame* horizontalFrameAttribute = nullptr; - // create ComboBox for spread type - horizontalFrameAttribute = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - new FXLabel(horizontalFrameAttribute, "Lane index", nullptr, GUIDesignLabelAttribute); - myLaneIndex = new FXComboBox(horizontalFrameAttribute, GUIDesignComboBoxNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignComboBoxAttribute); - // create horizontalFrameAttribute for buttons - horizontalFrameAttribute = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - // create delete edge type button - myDeleteLaneTypeButton = new FXButton(horizontalFrameAttribute, - "delete\t\tdelete lane type", GUIIconSubSys::getIcon(GUIIcon::REMOVE), this, MID_GNE_CREATEEDGEFRAME_DELETELANETYPE, GUIDesignButton); - // create reset edge type button - myResetLaneTypeButton = new FXButton(horizontalFrameAttribute, - "reset\t\treset lane type", GUIIconSubSys::getIcon(GUIIcon::RESET), this, MID_GNE_CREATEEDGEFRAME_RESETLANETYPE, GUIDesignButton); - // create textField for speed - horizontalFrameAttribute = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - new FXLabel(horizontalFrameAttribute, toString(SUMO_ATTR_SPEED).c_str(), nullptr, GUIDesignLabelAttribute); - mySpeed = new FXTextField(horizontalFrameAttribute, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create Button for allow vehicles - horizontalFrameAttribute = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myAllowButton = new FXButton(horizontalFrameAttribute, toString(SUMO_ATTR_ALLOW).c_str(), nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute); - myAllow = new FXTextField(horizontalFrameAttribute, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create Button for disallow vehicles - horizontalFrameAttribute = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myDisallowButton = new FXButton(horizontalFrameAttribute, toString(SUMO_ATTR_DISALLOW).c_str(), nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute); - myDisallow = new FXTextField(horizontalFrameAttribute, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create textField for width - horizontalFrameAttribute = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - new FXLabel(horizontalFrameAttribute, toString(SUMO_ATTR_WIDTH).c_str(), nullptr, GUIDesignLabelAttribute); - myWidth = new FXTextField(horizontalFrameAttribute, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create textField for parameters - horizontalFrameAttribute = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myParametersButton = new FXButton(horizontalFrameAttribute, "parameters", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute); - myParameters = new FXTextField(horizontalFrameAttribute, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); +GNECreateEdgeFrame::LaneTypeSelector::LaneTypeSelector(GNECreateEdgeFrame* createEdgeFrameParent) : + FXGroupBoxModule(createEdgeFrameParent->myContentFrame, "LaneType selector"), + myCreateEdgeFrameParent(createEdgeFrameParent), + myLaneIndex(0) { + // lane types combo box + myLaneTypesComboBox = new FXComboBox(getCollapsableFrame(), GUIDesignComboBoxNCol, this, MID_GNE_CREATEEDGEFRAME_SELECT, GUIDesignComboBoxAttribute); + // create horizontal frame + FXHorizontalFrame* horizontalFrameButtons = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); + // create new lane type button + myAddLaneTypeButton = new FXButton(horizontalFrameButtons, "Add\t\tAdd lane type", GUIIconSubSys::getIcon(GUIIcon::ADD), + this, MID_GNE_CREATEEDGEFRAME_ADD, GUIDesignButton); + // create delete lane type button + myDeleteLaneTypeButton = new FXButton(horizontalFrameButtons, "Delete\t\tDelete lane type", GUIIconSubSys::getIcon(GUIIcon::REMOVE), + this, MID_GNE_CREATEEDGEFRAME_DELETE, GUIDesignButton); } -GNECreateEdgeFrame::LaneTypeParameters::~LaneTypeParameters() {} - - -void -GNECreateEdgeFrame::LaneTypeParameters::refreshLaneTypeParameters() { - // save previous laneIndex - const int previousLaneIndex = (myLaneIndex->getNumItems() > 0) ? myLaneIndex->getCurrentItem() : 0; - // first get GNEEdgeType - GNEEdgeType* edgeType = nullptr; - if (myCreateEdgeFrameParent->myEdgeTypeSelector->useDefaultEdgeType()) { - edgeType = myCreateEdgeFrameParent->myEdgeTypeSelector->getDefaultEdgeType(); - } else { - edgeType = myCreateEdgeFrameParent->myEdgeTypeSelector->getEdgeTypeSelected(); - } - // check edge type - if (edgeType) { - // clear and refill myLaneIndex - myLaneIndex->clearItems(); - for (int i = 0; i < (int)edgeType->getLaneTypes().size(); i++) { - myLaneIndex->appendItem(toString(i).c_str()); - } - // set visible items - myLaneIndex->setNumVisible(myLaneIndex->getNumItems()); - // continue checking number of lanes - if (previousLaneIndex < (int)edgeType->getLaneTypes().size()) { - myLaneIndex->setCurrentItem(previousLaneIndex); - } else { - myLaneIndex->setCurrentItem(0); - } - // set speed - mySpeed->setText(edgeType->getLaneTypes().at(myLaneIndex->getCurrentItem())->getAttribute(SUMO_ATTR_SPEED).c_str(), FALSE); - mySpeed->setTextColor(FXRGB(0, 0, 0)); - // set allow - myAllow->setText(edgeType->getLaneTypes().at(myLaneIndex->getCurrentItem())->getAttribute(SUMO_ATTR_ALLOW).c_str(), FALSE); - myAllow->setTextColor(FXRGB(0, 0, 0)); - // set disallow - myDisallow->setText(edgeType->getLaneTypes().at(myLaneIndex->getCurrentItem())->getAttribute(SUMO_ATTR_DISALLOW).c_str(), FALSE); - myDisallow->setTextColor(FXRGB(0, 0, 0)); - // set width - myWidth->setText(edgeType->getLaneTypes().at(myLaneIndex->getCurrentItem())->getAttribute(SUMO_ATTR_WIDTH).c_str(), FALSE); - myWidth->setTextColor(FXRGB(0, 0, 0)); - // set parameters - myParameters->setText(edgeType->getLaneTypes().at(myLaneIndex->getCurrentItem())->getAttribute(GNE_ATTR_PARAMETERS).c_str(), FALSE); - myParameters->setTextColor(FXRGB(0, 0, 0)); - } +GNECreateEdgeFrame::LaneTypeSelector::~LaneTypeSelector() { } void -GNECreateEdgeFrame::LaneTypeParameters::showLaneTypeParameters() { +GNECreateEdgeFrame::LaneTypeSelector::showLaneTypeSelector() { + // start at first lane + myLaneIndex = 0; + // refresh laneTypeSelector + refreshLaneTypeSelector(); + // show show(); } void -GNECreateEdgeFrame::LaneTypeParameters::hideLaneTypeParameters() { +GNECreateEdgeFrame::LaneTypeSelector::hideLaneTypeSelector() { + // hide attributes creator modul + myCreateEdgeFrameParent->myLaneTypeAttributes->hideAttributesCreatorModule(); + // hide hide(); } void -GNECreateEdgeFrame::LaneTypeParameters::enableLaneTypeParameters() { - myLaneIndex->enable(); - mySpeed->enable(); - myAllowButton->enable(); - myAllow->enable(); - myDisallowButton->enable(); - myDisallow->enable(); - myWidth->enable(); -} - - -void -GNECreateEdgeFrame::LaneTypeParameters::disableLaneTypeParameters() { - myLaneIndex->disable(); - mySpeed->disable(); - myAllowButton->disable(); - myAllow->disable(); - myDisallowButton->disable(); - myDisallow->disable(); - myWidth->disable(); -} - - -void -GNECreateEdgeFrame::LaneTypeParameters::setAttributes(GNEEdge* edge, GNEUndoList* undoList) const { - // set speed - edge->setAttribute(SUMO_ATTR_SPEED, toString(mySpeed->getText().text()), undoList); - // set allow (no disallow) - edge->setAttribute(SUMO_ATTR_ALLOW, toString(myAllow->getText().text()), undoList); - // set witdth - edge->setAttribute(SUMO_ATTR_WIDTH, toString(myWidth->getText().text()), undoList); -} - - -void -GNECreateEdgeFrame::LaneTypeParameters::updateNumLanes(int numLanes) { - // first check if numLanes > 0 - if (numLanes > 0) { - // get edgeTypeSelector - GNECreateEdgeFrame::EdgeTypeSelector* edgeTypeSelector = myCreateEdgeFrameParent->getEdgeTypeSelector(); - // change numLanes depending of edited edgeType - if (edgeTypeSelector->useDefaultEdgeType()) { - // check if we have to add new lanes - while (numLanes > (int)edgeTypeSelector->getDefaultEdgeType()->getLaneTypes().size()) { - // create new GNELaneType - GNELaneType* laneType = new GNELaneType(edgeTypeSelector->getDefaultEdgeType()); - // add it in the last position - edgeTypeSelector->getDefaultEdgeType()->addLaneType(laneType, (int)edgeTypeSelector->getDefaultEdgeType()->getLaneTypes().size()); - } - // check if we have to remove new lanes - while (numLanes < (int)edgeTypeSelector->getDefaultEdgeType()->getLaneTypes().size()) { - // remove it from the last position - edgeTypeSelector->getDefaultEdgeType()->removeLaneType(edgeTypeSelector->getDefaultEdgeType()->getLaneTypes().back()); - } - } else if (myCreateEdgeFrameParent->getEdgeTypeSelector()->getEdgeTypeSelected()) { - // check if we have to add new lanes - while (numLanes > (int)edgeTypeSelector->getEdgeTypeSelected()->getLaneTypes().size()) { - // add it in the last position - edgeTypeSelector->getEdgeTypeSelected()->addLaneType(myCreateEdgeFrameParent->getViewNet()->getUndoList()); - } - // check if we have to remove new lanes - while (numLanes < (int)edgeTypeSelector->getEdgeTypeSelected()->getLaneTypes().size()) { - // remove it from the last position - edgeTypeSelector->getEdgeTypeSelected()->removeLaneType((int)edgeTypeSelector->getEdgeTypeSelected()->getLaneTypes().size() - 1, myCreateEdgeFrameParent->getViewNet()->getUndoList()); - } - - } - // refresh - refreshLaneTypeParameters(); - } -} - - -long -GNECreateEdgeFrame::LaneTypeParameters::onCmdSetAttribute(FXObject* obj, FXSelector, void*) { - if (obj == myLaneIndex) { - // refresh - refreshLaneTypeParameters(); - } else if (myCreateEdgeFrameParent->myEdgeTypeSelector->useDefaultEdgeType()) { - setAttributeDefaultParameters(obj); - } else { - setAttributeExistentLaneType(obj); - } - return 1; -} - - -long -GNECreateEdgeFrame::LaneTypeParameters::onCmdOpenAttributeDialog(FXObject* obj, FXSelector, void*) { - if (obj == myParametersButton) { - // write debug information - WRITE_DEBUG("Open parameters dialog"); - // check if use default edge - if (myCreateEdgeFrameParent->myEdgeTypeSelector->useDefaultEdgeType()) { - // get lane type - GNELaneType* laneType = myCreateEdgeFrameParent->myEdgeTypeSelector->getDefaultEdgeType()->getLaneTypes().at(myLaneIndex->getCurrentItem()); - // edit parameters using dialog - if (GNESingleParametersDialog(laneType).execute()) { - // write debug information - WRITE_DEBUG("Close parameters dialog"); - // update myParameters text field - myParameters->setText(laneType->getAttribute(GNE_ATTR_PARAMETERS).c_str(), FALSE); - } else { - // write debug information - WRITE_DEBUG("Cancel parameters dialog"); - } - } else if (myCreateEdgeFrameParent->myEdgeTypeSelector->getEdgeTypeSelected()) { - // get lane type - GNELaneType* laneType = myCreateEdgeFrameParent->myEdgeTypeSelector->getEdgeTypeSelected()->getLaneTypes().at(myLaneIndex->getCurrentItem()); - // edit parameters using dialog - if (GNESingleParametersDialog(laneType).execute()) { - // write debug information - WRITE_DEBUG("Close parameters dialog"); - // update myParameters text field - myParameters->setText(laneType->getAttribute(GNE_ATTR_PARAMETERS).c_str(), FALSE); - } else { - // write debug information - WRITE_DEBUG("Cancel parameters dialog"); - } - } - } else { - // declare strings - std::string allow = myAllow->getText().text(); - std::string disallow = myDisallow->getText().text(); - // declare accept changes - bool acceptChanges = false; - // open allow/disallow - GNEAllowDisallow(myCreateEdgeFrameParent->getViewNet(), &allow, &disallow, &acceptChanges).execute(); - // continue depending of acceptChanges - if (acceptChanges) { - // update allow/disallow - myAllow->setText(allow.c_str(), FALSE); - myDisallow->setText(disallow.c_str(), FALSE); - // set attribute - if (myCreateEdgeFrameParent->myEdgeTypeSelector->useDefaultEdgeType()) { - myCreateEdgeFrameParent->myEdgeTypeSelector->getDefaultEdgeType()->getLaneTypes().at(myLaneIndex->getCurrentItem())->setAttribute(SUMO_ATTR_ALLOW, allow.c_str()); - } else if (myCreateEdgeFrameParent->myEdgeTypeSelector->getEdgeTypeSelected()) { - myCreateEdgeFrameParent->myEdgeTypeSelector->getEdgeTypeSelected()->getLaneTypes().at(myLaneIndex->getCurrentItem())->setAttribute(SUMO_ATTR_ALLOW, allow.c_str()); - } - } - } - return 1; -} - - -long -GNECreateEdgeFrame::LaneTypeParameters::onCmdDeleteLaneType(FXObject*, FXSelector, void*) { - /* */ - return 1; -} - - -long -GNECreateEdgeFrame::LaneTypeParameters::onCmdResetLaneType(FXObject*, FXSelector, void*) { - /* */ - return 1; -} - - -void -GNECreateEdgeFrame::LaneTypeParameters::setAttributeDefaultParameters(FXObject* obj) { - // get default edge type - GNELaneType* defaultLaneType = myCreateEdgeFrameParent->myEdgeTypeSelector->getDefaultEdgeType()->getLaneTypes().at(myLaneIndex->getCurrentItem()); - // check what attribute was changed - if (obj == mySpeed) { - // check if is valid - if (defaultLaneType->isValid(SUMO_ATTR_SPEED, mySpeed->getText().text())) { - // set attribute (Without undoList) - defaultLaneType->setAttribute(SUMO_ATTR_SPEED, mySpeed->getText().text()); - // reset color - mySpeed->setTextColor(FXRGB(0, 0, 0)); - mySpeed->killFocus(); - } else { - mySpeed->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myAllow) { - // check if is valid - if (defaultLaneType->isValid(SUMO_ATTR_ALLOW, myAllow->getText().text())) { - // set attribute (Without undoList) - defaultLaneType->setAttribute(SUMO_ATTR_ALLOW, myAllow->getText().text()); - // reset color - myAllow->setTextColor(FXRGB(0, 0, 0)); - myAllow->killFocus(); - // update disallow textField - myDisallow->setText(defaultLaneType->getAttribute(SUMO_ATTR_DISALLOW).c_str(), FALSE); - } else { - myAllow->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myDisallow) { - // check if is valid - if (defaultLaneType->isValid(SUMO_ATTR_DISALLOW, myDisallow->getText().text())) { - // set attribute (Without undoList) - defaultLaneType->setAttribute(SUMO_ATTR_DISALLOW, myDisallow->getText().text()); - // reset color - myDisallow->setTextColor(FXRGB(0, 0, 0)); - myDisallow->killFocus(); - // update allow textField - myAllow->setText(defaultLaneType->getAttribute(SUMO_ATTR_ALLOW).c_str(), FALSE); +GNECreateEdgeFrame::LaneTypeSelector::refreshLaneTypeSelector() { + // clear lane types + myLaneTypesComboBox->clearItems(); + // first check if use template + if (myCreateEdgeFrameParent->myEdgeTypeSelector->useEdgeTemplate()) { + const GNEEdgeTemplate* edgeTemplate = myCreateEdgeFrameParent->getViewNet()->getViewParent()->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(); + // fill comboBox + for (const auto& laneTemplate : edgeTemplate->getLaneTemplates()) { + myLaneTypesComboBox->appendItem(laneTemplate->getAttribute(SUMO_ATTR_ID).c_str(), nullptr); + } + // update comboBox + updateComboBox(); + // show laneTypeAttributes + myCreateEdgeFrameParent->myLaneTypeAttributes->showAttributesCreatorModule(edgeTemplate->getLaneTemplates().at(myLaneIndex), {SUMO_ATTR_ID}); + // disable laneAttributes (because is a template) + myCreateEdgeFrameParent->myLaneTypeAttributes->disableAttributesCreator(); + // disable add and remove buttons + myAddLaneTypeButton->disable(); + myDeleteLaneTypeButton->disable(); + } else { + // get edgeType + const GNEEdgeType* edgeType = myCreateEdgeFrameParent->myEdgeTypeSelector->getEdgeTypeSelected(); + // fill comboBox + for (const auto& laneType : edgeType->getLaneTypes()) { + myLaneTypesComboBox->appendItem(laneType->getAttribute(SUMO_ATTR_ID).c_str(), nullptr); + } + // update comboBox + updateComboBox(); + // show laneTypeAttributes + myCreateEdgeFrameParent->myLaneTypeAttributes->showAttributesCreatorModule(edgeType->getLaneTypes().at(myLaneIndex), {}); + // enable add and remove buttons + myAddLaneTypeButton->enable(); + // check if enable or disable remove lane button + if (edgeType->getLaneTypes().size() > 1) { + myDeleteLaneTypeButton->enable(); } else { - myDisallow->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myWidth) { - // check if is valid - if (defaultLaneType->isValid(SUMO_ATTR_WIDTH, myWidth->getText().text())) { - // set attribute (Without undoList) - defaultLaneType->setAttribute(SUMO_ATTR_WIDTH, myWidth->getText().text()); - // reset color - myWidth->setTextColor(FXRGB(0, 0, 0)); - myWidth->killFocus(); - } else { - myWidth->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myParameters) { - // check if is valid - if (defaultLaneType->isValid(GNE_ATTR_PARAMETERS, myParameters->getText().text())) { - // set attribute (Without undoList) - defaultLaneType->setAttribute(GNE_ATTR_PARAMETERS, myParameters->getText().text()); - // reset color - myParameters->setTextColor(FXRGB(0, 0, 0)); - myParameters->killFocus(); - } else { - myParameters->setTextColor(FXRGB(255, 0, 0)); + myDeleteLaneTypeButton->disable(); } } -} - - -void -GNECreateEdgeFrame::LaneTypeParameters::setAttributeExistentLaneType(FXObject* obj) { - // get undoList - GNEUndoList* undoList = myCreateEdgeFrameParent->myViewNet->getUndoList(); - // get selected lane type - GNELaneType* laneType = myCreateEdgeFrameParent->myEdgeTypeSelector->getEdgeTypeSelected()->getLaneTypes().at(myLaneIndex->getCurrentItem()); - // check what attribute was changed - if (obj == mySpeed) { - // check if is valid - if (laneType->isValid(SUMO_ATTR_SPEED, mySpeed->getText().text())) { - // set attribute - laneType->setAttribute(SUMO_ATTR_SPEED, mySpeed->getText().text(), undoList); - // reset color - mySpeed->setTextColor(FXRGB(0, 0, 0)); - mySpeed->killFocus(); - } else { - mySpeed->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myAllow) { - // check if is valid - if (laneType->isValid(SUMO_ATTR_ALLOW, myAllow->getText().text())) { - // set attribute - laneType->setAttribute(SUMO_ATTR_ALLOW, myAllow->getText().text(), undoList); - // reset color - myAllow->setTextColor(FXRGB(0, 0, 0)); - myAllow->killFocus(); - // update disallow textField - myDisallow->setText(laneType->getAttribute(SUMO_ATTR_DISALLOW).c_str(), FALSE); - } else { - myAllow->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myDisallow) { - // check if is valid - if (laneType->isValid(SUMO_ATTR_DISALLOW, myDisallow->getText().text())) { - // set attribute - laneType->setAttribute(SUMO_ATTR_DISALLOW, myDisallow->getText().text(), undoList); - // reset color - myDisallow->setTextColor(FXRGB(0, 0, 0)); - myDisallow->killFocus(); - // update allow textField - myAllow->setText(laneType->getAttribute(SUMO_ATTR_ALLOW).c_str(), FALSE); - } else { - myDisallow->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myWidth) { - // check if is valid - if (laneType->isValid(SUMO_ATTR_WIDTH, myWidth->getText().text())) { - // set attribute - laneType->setAttribute(SUMO_ATTR_WIDTH, myWidth->getText().text(), undoList); - // reset color - myWidth->setTextColor(FXRGB(0, 0, 0)); - myWidth->killFocus(); - } else { - myWidth->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myParameters) { - // check if is valid - if (laneType->isValid(GNE_ATTR_PARAMETERS, myParameters->getText().text())) { - // set attribute - laneType->setAttribute(GNE_ATTR_PARAMETERS, myParameters->getText().text(), undoList); - // reset color - myParameters->setTextColor(FXRGB(0, 0, 0)); - myParameters->killFocus(); - } else { - myParameters->setTextColor(FXRGB(255, 0, 0)); - } - } -} - -// --------------------------------------------------------------------------- -// GNECreateEdgeFrame::EdgeTypeParameters - methods -// --------------------------------------------------------------------------- - -GNECreateEdgeFrame::EdgeTypeParameters::EdgeTypeParameters(GNECreateEdgeFrame* createEdgeFrameParent) : - FXGroupBox(createEdgeFrameParent->myContentFrame, "Edge parameters", GUIDesignGroupBoxFrame), - myCreateEdgeFrameParent(createEdgeFrameParent) { - // declare horizontalFrameAttribute - FXHorizontalFrame* horizontalFrameAttribute = nullptr; - // create textField for ID - myHorizontalFrameID = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myLabelID = new FXLabel(myHorizontalFrameID, "edgeType id", nullptr, GUIDesignLabelAttribute); - myID = new FXTextField(myHorizontalFrameID, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create textField for speed - horizontalFrameAttribute = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - new FXLabel(horizontalFrameAttribute, toString(SUMO_ATTR_SPEED).c_str(), nullptr, GUIDesignLabelAttribute); - mySpeed = new FXTextField(horizontalFrameAttribute, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create textField for numLanes - horizontalFrameAttribute = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - new FXLabel(horizontalFrameAttribute, toString(SUMO_ATTR_NUMLANES).c_str(), nullptr, GUIDesignLabelAttribute); - myNumLanes = new FXTextField(horizontalFrameAttribute, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextFieldInt); - // create Button for allow vehicles - horizontalFrameAttribute = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myAllowButton = new FXButton(horizontalFrameAttribute, toString(SUMO_ATTR_ALLOW).c_str(), nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute); - myAllow = new FXTextField(horizontalFrameAttribute, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create Button for disallow vehicles - horizontalFrameAttribute = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myDisallowButton = new FXButton(horizontalFrameAttribute, toString(SUMO_ATTR_DISALLOW).c_str(), nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute); - myDisallow = new FXTextField(horizontalFrameAttribute, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create combo box for spread type - horizontalFrameAttribute = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - new FXLabel(horizontalFrameAttribute, toString(SUMO_ATTR_SPREADTYPE).c_str(), nullptr, GUIDesignLabelAttribute); - mySpreadType = new FXComboBox(horizontalFrameAttribute, GUIDesignComboBoxNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignComboBoxAttribute); - // fill spreadType - mySpreadType->appendItem("right"); - mySpreadType->appendItem("center"); - mySpreadType->appendItem("roadCenter"); - mySpreadType->setNumVisible(3); - // create textField for width - horizontalFrameAttribute = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - new FXLabel(horizontalFrameAttribute, toString(SUMO_ATTR_WIDTH).c_str(), nullptr, GUIDesignLabelAttribute); - myWidth = new FXTextField(horizontalFrameAttribute, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create textField for priority - horizontalFrameAttribute = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - new FXLabel(horizontalFrameAttribute, toString(SUMO_ATTR_PRIORITY).c_str(), nullptr, GUIDesignLabelAttribute); - myPriority = new FXTextField(horizontalFrameAttribute, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create textField for parameters - horizontalFrameAttribute = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myParametersButton = new FXButton(horizontalFrameAttribute, "parameters", nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute); - myParameters = new FXTextField(horizontalFrameAttribute, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create lane parameters - myLaneTypeParameters = new LaneTypeParameters(createEdgeFrameParent); -} - - -GNECreateEdgeFrame::EdgeTypeParameters::~EdgeTypeParameters() {} - - -void -GNECreateEdgeFrame::EdgeTypeParameters::showEdgeTypeParameters() { - // show EdgeTypeParameters - show(); - // show LaneTypeParameters - myLaneTypeParameters->showLaneTypeParameters(); -} - - -void -GNECreateEdgeFrame::EdgeTypeParameters::hideEdgeTypeParameters() { - // hide EdgeTypeParameters - hide(); - // hide LaneTypeParameters - myLaneTypeParameters->hideLaneTypeParameters(); -} - - -void -GNECreateEdgeFrame::EdgeTypeParameters::enableEdgeTypeParameters() { - // enable all elements - myID->enable(); - myNumLanes->enable(); - mySpeed->enable(); - myAllowButton->enable(); - myAllow->enable(); - myDisallowButton->enable(); - myDisallow->enable(); - mySpreadType->enable(); - myWidth->enable(); - myPriority->enable(); - myParameters->enable(); - // enable lane parameters - myLaneTypeParameters->enableLaneTypeParameters(); -} - - -void -GNECreateEdgeFrame::EdgeTypeParameters::disableEdgeTypeParameters() { - // disable all elements - myID->disable(); - myNumLanes->disable(); - mySpeed->disable(); - myAllowButton->disable(); - myAllow->disable(); - myDisallowButton->disable(); - myDisallow->disable(); - mySpreadType->disable(); - myWidth->disable(); - myPriority->disable(); - myParameters->disable(); - // disable lane parameters - myLaneTypeParameters->disableLaneTypeParameters(); -} - - -void -GNECreateEdgeFrame::EdgeTypeParameters::setEdgeType(GNEEdgeType* edgeType, bool showID) { - // set id - if (showID) { - myHorizontalFrameID->show(); - myLabelID->setText("edgeType ID"); - myID->setText(edgeType->getAttribute(SUMO_ATTR_ID).c_str(), FALSE); - myID->setTextColor(FXRGB(0, 0, 0)); - } else { - myHorizontalFrameID->hide(); - } - // set numLanes - myNumLanes->setText(edgeType->getAttribute(SUMO_ATTR_NUMLANES).c_str(), FALSE); - myNumLanes->setTextColor(FXRGB(0, 0, 0)); - // set speed - mySpeed->setText(edgeType->getAttribute(SUMO_ATTR_SPEED).c_str(), FALSE); - mySpeed->setTextColor(FXRGB(0, 0, 0)); - // set allow - myAllow->setText(edgeType->getAttribute(SUMO_ATTR_ALLOW).c_str(), FALSE); - myAllow->setTextColor(FXRGB(0, 0, 0)); - // set disallow - myDisallow->setText(edgeType->getAttribute(SUMO_ATTR_DISALLOW).c_str(), FALSE); - myDisallow->setTextColor(FXRGB(0, 0, 0)); - // set spreadType - if (edgeType->getAttribute(SUMO_ATTR_SPREADTYPE) == "right") { - mySpreadType->setCurrentItem(0); - } else if (edgeType->getAttribute(SUMO_ATTR_SPREADTYPE) == "center") { - mySpreadType->setCurrentItem(1); - } else { - mySpreadType->setCurrentItem(2); - } - mySpreadType->setTextColor(FXRGB(0, 0, 0)); - // set width - myWidth->setText(edgeType->getAttribute(SUMO_ATTR_WIDTH).c_str(), FALSE); - myWidth->setTextColor(FXRGB(0, 0, 0)); - // set width - myPriority->setText(edgeType->getAttribute(SUMO_ATTR_PRIORITY).c_str(), FALSE); - myPriority->setTextColor(FXRGB(0, 0, 0)); - // set parameters - myParameters->setText(edgeType->getAttribute(GNE_ATTR_PARAMETERS).c_str(), FALSE); - myParameters->setTextColor(FXRGB(0, 0, 0)); - // now update lane parameters - myLaneTypeParameters->refreshLaneTypeParameters(); - // recalc frame + // recalc recalc(); } -void -GNECreateEdgeFrame::EdgeTypeParameters::setTemplateValues() { - // get template editor - const GNEInspectorFrame::TemplateEditor* templateEditor = myCreateEdgeFrameParent->getViewNet()->getViewParent()->getInspectorFrame()->getTemplateEditor(); - // first check if there is a template - if (templateEditor->hasTemplate()) { - // set ID - myLabelID->setText("template ID"); - myID->setText(templateEditor->getEdgeTemplate().edgeParameters.at(SUMO_ATTR_ID).c_str(), FALSE); - myHorizontalFrameID->show(); - // set numLanes - myNumLanes->setText(templateEditor->getEdgeTemplate().edgeParameters.at(SUMO_ATTR_NUMLANES).c_str(), FALSE); - myNumLanes->setTextColor(FXRGB(0, 0, 0)); - // set speed - mySpeed->setText(templateEditor->getEdgeTemplate().edgeParameters.at(SUMO_ATTR_SPEED).c_str(), FALSE); - mySpeed->setTextColor(FXRGB(0, 0, 0)); - // set allow - myAllow->setText(templateEditor->getEdgeTemplate().edgeParameters.at(SUMO_ATTR_ALLOW).c_str(), FALSE); - myAllow->setTextColor(FXRGB(0, 0, 0)); - // set disallow - myDisallow->setText(templateEditor->getEdgeTemplate().edgeParameters.at(SUMO_ATTR_DISALLOW).c_str(), FALSE); - myDisallow->setTextColor(FXRGB(0, 0, 0)); - // set spreadType - if (templateEditor->getEdgeTemplate().edgeParameters.at(SUMO_ATTR_SPREADTYPE) == "right") { - mySpreadType->setCurrentItem(0); - } else if (templateEditor->getEdgeTemplate().edgeParameters.at(SUMO_ATTR_SPREADTYPE) == "center") { - mySpreadType->setCurrentItem(1); - } else { - mySpreadType->setCurrentItem(2); - } - mySpreadType->setTextColor(FXRGB(0, 0, 0)); - // set width - myWidth->setText(templateEditor->getEdgeTemplate().edgeParameters.at(SUMO_ATTR_WIDTH).c_str(), FALSE); - myWidth->setTextColor(FXRGB(0, 0, 0)); - // set priority - myPriority->setText(templateEditor->getEdgeTemplate().edgeParameters.at(SUMO_ATTR_PRIORITY).c_str(), FALSE); - myPriority->setTextColor(FXRGB(0, 0, 0)); - // set parameters - myParameters->setText(templateEditor->getEdgeTemplate().edgeParameters.at(GNE_ATTR_PARAMETERS).c_str(), FALSE); - myParameters->setTextColor(FXRGB(0, 0, 0)); - // recalc frame - recalc(); - } else { - throw ProcessError("no template"); - } -} - - long -GNECreateEdgeFrame::EdgeTypeParameters::onCmdSetAttribute(FXObject* obj, FXSelector, void*) { - // check if we're editing an existent edgeType +GNECreateEdgeFrame::LaneTypeSelector::onCmdAddLaneType(FXObject*, FXSelector, void*) { + // check what edgeType is being edited if (myCreateEdgeFrameParent->myEdgeTypeSelector->useDefaultEdgeType()) { - setAttributeDefaultParameters(obj); - } else { - setAttributeExistentEdgeType(obj); + // add new lane in default edge type + myCreateEdgeFrameParent->myEdgeTypeSelector->getDefaultEdgeType()->addLaneType(new GNELaneType(myCreateEdgeFrameParent->myEdgeTypeSelector->getDefaultEdgeType())); + // refresh laneTypeSelector + refreshLaneTypeSelector(); + // set combo box + myLaneTypesComboBox->setCurrentItem(myLaneTypesComboBox->getNumItems() - 1); + } else if (!myCreateEdgeFrameParent->myEdgeTypeSelector->useEdgeTemplate()) { + // get selected + const auto edgeType = myCreateEdgeFrameParent->myEdgeTypeSelector->getEdgeTypeSelected(); + if (edgeType) { + // create new edgeType + GNEEdgeType* newEdgeType = new GNEEdgeType(edgeType); + // create laneTypes + for (const auto& laneType : edgeType->getLaneTypes()) { + newEdgeType->addLaneType(new GNELaneType(newEdgeType, laneType)); + } + // add new lane + newEdgeType->addLaneType(new GNELaneType(newEdgeType)); + // remove old edgeTyp und and newEdgeType + myCreateEdgeFrameParent->getViewNet()->getUndoList()->begin(GUIIcon::LANE, "add laneType"); + myCreateEdgeFrameParent->getViewNet()->getUndoList()->add(new GNEChange_EdgeType(edgeType, false), true); + myCreateEdgeFrameParent->getViewNet()->getUndoList()->add(new GNEChange_EdgeType(newEdgeType, true), true); + myCreateEdgeFrameParent->getViewNet()->getUndoList()->end(); + // update index + myLaneIndex = myLaneTypesComboBox->getNumItems() - 1; + // set current edgeType in selector + myCreateEdgeFrameParent->myEdgeTypeSelector->setCurrentEdgeType(newEdgeType); + } } - return 1; + return 0; } long -GNECreateEdgeFrame::EdgeTypeParameters::onCmdOpenAttributeDialog(FXObject* obj, FXSelector, void*) { - if (obj == myParametersButton) { - // write debug information - WRITE_DEBUG("Open parameters dialog"); - // check if use default edge - if (myCreateEdgeFrameParent->myEdgeTypeSelector->useDefaultEdgeType()) { - // edit parameters using dialog - if (GNESingleParametersDialog(myCreateEdgeFrameParent->myEdgeTypeSelector->getDefaultEdgeType()).execute()) { - // write debug information - WRITE_DEBUG("Close parameters dialog"); - // update myParameters text field - myParameters->setText(myCreateEdgeFrameParent->myEdgeTypeSelector->getDefaultEdgeType()->getAttribute(GNE_ATTR_PARAMETERS).c_str(), FALSE); - } else { - // write debug information - WRITE_DEBUG("Cancel parameters dialog"); - } - } else if (myCreateEdgeFrameParent->myEdgeTypeSelector->getEdgeTypeSelected()) { - // edit parameters using dialog - if (GNESingleParametersDialog(myCreateEdgeFrameParent->myEdgeTypeSelector->getEdgeTypeSelected()).execute()) { - // write debug information - WRITE_DEBUG("Close parameters dialog"); - // update myParameters text field - myParameters->setText(myCreateEdgeFrameParent->myEdgeTypeSelector->getEdgeTypeSelected()->getAttribute(GNE_ATTR_PARAMETERS).c_str(), FALSE); - } else { - // write debug information - WRITE_DEBUG("Cancel parameters dialog"); - } - } - } else { - // declare strings - std::string allow = myAllow->getText().text(); - std::string disallow = myDisallow->getText().text(); - // declare accept changes - bool acceptChanges = false; - // open allow/disallow - GNEAllowDisallow(myCreateEdgeFrameParent->getViewNet(), &allow, &disallow, &acceptChanges).execute(); - // continue depending of acceptChanges - if (acceptChanges) { - // update allow/disallow - myAllow->setText(allow.c_str(), TRUE); - myDisallow->setText(disallow.c_str(), TRUE); - // set attribute - if (myCreateEdgeFrameParent->myEdgeTypeSelector->useDefaultEdgeType()) { - myCreateEdgeFrameParent->myEdgeTypeSelector->getDefaultEdgeType()->setAttribute(SUMO_ATTR_ALLOW, allow.c_str()); - } else if (myCreateEdgeFrameParent->myEdgeTypeSelector->getEdgeTypeSelected()) { - myCreateEdgeFrameParent->myEdgeTypeSelector->getEdgeTypeSelected()->setAttribute(SUMO_ATTR_ALLOW, allow.c_str()); - } - } - } - return 1; +GNECreateEdgeFrame::LaneTypeSelector::onCmdDeleteLaneType(FXObject*, FXSelector, void*) { + return 0; } -void -GNECreateEdgeFrame::EdgeTypeParameters::setAttributeDefaultParameters(FXObject* obj) { - // get default edge type - GNEEdgeType* defaultEdgeType = myCreateEdgeFrameParent->myEdgeTypeSelector->getDefaultEdgeType(); - // check what attribute was changed - if (obj == myID) { - // check if is valid - if (defaultEdgeType->isValid(SUMO_ATTR_ID, myID->getText().text())) { - // set attribute (Without undoList) - defaultEdgeType->setAttribute(SUMO_ATTR_ID, myID->getText().text()); - // reset color - myID->setTextColor(FXRGB(0, 0, 0)); - myID->killFocus(); - } else { - myID->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myNumLanes) { - // check if is valid - if (defaultEdgeType->isValid(SUMO_ATTR_NUMLANES, myNumLanes->getText().text())) { - // reset color - myNumLanes->setTextColor(FXRGB(0, 0, 0)); - myNumLanes->killFocus(); - // update numLanes in laneTypeParameters - myLaneTypeParameters->updateNumLanes(GNEAttributeCarrier::parse(myNumLanes->getText().text())); - } else { - myNumLanes->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == mySpeed) { - // check if is valid - if (defaultEdgeType->isValid(SUMO_ATTR_SPEED, mySpeed->getText().text())) { - // set attribute (Without undoList) - defaultEdgeType->setAttribute(SUMO_ATTR_SPEED, mySpeed->getText().text()); - // reset color - mySpeed->setTextColor(FXRGB(0, 0, 0)); - mySpeed->killFocus(); - } else { - mySpeed->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myAllow) { - // check if is valid - if (defaultEdgeType->isValid(SUMO_ATTR_ALLOW, myAllow->getText().text())) { - // set attribute (Without undoList) - defaultEdgeType->setAttribute(SUMO_ATTR_ALLOW, myAllow->getText().text()); - // reset color - myAllow->setTextColor(FXRGB(0, 0, 0)); - myAllow->killFocus(); - // update disallow textField - myDisallow->setText(defaultEdgeType->getAttribute(SUMO_ATTR_DISALLOW).c_str(), FALSE); - } else { - myAllow->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myDisallow) { - // check if is valid - if (defaultEdgeType->isValid(SUMO_ATTR_DISALLOW, myDisallow->getText().text())) { - // set attribute (Without undoList) - defaultEdgeType->setAttribute(SUMO_ATTR_DISALLOW, myDisallow->getText().text()); - // reset color - myDisallow->setTextColor(FXRGB(0, 0, 0)); - myDisallow->killFocus(); - // update allow textField - myAllow->setText(defaultEdgeType->getAttribute(SUMO_ATTR_ALLOW).c_str(), FALSE); - } else { - myDisallow->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == mySpreadType) { - // check if is valid - if (defaultEdgeType->isValid(SUMO_ATTR_SPREADTYPE, mySpreadType->getText().text())) { - // set attribute (Without undoList) - defaultEdgeType->setAttribute(SUMO_ATTR_SPREADTYPE, mySpreadType->getText().text()); - // reset color - mySpreadType->setTextColor(FXRGB(0, 0, 0)); - mySpreadType->killFocus(); - } else { - mySpreadType->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myWidth) { - // check if is valid - if (defaultEdgeType->isValid(SUMO_ATTR_WIDTH, myWidth->getText().text())) { - // set attribute (Without undoList) - defaultEdgeType->setAttribute(SUMO_ATTR_WIDTH, myWidth->getText().text()); - // reset color - myWidth->setTextColor(FXRGB(0, 0, 0)); - myWidth->killFocus(); - } else { - myWidth->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myPriority) { - // check if is valid - if (defaultEdgeType->isValid(SUMO_ATTR_PRIORITY, myPriority->getText().text())) { - // set attribute (Without undoList) - defaultEdgeType->setAttribute(SUMO_ATTR_PRIORITY, myPriority->getText().text()); - // reset color - myPriority->setTextColor(FXRGB(0, 0, 0)); - myPriority->killFocus(); - } else { - myPriority->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myParameters) { - // check if is valid - if (defaultEdgeType->isValid(GNE_ATTR_PARAMETERS, myParameters->getText().text())) { - // set attribute (Without undoList) - defaultEdgeType->setAttribute(GNE_ATTR_PARAMETERS, myParameters->getText().text()); - // reset color - myParameters->setTextColor(FXRGB(0, 0, 0)); - myParameters->killFocus(); - } else { - myParameters->setTextColor(FXRGB(255, 0, 0)); - } - } +long +GNECreateEdgeFrame::LaneTypeSelector::onCmdSelectLaneType(FXObject*, FXSelector, void*) { + // update index + myLaneIndex = myLaneTypesComboBox->getCurrentItem(); + // refresh laneType selector + refreshLaneTypeSelector(); + return 0; } void -GNECreateEdgeFrame::EdgeTypeParameters::setAttributeExistentEdgeType(FXObject* obj) { - // get undoList - GNEUndoList* undoList = myCreateEdgeFrameParent->myViewNet->getUndoList(); - // get selected edge type - GNEEdgeType* edgeType = myCreateEdgeFrameParent->myEdgeTypeSelector->getEdgeTypeSelected(); - // check what attribute was changed - if (obj == myID) { - // check if is valid - if (edgeType->isValid(SUMO_ATTR_ID, myID->getText().text())) { - // set attribute - edgeType->setAttribute(SUMO_ATTR_ID, myID->getText().text(), undoList); - // reset color - myID->setTextColor(FXRGB(0, 0, 0)); - myID->killFocus(); - } else { - myID->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myNumLanes) { - // check if is valid - if (edgeType->isValid(SUMO_ATTR_NUMLANES, myNumLanes->getText().text())) { - // reset color - myNumLanes->setTextColor(FXRGB(0, 0, 0)); - myNumLanes->killFocus(); - // update numLanes in laneTypeParameters - myLaneTypeParameters->updateNumLanes(GNEAttributeCarrier::parse(myNumLanes->getText().text())); - } else { - myNumLanes->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == mySpeed) { - // check if is valid - if (edgeType->isValid(SUMO_ATTR_SPEED, mySpeed->getText().text())) { - // set attribute - edgeType->setAttribute(SUMO_ATTR_SPEED, mySpeed->getText().text(), undoList); - // reset color - mySpeed->setTextColor(FXRGB(0, 0, 0)); - mySpeed->killFocus(); - } else { - mySpeed->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myAllow) { - // check if is valid - if (edgeType->isValid(SUMO_ATTR_ALLOW, myAllow->getText().text())) { - // set attribute - edgeType->setAttribute(SUMO_ATTR_ALLOW, myAllow->getText().text(), undoList); - // reset color - myAllow->setTextColor(FXRGB(0, 0, 0)); - myAllow->killFocus(); - // update disallow textField - myDisallow->setText(edgeType->getAttribute(SUMO_ATTR_DISALLOW).c_str(), FALSE); - } else { - myAllow->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myDisallow) { - // check if is valid - if (edgeType->isValid(SUMO_ATTR_DISALLOW, myDisallow->getText().text())) { - // set attribute - edgeType->setAttribute(SUMO_ATTR_DISALLOW, myDisallow->getText().text(), undoList); - // reset color - myDisallow->setTextColor(FXRGB(0, 0, 0)); - myDisallow->killFocus(); - // update allow textField - myAllow->setText(edgeType->getAttribute(SUMO_ATTR_ALLOW).c_str(), FALSE); - } else { - myDisallow->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == mySpreadType) { - // check if is valid - if (edgeType->isValid(SUMO_ATTR_SPREADTYPE, mySpreadType->getText().text())) { - // set attribute - edgeType->setAttribute(SUMO_ATTR_SPREADTYPE, mySpreadType->getText().text(), undoList); - // reset color - mySpreadType->setTextColor(FXRGB(0, 0, 0)); - mySpreadType->killFocus(); - } else { - mySpreadType->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myWidth) { - // check if is valid - if (edgeType->isValid(SUMO_ATTR_WIDTH, myWidth->getText().text())) { - // set attribute - edgeType->setAttribute(SUMO_ATTR_WIDTH, myWidth->getText().text(), undoList); - // reset color - myWidth->setTextColor(FXRGB(0, 0, 0)); - myWidth->killFocus(); - } else { - myWidth->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myPriority) { - // check if is valid - if (edgeType->isValid(SUMO_ATTR_PRIORITY, myPriority->getText().text())) { - // set attribute (Without undoList) - edgeType->setAttribute(SUMO_ATTR_PRIORITY, myPriority->getText().text()); - // reset color - myPriority->setTextColor(FXRGB(0, 0, 0)); - myPriority->killFocus(); - } else { - myPriority->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myParameters) { - // check if is valid - if (edgeType->isValid(GNE_ATTR_PARAMETERS, myParameters->getText().text())) { - // set attribute - edgeType->setAttribute(GNE_ATTR_PARAMETERS, myParameters->getText().text(), undoList); - // reset color - myParameters->setTextColor(FXRGB(0, 0, 0)); - myParameters->killFocus(); - } else { - myParameters->setTextColor(FXRGB(255, 0, 0)); - } +GNECreateEdgeFrame::LaneTypeSelector::updateComboBox() { + // check lane index + if (myLaneIndex > myLaneTypesComboBox->getNumItems()) { + myLaneIndex = 0; + } + // set current item + myLaneTypesComboBox->setCurrentItem(myLaneIndex); + // set num visible items + if (myLaneTypesComboBox->getNumItems() <= 10) { + myLaneTypesComboBox->setNumVisible(myLaneTypesComboBox->getNumItems()); + } else { + myLaneTypesComboBox->setNumVisible(10); } } @@ -1352,8 +538,8 @@ // GNECreateEdgeFrame::Legend - methods // --------------------------------------------------------------------------- -GNECreateEdgeFrame::EdgeTypeSelectorLegend::EdgeTypeSelectorLegend(GNECreateEdgeFrame* createEdgeFrameParent) : - FXGroupBox(createEdgeFrameParent->myContentFrame, "Legend", GUIDesignGroupBoxFrame) { +GNECreateEdgeFrame::Legend::Legend(GNECreateEdgeFrame* createEdgeFrameParent) : + FXGroupBoxModule(createEdgeFrameParent->myContentFrame, "Information") { // crate information std::ostringstream information; // add label for shift+click @@ -1367,11 +553,11 @@ << "- Alt+Shift+Click:" << "\n" << " Splits edge in one direction"; // create label - new FXLabel(this, information.str().c_str(), 0, GUIDesignLabelFrameThicked); + new FXLabel(getCollapsableFrame(), information.str().c_str(), 0, GUIDesignLabelFrameInformation); } -GNECreateEdgeFrame::EdgeTypeSelectorLegend::~EdgeTypeSelectorLegend() {} +GNECreateEdgeFrame::Legend::~Legend() {} // --------------------------------------------------------------------------- // GNECreateEdgeFrame - methods @@ -1383,10 +569,14 @@ myCreateEdgeSource(nullptr) { // create custom edge selector myEdgeTypeSelector = new EdgeTypeSelector(this); - // create edge parameters - myEdgeTypeParameters = new EdgeTypeParameters(this); + // Create edgeType parameters + myEdgeTypeAttributes = new GNEFrameAttributeModules::AttributesCreator(this); + // lane type selector + myLaneTypeSelector = new LaneTypeSelector(this); + // Create laneType parameters + myLaneTypeAttributes = new GNEFrameAttributeModules::AttributesCreator(this); // create edge selector legend - myEdgeTypeSelectorLegend = new EdgeTypeSelectorLegend(this); + myLegend = new Legend(this); } @@ -1396,77 +586,82 @@ void GNECreateEdgeFrame::processClick(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const bool oppositeEdge, const bool chainEdge) { - // obtain junction depending of gridEnabled - GNEJunction* junction = nullptr; - if (objectsUnderCursor.getJunctionFront()) { - junction = objectsUnderCursor.getJunctionFront(); - } else if (myObjectsUnderSnappedCursor.getJunctionFront()) { - junction = myObjectsUnderSnappedCursor.getJunctionFront(); - } - // begin undo list - if (!myViewNet->getUndoList()->hasCommandGroup()) { - myViewNet->getUndoList()->begin(GUIIcon::EDGE, "create new " + toString(SUMO_TAG_EDGE)); - } - // if we didn't clicked over another junction, then create a new - if (junction == nullptr) { - junction = myViewNet->getNet()->createJunction(myViewNet->snapToActiveGrid(clickedPosition), myViewNet->getUndoList()); - } - // now check if we have to create a new edge - if (myCreateEdgeSource == nullptr) { - myCreateEdgeSource = junction; - myCreateEdgeSource->markAsCreateEdgeSource(); - update(); - } else { - // make sure that junctions source and destiny are different - if (myCreateEdgeSource != junction) { - // may fail to prevent double edges - GNEEdge* newEdge = myViewNet->getNet()->createEdge(myCreateEdgeSource, junction, nullptr, myViewNet->getUndoList()); - // check if edge was sucesfully created - if (newEdge) { - // set parameters - if (myEdgeTypeSelector->useEdgeTemplate()) { - newEdge->copyTemplate(myViewNet->getViewParent()->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myViewNet->getUndoList()); - } else if (myEdgeTypeSelector->useDefaultEdgeType()) { - newEdge->copyEdgeType(myEdgeTypeSelector->getDefaultEdgeType(), myViewNet->getUndoList()); - } else { - newEdge->copyEdgeType(myEdgeTypeSelector->getEdgeTypeSelected(), myViewNet->getUndoList()); - } - // create another edge, if create opposite edge is enabled - if (oppositeEdge && (myViewNet->getNet()->getAttributeCarriers()->retrieveEdge(junction, myCreateEdgeSource, false) == nullptr)) { - GNEEdge* newOppositeEdge = myViewNet->getNet()->createEdge(junction, myCreateEdgeSource, nullptr, - myViewNet->getUndoList(), "-" + newEdge->getNBEdge()->getID()); + // first check if there is an edge template, an edge type (default or custom) + if (!myEdgeTypeSelector->useDefaultEdgeType() && !myEdgeTypeSelector->useEdgeTemplate() && (myEdgeTypeSelector->getEdgeTypeSelected() == nullptr)) { + WRITE_WARNING("Select either default edgeType or a custom edgeType or template"); + } else { + // obtain junction depending of gridEnabled + GNEJunction* junction = nullptr; + if (objectsUnderCursor.getJunctionFront()) { + junction = objectsUnderCursor.getJunctionFront(); + } else if (myObjectsUnderSnappedCursor.getJunctionFront()) { + junction = myObjectsUnderSnappedCursor.getJunctionFront(); + } + // begin undo list + if (!myViewNet->getUndoList()->hasCommandGroup()) { + myViewNet->getUndoList()->begin(GUIIcon::EDGE, "create new " + toString(SUMO_TAG_EDGE)); + } + // if we didn't clicked over another junction, then create a new + if (junction == nullptr) { + junction = myViewNet->getNet()->createJunction(myViewNet->snapToActiveGrid(clickedPosition), myViewNet->getUndoList()); + } + // now check if we have to create a new edge + if (myCreateEdgeSource == nullptr) { + myCreateEdgeSource = junction; + myCreateEdgeSource->markAsCreateEdgeSource(); + update(); + } else { + // make sure that junctions source and destiny are different + if (myCreateEdgeSource != junction) { + // may fail to prevent double edges + GNEEdge* newEdge = myViewNet->getNet()->createEdge(myCreateEdgeSource, junction, nullptr, myViewNet->getUndoList()); + // check if edge was sucesfully created + if (newEdge) { // set parameters if (myEdgeTypeSelector->useEdgeTemplate()) { - newOppositeEdge->copyTemplate(myViewNet->getViewParent()->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myViewNet->getUndoList()); + newEdge->copyTemplate(myViewNet->getViewParent()->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myViewNet->getUndoList()); } else if (myEdgeTypeSelector->useDefaultEdgeType()) { - newOppositeEdge->copyEdgeType(myEdgeTypeSelector->getDefaultEdgeType(), myViewNet->getUndoList()); + newEdge->copyEdgeType(myEdgeTypeSelector->getDefaultEdgeType(), myViewNet->getUndoList()); } else { - newOppositeEdge->copyEdgeType(myEdgeTypeSelector->getEdgeTypeSelected(), myViewNet->getUndoList()); + newEdge->copyEdgeType(myEdgeTypeSelector->getEdgeTypeSelected(), myViewNet->getUndoList()); + } + // create another edge, if create opposite edge is enabled + if (oppositeEdge && (myViewNet->getNet()->getAttributeCarriers()->retrieveEdge(junction, myCreateEdgeSource, false) == nullptr)) { + GNEEdge* newOppositeEdge = myViewNet->getNet()->createEdge(junction, myCreateEdgeSource, nullptr, + myViewNet->getUndoList(), "-" + newEdge->getNBEdge()->getID()); + // set parameters + if (myEdgeTypeSelector->useEdgeTemplate()) { + newOppositeEdge->copyTemplate(myViewNet->getViewParent()->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myViewNet->getUndoList()); + } else if (myEdgeTypeSelector->useDefaultEdgeType()) { + newOppositeEdge->copyEdgeType(myEdgeTypeSelector->getDefaultEdgeType(), myViewNet->getUndoList()); + } else { + newOppositeEdge->copyEdgeType(myEdgeTypeSelector->getEdgeTypeSelected(), myViewNet->getUndoList()); + } + } + // edge created, then unmark as create edge source + myCreateEdgeSource->unMarkAsCreateEdgeSource(); + // end undo list + if (myViewNet->getUndoList()->hasCommandGroup()) { + myViewNet->getUndoList()->end(); + } else { + std::cout << "edge created without an open CommandGroup )-:\n"; + } + // if we're creating edges in chain mode, mark junction as junction edge source + if (chainEdge) { + myCreateEdgeSource = junction; + myCreateEdgeSource->markAsCreateEdgeSource(); + myViewNet->getUndoList()->begin(GUIIcon::EDGE, "create new " + toString(SUMO_TAG_EDGE)); + } else { + myCreateEdgeSource = nullptr; } - } - // edge created, then unmark as create edge source - myCreateEdgeSource->unMarkAsCreateEdgeSource(); - // end undo list - if (myViewNet->getUndoList()->hasCommandGroup()) { - myViewNet->getUndoList()->end(); - } else { - std::cout << "edge created without an open CommandGroup )-:\n"; - } - // if we're creating edges in chain mode, mark junction as junction edge source - if (chainEdge) { - myCreateEdgeSource = junction; - myCreateEdgeSource->markAsCreateEdgeSource(); - myViewNet->getUndoList()->begin(GUIIcon::EDGE, "create new " + toString(SUMO_TAG_EDGE)); } else { - myCreateEdgeSource = nullptr; + myViewNet->setStatusBarText("An " + toString(SUMO_TAG_EDGE) + " with the same geometry already exists!"); } } else { - myViewNet->setStatusBarText("An " + toString(SUMO_TAG_EDGE) + " with the same geometry already exists!"); + myViewNet->setStatusBarText("Start- and endpoint for an " + toString(SUMO_TAG_EDGE) + " must be distinct!"); } - } else { - myViewNet->setStatusBarText("Start- and endpoint for an " + toString(SUMO_TAG_EDGE) + " must be distinct!"); + update(); } - update(); } } @@ -1497,7 +692,7 @@ void GNECreateEdgeFrame::show() { // refresh template selector - myEdgeTypeSelector->refreshEdgeTypeSelector(true); + myEdgeTypeSelector->refreshEdgeTypeSelector(); // show frame GNEFrame::show(); } @@ -1515,9 +710,29 @@ return myEdgeTypeSelector; } + +GNEFrameAttributeModules::AttributesCreator* +GNECreateEdgeFrame::getEdgeTypeAttributes() const { + return myEdgeTypeAttributes; +} + + +GNECreateEdgeFrame::LaneTypeSelector* +GNECreateEdgeFrame::getLaneTypeSelector() { + return myLaneTypeSelector; +} + + +GNEFrameAttributeModules::AttributesCreator* +GNECreateEdgeFrame::getLaneTypeAttributes() const { + return myLaneTypeAttributes; +} + + void GNECreateEdgeFrame::setUseEdgeTemplate() { myEdgeTypeSelector->useTemplate(); + myEdgeTypeSelector->refreshEdgeTypeSelector(); } /****************************************************************************/ diff -Nru sumo-1.11.0/src/netedit/frames/network/GNECreateEdgeFrame.h sumo-1.12.0/src/netedit/frames/network/GNECreateEdgeFrame.h --- sumo-1.11.0/src/netedit/frames/network/GNECreateEdgeFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNECreateEdgeFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -44,7 +44,7 @@ // class EdgeTypeSelector // =========================================================================== - class EdgeTypeSelector : protected FXGroupBox { + class EdgeTypeSelector : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNECreateEdgeFrame::EdgeTypeSelector) @@ -56,7 +56,10 @@ ~EdgeTypeSelector(); /// @brief refresh edge type selector - void refreshEdgeTypeSelector(const bool show = false); + void refreshEdgeTypeSelector(); + + /// @brief update id in comboBox + void updateIDinComboBox(const std::string& oldID, const std::string& newID); /// @brief check if we have to use edge template bool useEdgeTemplate() const; @@ -73,6 +76,12 @@ /// @brief clear edgeType selected void clearEdgeTypeSelected(); + /// @brief set current edgeType + void setCurrentEdgeType(const GNEEdgeType* edgeType); + + /// @brief use template + void useTemplate(); + /// @name FOX-callbacks /// @{ /// @brief Called when the user press a radio button @@ -84,15 +93,13 @@ /// @brief Called when the user press button for delete edge type long onCmdDeleteEdgeType(FXObject*, FXSelector, void*); - /// @brief Called when the user press button for reset edge type - long onCmdResetEdgeType(FXObject*, FXSelector, void*); - /// @brief Called when the user press select an edgeType in comboBox long onCmdSelectEdgeType(FXObject*, FXSelector, void*); - /// @} + /// @brief Called when the user press create edgeType from Template + long onCmdCreateFromTemplate(FXObject*, FXSelector, void*); - void useTemplate(); + /// @} protected: /// @brief FOX need this @@ -101,19 +108,19 @@ /// @brief fill comboBox void fillComboBox(); - /// @brief fill default parameters - void fillDefaultParameters(); - private: /// @brief pointer to createEdgeFrameParent GNECreateEdgeFrame* myCreateEdgeFrameParent; - /// @brief selected edgeType - GNEEdgeType* myEdgeTypeSelected; - /// @brief default edge type GNEEdgeType* myDefaultEdgeType; + /// @brief selected edgeType + GNEEdgeType* myEdgeTypeSelected = nullptr; + + /// @brief currentIndex + int myCurrentIndex; + /// @brief create default edge FXRadioButton* myUseDefaultEdgeType = nullptr; @@ -129,225 +136,82 @@ /// @brief button for delete edge type FXButton* myDeleteEdgeTypeButton = nullptr; - /// @brief button for reset edge type - FXButton* myResetEdgeTypeButton = nullptr; + /// @brief button for create edgeType from template + FXButton* myCreateFromTemplate = nullptr; }; // =========================================================================== - // class LaneTypeParameters + // class LaneTypeSelector // =========================================================================== - class LaneTypeParameters : protected FXGroupBox { + class LaneTypeSelector : public FXGroupBoxModule { /// @brief FOX-declaration - FXDECLARE(GNECreateEdgeFrame::LaneTypeParameters) + FXDECLARE(GNECreateEdgeFrame::LaneTypeSelector) public: /// @brief constructor - LaneTypeParameters(GNECreateEdgeFrame* createEdgeFrameParent); + LaneTypeSelector(GNECreateEdgeFrame* createEdgeFrameParent); /// @brief destructor - ~LaneTypeParameters(); - - /// @brief refresh lane paramters - void refreshLaneTypeParameters(); - - /// @brief show lane parameters - void showLaneTypeParameters(); - - /// @brief hide lane parameters - void hideLaneTypeParameters(); + ~LaneTypeSelector(); - /// @brief enable lane parameters - void enableLaneTypeParameters(); + /// @brief show lane type selector + void showLaneTypeSelector(); - /// @brief disable lane parameters - void disableLaneTypeParameters(); + /// @brief hide lane type selector + void hideLaneTypeSelector(); - /// @brief set attributes - void setAttributes(GNEEdge* edge, GNEUndoList* undoList) const; - - /// @brief update numLanes - void updateNumLanes(int numLanes); + /// @brief refresh LaneTypeSelector + void refreshLaneTypeSelector(); /// @name FOX-callbacks /// @{ - /// @brief Called when the user change value - long onCmdSetAttribute(FXObject*, FXSelector, void*); - - /// @brief Called when the user open attribute dialog - long onCmdOpenAttributeDialog(FXObject*, FXSelector, void*); + /// @brief Called when the user press button for add a new lane type + long onCmdAddLaneType(FXObject*, FXSelector, void*); /// @brief Called when the user press button for delete lane type long onCmdDeleteLaneType(FXObject*, FXSelector, void*); - /// @brief Called when the user press button for reset lane type - long onCmdResetLaneType(FXObject*, FXSelector, void*); - - /// @} - - protected: - /// @brief FOX need this - FOX_CONSTRUCTOR(LaneTypeParameters); - - /// @brief set attribute for default parameters - void setAttributeDefaultParameters(FXObject* obj); - - /// @brief set attribute for existent lane type - void setAttributeExistentLaneType(FXObject* obj); - - private: - /// @brief pointer to createEdgeFrameParent - GNECreateEdgeFrame* myCreateEdgeFrameParent; - - /// @brief button for delete lane type - FXButton* myDeleteLaneTypeButton = nullptr; - - /// @brief button for reset lane type - FXButton* myResetLaneTypeButton = nullptr; - - /// @brief ComboBox for laneIndex - FXComboBox* myLaneIndex = nullptr; - - /// @brief textField for speed - FXTextField* mySpeed = nullptr; - - /// @brief Button for allow vehicles - FXButton* myAllowButton = nullptr; - - /// @brief textField for allow vehicles - FXTextField* myAllow = nullptr; - - /// @brief Button for disallow vehicles - FXButton* myDisallowButton = nullptr; - - /// @brief textField for disallow vehicles - FXTextField* myDisallow = nullptr; - - /// @brief textField for width - FXTextField* myWidth = nullptr; - - /// @brief Button for edit generic parameters - FXButton* myParametersButton = nullptr; - - /// @brief textField for Parameters - FXTextField* myParameters = nullptr; - }; - - // =========================================================================== - // class EdgeTypeParameters - // =========================================================================== - - class EdgeTypeParameters : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNECreateEdgeFrame::EdgeTypeParameters) - - public: - /// @brief constructor - EdgeTypeParameters(GNECreateEdgeFrame* createEdgeFrameParent); - - /// @brief destructor - ~EdgeTypeParameters(); - - /// @brief show edge parameters - void showEdgeTypeParameters(); - - /// @brief hide edge parameters - void hideEdgeTypeParameters(); - - /// @brief enable edge parameters - void enableEdgeTypeParameters(); - - /// @brief disable edge parameters - void disableEdgeTypeParameters(); - - /// @brief set edgeType - void setEdgeType(GNEEdgeType* edgeType, bool showID); - - /// @brief set template values - void setTemplateValues(); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user change value - long onCmdSetAttribute(FXObject* obj, FXSelector, void*); - - /// @brief Called when the user open attribute dialog - long onCmdOpenAttributeDialog(FXObject* obj, FXSelector, void*); + /// @brief Called when the user press select an laneType in comboBox + long onCmdSelectLaneType(FXObject*, FXSelector, void*); /// @} protected: /// @brief FOX need this - FOX_CONSTRUCTOR(EdgeTypeParameters); - - /// @brief set attribute for default parameters - void setAttributeDefaultParameters(FXObject* obj); + FOX_CONSTRUCTOR(LaneTypeSelector); - /// @brief set attribute for existent edge type - void setAttributeExistentEdgeType(FXObject* obj); + /// @brief update comboBox + void updateComboBox(); private: /// @brief pointer to createEdgeFrameParent GNECreateEdgeFrame* myCreateEdgeFrameParent; - /// @brief horizontal frame for ID - FXHorizontalFrame* myHorizontalFrameID; + /// @brief lane index + int myLaneIndex; + /// @brief ComboBox for lane types + FXComboBox* myLaneTypesComboBox = nullptr; - // @brief label frame for ID/template - FXLabel* myLabelID; + /// @brief button for create new lane type + FXButton* myAddLaneTypeButton = nullptr; - /// @brief textField for id - FXTextField* myID = nullptr; - - /// @brief textField for numLanes - FXTextField* myNumLanes = nullptr; - - /// @brief textField for speed - FXTextField* mySpeed = nullptr; - - /// @brief Button for allow vehicles - FXButton* myAllowButton = nullptr; - - /// @brief textField for allow vehicles - FXTextField* myAllow = nullptr; - - /// @brief Button for disallow vehicles - FXButton* myDisallowButton = nullptr; - - /// @brief textField for disallow vehicles - FXTextField* myDisallow = nullptr; - - /// @brief comboBox for spreadType - FXComboBox* mySpreadType = nullptr; - - /// @brief textField for width - FXTextField* myWidth = nullptr; - - /// @brief textField for priority - FXTextField* myPriority = nullptr; - - /// @brief Button for edit generic parameters - FXButton* myParametersButton = nullptr; - - /// @brief textField for Parameters - FXTextField* myParameters = nullptr; - - /// @brief lane parameters - LaneTypeParameters* myLaneTypeParameters = nullptr; + /// @brief button for delete lane type + FXButton* myDeleteLaneTypeButton = nullptr; }; // =========================================================================== - // class EdgeTypeSelectorLegend + // class Legend // =========================================================================== - class EdgeTypeSelectorLegend : protected FXGroupBox { + class Legend : public FXGroupBoxModule { public: /// @brief constructor - EdgeTypeSelectorLegend(GNECreateEdgeFrame* createEdgeFrameParent); + Legend(GNECreateEdgeFrame* createEdgeFrameParent); /// @brief destructor - ~EdgeTypeSelectorLegend(); + ~Legend(); }; /**@brief Constructor @@ -382,21 +246,36 @@ /// @brief hide create edge frame void hide(); - /// @brief getcustom edge selector + /// @brief get edgeType selector EdgeTypeSelector* getEdgeTypeSelector() const; + /// @brief get edgeType attributes + GNEFrameAttributeModules::AttributesCreator* getEdgeTypeAttributes() const; + + /// @brief get lane type selector + LaneTypeSelector* getLaneTypeSelector(); + + /// @brief get laneType attributes + GNEFrameAttributeModules::AttributesCreator* getLaneTypeAttributes() const; + /// @brief set default to using edge template void setUseEdgeTemplate(); protected: - /// @brief edge parameters - EdgeTypeParameters* myEdgeTypeParameters = nullptr; - - /// @brief custom edge selector + /// @brief edge type selector EdgeTypeSelector* myEdgeTypeSelector = nullptr; - /// @brief edge selector legend - EdgeTypeSelectorLegend* myEdgeTypeSelectorLegend = nullptr; + /// @brief internal edgeType attributes + GNEFrameAttributeModules::AttributesCreator* myEdgeTypeAttributes = nullptr; + + /// @brief lane type selector + GNECreateEdgeFrame::LaneTypeSelector* myLaneTypeSelector = nullptr; + + /// @brief internal laneType attributes + GNEFrameAttributeModules::AttributesCreator* myLaneTypeAttributes = nullptr; + + /// @brief Legend + GNECreateEdgeFrame::Legend* myLegend = nullptr; private: /// @brief objects under snapped cursor diff -Nru sumo-1.11.0/src/netedit/frames/network/GNECrossingFrame.cpp sumo-1.12.0/src/netedit/frames/network/GNECrossingFrame.cpp --- sumo-1.11.0/src/netedit/frames/network/GNECrossingFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNECrossingFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -49,9 +50,9 @@ }; // Object implementation -FXIMPLEMENT(GNECrossingFrame::EdgesSelector, FXGroupBox, EdgesSelectorMap, ARRAYNUMBER(EdgesSelectorMap)) -FXIMPLEMENT(GNECrossingFrame::CrossingParameters, FXGroupBox, CrossingParametersMap, ARRAYNUMBER(CrossingParametersMap)) -FXIMPLEMENT(GNECrossingFrame::CreateCrossing, FXGroupBox, CreateCrossingMap, ARRAYNUMBER(CreateCrossingMap)) +FXIMPLEMENT(GNECrossingFrame::EdgesSelector, FXGroupBoxModule, EdgesSelectorMap, ARRAYNUMBER(EdgesSelectorMap)) +FXIMPLEMENT(GNECrossingFrame::CrossingParameters, FXGroupBoxModule, CrossingParametersMap, ARRAYNUMBER(CrossingParametersMap)) +FXIMPLEMENT(GNECrossingFrame::CreateCrossing, FXGroupBoxModule, CreateCrossingMap, ARRAYNUMBER(CreateCrossingMap)) // =========================================================================== @@ -63,9 +64,9 @@ // --------------------------------------------------------------------------- GNECrossingFrame::CurrentJunction::CurrentJunction(GNECrossingFrame* crossingFrameParent) : - FXGroupBox(crossingFrameParent->myContentFrame, "Junction", GUIDesignGroupBoxFrame) { + FXGroupBoxModule(crossingFrameParent->myContentFrame, "Junction") { // Create frame for junction ID - FXHorizontalFrame* junctionIDFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* junctionIDFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); // create label new FXLabel(junctionIDFrame, "", nullptr, GUIDesignLabelAttribute); // create text field and disable it @@ -91,18 +92,18 @@ // --------------------------------------------------------------------------- GNECrossingFrame::EdgesSelector::EdgesSelector(GNECrossingFrame* crossingFrameParent) : - FXGroupBox(crossingFrameParent->myContentFrame, ("selection of " + toString(SUMO_TAG_EDGE) + "s").c_str(), GUIDesignGroupBoxFrame), + FXGroupBoxModule(crossingFrameParent->myContentFrame, ("selection of " + toString(SUMO_TAG_EDGE) + "s").c_str()), myCrossingFrameParent(crossingFrameParent), myCurrentJunction(nullptr) { // Create button for selected edges - myUseSelectedEdges = new FXButton(this, ("Use selected " + toString(SUMO_TAG_EDGE) + "s").c_str(), nullptr, this, MID_GNE_ADDITIONALFRAME_USESELECTED, GUIDesignButton); + myUseSelectedEdges = new FXButton(getCollapsableFrame(), ("Use selected " + toString(SUMO_TAG_EDGE) + "s").c_str(), nullptr, this, MID_GNE_ADDITIONALFRAME_USESELECTED, GUIDesignButton); // Create button for clear selection - myClearEdgesSelection = new FXButton(this, ("Clear " + toString(SUMO_TAG_EDGE) + "s").c_str(), nullptr, this, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GUIDesignButton); + myClearEdgesSelection = new FXButton(getCollapsableFrame(), ("Clear " + toString(SUMO_TAG_EDGE) + "s").c_str(), nullptr, this, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GUIDesignButton); // Create button for invert selection - myInvertEdgesSelection = new FXButton(this, ("Invert " + toString(SUMO_TAG_EDGE) + "s").c_str(), nullptr, this, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GUIDesignButton); + myInvertEdgesSelection = new FXButton(getCollapsableFrame(), ("Invert " + toString(SUMO_TAG_EDGE) + "s").c_str(), nullptr, this, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GUIDesignButton); } @@ -188,41 +189,46 @@ // --------------------------------------------------------------------------- GNECrossingFrame::CrossingParameters::CrossingParameters(GNECrossingFrame* crossingFrameParent) : - FXGroupBox(crossingFrameParent->myContentFrame, "Crossing parameters", GUIDesignGroupBoxFrame), + FXGroupBoxModule(crossingFrameParent->myContentFrame, "Crossing parameters"), myCrossingFrameParent(crossingFrameParent), + myCrossingTemplate(nullptr), myCurrentParametersValid(true) { + // createcrossing template + myCrossingTemplate = new GNECrossing(crossingFrameParent->getViewNet()->getNet()); FXHorizontalFrame* crossingParameter = nullptr; // create label and string textField for edges - crossingParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + crossingParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); myCrossingEdgesLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_EDGES).c_str(), nullptr, GUIDesignLabelAttribute); myCrossingEdges = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); myCrossingEdgesLabel->disable(); myCrossingEdges->disable(); // create label and checkbox for Priority - crossingParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + crossingParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); myCrossingPriorityLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_PRIORITY).c_str(), nullptr, GUIDesignLabelAttribute); myCrossingPriorityCheckButton = new FXCheckButton(crossingParameter, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); myCrossingPriorityLabel->disable(); myCrossingPriorityCheckButton->disable(); // create label and textfield for width - crossingParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + crossingParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); myCrossingWidthLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_WIDTH).c_str(), nullptr, GUIDesignLabelAttribute); myCrossingWidth = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); myCrossingWidthLabel->disable(); myCrossingWidth->disable(); // Create help button - myHelpCrossingAttribute = new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); + myHelpCrossingAttribute = new FXButton(getCollapsableFrame(), "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); myHelpCrossingAttribute->disable(); } -GNECrossingFrame::CrossingParameters::~CrossingParameters() {} +GNECrossingFrame::CrossingParameters::~CrossingParameters() { + delete myCrossingTemplate; +} void GNECrossingFrame::CrossingParameters::enableCrossingParameters(bool hasTLS) { // obtain Tag Values - const auto& tagProperties = GNEAttributeCarrier::getTagProperties(SUMO_TAG_CROSSING); + const auto& tagProperties = GNEAttributeCarrier::getTagProperty(SUMO_TAG_CROSSING); // Enable all elements of the crossing frames myCrossingEdgesLabel->enable(); myCrossingEdges->enable(); @@ -444,7 +450,7 @@ long GNECrossingFrame::CrossingParameters::onCmdHelp(FXObject*, FXSelector, void*) { - myCrossingFrameParent->openHelpAttributesDialog(GNEAttributeCarrier::getTagProperties(SUMO_TAG_CROSSING)); + myCrossingFrameParent->openHelpAttributesDialog(myCrossingTemplate); return 1; } @@ -453,10 +459,10 @@ // --------------------------------------------------------------------------- GNECrossingFrame::CreateCrossing::CreateCrossing(GNECrossingFrame* crossingFrameParent) : - FXGroupBox(crossingFrameParent->myContentFrame, "Create", GUIDesignGroupBoxFrame), + FXGroupBoxModule(crossingFrameParent->myContentFrame, "Create"), myCrossingFrameParent(crossingFrameParent) { // Create groupbox for create crossings - myCreateCrossingButton = new FXButton(this, "Create crossing", 0, this, MID_GNE_CREATE, GUIDesignButton); + myCreateCrossingButton = new FXButton(getCollapsableFrame(), "Create crossing", 0, this, MID_GNE_CREATE, GUIDesignButton); myCreateCrossingButton->disable(); } @@ -498,6 +504,24 @@ } // --------------------------------------------------------------------------- +// GNECrossingFrame::Legend - methods +// --------------------------------------------------------------------------- + +GNECrossingFrame::Information::Information(GNECrossingFrame* crossingFrameParent) : + FXGroupBoxModule(crossingFrameParent->myContentFrame, "Information") { + // candidate + FXLabel* colorCandidateLabel = new FXLabel(getCollapsableFrame(), " Candidate", 0, GUIDesignLabelLeft); + colorCandidateLabel->setBackColor(MFXUtils::getFXColor(crossingFrameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.possible)); + colorCandidateLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE)); + // selected + FXLabel* colorSelectedLabel = new FXLabel(getCollapsableFrame(), " Selected", 0, GUIDesignLabelLeft); + colorSelectedLabel->setBackColor(MFXUtils::getFXColor(crossingFrameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.target)); +} + + +GNECrossingFrame::Information::~Information() {} + +// --------------------------------------------------------------------------- // GNECrossingFrame - methods // --------------------------------------------------------------------------- @@ -515,13 +539,8 @@ // create CreateCrossing modul myCreateCrossing = new CreateCrossing(this); - // Create groupbox and labels for legends - FXGroupBox* groupBoxLegend = new FXGroupBox(myContentFrame, "", GUIDesignGroupBoxFrame); - FXLabel* colorCandidateLabel = new FXLabel(groupBoxLegend, " Candidate", 0, GUIDesignLabelLeft); - colorCandidateLabel->setBackColor(MFXUtils::getFXColor(viewNet->getVisualisationSettings().candidateColorSettings.possible)); - colorCandidateLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE)); - FXLabel* colorSelectedLabel = new FXLabel(groupBoxLegend, " Selected", 0, GUIDesignLabelLeft); - colorSelectedLabel->setBackColor(MFXUtils::getFXColor(viewNet->getVisualisationSettings().candidateColorSettings.target)); + // create information modul + myInformation = new Information(this); // disable edge selector myEdgeSelector->disableEdgeSelector(); diff -Nru sumo-1.11.0/src/netedit/frames/network/GNECrossingFrame.h sumo-1.12.0/src/netedit/frames/network/GNECrossingFrame.h --- sumo-1.11.0/src/netedit/frames/network/GNECrossingFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNECrossingFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -22,6 +22,13 @@ #include + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNECrossing; + // =========================================================================== // class definitions // =========================================================================== @@ -37,7 +44,7 @@ // class CurrentJunction // =========================================================================== - class CurrentJunction : protected FXGroupBox { + class CurrentJunction : public FXGroupBoxModule { public: /// @brief constructor @@ -58,7 +65,7 @@ // class EdgesSelector // =========================================================================== - class EdgesSelector : protected FXGroupBox { + class EdgesSelector : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNECrossingFrame::EdgesSelector) @@ -117,7 +124,7 @@ // class CrossingParameters // =========================================================================== - class CrossingParameters : protected FXGroupBox { + class CrossingParameters : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNECrossingFrame::CrossingParameters) @@ -177,6 +184,9 @@ /// @brief pointer to GNECrossingFrame parent GNECrossingFrame* myCrossingFrameParent; + /// @brief crossing template + GNECrossing* myCrossingTemplate; + /// @brief current selected edges std::vector myCurrentSelectedEdges; @@ -209,7 +219,7 @@ // class CreateCrossing // =========================================================================== - class CreateCrossing : protected FXGroupBox { + class CreateCrossing : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNECrossingFrame::CreateCrossing) @@ -240,6 +250,20 @@ FXButton* myCreateCrossingButton; }; + // =========================================================================== + // class Information + // =========================================================================== + + class Information : public FXGroupBoxModule { + + public: + /// @brief constructor + Information(GNECrossingFrame* crossingFrameParent); + + /// @brief destructor + ~Information(); + }; + /**@brief Constructor * @brief parent FXHorizontalFrame in which this GNEFrame is placed * @brief viewNet viewNet that uses this GNEFrame @@ -261,18 +285,22 @@ void createCrossingHotkey(); protected: + /// @brief FOX need this FOX_CONSTRUCTOR(GNECrossingFrame) private: /// @brief current junction modul - GNECrossingFrame::CurrentJunction* myCurrentJunction; + GNECrossingFrame::CurrentJunction* myCurrentJunction = nullptr; /// @brief edge selector modul - GNECrossingFrame::EdgesSelector* myEdgeSelector; + GNECrossingFrame::EdgesSelector* myEdgeSelector = nullptr; /// @brief crossing parameters modul - GNECrossingFrame::CrossingParameters* myCrossingParameters; + GNECrossingFrame::CrossingParameters* myCrossingParameters = nullptr; /// @brief create crossing modul - GNECrossingFrame::CreateCrossing* myCreateCrossing; + GNECrossingFrame::CreateCrossing* myCreateCrossing = nullptr; + + /// @brief information modul + GNECrossingFrame::Information* myInformation = nullptr; }; diff -Nru sumo-1.11.0/src/netedit/frames/network/GNEPolygonFrame.cpp sumo-1.12.0/src/netedit/frames/network/GNEPolygonFrame.cpp --- sumo-1.11.0/src/netedit/frames/network/GNEPolygonFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNEPolygonFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -43,7 +43,7 @@ }; // Object implementation -FXIMPLEMENT(GNEPolygonFrame::GEOPOICreator, FXGroupBox, GEOPOICreatorMap, ARRAYNUMBER(GEOPOICreatorMap)) +FXIMPLEMENT(GNEPolygonFrame::GEOPOICreator, FXGroupBoxModule, GEOPOICreatorMap, ARRAYNUMBER(GEOPOICreatorMap)) // =========================================================================== @@ -55,21 +55,21 @@ // --------------------------------------------------------------------------- GNEPolygonFrame::GEOPOICreator::GEOPOICreator(GNEPolygonFrame* polygonFrameParent) : - FXGroupBox(polygonFrameParent->myContentFrame, "GEO POI Creator", GUIDesignGroupBoxFrame), + FXGroupBoxModule(polygonFrameParent->myContentFrame, "GEO POI Creator"), myPolygonFrameParent(polygonFrameParent) { // create RadioButtons for formats - myLonLatRadioButton = new FXRadioButton(this, "Format: Lon-Lat", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - myLatLonRadioButton = new FXRadioButton(this, "Format: Lat-Lon", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); + myLonLatRadioButton = new FXRadioButton(getCollapsableFrame(), "Format: Lon-Lat", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); + myLatLonRadioButton = new FXRadioButton(getCollapsableFrame(), "Format: Lat-Lon", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); // set lat-lon as default myLatLonRadioButton->setCheck(TRUE); // create text field for coordinates - myCoordinatesTextField = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + myCoordinatesTextField = new FXTextField(getCollapsableFrame(), GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // create checkBox - myCenterViewAfterCreationCheckButton = new FXCheckButton(this, "Center View after creation", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + myCenterViewAfterCreationCheckButton = new FXCheckButton(getCollapsableFrame(), "Center View after creation", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); // create button for create GEO POIs - myCreateGEOPOIButton = new FXButton(this, "Create GEO POI (clipboard)", nullptr, this, MID_GNE_CREATE, GUIDesignButton); + myCreateGEOPOIButton = new FXButton(getCollapsableFrame(), "Create GEO POI (clipboard)", nullptr, this, MID_GNE_CREATE, GUIDesignButton); // create information label - myLabelCartesianPosition = new FXLabel(this, "Cartesian equivalence:\n- X = give valid longitude\n- Y = give valid latitude", 0, GUIDesignLabelFrameInformation); + myLabelCartesianPosition = new FXLabel(getCollapsableFrame(), "Cartesian equivalence:\n- X = give valid longitude\n- Y = give valid latitude", 0, GUIDesignLabelFrameInformation); } @@ -77,7 +77,7 @@ void -GNEPolygonFrame::GEOPOICreator::showGEOPOICreatorModul() { +GNEPolygonFrame::GEOPOICreator::showGEOPOICreatorModule() { // check if there is an GEO Proj string is defined if (GeoConvHelper::getFinal().getProjString() != "!") { myCoordinatesTextField->enable(); @@ -94,7 +94,7 @@ void -GNEPolygonFrame::GEOPOICreator::hideGEOPOICreatorModul() { +GNEPolygonFrame::GEOPOICreator::hideGEOPOICreatorModule() { hide(); } @@ -203,7 +203,7 @@ } } // refresh shape attributes - myPolygonFrameParent->myShapeAttributes->refreshRows(); + myPolygonFrameParent->myShapeAttributes->refreshAttributesCreator(); } return 1; } @@ -218,22 +218,19 @@ myBaseShape(nullptr) { // create item Selector modul for shapes - myShapeTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::SHAPE); + myShapeTagSelector = new GNEFrameModules::TagSelector(this, GNETagProperties::TagType::SHAPE, SUMO_TAG_POLY); // Create shape parameters - myShapeAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + myShapeAttributes = new GNEFrameAttributeModules::AttributesCreator(this); // Create Netedit parameter - myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); + myNeteditAttributes = new GNEFrameAttributeModules::NeteditAttributes(this); // Create drawing controls - myDrawingShape = new GNEFrameModuls::DrawingShape(this); + myDrawingShape = new GNEFrameModules::DrawingShape(this); /// @brief create GEOPOICreator myGEOPOICreator = new GEOPOICreator(this); - - // set polygon as default shape - myShapeTagSelector->setCurrentTag(SUMO_TAG_POLY); } @@ -247,8 +244,8 @@ void GNEPolygonFrame::show() { - // refresh item selector - myShapeTagSelector->refreshTagProperties(); + // refresh tag selector + myShapeTagSelector->refreshTagSelector(); // show frame GNEFrame::show(); } @@ -259,112 +256,113 @@ // reset updateTemporalShape updateTemporalShape = false; // check if current selected shape is valid - if (myShapeTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_POI) { - // show warning dialogbox and stop if input parameters are invalid - if (myShapeAttributes->areValuesValid() == false) { - myShapeAttributes->showWarningMessage(); - return false; - } - // create baseShape object - createBaseShapeObject(SUMO_TAG_POI); - // obtain shape attributes and values - myShapeAttributes->getAttributesAndValues(myBaseShape, true); - // obtain netedit attributes and values - myNeteditAttributes->getNeteditAttributesAndValues(myBaseShape, objectsUnderCursor.getLaneFront()); - // Check if ID has to be generated - if (!myBaseShape->hasStringAttribute(SUMO_ATTR_ID)) { - myBaseShape->addStringAttribute(SUMO_ATTR_ID, myViewNet->getNet()->getAttributeCarriers()->generateShapeID(SUMO_TAG_POI)); - } - // add X-Y - myBaseShape->addDoubleAttribute(SUMO_ATTR_X, clickedPosition.x()); - myBaseShape->addDoubleAttribute(SUMO_ATTR_Y, clickedPosition.y()); - // set GEO Position as false (because we have created POI clicking over View - myBaseShape->addBoolAttribute(SUMO_ATTR_GEO, "false"); - // add shape - addShape(); - // refresh shape attributes - myShapeAttributes->refreshRows(); - // shape added, then return true - return true; - } else if (myShapeTagSelector->getCurrentTagProperties().getTag() == GNE_TAG_POIGEO) { - // show warning dialogbox and stop if input parameters are invalid - if (myShapeAttributes->areValuesValid() == false) { - myShapeAttributes->showWarningMessage(); - return false; - } - // create baseShape object - createBaseShapeObject(SUMO_TAG_POI); - // obtain shape attributes and values - myShapeAttributes->getAttributesAndValues(myBaseShape, true); - // obtain netedit attributes and values - myNeteditAttributes->getNeteditAttributesAndValues(myBaseShape, objectsUnderCursor.getLaneFront()); - // Check if ID has to be generated - if (!myBaseShape->hasStringAttribute(SUMO_ATTR_ID)) { - myBaseShape->addStringAttribute(SUMO_ATTR_ID, myViewNet->getNet()->getAttributeCarriers()->generateShapeID(SUMO_TAG_POI)); - } - // convert position to cartesian - Position GEOPos = clickedPosition; - GeoConvHelper::getFinal().cartesian2geo(GEOPos); - // add X-Y in geo format - myBaseShape->addDoubleAttribute(SUMO_ATTR_LON, GEOPos.x()); - myBaseShape->addDoubleAttribute(SUMO_ATTR_LAT, GEOPos.y()); - // set GEO Position as false (because we have created POI clicking over View - myBaseShape->addBoolAttribute(SUMO_ATTR_GEO, "true"); - // add shape - addShape(); - // refresh shape attributes - myShapeAttributes->refreshRows(); - // shape added, then return true - return true; - } else if (myShapeTagSelector->getCurrentTagProperties().getTag() == GNE_TAG_POILANE) { - // abort if lane is nullptr - if (objectsUnderCursor.getLaneFront() == nullptr) { - WRITE_WARNING(toString(GNE_TAG_POILANE) + " can be only placed over lanes"); - return false; - } - // show warning dialogbox and stop if input parameters are invalid - if (myShapeAttributes->areValuesValid() == false) { - myShapeAttributes->showWarningMessage(); - return false; - } - // create baseShape object - createBaseShapeObject(SUMO_TAG_POI); - // obtain shape attributes and values - myShapeAttributes->getAttributesAndValues(myBaseShape, true); - // obtain netedit attributes and values - myNeteditAttributes->getNeteditAttributesAndValues(myBaseShape, objectsUnderCursor.getLaneFront()); - // Check if ID has to be generated - if (!myBaseShape->hasStringAttribute(SUMO_ATTR_ID)) { - myBaseShape->addStringAttribute(SUMO_ATTR_ID, myViewNet->getNet()->getAttributeCarriers()->generateShapeID(SUMO_TAG_POI)); - } - // obtain Lane - myBaseShape->addStringAttribute(SUMO_ATTR_LANE, objectsUnderCursor.getLaneFront()->getID()); - // obtain position over lane - myBaseShape->addDoubleAttribute(SUMO_ATTR_POSITION, objectsUnderCursor.getLaneFront()->getLaneShape().nearest_offset_to_point2D(clickedPosition)); - // add shape - addShape(); - // refresh shape attributes - myShapeAttributes->refreshRows(); - // shape added, then return true - return true; - } else if (myShapeTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_POLY) { - if (myDrawingShape->isDrawing()) { - // add or delete a new point depending of flag "delete last created point" - if (myDrawingShape->getDeleteLastCreatedPoint()) { - myDrawingShape->removeLastPoint(); - } else { - myDrawingShape->addNewPoint(clickedPosition); + if (myShapeTagSelector->getCurrentTemplateAC() != nullptr) { + if (myShapeTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() == SUMO_TAG_POI) { + // show warning dialogbox and stop if input parameters are invalid + if (myShapeAttributes->areValuesValid() == false) { + myShapeAttributes->showWarningMessage(); + return false; } - // set temporal shape - updateTemporalShape = true; + // create baseShape object + createBaseShapeObject(SUMO_TAG_POI); + // obtain shape attributes and values + myShapeAttributes->getAttributesAndValues(myBaseShape, true); + // obtain netedit attributes and values + myNeteditAttributes->getNeteditAttributesAndValues(myBaseShape, objectsUnderCursor.getLaneFront()); + // Check if ID has to be generated + if (!myBaseShape->hasStringAttribute(SUMO_ATTR_ID)) { + myBaseShape->addStringAttribute(SUMO_ATTR_ID, myViewNet->getNet()->getAttributeCarriers()->generateShapeID(SUMO_TAG_POI)); + } + // add X-Y + myBaseShape->addDoubleAttribute(SUMO_ATTR_X, clickedPosition.x()); + myBaseShape->addDoubleAttribute(SUMO_ATTR_Y, clickedPosition.y()); + // set GEO Position as false (because we have created POI clicking over View + myBaseShape->addBoolAttribute(SUMO_ATTR_GEO, "false"); + // add shape + addShape(); + // refresh shape attributes + myShapeAttributes->refreshAttributesCreator(); + // shape added, then return true return true; - } else { - return false; + } else if (myShapeTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() == GNE_TAG_POIGEO) { + // show warning dialogbox and stop if input parameters are invalid + if (myShapeAttributes->areValuesValid() == false) { + myShapeAttributes->showWarningMessage(); + return false; + } + // create baseShape object + createBaseShapeObject(SUMO_TAG_POI); + // obtain shape attributes and values + myShapeAttributes->getAttributesAndValues(myBaseShape, true); + // obtain netedit attributes and values + myNeteditAttributes->getNeteditAttributesAndValues(myBaseShape, objectsUnderCursor.getLaneFront()); + // Check if ID has to be generated + if (!myBaseShape->hasStringAttribute(SUMO_ATTR_ID)) { + myBaseShape->addStringAttribute(SUMO_ATTR_ID, myViewNet->getNet()->getAttributeCarriers()->generateShapeID(SUMO_TAG_POI)); + } + // convert position to cartesian + Position GEOPos = clickedPosition; + GeoConvHelper::getFinal().cartesian2geo(GEOPos); + // add X-Y in geo format + myBaseShape->addDoubleAttribute(SUMO_ATTR_LON, GEOPos.x()); + myBaseShape->addDoubleAttribute(SUMO_ATTR_LAT, GEOPos.y()); + // set GEO Position as false (because we have created POI clicking over View + myBaseShape->addBoolAttribute(SUMO_ATTR_GEO, "true"); + // add shape + addShape(); + // refresh shape attributes + myShapeAttributes->refreshAttributesCreator(); + // shape added, then return true + return true; + } else if (myShapeTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() == GNE_TAG_POILANE) { + // abort if lane is nullptr + if (objectsUnderCursor.getLaneFront() == nullptr) { + WRITE_WARNING(toString(GNE_TAG_POILANE) + " can be only placed over lanes"); + return false; + } + // show warning dialogbox and stop if input parameters are invalid + if (myShapeAttributes->areValuesValid() == false) { + myShapeAttributes->showWarningMessage(); + return false; + } + // create baseShape object + createBaseShapeObject(SUMO_TAG_POI); + // obtain shape attributes and values + myShapeAttributes->getAttributesAndValues(myBaseShape, true); + // obtain netedit attributes and values + myNeteditAttributes->getNeteditAttributesAndValues(myBaseShape, objectsUnderCursor.getLaneFront()); + // Check if ID has to be generated + if (!myBaseShape->hasStringAttribute(SUMO_ATTR_ID)) { + myBaseShape->addStringAttribute(SUMO_ATTR_ID, myViewNet->getNet()->getAttributeCarriers()->generateShapeID(SUMO_TAG_POI)); + } + // obtain Lane + myBaseShape->addStringAttribute(SUMO_ATTR_LANE, objectsUnderCursor.getLaneFront()->getID()); + // obtain position over lane + myBaseShape->addDoubleAttribute(SUMO_ATTR_POSITION, objectsUnderCursor.getLaneFront()->getLaneShape().nearest_offset_to_point2D(clickedPosition)); + // add shape + addShape(); + // refresh shape attributes + myShapeAttributes->refreshAttributesCreator(); + // shape added, then return true + return true; + } else if (myShapeTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() == SUMO_TAG_POLY) { + if (myDrawingShape->isDrawing()) { + // add or delete a new point depending of flag "delete last created point" + if (myDrawingShape->getDeleteLastCreatedPoint()) { + myDrawingShape->removeLastPoint(); + } else { + myDrawingShape->addNewPoint(clickedPosition); + } + // set temporal shape + updateTemporalShape = true; + return true; + } else { + return false; + } } - } else { - myViewNet->setStatusBarText("Current selected shape isn't valid."); - return false; } + myViewNet->setStatusBarText("Current selected shape isn't valid."); + return false; } @@ -384,8 +382,8 @@ } -GNEFrameModuls::DrawingShape* -GNEPolygonFrame::getDrawingShapeModul() const { +GNEFrameModules::DrawingShape* +GNEPolygonFrame::getDrawingShapeModule() const { return myDrawingShape; } @@ -435,7 +433,7 @@ // add shape addShape(); // refresh shape attributes - myShapeAttributes->refreshRows(); + myShapeAttributes->refreshAttributesCreator(); // shape added, then return true; return true; } @@ -444,29 +442,29 @@ void GNEPolygonFrame::tagSelected() { - if (myShapeTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + if (myShapeTagSelector->getCurrentTemplateAC()) { // if there are parmeters, show and Recalc groupBox - myShapeAttributes->showAttributesCreatorModul(myShapeTagSelector->getCurrentTagProperties(), {}); + myShapeAttributes->showAttributesCreatorModule(myShapeTagSelector->getCurrentTemplateAC(), {}); // show netedit attributes - myNeteditAttributes->showNeteditAttributesModul(myShapeTagSelector->getCurrentTagProperties()); + myNeteditAttributes->showNeteditAttributesModule(myShapeTagSelector->getCurrentTemplateAC()->getTagProperty()); // Check if drawing mode has to be shown - if (myShapeTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_POLY) { + if (myShapeTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() == SUMO_TAG_POLY) { myDrawingShape->showDrawingShape(); } else { myDrawingShape->hideDrawingShape(); } // Check if GEO POI Creator has to be shown - if (myShapeTagSelector->getCurrentTagProperties().getTag() == GNE_TAG_POIGEO) { - myGEOPOICreator->showGEOPOICreatorModul(); + if (myShapeTagSelector->getCurrentTemplateAC()->getTagProperty().getTag() == GNE_TAG_POIGEO) { + myGEOPOICreator->showGEOPOICreatorModule(); } else { - myGEOPOICreator->hideGEOPOICreatorModul(); + myGEOPOICreator->hideGEOPOICreatorModule(); } } else { // hide all widgets - myShapeAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); + myShapeAttributes->hideAttributesCreatorModule(); + myNeteditAttributes->hideNeteditAttributesModule(); myDrawingShape->hideDrawingShape(); - myGEOPOICreator->hideGEOPOICreatorModul(); + myGEOPOICreator->hideGEOPOICreatorModule(); } } diff -Nru sumo-1.11.0/src/netedit/frames/network/GNEPolygonFrame.h sumo-1.12.0/src/netedit/frames/network/GNEPolygonFrame.h --- sumo-1.11.0/src/netedit/frames/network/GNEPolygonFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNEPolygonFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -36,7 +36,7 @@ // class GEOPOICreator // =========================================================================== - class GEOPOICreator : protected FXGroupBox { + class GEOPOICreator : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNEPolygonFrame::GEOPOICreator) @@ -47,11 +47,11 @@ /// @brief destructor ~GEOPOICreator(); - /// @brief Show list of GEOPOICreator Modul - void showGEOPOICreatorModul(); + /// @brief Show list of GEOPOICreator Module + void showGEOPOICreatorModule(); - /// @brief hide GEOPOICreator Modul - void hideGEOPOICreatorModul(); + /// @brief hide GEOPOICreator Module + void hideGEOPOICreatorModule(); /// @name FOX-callbacks /// @{ @@ -114,7 +114,7 @@ static std::string getIdsSelected(const FXList* list); /// @brief get drawing mode editor - GNEFrameModuls::DrawingShape* getDrawingShapeModul() const; + GNEFrameModules::DrawingShape* getDrawingShapeModule() const; protected: /// @brief SumoBaseObject used for create shape @@ -137,16 +137,16 @@ private: /// @brief shape tag selector - GNEFrameModuls::TagSelector* myShapeTagSelector; + GNEFrameModules::TagSelector* myShapeTagSelector; /// @brief shape internal attributes - GNEFrameAttributesModuls::AttributesCreator* myShapeAttributes; + GNEFrameAttributeModules::AttributesCreator* myShapeAttributes; /// @brief Netedit parameter - GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; + GNEFrameAttributeModules::NeteditAttributes* myNeteditAttributes; /// @brief Drawing shape - GNEFrameModuls::DrawingShape* myDrawingShape; + GNEFrameModules::DrawingShape* myDrawingShape; /// @brief GEOPOICreator GEOPOICreator* myGEOPOICreator; diff -Nru sumo-1.11.0/src/netedit/frames/network/GNEProhibitionFrame.cpp sumo-1.12.0/src/netedit/frames/network/GNEProhibitionFrame.cpp --- sumo-1.11.0/src/netedit/frames/network/GNEProhibitionFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNEProhibitionFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -50,10 +50,10 @@ // --------------------------------------------------------------------------- GNEProhibitionFrame::RelativeToConnection::RelativeToConnection(GNEProhibitionFrame* prohibitionFrameParent) : - FXGroupBox(prohibitionFrameParent->myContentFrame, "Relative to connection", GUIDesignGroupBoxFrame), + FXGroupBoxModule(prohibitionFrameParent->myContentFrame, "Relative to connection"), myProhibitionFrameParent(prohibitionFrameParent) { // Create label for current connection description and update it - myConnDescriptionLabel = new FXLabel(this, "", nullptr, GUIDesignLabelFrameInformation); + myConnDescriptionLabel = new FXLabel(getCollapsableFrame(), "", nullptr, GUIDesignLabelFrameInformation); // update description updateDescription(); } @@ -77,64 +77,64 @@ // GNEProhibitionFrame::ProhibitionLegend - methods // --------------------------------------------------------------------------- -GNEProhibitionFrame::ProhibitionLegend::ProhibitionLegend(GNEProhibitionFrame* prohibitionFrameParent) : - FXGroupBox(prohibitionFrameParent->myContentFrame, "Legend", GUIDesignGroupBoxFrame), +GNEProhibitionFrame::Legend::Legend(GNEProhibitionFrame* prohibitionFrameParent) : + FXGroupBoxModule(prohibitionFrameParent->myContentFrame, "Information"), myUndefinedColor(RGBColor::GREY), myProhibitedColor(RGBColor(0, 179, 0)), myProhibitingColor(RGBColor::RED), myUnregulatedConflictColor(RGBColor::ORANGE), myMutualConflictColor(RGBColor::CYAN) { // Create labels for color legend - FXLabel* legendLabel = new FXLabel(this, "Selected", nullptr, GUIDesignLabelFrameInformation); + FXLabel* legendLabel = new FXLabel(getCollapsableFrame(), "Selected", nullptr, GUIDesignLabelFrameInformation); legendLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE)); legendLabel->setBackColor(MFXUtils::getFXColor(prohibitionFrameParent->myViewNet->getVisualisationSettings().colorSettings.selectedProhibitionColor)); // label for conflicts - legendLabel = new FXLabel(this, "No conflict", nullptr, GUIDesignLabelFrameInformation); + legendLabel = new FXLabel(getCollapsableFrame(), "No conflict", nullptr, GUIDesignLabelFrameInformation); legendLabel->setBackColor(MFXUtils::getFXColor(myUndefinedColor)); // label for yields - legendLabel = new FXLabel(this, "Yields", nullptr, GUIDesignLabelFrameInformation); + legendLabel = new FXLabel(getCollapsableFrame(), "Yields", nullptr, GUIDesignLabelFrameInformation); legendLabel->setBackColor(MFXUtils::getFXColor(myProhibitedColor)); // label for right of way - legendLabel = new FXLabel(this, "Has right of way", nullptr, GUIDesignLabelFrameInformation); + legendLabel = new FXLabel(getCollapsableFrame(), "Has right of way", nullptr, GUIDesignLabelFrameInformation); legendLabel->setBackColor(MFXUtils::getFXColor(myProhibitingColor)); // label for unregulated conflict - legendLabel = new FXLabel(this, "Unregulated conflict", nullptr, GUIDesignLabelFrameInformation); + legendLabel = new FXLabel(getCollapsableFrame(), "Unregulated conflict", nullptr, GUIDesignLabelFrameInformation); legendLabel->setBackColor(MFXUtils::getFXColor(myUnregulatedConflictColor)); // label for mutual conflict - legendLabel = new FXLabel(this, "Mutual conflict", nullptr, GUIDesignLabelFrameInformation); + legendLabel = new FXLabel(getCollapsableFrame(), "Mutual conflict", nullptr, GUIDesignLabelFrameInformation); legendLabel->setBackColor(MFXUtils::getFXColor(myMutualConflictColor)); } -GNEProhibitionFrame::ProhibitionLegend::~ProhibitionLegend() {} +GNEProhibitionFrame::Legend::~Legend() {} const RGBColor& -GNEProhibitionFrame::ProhibitionLegend::getUndefinedColor() const { +GNEProhibitionFrame::Legend::getUndefinedColor() const { return myUndefinedColor; } const RGBColor& -GNEProhibitionFrame::ProhibitionLegend::getProhibitedColor() const { +GNEProhibitionFrame::Legend::getProhibitedColor() const { return myProhibitedColor; } const RGBColor& -GNEProhibitionFrame::ProhibitionLegend::getProhibitingColor() const { +GNEProhibitionFrame::Legend::getProhibitingColor() const { return myProhibitingColor; } const RGBColor& -GNEProhibitionFrame::ProhibitionLegend::getUnregulatedConflictColor() const { +GNEProhibitionFrame::Legend::getUnregulatedConflictColor() const { return myUnregulatedConflictColor; } const RGBColor& -GNEProhibitionFrame::ProhibitionLegend::getMutualConflictColor() const { +GNEProhibitionFrame::Legend::getMutualConflictColor() const { return myMutualConflictColor; } @@ -143,14 +143,14 @@ // --------------------------------------------------------------------------- GNEProhibitionFrame::Modifications::Modifications(GNEProhibitionFrame* prohibitionFrameParent) : - FXGroupBox(prohibitionFrameParent->myContentFrame, "Modifications", GUIDesignGroupBoxFrame) { + FXGroupBoxModule(prohibitionFrameParent->myContentFrame, "Modifications") { // Create "OK" button - mySaveButton = new FXButton(this, "OK\t\tSave prohibition modifications (Enter)", + mySaveButton = new FXButton(getCollapsableFrame(), "OK\t\tSave prohibition modifications (Enter)", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), prohibitionFrameParent, MID_OK, GUIDesignButton); // Create "Cancel" button - myCancelButton = new FXButton(this, "Cancel\t\tDiscard prohibition modifications (Esc)", + myCancelButton = new FXButton(getCollapsableFrame(), "Cancel\t\tDiscard prohibition modifications (Esc)", GUIIconSubSys::getIcon(GUIIcon::CANCEL), prohibitionFrameParent, MID_CANCEL, GUIDesignButton); // Currently mySaveButton is disabled @@ -174,8 +174,8 @@ // create RelativeToConnection myRelativeToConnection = new RelativeToConnection(this); - // create ProhibitionLegend - myProhibitionLegend = new ProhibitionLegend(this); + // create legend + myLegend = new Legend(this); // create Modifications myModifications = new Modifications(this); @@ -261,16 +261,16 @@ myConcernedConns.insert(i); // change color depending of prohibition status if (!foes) { - i->setSpecialColor(&myProhibitionLegend->getUndefinedColor()); + i->setSpecialColor(&myLegend->getUndefinedColor()); } else { if (forbids && forbidden) { - i->setSpecialColor(&myProhibitionLegend->getMutualConflictColor()); + i->setSpecialColor(&myLegend->getMutualConflictColor()); } else if (forbids) { - i->setSpecialColor(&myProhibitionLegend->getProhibitedColor()); + i->setSpecialColor(&myLegend->getProhibitedColor()); } else if (forbidden) { - i->setSpecialColor(&myProhibitionLegend->getProhibitingColor()); + i->setSpecialColor(&myLegend->getProhibitingColor()); } else { - i->setSpecialColor(&myProhibitionLegend->getUnregulatedConflictColor()); + i->setSpecialColor(&myLegend->getUnregulatedConflictColor()); } } } diff -Nru sumo-1.11.0/src/netedit/frames/network/GNEProhibitionFrame.h sumo-1.12.0/src/netedit/frames/network/GNEProhibitionFrame.h --- sumo-1.11.0/src/netedit/frames/network/GNEProhibitionFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNEProhibitionFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -51,7 +51,7 @@ // class RelativeToConnection // =========================================================================== - class RelativeToConnection : protected FXGroupBox { + class RelativeToConnection : public FXGroupBoxModule { public: /// @brief constructor @@ -72,17 +72,17 @@ }; // =========================================================================== - // class ProhibitionLegend + // class Legend // =========================================================================== - class ProhibitionLegend : protected FXGroupBox { + class Legend : public FXGroupBoxModule { public: /// @brief constructor - ProhibitionLegend(GNEProhibitionFrame* prohibitionFrameParent); + Legend(GNEProhibitionFrame* prohibitionFrameParent); /// @brief destructor - ~ProhibitionLegend(); + ~Legend(); /// @brief get color for non-conflicting pairs of connections const RGBColor& getUndefinedColor() const; @@ -120,7 +120,7 @@ // class Modifications // =========================================================================== - class Modifications : protected FXGroupBox { + class Modifications : public FXGroupBoxModule { public: /// @brief constructor @@ -178,13 +178,13 @@ RelativeToConnection* myRelativeToConnection; /// @brief prohibition legend - ProhibitionLegend* myProhibitionLegend; + GNEProhibitionFrame::Legend* myLegend = nullptr; /// @brief Modifications - Modifications* myModifications; + GNEProhibitionFrame::Modifications* myModifications = nullptr; /// @brief the connection which prohibits - GNEConnection* myCurrentConn; + GNEConnection* myCurrentConn = nullptr; /// @brief the set of connections which std::set myConcernedConns; diff -Nru sumo-1.11.0/src/netedit/frames/network/GNETAZFrame.cpp sumo-1.12.0/src/netedit/frames/network/GNETAZFrame.cpp --- sumo-1.11.0/src/netedit/frames/network/GNETAZFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNETAZFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -62,11 +62,11 @@ }; // Object implementation -FXIMPLEMENT(GNETAZFrame::TAZParameters, FXGroupBox, TAZParametersMap, ARRAYNUMBER(TAZParametersMap)) -FXIMPLEMENT(GNETAZFrame::TAZSaveChanges, FXGroupBox, TAZSaveChangesMap, ARRAYNUMBER(TAZSaveChangesMap)) -FXIMPLEMENT(GNETAZFrame::TAZChildDefaultParameters, FXGroupBox, TAZChildDefaultParametersMap, ARRAYNUMBER(TAZChildDefaultParametersMap)) -FXIMPLEMENT(GNETAZFrame::TAZSelectionStatistics, FXGroupBox, TAZSelectionStatisticsMap, ARRAYNUMBER(TAZSelectionStatisticsMap)) -FXIMPLEMENT(GNETAZFrame::TAZEdgesGraphic, FXGroupBox, TAZEdgesGraphicMap, ARRAYNUMBER(TAZEdgesGraphicMap)) +FXIMPLEMENT(GNETAZFrame::TAZParameters, FXGroupBoxModule, TAZParametersMap, ARRAYNUMBER(TAZParametersMap)) +FXIMPLEMENT(GNETAZFrame::TAZSaveChanges, FXGroupBoxModule, TAZSaveChangesMap, ARRAYNUMBER(TAZSaveChangesMap)) +FXIMPLEMENT(GNETAZFrame::TAZChildDefaultParameters, FXGroupBoxModule, TAZChildDefaultParametersMap, ARRAYNUMBER(TAZChildDefaultParametersMap)) +FXIMPLEMENT(GNETAZFrame::TAZSelectionStatistics, FXGroupBoxModule, TAZSelectionStatisticsMap, ARRAYNUMBER(TAZSelectionStatisticsMap)) +FXIMPLEMENT(GNETAZFrame::TAZEdgesGraphic, FXGroupBoxModule, TAZEdgesGraphicMap, ARRAYNUMBER(TAZEdgesGraphicMap)) // =========================================================================== @@ -148,7 +148,7 @@ GNETAZFrame::CurrentTAZ::CurrentTAZ(GNETAZFrame* TAZFrameParent) : - FXGroupBox(TAZFrameParent->myContentFrame, "TAZ", GUIDesignGroupBoxFrame), + FXGroupBoxModule(TAZFrameParent->myContentFrame, "TAZ"), myTAZFrameParent(TAZFrameParent), myEditedTAZ(nullptr), myMaxSourcePlusSinkWeight(0), @@ -156,7 +156,7 @@ myMaxSourceMinusSinkWeight(0), myMinSourceMinusSinkWeight(-1) { // create TAZ label - myCurrentTAZLabel = new FXLabel(this, "No TAZ selected", 0, GUIDesignLabelLeft); + myCurrentTAZLabel = new FXLabel(getCollapsableFrame(), "No TAZ selected", 0, GUIDesignLabelLeft); } @@ -175,34 +175,34 @@ // resfresh TAZ Edges refreshTAZEdges(); // hide TAZ parameters - myTAZFrameParent->myTAZParameters->hideTAZParametersModul(); + myTAZFrameParent->myTAZParameters->hideTAZParametersModule(); // hide Netedit parameters - myTAZFrameParent->myNeteditAttributes->hideNeteditAttributesModul(); + myTAZFrameParent->myNeteditAttributes->hideNeteditAttributesModule(); // hide drawing shape myTAZFrameParent->myDrawingShape->hideDrawingShape(); // show edge common parameters - myTAZFrameParent->myTAZCommonStatistics->showTAZCommonStatisticsModul(); + myTAZFrameParent->myTAZCommonStatistics->showTAZCommonStatisticsModule(); // show save TAZ Edges - myTAZFrameParent->myTAZSaveChanges->showTAZSaveChangesModul(); + myTAZFrameParent->myTAZSaveChanges->showTAZSaveChangesModule(); // show edge common parameters - myTAZFrameParent->myTAZChildDefaultParameters->showTAZChildDefaultParametersModul(); + myTAZFrameParent->myTAZChildDefaultParameters->showTAZChildDefaultParametersModule(); // show Edges graphics - myTAZFrameParent->myTAZEdgesGraphic->showTAZEdgesGraphicModul(); + myTAZFrameParent->myTAZEdgesGraphic->showTAZEdgesGraphicModule(); } else { // show TAZ parameters - myTAZFrameParent->myTAZParameters->showTAZParametersModul(); + myTAZFrameParent->myTAZParameters->showTAZParametersModule(); // show Netedit parameters - myTAZFrameParent->myNeteditAttributes->showNeteditAttributesModul(GNEAttributeCarrier::getTagProperties(SUMO_TAG_TAZ)); + myTAZFrameParent->myNeteditAttributes->showNeteditAttributesModule(GNEAttributeCarrier::getTagProperty(SUMO_TAG_TAZ)); // show drawing shape myTAZFrameParent->myDrawingShape->showDrawingShape(); // hide edge common parameters - myTAZFrameParent->myTAZCommonStatistics->hideTAZCommonStatisticsModul(); + myTAZFrameParent->myTAZCommonStatistics->hideTAZCommonStatisticsModule(); // hide edge common parameters - myTAZFrameParent->myTAZChildDefaultParameters->hideTAZChildDefaultParametersModul(); + myTAZFrameParent->myTAZChildDefaultParameters->hideTAZChildDefaultParametersModule(); // hide Edges graphics - myTAZFrameParent->myTAZEdgesGraphic->hideTAZEdgesGraphicModul(); + myTAZFrameParent->myTAZEdgesGraphic->hideTAZEdgesGraphicModule(); // hide save TAZ Edges - myTAZFrameParent->myTAZSaveChanges->hideTAZSaveChangesModul(); + myTAZFrameParent->myTAZSaveChanges->hideTAZSaveChangesModule(); // restore label myCurrentTAZLabel->setText("No TAZ selected"); // clear selected edges @@ -345,10 +345,10 @@ // --------------------------------------------------------------------------- GNETAZFrame::TAZCommonStatistics::TAZCommonStatistics(GNETAZFrame* TAZFrameParent) : - FXGroupBox(TAZFrameParent->myContentFrame, "TAZ Statistics", GUIDesignGroupBoxFrame), + FXGroupBoxModule(TAZFrameParent->myContentFrame, "TAZ Statistics"), myTAZFrameParent(TAZFrameParent) { // create label for statistics - myStatisticsLabel = new FXLabel(this, "Statistics", 0, GUIDesignLabelFrameInformation); + myStatisticsLabel = new FXLabel(getCollapsableFrame(), "Statistics", 0, GUIDesignLabelFrameInformation); } @@ -356,7 +356,7 @@ void -GNETAZFrame::TAZCommonStatistics::showTAZCommonStatisticsModul() { +GNETAZFrame::TAZCommonStatistics::showTAZCommonStatisticsModule() { // always update statistics after show updateStatistics(); show(); @@ -364,7 +364,7 @@ void -GNETAZFrame::TAZCommonStatistics::hideTAZCommonStatisticsModul() { +GNETAZFrame::TAZCommonStatistics::hideTAZCommonStatisticsModule() { hide(); } @@ -395,13 +395,13 @@ // --------------------------------------------------------------------------- GNETAZFrame::TAZSaveChanges::TAZSaveChanges(GNETAZFrame* TAZFrameParent) : - FXGroupBox(TAZFrameParent->myContentFrame, "Modifications", GUIDesignGroupBoxFrame), + FXGroupBoxModule(TAZFrameParent->myContentFrame, "Modifications"), myTAZFrameParent(TAZFrameParent) { // Create groupbox for save changes - mySaveChangesButton = new FXButton(this, "Confirm changes", GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_OK, GUIDesignButton); + mySaveChangesButton = new FXButton(getCollapsableFrame(), "Confirm changes", GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_OK, GUIDesignButton); mySaveChangesButton->disable(); // Create groupbox cancel changes - myCancelChangesButton = new FXButton(this, "Cancel changes", GUIIconSubSys::getIcon(GUIIcon::CANCEL), this, MID_CANCEL, GUIDesignButton); + myCancelChangesButton = new FXButton(getCollapsableFrame(), "Cancel changes", GUIIconSubSys::getIcon(GUIIcon::CANCEL), this, MID_CANCEL, GUIDesignButton); myCancelChangesButton->disable(); } @@ -410,13 +410,13 @@ void -GNETAZFrame::TAZSaveChanges::showTAZSaveChangesModul() { +GNETAZFrame::TAZSaveChanges::showTAZSaveChangesModule() { show(); } void -GNETAZFrame::TAZSaveChanges::hideTAZSaveChangesModul() { +GNETAZFrame::TAZSaveChanges::hideTAZSaveChangesModule() { // cancel changes before hidding modul onCmdCancelChanges(0, 0, 0); hide(); @@ -484,35 +484,35 @@ // --------------------------------------------------------------------------- GNETAZFrame::TAZChildDefaultParameters::TAZChildDefaultParameters(GNETAZFrame* TAZFrameParent) : - FXGroupBox(TAZFrameParent->myContentFrame, "TAZ Sources/Sinks", GUIDesignGroupBoxFrame), + FXGroupBoxModule(TAZFrameParent->myContentFrame, "TAZ Sources/Sinks"), myTAZFrameParent(TAZFrameParent), myDefaultTAZSourceWeight(1), myDefaultTAZSinkWeight(1) { // create checkbox for toggle membership - FXHorizontalFrame* toggleMembershipFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* toggleMembershipFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); new FXLabel(toggleMembershipFrame, "Membership", 0, GUIDesignLabelAttribute); myToggleMembership = new FXCheckButton(toggleMembershipFrame, "Toggle", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); // by default enabled myToggleMembership->setCheck(TRUE); // create default TAZ Source weight - myDefaultTAZSourceFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myDefaultTAZSourceFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); new FXLabel(myDefaultTAZSourceFrame, "New source", 0, GUIDesignLabelAttribute); myTextFieldDefaultValueTAZSources = new FXTextField(myDefaultTAZSourceFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); myTextFieldDefaultValueTAZSources->setText("1"); // create default TAZ Sink weight - myDefaultTAZSinkFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myDefaultTAZSinkFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); new FXLabel(myDefaultTAZSinkFrame, "New sink", 0, GUIDesignLabelAttribute); myTextFieldDefaultValueTAZSinks = new FXTextField(myDefaultTAZSinkFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); myTextFieldDefaultValueTAZSinks->setText("1"); // Create button for use selected edges - myUseSelectedEdges = new FXButton(this, "Use selected edges", nullptr, this, MID_GNE_SELECT, GUIDesignButton); + myUseSelectedEdges = new FXButton(getCollapsableFrame(), "Use selected edges", nullptr, this, MID_GNE_SELECT, GUIDesignButton); // Create information label std::ostringstream information; information << "- Toggle Membership:\n" << " Create new Sources/Sinks\n" << " with given weights."; - myInformationLabel = new FXLabel(this, information.str().c_str(), 0, GUIDesignLabelFrameInformation); + myInformationLabel = new FXLabel(getCollapsableFrame(), information.str().c_str(), 0, GUIDesignLabelFrameInformation); } @@ -520,12 +520,12 @@ void -GNETAZFrame::TAZChildDefaultParameters::showTAZChildDefaultParametersModul() { - // check if TAZ selection Statistics Modul has to be shown +GNETAZFrame::TAZChildDefaultParameters::showTAZChildDefaultParametersModule() { + // check if TAZ selection Statistics Module has to be shown if (myToggleMembership->getCheck() == FALSE) { - myTAZFrameParent->myTAZSelectionStatistics->showTAZSelectionStatisticsModul(); + myTAZFrameParent->myTAZSelectionStatistics->showTAZSelectionStatisticsModule(); } else { - myTAZFrameParent->myTAZSelectionStatistics->hideTAZSelectionStatisticsModul(); + myTAZFrameParent->myTAZSelectionStatistics->hideTAZSelectionStatisticsModule(); } // update selected button updateSelectEdgesButton(); @@ -535,9 +535,9 @@ void -GNETAZFrame::TAZChildDefaultParameters::hideTAZChildDefaultParametersModul() { - // hide TAZ Selection Statistics Modul - myTAZFrameParent->myTAZSelectionStatistics->hideTAZSelectionStatisticsModul(); +GNETAZFrame::TAZChildDefaultParameters::hideTAZChildDefaultParametersModule() { + // hide TAZ Selection Statistics Module + myTAZFrameParent->myTAZSelectionStatistics->hideTAZSelectionStatisticsModule(); // hide modul hide(); } @@ -557,14 +557,14 @@ myUseSelectedEdges->setText("Use selected edges"); myUseSelectedEdges->disable(); } - } else if (myTAZFrameParent->getCurrentTAZModul()->getTAZEdges().size() > 0) { + } else if (myTAZFrameParent->getCurrentTAZModule()->getTAZEdges().size() > 0) { // enable myUseSelectedEdges button myUseSelectedEdges->enable(); // update mySelectEdgesOfSelection label if (myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected().size() == 0) { // check if all edges of TAZChildren are selected bool allSelected = true; - for (const auto& TAZEdgeColor : myTAZFrameParent->getCurrentTAZModul()->getTAZEdges()) { + for (const auto& TAZEdgeColor : myTAZFrameParent->getCurrentTAZModule()->getTAZEdges()) { if (!TAZEdgeColor.edge->isAttributeCarrierSelected()) { allSelected = false; } @@ -639,7 +639,7 @@ << " with given weights."; myInformationLabel->setText(information.str().c_str()); // hide TAZSelectionStatistics - myTAZFrameParent->myTAZSelectionStatistics->hideTAZSelectionStatisticsModul(); + myTAZFrameParent->myTAZSelectionStatistics->hideTAZSelectionStatisticsModule(); // check if use selected edges has to be enabled if (myTAZFrameParent->myCurrentTAZ->getSelectedEdges().size() > 0) { myUseSelectedEdges->setText("Use selected edges"); @@ -663,7 +663,7 @@ << " current selection."; myInformationLabel->setText(information.str().c_str()); // show TAZSelectionStatistics - myTAZFrameParent->myTAZSelectionStatistics->showTAZSelectionStatisticsModul(); + myTAZFrameParent->myTAZSelectionStatistics->showTAZSelectionStatisticsModule(); } // update button updateSelectEdgesButton(); @@ -724,7 +724,7 @@ if (myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected().size() == 0) { // first check if all TAZEdges are selected bool allSelected = true; - for (const auto& TAZEdgeColor : myTAZFrameParent->getCurrentTAZModul()->getTAZEdges()) { + for (const auto& TAZEdgeColor : myTAZFrameParent->getCurrentTAZModule()->getTAZEdges()) { if (!TAZEdgeColor.edge->isAttributeCarrierSelected()) { allSelected = false; } @@ -732,13 +732,13 @@ // select or unselect all depending of allSelected if (allSelected) { // remove form selection all TAZEdges - for (const auto& TAZEdgeColor : myTAZFrameParent->getCurrentTAZModul()->getTAZEdges()) { + for (const auto& TAZEdgeColor : myTAZFrameParent->getCurrentTAZModule()->getTAZEdges()) { // change attribute selected (without undo-redo) TAZEdgeColor.edge->unselectAttributeCarrier(); } } else { // add to selection all TAZEdges - for (const auto& TAZEdgeColor : myTAZFrameParent->getCurrentTAZModul()->getTAZEdges()) { + for (const auto& TAZEdgeColor : myTAZFrameParent->getCurrentTAZModule()->getTAZEdges()) { // change attribute selected (without undo-redo) TAZEdgeColor.edge->selectAttributeCarrier(); } @@ -783,20 +783,20 @@ // --------------------------------------------------------------------------- GNETAZFrame::TAZSelectionStatistics::TAZSelectionStatistics(GNETAZFrame* TAZFrameParent) : - FXGroupBox(TAZFrameParent->myContentFrame, "Selection Statistics", GUIDesignGroupBoxFrame), + FXGroupBoxModule(TAZFrameParent->myContentFrame, "Selection Statistics"), myTAZFrameParent(TAZFrameParent) { // create default TAZ Source weight - myTAZSourceFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myTAZSourceFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); new FXLabel(myTAZSourceFrame, "Source", 0, GUIDesignLabelAttribute); myTextFieldTAZSourceWeight = new FXTextField(myTAZSourceFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); myTAZSourceFrame->hide(); // create default TAZ Sink weight - myTAZSinkFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myTAZSinkFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); new FXLabel(myTAZSinkFrame, "Sink", 0, GUIDesignLabelAttribute); myTextFieldTAZSinkWeight = new FXTextField(myTAZSinkFrame, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); myTAZSinkFrame->hide(); // create label for statistics - myStatisticsLabel = new FXLabel(this, "Statistics", 0, GUIDesignLabelFrameInformation); + myStatisticsLabel = new FXLabel(getCollapsableFrame(), "Statistics", 0, GUIDesignLabelFrameInformation); } @@ -804,7 +804,7 @@ void -GNETAZFrame::TAZSelectionStatistics::showTAZSelectionStatisticsModul() { +GNETAZFrame::TAZSelectionStatistics::showTAZSelectionStatisticsModule() { // update Statistics before show updateStatistics(); show(); @@ -812,7 +812,7 @@ void -GNETAZFrame::TAZSelectionStatistics::hideTAZSelectionStatisticsModul() { +GNETAZFrame::TAZSelectionStatistics::hideTAZSelectionStatisticsModule() { // clear children before hide clearSelectedEdges(); hide(); @@ -912,7 +912,7 @@ selectedEdge.source->setAttribute(SUMO_ATTR_WEIGHT, myTextFieldTAZSourceWeight->getText().text(), myTAZFrameParent->myViewNet->getUndoList()); } // refresh TAZ Edges - myTAZFrameParent->getCurrentTAZModul()->refreshTAZEdges(); + myTAZFrameParent->getCurrentTAZModule()->refreshTAZEdges(); } else { // set invalid color myTextFieldTAZSourceWeight->setTextColor(FXRGB(255, 0, 0)); @@ -936,7 +936,7 @@ selectedEdge.sink->setAttribute(SUMO_ATTR_WEIGHT, myTextFieldTAZSinkWeight->getText().text(), myTAZFrameParent->myViewNet->getUndoList()); } // refresh TAZ Edges - myTAZFrameParent->getCurrentTAZModul()->refreshTAZEdges(); + myTAZFrameParent->getCurrentTAZModule()->refreshTAZEdges(); } else { // set invalid color myTextFieldTAZSinkWeight->setTextColor(FXRGB(255, 0, 0)); @@ -954,7 +954,7 @@ GNETAZFrame::TAZSelectionStatistics::onCmdSelectEdges(FXObject*, FXSelector, void*) { if (myEdgeAndTAZChildrenSelected.size() == 0) { // add to selection all TAZEdges - for (const auto& TAZEdgeColor : myTAZFrameParent->getCurrentTAZModul()->getTAZEdges()) { + for (const auto& TAZEdgeColor : myTAZFrameParent->getCurrentTAZModule()->getTAZEdges()) { // avoid empty undolists if (!TAZEdgeColor.edge->isAttributeCarrierSelected()) { // enable save button @@ -1070,48 +1070,53 @@ // --------------------------------------------------------------------------- GNETAZFrame::TAZParameters::TAZParameters(GNETAZFrame* TAZFrameParent) : - FXGroupBox(TAZFrameParent->myContentFrame, "TAZ parameters", GUIDesignGroupBoxFrame), - myTAZFrameParent(TAZFrameParent) { + FXGroupBoxModule(TAZFrameParent->myContentFrame, "TAZ parameters"), + myTAZFrameParent(TAZFrameParent), + myTAZTemplate(nullptr) { + // create TAZ Template + myTAZTemplate = new GNETAZ(TAZFrameParent->getViewNet()->getNet()); // create Button and string textField for center (by default, empty) - FXHorizontalFrame* centerParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* centerParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); new FXLabel(centerParameter, toString(SUMO_ATTR_CENTER).c_str(), 0, GUIDesignLabelAttribute); myTextFieldCenter = new FXTextField(centerParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // create Button and string textField for color and set blue as default color - FXHorizontalFrame* fillParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* fillParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); new FXLabel(fillParameter, toString(SUMO_ATTR_FILL).c_str(), 0, GUIDesignLabelAttribute); myCheckButtonFill = new FXCheckButton(fillParameter, "false", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); myCheckButtonFill->setCheck(FALSE); // create Button and string textField for color and set blue as default color - FXHorizontalFrame* colorParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* colorParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); myColorEditor = new FXButton(colorParameter, toString(SUMO_ATTR_COLOR).c_str(), 0, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButtonAttribute); myTextFieldColor = new FXTextField(colorParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); myTextFieldColor->setText("blue"); // create Button and string textField for name and set blue as default name - FXHorizontalFrame* nameParameter = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* nameParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); new FXLabel(nameParameter, toString(SUMO_ATTR_NAME).c_str(), 0, GUIDesignLabelAttribute); myTextFieldName = new FXTextField(nameParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // create Label and CheckButton for use innen edges with true as default value - FXHorizontalFrame* useInnenEdges = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* useInnenEdges = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); new FXLabel(useInnenEdges, "Edges within", 0, GUIDesignLabelAttribute); myAddEdgesWithinCheckButton = new FXCheckButton(useInnenEdges, "use", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); myAddEdgesWithinCheckButton->setCheck(true); // Create help button - myHelpTAZAttribute = new FXButton(this, "Help", 0, this, MID_HELP, GUIDesignButtonRectangular); + myHelpTAZAttribute = new FXButton(getCollapsableFrame(), "Help", 0, this, MID_HELP, GUIDesignButtonRectangular); } -GNETAZFrame::TAZParameters::~TAZParameters() {} +GNETAZFrame::TAZParameters::~TAZParameters() { + delete myTAZTemplate; +} void -GNETAZFrame::TAZParameters::showTAZParametersModul() { - FXGroupBox::show(); +GNETAZFrame::TAZParameters::showTAZParametersModule() { + FXGroupBoxModule::show(); } void -GNETAZFrame::TAZParameters::hideTAZParametersModul() { - FXGroupBox::hide(); +GNETAZFrame::TAZParameters::hideTAZParametersModule() { + FXGroupBoxModule::hide(); } @@ -1152,7 +1157,7 @@ long GNETAZFrame::TAZParameters::onCmdSetColorAttribute(FXObject*, FXSelector, void*) { // create FXColorDialog - FXColorDialog colordialog(this, tr("Color Dialog")); + FXColorDialog colordialog(getCollapsableFrame(), tr("Color Dialog")); colordialog.setTarget(this); // If previous attribute wasn't correct, set black as default color if (GNEAttributeCarrier::canParse(myTextFieldColor->getText().text())) { @@ -1216,7 +1221,7 @@ long GNETAZFrame::TAZParameters::onCmdHelp(FXObject*, FXSelector, void*) { - myTAZFrameParent->openHelpAttributesDialog(GNEAttributeCarrier::getTagProperties(SUMO_TAG_TAZ)); + myTAZFrameParent->openHelpAttributesDialog(myTAZTemplate); return 1; } @@ -1225,27 +1230,27 @@ // --------------------------------------------------------------------------- GNETAZFrame::TAZEdgesGraphic::TAZEdgesGraphic(GNETAZFrame* TAZFrameParent) : - FXGroupBox(TAZFrameParent->myContentFrame, "Edges", GUIDesignGroupBoxFrame), + FXGroupBoxModule(TAZFrameParent->myContentFrame, "Edges"), myTAZFrameParent(TAZFrameParent), myEdgeDefaultColor(RGBColor::GREY), myEdgeSelectedColor(RGBColor::MAGENTA) { // create label for non taz edge color information - FXLabel* NonTAZEdgeLabel = new FXLabel(this, "Non TAZ Edge", nullptr, GUIDesignLabelCenter); + FXLabel* NonTAZEdgeLabel = new FXLabel(getCollapsableFrame(), "Non TAZ Edge", nullptr, GUIDesignLabelCenter); NonTAZEdgeLabel->setBackColor(MFXUtils::getFXColor(myEdgeDefaultColor)); NonTAZEdgeLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE)); // create label for selected TAZEdgeColor color information - FXLabel* selectedTAZEdgeLabel = new FXLabel(this, "Selected TAZ Edge", nullptr, GUIDesignLabelCenter); + FXLabel* selectedTAZEdgeLabel = new FXLabel(getCollapsableFrame(), "Selected TAZ Edge", nullptr, GUIDesignLabelCenter); selectedTAZEdgeLabel->setBackColor(MFXUtils::getFXColor(myEdgeSelectedColor)); // build rainbow - GNEFrameModuls::buildRainbow(this); + GNEFrameModules::buildRainbow(this); // create Radio button for show edges by source weight - myColorBySourceWeight = new FXRadioButton(this, "Color by Source", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); + myColorBySourceWeight = new FXRadioButton(getCollapsableFrame(), "Color by Source", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); // create Radio button for show edges by sink weight - myColorBySinkWeight = new FXRadioButton(this, "Color by Sink", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); + myColorBySinkWeight = new FXRadioButton(getCollapsableFrame(), "Color by Sink", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); // create Radio button for show edges by source + sink weight - myColorBySourcePlusSinkWeight = new FXRadioButton(this, "Color by Source + Sink", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); + myColorBySourcePlusSinkWeight = new FXRadioButton(getCollapsableFrame(), "Color by Source + Sink", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); // create Radio button for show edges by source - sink weight - myColorBySourceMinusSinkWeight = new FXRadioButton(this, "Color by Source - Sink", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); + myColorBySourceMinusSinkWeight = new FXRadioButton(getCollapsableFrame(), "Color by Source - Sink", this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); // show by source as default myColorBySourceWeight->setCheck(true); } @@ -1255,7 +1260,7 @@ void -GNETAZFrame::TAZEdgesGraphic::showTAZEdgesGraphicModul() { +GNETAZFrame::TAZEdgesGraphic::showTAZEdgesGraphicModule() { // update edge colors updateEdgeColors(); show(); @@ -1263,7 +1268,7 @@ void -GNETAZFrame::TAZEdgesGraphic::hideTAZEdgesGraphicModul() { +GNETAZFrame::TAZEdgesGraphic::hideTAZEdgesGraphicModule() { // iterate over all edges and restore color for (const auto& edge : myTAZFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) { for (const auto& lane : edge.second->getLanes()) { @@ -1358,10 +1363,10 @@ myTAZParameters = new TAZParameters(this); /// @brief create Netedit parameter - myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); + myNeteditAttributes = new GNEFrameAttributeModules::NeteditAttributes(this); // Create drawing controls modul - myDrawingShape = new GNEFrameModuls::DrawingShape(this); + myDrawingShape = new GNEFrameModules::DrawingShape(this); // Create TAZ Edges Common Statistics modul myTAZCommonStatistics = new TAZCommonStatistics(this); @@ -1487,26 +1492,26 @@ } -GNEFrameModuls::DrawingShape* -GNETAZFrame::getDrawingShapeModul() const { +GNEFrameModules::DrawingShape* +GNETAZFrame::getDrawingShapeModule() const { return myDrawingShape; } GNETAZFrame::CurrentTAZ* -GNETAZFrame::getCurrentTAZModul() const { +GNETAZFrame::getCurrentTAZModule() const { return myCurrentTAZ; } GNETAZFrame::TAZSelectionStatistics* -GNETAZFrame::getTAZSelectionStatisticsModul() const { +GNETAZFrame::getTAZSelectionStatisticsModule() const { return myTAZSelectionStatistics; } GNETAZFrame::TAZSaveChanges* -GNETAZFrame::getTAZSaveChangesModul() const { +GNETAZFrame::getTAZSaveChangesModule() const { return myTAZSaveChanges; } diff -Nru sumo-1.11.0/src/netedit/frames/network/GNETAZFrame.h sumo-1.12.0/src/netedit/frames/network/GNETAZFrame.h --- sumo-1.11.0/src/netedit/frames/network/GNETAZFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNETAZFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -44,7 +44,7 @@ // class CurrentTAZ // =========================================================================== - class CurrentTAZ : protected FXGroupBox { + class CurrentTAZ : public FXGroupBoxModule { public: /// @brief struct for edges and the source/sink colors @@ -150,7 +150,7 @@ // class TAZCommonStatistics // =========================================================================== - class TAZCommonStatistics : protected FXGroupBox { + class TAZCommonStatistics : public FXGroupBoxModule { public: /// @brief constructor @@ -159,11 +159,11 @@ /// @brief destructor ~TAZCommonStatistics(); - /// @brief show TAZ Common Statistics Modul - void showTAZCommonStatisticsModul(); + /// @brief show TAZ Common Statistics Module + void showTAZCommonStatisticsModule(); - /// @brief hide TAZ Common Statistics Modul - void hideTAZCommonStatisticsModul(); + /// @brief hide TAZ Common Statistics Module + void hideTAZCommonStatisticsModule(); /// @brief update Statistics label void updateStatistics(); @@ -180,7 +180,7 @@ // class TAZSaveChanges // =========================================================================== - class TAZSaveChanges : protected FXGroupBox { + class TAZSaveChanges : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNETAZFrame::TAZSaveChanges) @@ -191,11 +191,11 @@ /// @brief destructor ~TAZSaveChanges(); - /// @brief show TAZ Save Changes Modul - void showTAZSaveChangesModul(); + /// @brief show TAZ Save Changes Module + void showTAZSaveChangesModule(); - /// @brief hide TAZ Save Changes Modul - void hideTAZSaveChangesModul(); + /// @brief hide TAZ Save Changes Module + void hideTAZSaveChangesModule(); /// @brief enable buttons save and cancel changes (And begin Undo List) void enableButtonsAndBeginUndoList(); @@ -230,7 +230,7 @@ // class TAZChildDefaultParameters // =========================================================================== - class TAZChildDefaultParameters : protected FXGroupBox { + class TAZChildDefaultParameters : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNETAZFrame::TAZChildDefaultParameters) @@ -241,11 +241,11 @@ /// @brief destructor ~TAZChildDefaultParameters(); - /// @brief show TAZ child default parameters Modul - void showTAZChildDefaultParametersModul(); + /// @brief show TAZ child default parameters Module + void showTAZChildDefaultParametersModule(); - /// @brief hide TAZ child default parameters Modul - void hideTAZChildDefaultParametersModul(); + /// @brief hide TAZ child default parameters Module + void hideTAZChildDefaultParametersModule(); /// @brief update "select edges button" void updateSelectEdgesButton(); @@ -307,7 +307,7 @@ // class TAZSelectionStatistics // =========================================================================== - class TAZSelectionStatistics : protected FXGroupBox { + class TAZSelectionStatistics : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNETAZFrame::TAZSelectionStatistics) @@ -318,11 +318,11 @@ /// @brief destructor ~TAZSelectionStatistics(); - /// @brief show TAZ Selection Statistics Modul - void showTAZSelectionStatisticsModul(); + /// @brief show TAZ Selection Statistics Module + void showTAZSelectionStatisticsModule(); - /// @brief hide TAZ Selection Statistics Modul - void hideTAZSelectionStatisticsModul(); + /// @brief hide TAZ Selection Statistics Module + void hideTAZSelectionStatisticsModule(); /// @brief add an edge and their TAZ Children in the list of selected items bool selectEdge(const CurrentTAZ::TAZEdgeColor& edge); @@ -381,7 +381,7 @@ // class TAZParameters // =========================================================================== - class TAZParameters : protected FXGroupBox { + class TAZParameters : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNETAZFrame::TAZParameters) @@ -393,10 +393,10 @@ ~TAZParameters(); /// @brief show TAZ parameters and set the default value of parameters - void showTAZParametersModul(); + void showTAZParametersModule(); /// @brief hide TAZ parameters - void hideTAZParametersModul(); + void hideTAZParametersModule(); /// @brief check if current parameters are valid bool isCurrentParametersValid() const; @@ -426,6 +426,9 @@ /// @brief pointer to GNETAZFrame parent GNETAZFrame* myTAZFrameParent; + /// @brief TAZ + GNETAZ* myTAZTemplate; + /// @brief Button for open color editor FXButton* myColorEditor; @@ -452,7 +455,7 @@ // class TAZEdgesGraphic // =========================================================================== - class TAZEdgesGraphic : protected FXGroupBox { + class TAZEdgesGraphic : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNETAZFrame::TAZEdgesGraphic) @@ -463,11 +466,11 @@ /// @brief destructor ~TAZEdgesGraphic(); - /// @brief show TAZ Edges Graphic Modul - void showTAZEdgesGraphicModul(); + /// @brief show TAZ Edges Graphic Module + void showTAZEdgesGraphicModule(); - /// @brief hide TAZ Edges Graphic Modul - void hideTAZEdgesGraphicModul(); + /// @brief hide TAZ Edges Graphic Module + void hideTAZEdgesGraphicModule(); /// @brief update edge colors; void updateEdgeColors(); @@ -527,16 +530,16 @@ void processEdgeSelection(const std::vector& edges); /// @brief get drawing mode modul - GNEFrameModuls::DrawingShape* getDrawingShapeModul() const; + GNEFrameModules::DrawingShape* getDrawingShapeModule() const; /// @brief get Current TAZ modul - CurrentTAZ* getCurrentTAZModul() const; + CurrentTAZ* getCurrentTAZModule() const; /// @brief get TAZ Selection Statistics modul - TAZSelectionStatistics* getTAZSelectionStatisticsModul() const; + TAZSelectionStatistics* getTAZSelectionStatisticsModule() const; /// @brief get TAZ Save Changes modul - TAZSaveChanges* getTAZSaveChangesModul() const; + TAZSaveChanges* getTAZSaveChangesModule() const; protected: /// @brief SumoBaseObject used for creating TAZ @@ -565,10 +568,10 @@ TAZParameters* myTAZParameters; /// @brief Netedit parameter - GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; + GNEFrameAttributeModules::NeteditAttributes* myNeteditAttributes; /// @brief Drawing shape - GNEFrameModuls::DrawingShape* myDrawingShape; + GNEFrameModules::DrawingShape* myDrawingShape; /// @brief save TAZ Edges TAZSaveChanges* myTAZSaveChanges; diff -Nru sumo-1.11.0/src/netedit/frames/network/GNETLSEditorFrame.cpp sumo-1.12.0/src/netedit/frames/network/GNETLSEditorFrame.cpp --- sumo-1.11.0/src/netedit/frames/network/GNETLSEditorFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNETLSEditorFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -85,7 +85,7 @@ // Object implementation FXIMPLEMENT(GNETLSEditorFrame, FXVerticalFrame, GNETLSEditorFrameMap, ARRAYNUMBER(GNETLSEditorFrameMap)) -FXIMPLEMENT(GNETLSEditorFrame::TLSFile, FXGroupBox, TLSFileMap, ARRAYNUMBER(TLSFileMap)) +FXIMPLEMENT(GNETLSEditorFrame::TLSFile, FXGroupBoxModule, TLSFileMap, ARRAYNUMBER(TLSFileMap)) // =========================================================================== @@ -97,7 +97,7 @@ myEditedDef(nullptr) { // Create Overlapped Inspection modul - myOverlappedInspection = new GNEFrameModuls::OverlappedInspection(this, SUMO_TAG_JUNCTION); + myOverlappedInspection = new GNEFrameModules::OverlappedInspection(this, SUMO_TAG_JUNCTION); // create TLSJunction modul myTLSJunction = new GNETLSEditorFrame::TLSJunction(this); @@ -818,8 +818,15 @@ // iterate over links for (const auto& link : links) { int tlIndex = link.getTLIndex(); - PositionVector shape = link.getFrom()->getToNode()->computeInternalLaneShape(link.getFrom(), NBEdge::Connection(link.getFromLane(), - link.getTo(), link.getToLane()), NUM_POINTS); + PositionVector shape; + try { + const NBEdge::Connection& con = link.getFrom()->getConnectionRef(link.getFromLane(), link.getTo(), link.getToLane()); + shape = con.shape; + shape.append(con.viaShape); + } catch (ProcessError&) { + shape = link.getFrom()->getToNode()->computeInternalLaneShape(link.getFrom(), NBEdge::Connection(link.getFromLane(), + link.getTo(), link.getToLane()), NUM_POINTS); + } if (shape.length() < 2) { // enlarge shape to ensure visibility shape.clear(); @@ -982,29 +989,29 @@ // --------------------------------------------------------------------------- GNETLSEditorFrame::TLSAttributes::TLSAttributes(GNETLSEditorFrame* TLSEditorParent) : - FXGroupBox(TLSEditorParent->myContentFrame, "Traffic light Attributes", GUIDesignGroupBoxFrame), + FXGroupBoxModule(TLSEditorParent->myContentFrame, "Traffic light Attributes"), myTLSEditorParent(TLSEditorParent) { // create frame, label and textfield for name (By default disabled) - FXHorizontalFrame* nameFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* nameFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); new FXLabel(nameFrame, toString(SUMO_ATTR_ID).c_str(), nullptr, GUIDesignLabelAttribute); myNameTextField = new FXTextField(nameFrame, GUIDesignTextFieldNCol, myTLSEditorParent, MID_GNE_TLSFRAME_SWITCH, GUIDesignTextField); myNameTextField->disable(); // create frame, label and comboBox for Program (By default hidden) - FXHorizontalFrame* programFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* programFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); new FXLabel(programFrame, "program", nullptr, GUIDesignLabelAttribute); myProgramComboBox = new FXComboBox(programFrame, GUIDesignComboBoxNCol, myTLSEditorParent, MID_GNE_TLSFRAME_SWITCH, GUIDesignComboBoxAttribute); myProgramComboBox->disable(); // create frame, label and TextField for Offset (By default disabled) - FXHorizontalFrame* offsetFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* offsetFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); new FXLabel(offsetFrame, toString(SUMO_ATTR_OFFSET).c_str(), nullptr, GUIDesignLabelAttribute); myOffsetTextField = new FXTextField(offsetFrame, GUIDesignTextFieldNCol, myTLSEditorParent, MID_GNE_TLSFRAME_OFFSET, GUIDesignTextField); myOffsetTextField->disable(); // create frame, label and TextField for Offset (By default disabled) - FXHorizontalFrame* parametersFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* parametersFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); myButtonEditParameters = new FXButton(parametersFrame, "parameters", nullptr, myTLSEditorParent, MID_GNE_OPEN_PARAMETERS_DIALOG, GUIDesignButtonAttribute); myParametersTextField = new FXTextField(parametersFrame, GUIDesignTextFieldNCol, myTLSEditorParent, MID_GNE_TLSFRAME_PARAMETERS, GUIDesignTextField); myButtonEditParameters->disable(); @@ -1148,10 +1155,10 @@ // --------------------------------------------------------------------------- GNETLSEditorFrame::TLSJunction::TLSJunction(GNETLSEditorFrame* tlsEditorParent) : - FXGroupBox(tlsEditorParent->myContentFrame, "Junction", GUIDesignGroupBoxFrame), + FXGroupBoxModule(tlsEditorParent->myContentFrame, "Junction"), myCurrentJunction(nullptr) { // Create frame for junction ID - FXHorizontalFrame* junctionIDFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* junctionIDFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); myLabelJunctionID = new FXLabel(junctionIDFrame, "Junction ID", nullptr, GUIDesignLabelAttribute); myTextFieldJunctionID = new FXTextField(junctionIDFrame, GUIDesignTextFieldNCol, this, MID_GNE_TLSFRAME_SELECT_JUNCTION, GUIDesignTextField); myTextFieldJunctionID->setEditable(false); @@ -1192,8 +1199,8 @@ // --------------------------------------------------------------------------- GNETLSEditorFrame::TLSDefinition::TLSDefinition(GNETLSEditorFrame* TLSEditorParent) : - FXGroupBox(TLSEditorParent->myContentFrame, "Traffic Light Programs", GUIDesignGroupBoxFrame) { - FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXGroupBoxModule(TLSEditorParent->myContentFrame, "Traffic Light Programs") { + FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); // create create tlDef button myNewTLProgram = new FXButton(buttonsFrame, "Create\t\tCreate a new traffic light program", GUIIconSubSys::getIcon(GUIIcon::MODETLS), TLSEditorParent, MID_GNE_TLSFRAME_CREATE, GUIDesignButton); @@ -1212,12 +1219,12 @@ // --------------------------------------------------------------------------- GNETLSEditorFrame::TLSPhases::TLSPhases(GNETLSEditorFrame* TLSEditorParent) : - FXGroupBox(TLSEditorParent->myContentFrame, "Phases", GUIDesignGroupBoxFrame), + FXGroupBoxModule(TLSEditorParent->myContentFrame, "Phases"), myTLSEditorParent(TLSEditorParent), myTableFont(new FXFont(getApp(), "Courier New", 9)) { // create and configure phase table - myTableScroll = new FXScrollWindow(this, LAYOUT_FILL_X | LAYOUT_FIX_HEIGHT); + myTableScroll = new FXScrollWindow(getCollapsableFrame(), LAYOUT_FILL_X | LAYOUT_FIX_HEIGHT); myPhaseTable = new FXTable(myTableScroll, myTLSEditorParent, MID_GNE_TLSFRAME_PHASE_TABLE, GUIDesignTableLimitedHeight); myPhaseTable->setColumnHeaderMode(LAYOUT_FIX_HEIGHT); myPhaseTable->setColumnHeaderHeight(getApp()->getNormalFont()->getFontHeight() + getApp()->getNormalFont()->getFontAscent() / 2); @@ -1228,13 +1235,13 @@ myPhaseTable->setHelpText("phase duration in seconds | phase state"); // create total duration info label - myCycleDuration = new FXLabel(this, "", nullptr, GUIDesignLabelLeft); + myCycleDuration = new FXLabel(getCollapsableFrame(), "", nullptr, GUIDesignLabelLeft); // using FXMatrix for tabular button layout would have been cleaner but the // below attempt did not make the buttons fill available horizontal space - // FXMatrix* phaseButtons = new FXMatrix(this, 2, LAYOUT_FILL_X | MATRIX_BY_COLUMNS); + // FXMatrix* phaseButtons = new FXMatrix(getCollapsableFrame(), 2, LAYOUT_FILL_X | MATRIX_BY_COLUMNS); - FXHorizontalFrame* phaseButtons = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* phaseButtons = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); FXVerticalFrame* col1 = new FXVerticalFrame(phaseButtons, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); // left button columm FXVerticalFrame* col2 = new FXVerticalFrame(phaseButtons, LAYOUT_FILL_X, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); // right button column @@ -1362,10 +1369,10 @@ // --------------------------------------------------------------------------- GNETLSEditorFrame::TLSModifications::TLSModifications(GNETLSEditorFrame* TLSEditorParent) : - FXGroupBox(TLSEditorParent->myContentFrame, "Modifications", GUIDesignGroupBoxFrame), + FXGroupBoxModule(TLSEditorParent->myContentFrame, "Modifications"), myTLSEditorParent(TLSEditorParent), myHaveModifications(false) { - FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); // create save modifications button mySaveModificationsButtons = new FXButton(buttonsFrame, "Save\t\tSave program modifications (Enter)", GUIIconSubSys::getIcon(GUIIcon::OK), myTLSEditorParent, MID_OK, GUIDesignButton); @@ -1396,9 +1403,9 @@ // --------------------------------------------------------------------------- GNETLSEditorFrame::TLSFile::TLSFile(GNETLSEditorFrame* TLSEditorParent) : - FXGroupBox(TLSEditorParent->myContentFrame, "TLS Program File", GUIDesignGroupBoxFrame), + FXGroupBoxModule(TLSEditorParent->myContentFrame, "TLS Program File"), myTLSEditorParent(TLSEditorParent) { - FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame); // create create tlDef button myLoadTLSProgramButton = new FXButton(buttonsFrame, "Load\t\tLoad TLS program from additional file", GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG), this, MID_GNE_TLSFRAME_LOAD_PROGRAM, GUIDesignButton); // create create tlDef button @@ -1413,7 +1420,7 @@ long GNETLSEditorFrame::TLSFile::onCmdLoadTLSProgram(FXObject*, FXSelector, void*) { - FXFileDialog opendialog(this, "Load TLS Program"); + FXFileDialog opendialog(getCollapsableFrame(), "Load TLS Program"); opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::MODETLS)); opendialog.setSelectMode(SELECTFILE_EXISTING); opendialog.setPatternList("XML files (*.xml)\nAll files (*)"); @@ -1529,7 +1536,7 @@ long GNETLSEditorFrame::TLSFile::onUpdNeedsDef(FXObject* o, FXSelector, void*) { const bool enable = myTLSEditorParent->myTLSAttributes->getNumberOfTLSDefinitions() > 0; - o->handle(this, FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); + o->handle(getCollapsableFrame(), FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); return 1; } diff -Nru sumo-1.11.0/src/netedit/frames/network/GNETLSEditorFrame.h sumo-1.12.0/src/netedit/frames/network/GNETLSEditorFrame.h --- sumo-1.11.0/src/netedit/frames/network/GNETLSEditorFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/frames/network/GNETLSEditorFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -48,7 +48,7 @@ // class TLSJunction // =========================================================================== - class TLSJunction : protected FXGroupBox { + class TLSJunction : public FXGroupBoxModule { public: /// @brief constructor @@ -81,7 +81,7 @@ // class TLSDefinition // =========================================================================== - class TLSDefinition : protected FXGroupBox { + class TLSDefinition : public FXGroupBoxModule { public: /// @brief constructor @@ -102,7 +102,7 @@ // class TLSAttributes // =========================================================================== - class TLSAttributes : protected FXGroupBox { + class TLSAttributes : public FXGroupBoxModule { public: /// @brief constructor @@ -174,7 +174,7 @@ // class TLSPhases // =========================================================================== - class TLSPhases : protected FXGroupBox { + class TLSPhases : public FXGroupBoxModule { public: /// @brief constructor @@ -227,7 +227,7 @@ // class TLSModifications // =========================================================================== - class TLSModifications : protected FXGroupBox { + class TLSModifications : public FXGroupBoxModule { public: /// @brief constructor @@ -260,7 +260,7 @@ // class TLSFile // =========================================================================== - class TLSFile : protected FXGroupBox { + class TLSFile : public FXGroupBoxModule { /// @brief FOX-declaration FXDECLARE(GNETLSEditorFrame::TLSFile) @@ -445,7 +445,7 @@ private: /// @brief Overlapped Inspection - GNEFrameModuls::OverlappedInspection* myOverlappedInspection; + GNEFrameModules::OverlappedInspection* myOverlappedInspection; /// @brief modul for TLS Junction GNETLSEditorFrame::TLSJunction* myTLSJunction; diff -Nru sumo-1.11.0/src/netedit/GNEApplicationWindow.cpp sumo-1.12.0/src/netedit/GNEApplicationWindow.cpp --- sumo-1.11.0/src/netedit/GNEApplicationWindow.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEApplicationWindow.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -25,11 +25,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -164,9 +164,9 @@ FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_P_MODES_POLYGON_PERSON, GNEApplicationWindow::onCmdSetMode), FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA, GNEApplicationWindow::onCmdSetMode), FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_S_MODES_SELECT, GNEApplicationWindow::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_T_MODES_TLS_VTYPE, GNEApplicationWindow::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_T_MODES_TLS_TYPE, GNEApplicationWindow::onCmdSetMode), FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_V_MODES_VEHICLE, GNEApplicationWindow::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE, GNEApplicationWindow::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_W_MODES_PROHIBITION, GNEApplicationWindow::onCmdSetMode), FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_Z_MODES_TAZ_TAZREL, GNEApplicationWindow::onCmdSetMode), // Toolbar edit @@ -737,15 +737,13 @@ for (const auto& auxEdgeType : typeContainerAux) { // create new edge type GNEEdgeType* edgeType = new GNEEdgeType(myNet, auxEdgeType.first, auxEdgeType.second); + // add lane types + for (const auto& laneType : auxEdgeType.second->laneTypeDefinitions) { + edgeType->addLaneType(new GNELaneType(edgeType, laneType)); + } // add it using undoList myViewNet->getUndoList()->add(new GNEChange_EdgeType(edgeType, true), true); - // iterate over lanes auxType - for (const auto& auxLaneType : auxEdgeType.second->laneTypeDefinitions) { - // also create a new laneType - GNELaneType* laneType = new GNELaneType(edgeType, auxLaneType); - // add it using undoList - myViewNet->getUndoList()->add(new GNEChange_LaneType(laneType, (int)edgeType->getLaneTypes().size(), true), true); - } + } // end undo list myViewNet->getUndoList()->end(); @@ -987,14 +985,14 @@ myEvents.pop(); // process switch (e->getOwnType()) { - case EVENT_SIMULATION_LOADED: + case GUIEventType::SIMULATION_LOADED: handleEvent_NetworkLoaded(e); break; - case EVENT_MESSAGE_OCCURRED: - case EVENT_WARNING_OCCURRED: - case EVENT_ERROR_OCCURRED: - case EVENT_DEBUG_OCCURRED: - case EVENT_GLDEBUG_OCCURRED: + case GUIEventType::MESSAGE_OCCURRED: + case GUIEventType::WARNING_OCCURRED: + case GUIEventType::ERROR_OCCURRED: + case GUIEventType::DEBUG_OCCURRED: + case GUIEventType::GLDEBUG_OCCURRED: handleEvent_Message(e); break; default: @@ -1904,6 +1902,7 @@ sumogui = "\"" + newPath + "\""; } } + // declare comand std::string cmd = sumogui + " --registry-viewport" + " -n " + "\"" + OptionsCont::getOptions().getString("output-file") + "\""; // obtainer options container OptionsCont& oc = OptionsCont::getOptions(); @@ -1915,6 +1914,11 @@ if ((myEditMenuCommands.loadDemandInSUMOGUI->getCheck() == TRUE) && (oc.getString("route-files").size() > 0)) { cmd += " -r \"" + oc.getString("route-files") + "\""; } + // if we have trips or flow over junctions, add option junction-taz + if ((myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_TRIP_JUNCTIONS).size() > 0) || + (myNet->getAttributeCarriers()->getDemandElements().at(GNE_TAG_FLOW_JUNCTIONS).size() > 0)) { + cmd += " --junction-taz"; + } // start in background #ifndef WIN32 cmd = cmd + " &"; @@ -1937,11 +1941,11 @@ // show extra information for tests WRITE_DEBUG("Key ESC (abort) pressed"); // first check if we're selecting a subset of edges in TAZ Frame - if (myViewNet->getViewParent()->getTAZFrame()->getTAZSelectionStatisticsModul()->getEdgeAndTAZChildrenSelected().size() > 0) { + if (myViewNet->getViewParent()->getTAZFrame()->getTAZSelectionStatisticsModule()->getEdgeAndTAZChildrenSelected().size() > 0) { // show extra information for tests WRITE_DEBUG("Cleaning current selected edges"); // clear current selection - myViewNet->getViewParent()->getTAZFrame()->getTAZSelectionStatisticsModul()->clearSelectedEdges(); + myViewNet->getViewParent()->getTAZFrame()->getTAZSelectionStatisticsModule()->clearSelectedEdges(); } else if (myViewNet->getViewParent()->getInspectorFrame()->shown()) { // show extra information for tests WRITE_DEBUG("Cleaning inspected elements"); @@ -2403,7 +2407,7 @@ // write warning if netedit is running in testing mode WRITE_DEBUG("Closed FXMessageBox 'Error saving plainXML' with 'OK'"); } - myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Plain XML saved with prefix '" + prefix + "'.\n"); + myMessageWindow->appendMsg(GUIEventType::MESSAGE_OCCURRED, "Plain XML saved with prefix '" + prefix + "'.\n"); myMessageWindow->addSeparator(); if (wasSet) { oc.resetWritable(); @@ -2454,7 +2458,7 @@ // write warning if netedit is running in testing mode WRITE_DEBUG("Closed FXMessageBox 'error saving joined' with 'OK'"); } - myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Joined junctions saved to '" + fileWithExtension + "'.\n"); + myMessageWindow->appendMsg(GUIEventType::MESSAGE_OCCURRED, "Joined junctions saved to '" + fileWithExtension + "'.\n"); myMessageWindow->addSeparator(); if (wasSet) { oc.resetWritable(); @@ -2945,7 +2949,7 @@ // write warning if netedit is running in testing mode WRITE_DEBUG("Closed FXMessageBox 'error saving network' with 'OK'"); } - myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Network saved in " + oc.getString("output-file") + ".\n"); + myMessageWindow->appendMsg(GUIEventType::MESSAGE_OCCURRED, "Network saved in " + oc.getString("output-file") + ".\n"); // After saveing a net sucesfully, add it into Recent Nets list. myMenuBarFile.myRecentNetsAndConfigs.appendFile(oc.getString("output-file").c_str()); myMessageWindow->addSeparator(); @@ -2994,7 +2998,7 @@ try { myNet->computeNetwork(this, true); // GNEChange_TLS does not triggere GNENet:requireRecompute myNet->saveTLSPrograms(oc.getString("TLSPrograms-output")); - myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "TLS Programs saved in " + oc.getString("TLSPrograms-output") + ".\n"); + myMessageWindow->appendMsg(GUIEventType::MESSAGE_OCCURRED, "TLS Programs saved in " + oc.getString("TLSPrograms-output") + ".\n"); myFileMenuCommands.saveTLSPrograms->disable(); } catch (IOError& e) { // write warning if netedit is running in testing mode @@ -3051,7 +3055,7 @@ getApp()->beginWaitCursor(); try { myNet->saveEdgeTypes(oc.getString("edgeTypes-output")); - myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "EdgeType saved in " + oc.getString("edgeTypes-output") + ".\n"); + myMessageWindow->appendMsg(GUIEventType::MESSAGE_OCCURRED, "EdgeType saved in " + oc.getString("edgeTypes-output") + ".\n"); myFileMenuCommands.saveEdgeTypes->disable(); } catch (IOError& e) { // write warning if netedit is running in testing mode @@ -3249,7 +3253,7 @@ // compute before saving (for detectors positions) myNet->computeNetwork(this); myNet->saveAdditionals(oc.getString("additional-files")); - myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Additionals saved in " + oc.getString("additional-files") + ".\n"); + myMessageWindow->appendMsg(GUIEventType::MESSAGE_OCCURRED, "Additionals saved in " + oc.getString("additional-files") + ".\n"); myFileMenuCommands.saveAdditionals->disable(); } catch (IOError& e) { // write warning if netedit is running in testing mode @@ -3418,7 +3422,7 @@ getApp()->beginWaitCursor(); try { myNet->saveDemandElements(oc.getString("route-files")); - myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Demand elements saved in " + oc.getString("route-files") + ".\n"); + myMessageWindow->appendMsg(GUIEventType::MESSAGE_OCCURRED, "Demand elements saved in " + oc.getString("route-files") + ".\n"); myFileMenuCommands.saveDemandElements->disable(); } catch (IOError& e) { // write warning if netedit is running in testing mode @@ -3605,7 +3609,7 @@ getApp()->beginWaitCursor(); try { myNet->saveDataElements(oc.getString("data-files")); - myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Data elements saved in " + oc.getString("data-files") + ".\n"); + myMessageWindow->appendMsg(GUIEventType::MESSAGE_OCCURRED, "Data elements saved in " + oc.getString("data-files") + ".\n"); myFileMenuCommands.saveDataElements->disable(); } catch (IOError& e) { // write warning if netedit is running in testing mode diff -Nru sumo-1.11.0/src/netedit/GNEApplicationWindow.h sumo-1.12.0/src/netedit/GNEApplicationWindow.h --- sumo-1.11.0/src/netedit/GNEApplicationWindow.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEApplicationWindow.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/GNEApplicationWindowHelper.cpp sumo-1.12.0/src/netedit/GNEApplicationWindowHelper.cpp --- sumo-1.11.0/src/netedit/GNEApplicationWindowHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEApplicationWindowHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -384,10 +384,10 @@ GUIIconSubSys::getIcon(GUIIcon::MODECONNECTION), myModesMenuCommandsParent->myGNEApp, MID_HOTKEY_C_MODES_CONNECT_PERSONPLAN); prohibitionMode = GUIDesigns::buildFXMenuCommandShortcut(modesMenu, "Pro&hibition mode", "W", "Modes connection prohibitions.", - GUIIconSubSys::getIcon(GUIIcon::MODEPROHIBITION), myModesMenuCommandsParent->myGNEApp, MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE); + GUIIconSubSys::getIcon(GUIIcon::MODEPROHIBITION), myModesMenuCommandsParent->myGNEApp, MID_HOTKEY_W_MODES_PROHIBITION); TLSMode = GUIDesigns::buildFXMenuCommandShortcut(modesMenu, "&Traffic light mode", "T", "Modes traffic lights over junctions.", - GUIIconSubSys::getIcon(GUIIcon::MODETLS), myModesMenuCommandsParent->myGNEApp, MID_HOTKEY_T_MODES_TLS_VTYPE); + GUIIconSubSys::getIcon(GUIIcon::MODETLS), myModesMenuCommandsParent->myGNEApp, MID_HOTKEY_T_MODES_TLS_TYPE); additionalMode = GUIDesigns::buildFXMenuCommandShortcut(modesMenu, "&Additional mode", "A", "Create additional elements.", GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL), myModesMenuCommandsParent->myGNEApp, MID_HOTKEY_A_MODES_ADDITIONAL_STOP); @@ -410,9 +410,8 @@ moveMode(nullptr), routeMode(nullptr), vehicleMode(nullptr), - vehicleTypeMode(nullptr), + typeMode(nullptr), stopMode(nullptr), - personTypeMode(nullptr), personMode(nullptr), personPlanMode(nullptr), containerMode(nullptr), @@ -426,9 +425,8 @@ moveMode->show(); routeMode->show(); vehicleMode->show(); - vehicleTypeMode->show(); + typeMode->show(); stopMode->show(); - personTypeMode->show(); personMode->show(); personPlanMode->show(); containerMode->show(); @@ -441,9 +439,8 @@ moveMode->hide(); routeMode->hide(); vehicleMode->hide(); - vehicleTypeMode->hide(); + typeMode->hide(); stopMode->hide(); - personTypeMode->hide(); personMode->hide(); personPlanMode->hide(); containerMode->hide(); @@ -463,16 +460,12 @@ vehicleMode = GUIDesigns::buildFXMenuCommandShortcut(modesMenu, "Vehicle mode", "V", "Create vehicles.", GUIIconSubSys::getIcon(GUIIcon::MODEVEHICLE), myModesMenuCommandsParent->myGNEApp, MID_HOTKEY_V_MODES_VEHICLE); - vehicleTypeMode = GUIDesigns::buildFXMenuCommandShortcut(modesMenu, - "Vehicle type mode", "T", "Create vehicle types.", - GUIIconSubSys::getIcon(GUIIcon::MODEVEHICLETYPE), myModesMenuCommandsParent->myGNEApp, MID_HOTKEY_T_MODES_TLS_VTYPE); + typeMode = GUIDesigns::buildFXMenuCommandShortcut(modesMenu, + "Type mode", "T", "Create types (vehicles, person an containers).", + GUIIconSubSys::getIcon(GUIIcon::MODETYPE), myModesMenuCommandsParent->myGNEApp, MID_HOTKEY_T_MODES_TLS_TYPE); stopMode = GUIDesigns::buildFXMenuCommandShortcut(modesMenu, "Stop mode", "A", "Create stops.", GUIIconSubSys::getIcon(GUIIcon::MODESTOP), myModesMenuCommandsParent->myGNEApp, MID_HOTKEY_A_MODES_ADDITIONAL_STOP); - personTypeMode = GUIDesigns::buildFXMenuCommandShortcut(modesMenu, - "Person type mode", "W", "Create person types.", - GUIIconSubSys::getIcon(GUIIcon::MODEPERSONTYPE), myModesMenuCommandsParent->myGNEApp, MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE); - personTypeMode->disable(); personMode = GUIDesigns::buildFXMenuCommandShortcut(modesMenu, "Person mode", "P", "Create persons.", GUIIconSubSys::getIcon(GUIIcon::MODEPERSON), myModesMenuCommandsParent->myGNEApp, MID_HOTKEY_P_MODES_POLYGON_PERSON); diff -Nru sumo-1.11.0/src/netedit/GNEApplicationWindowHelper.h sumo-1.12.0/src/netedit/GNEApplicationWindowHelper.h --- sumo-1.11.0/src/netedit/GNEApplicationWindowHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEApplicationWindowHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -300,15 +300,12 @@ /// @brief menu command for vehicle mode FXMenuCommand* vehicleMode; - /// @brief menu command for vehicle type mode - FXMenuCommand* vehicleTypeMode; + /// @brief menu command for type mode + FXMenuCommand* typeMode; /// @brief menu command for stop mode FXMenuCommand* stopMode; - /// @brief menu command for person type mode - FXMenuCommand* personTypeMode; - /// @brief menu command for person mode FXMenuCommand* personMode; diff -Nru sumo-1.11.0/src/netedit/GNEEvent_NetworkLoaded.h sumo-1.12.0/src/netedit/GNEEvent_NetworkLoaded.h --- sumo-1.11.0/src/netedit/GNEEvent_NetworkLoaded.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEEvent_NetworkLoaded.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -43,7 +43,7 @@ /// @brief constructor GNEEvent_NetworkLoaded(GNENet* _net, const bool _newNet, const std::string& _file, const std::string& _settingsFile, const bool _viewportFromRegistry) : - GUIEvent(EVENT_SIMULATION_LOADED), + GUIEvent(GUIEventType::SIMULATION_LOADED), net(_net), isNewNet(_newNet), file(_file), diff -Nru sumo-1.11.0/src/netedit/GNELane2laneConnection.cpp sumo-1.12.0/src/netedit/GNELane2laneConnection.cpp --- sumo-1.11.0/src/netedit/GNELane2laneConnection.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNELane2laneConnection.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/GNELane2laneConnection.h sumo-1.12.0/src/netedit/GNELane2laneConnection.h --- sumo-1.11.0/src/netedit/GNELane2laneConnection.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNELane2laneConnection.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/GNELoadThread.cpp sumo-1.12.0/src/netedit/GNELoadThread.cpp --- sumo-1.11.0/src/netedit/GNELoadThread.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNELoadThread.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -221,6 +221,8 @@ oc.doRegister("new", new Option_Bool(false)); // !!! oc.addDescription("new", "Input", "Start with a new network"); + // files + oc.doRegister("additional-files", 'a', new Option_FileName()); oc.addSynonyme("additional-files", "additional"); oc.addDescription("additional-files", "Netedit", "Load additional and shapes descriptions from FILE(s)"); @@ -248,15 +250,89 @@ oc.doRegister("edgeTypes-output", new Option_String()); oc.addDescription("edgeTypes-output", "Netedit", "file in which edgeTypes must be saved"); + // network prefixes + oc.doRegister("node-prefix", new Option_String("J")); oc.addDescription("node-prefix", "Netedit", "prefix for node naming"); oc.doRegister("edge-prefix", new Option_String("E")); - oc.addDescription("edge-prefix", "Netedit", "prefix for edge naming naming"); + oc.addDescription("edge-prefix", "Netedit", "prefix for edge naming"); oc.doRegister("edge-infix", new Option_String("")); oc.addDescription("edge-infix", "Netedit", "enable edge-infix ()"); + // additional prefixes + + oc.doRegister("busStop-prefix", new Option_String("bs")); + oc.addDescription("busStop-prefix", "Netedit", "prefix for busStop naming"); + + oc.doRegister("trainStop-prefix", new Option_String("ts")); + oc.addDescription("trainStop-prefix", "Netedit", "prefix for trainStop naming"); + + oc.doRegister("containerStop-prefix", new Option_String("ct")); + oc.addDescription("containerStop-prefix", "Netedit", "prefix for containerStop naming"); + + oc.doRegister("chargingStation-prefix", new Option_String("cs")); + oc.addDescription("chargingStation-prefix", "Netedit", "prefix for chargingStation naming"); + + oc.doRegister("parkingArea-prefix", new Option_String("pa")); + oc.addDescription("parkingArea-prefix", "Netedit", "prefix for parkingArea naming"); + + oc.doRegister("e1Detector-prefix", new Option_String("e1")); + oc.addDescription("e1Detector-prefix", "Netedit", "prefix for e1Detector naming"); + + oc.doRegister("e2Detector-prefix", new Option_String("e2")); + oc.addDescription("e2Detector-prefix", "Netedit", "prefix for e2Detector naming"); + + oc.doRegister("e3Detector-prefix", new Option_String("e3")); + oc.addDescription("e3Detector-prefix", "Netedit", "prefix for e3Detector naming"); + + oc.doRegister("e1InstantDetector-prefix", new Option_String("e1i")); + oc.addDescription("e1InstantDetector-prefix", "Netedit", "prefix for e1InstantDetector naming"); + + oc.doRegister("rerouter-prefix", new Option_String("rr")); + oc.addDescription("rerouter-prefix", "Netedit", "prefix for rerouter naming"); + + oc.doRegister("calibrator-prefix", new Option_String("ca")); + oc.addDescription("calibrator-prefix", "Netedit", "prefix for calibrator naming"); + + oc.doRegister("routeProbe-prefix", new Option_String("rp")); + oc.addDescription("routeProbe-prefix", "Netedit", "prefix for routeProbe naming"); + + oc.doRegister("vss-prefix", new Option_String("vs")); + oc.addDescription("vss-prefix", "Netedit", "prefix for vss naming"); + + oc.doRegister("polygon-prefix", new Option_String("po")); + oc.addDescription("polygon-prefix", "Netedit", "prefix for polygon naming"); + + oc.doRegister("poi-prefix", new Option_String("poi")); + oc.addDescription("poi-prefix", "Netedit", "prefix for poi naming"); + + // demand prefixes + + oc.doRegister("route-prefix", new Option_String("r")); + oc.addDescription("route-prefix", "Netedit", "prefix for route naming"); + + oc.doRegister("vType-prefix", new Option_String("t")); + oc.addDescription("vType-prefix", "Netedit", "prefix for vType naming"); + + oc.doRegister("vehicle-prefix", new Option_String("v")); + oc.addDescription("vehicle-prefix", "Netedit", "prefix for vehicle naming"); + + oc.doRegister("trip-prefix", new Option_String("t")); + oc.addDescription("trip-prefix", "Netedit", "prefix for trip naming"); + + oc.doRegister("flow-prefix", new Option_String("f")); + oc.addDescription("flow-prefix", "Netedit", "prefix for flow naming"); + + oc.doRegister("person-prefix", new Option_String("p")); + oc.addDescription("person-prefix", "Netedit", "prefix for person naming"); + + oc.doRegister("container-prefix", new Option_String("c")); + oc.addDescription("container-prefix", "Netedit", "prefix for container naming"); + + // drawing + oc.doRegister("disable-laneIcons", new Option_Bool(false)); oc.addDescription("disable-laneIcons", "Visualisation", "Disable icons of special lanes"); diff -Nru sumo-1.11.0/src/netedit/GNELoadThread.h sumo-1.12.0/src/netedit/GNELoadThread.h --- sumo-1.11.0/src/netedit/GNELoadThread.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNELoadThread.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/GNEMoveElement.cpp sumo-1.12.0/src/netedit/GNEMoveElement.cpp --- sumo-1.11.0/src/netedit/GNEMoveElement.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEMoveElement.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/GNEMoveElement.h sumo-1.12.0/src/netedit/GNEMoveElement.h --- sumo-1.11.0/src/netedit/GNEMoveElement.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEMoveElement.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/GNENet.cpp sumo-1.12.0/src/netedit/GNENet.cpp --- sumo-1.11.0/src/netedit/GNENet.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNENet.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -841,6 +842,9 @@ const double laneSplitPosition = oldLaneGeometry.nearest_offset_to_point2D(pos, false); // split edge geometry in two new geometries using edgeSplitPosition std::pair newGeoms = oldEdgeGeometry.splitAt(edgeSplitPosition); + const double oldLength = oldEdgeGeometry.length(); + const double relativeLength1 = oldLength != 0 ? newGeoms.first.length() / oldLength : 1; + const double relativeLength2 = oldLength != 0 ? newGeoms.second.length() / oldLength : 1; // get shape end const std::string shapeEnd = edge->getAttribute(GNE_ATTR_SHAPE_END); // figure out the new name @@ -895,6 +899,13 @@ newGeoms.second.pop_back(); newGeoms.second.erase(newGeoms.second.begin()); secondPart->setAttribute(SUMO_ATTR_SHAPE, toString(newGeoms.second), undoList); + // fix custom length + if (edge->getNBEdge()->hasLoadedLength()) { + // split in proportion to geometry lengths + const double loadedLength = edge->getNBEdge()->getLoadedLength(); + edge->setAttribute(SUMO_ATTR_LENGTH, toString(relativeLength1 * loadedLength), undoList); + secondPart->setAttribute(SUMO_ATTR_LENGTH, toString(relativeLength2 * loadedLength), undoList); + } // reconnect across the split for (int i = 0; i < (int)edge->getLanes().size(); ++i) { undoList->add(new GNEChange_Connection(edge, NBEdge::Connection(i, secondPart->getNBEdge(), i), false, true), true); @@ -904,7 +915,8 @@ undoList->add(new GNEChange_Crossing(secondPart->getToJunction(), nbC, true), true); } // Split geometry of all child additional - for (const auto& additional : edge->getChildAdditionals()) { + auto childAdditionals = edge->getChildAdditionals(); + for (const auto& additional : childAdditionals) { additional->splitEdgeGeometry(edgeSplitPosition, edge, secondPart, undoList); } // Split geometry of all child lane additional @@ -914,7 +926,8 @@ } } // Split geometry of all child demand elements - for (const auto& demandElement : edge->getChildDemandElements()) { + auto childDemandElements = edge->getChildDemandElements(); + for (const auto& demandElement : childDemandElements) { demandElement->splitEdgeGeometry(edgeSplitPosition, edge, secondPart, undoList); } // Split geometry of all child lane demand elements @@ -1698,19 +1711,19 @@ myAttributeCarriers->getDemandElements().at(SUMO_TAG_TRIP).size()); // iterate over routes for (const auto& route : myAttributeCarriers->getDemandElements().at(SUMO_TAG_ROUTE)) { - if (!route->isDemandElementValid()) { + if (route->isDemandElementValid() != GNEDemandElement::Problem::OK) { invalidDemandElements.push_back(route); } } // iterate over flows for (const auto& flow : myAttributeCarriers->getDemandElements().at(SUMO_TAG_FLOW)) { - if (!flow->isDemandElementValid()) { + if (flow->isDemandElementValid() != GNEDemandElement::Problem::OK) { invalidDemandElements.push_back(flow); } } // iterate over trip for (const auto& trip : myAttributeCarriers->getDemandElements().at(SUMO_TAG_TRIP)) { - if (!trip->isDemandElementValid()) { + if (trip->isDemandElementValid() != GNEDemandElement::Problem::OK) { invalidDemandElements.push_back(trip); } } @@ -1767,6 +1780,10 @@ begin->setAttribute(SUMO_ATTR_ENDOFFSET, continuation->getAttribute(SUMO_ATTR_ENDOFFSET), undoList); begin->setAttribute(SUMO_ATTR_SHAPE, toString(newShape), undoList); begin->getNBEdge()->resetNodeBorder(begin->getNBEdge()->getToNode()); + // fix loaded lengths + if (begin->getNBEdge()->hasLoadedLength() || continuation->getNBEdge()->hasLoadedLength()) { + begin->setAttribute(SUMO_ATTR_LENGTH, toString(begin->getNBEdge()->getLoadedLength() + continuation->getNBEdge()->getLoadedLength()), undoList); + } } //delete replaced junction deleteJunction(junction, undoList); @@ -2062,7 +2079,7 @@ // compute before check if demand element is valid demandElement->computePathElement(); // check if has to be fixed - if (!demandElement->isDemandElementValid()) { + if (demandElement->isDemandElementValid() != GNEDemandElement::Problem::OK) { invalidSingleLaneDemandElements.push_back(demandElement); } } @@ -2309,17 +2326,19 @@ device.writeXMLHeader("routes", "routes_file.xsd", std::map(), false); // declare map for saving demand elements sorted by ID std::map sortedDemandElements; - // first write all vehicle types - for (const auto& vType : myAttributeCarriers->getDemandElements().at(SUMO_TAG_VTYPE)) { - sortedDemandElements[vType->getID()] = vType; + // first write all vTypeDistributions (and their vTypes) + for (const auto& vTypeDistribution : myAttributeCarriers->getDemandElements().at(SUMO_TAG_VTYPE_DISTRIBUTION)) { + sortedDemandElements[vTypeDistribution->getID()] = vTypeDistribution; } for (const auto& demandElement : sortedDemandElements) { demandElement.second->writeDemandElement(device); } sortedDemandElements.clear(); - // first write all person types - for (const auto& pType : myAttributeCarriers->getDemandElements().at(SUMO_TAG_PTYPE)) { - sortedDemandElements[pType->getID()] = pType; + // now write all vType without vTypeDistributions + for (const auto& vType : myAttributeCarriers->getDemandElements().at(SUMO_TAG_VTYPE)) { + if (vType->getParentDemandElements().empty()) { + sortedDemandElements[vType->getID()] = vType; + } } for (const auto& demandElement : sortedDemandElements) { demandElement.second->writeDemandElement(device); diff -Nru sumo-1.11.0/src/netedit/GNENet.h sumo-1.12.0/src/netedit/GNENet.h --- sumo-1.11.0/src/netedit/GNENet.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNENet.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/GNENetHelper.cpp sumo-1.12.0/src/netedit/GNENetHelper.cpp --- sumo-1.11.0/src/netedit/GNENetHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNENetHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -23,17 +23,20 @@ #include #include #include -#include #include +#include #include #include -#include +#include #include #include +#include #include +#include #include #include #include +#include #include "GNENetHelper.h" @@ -44,33 +47,33 @@ GNENetHelper::AttributeCarriers::AttributeCarriers(GNENet* net) : myNet(net) { // fill additionals with tags - auto additionalTags = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::TagType::ADDITIONALELEMENT | GNETagProperties::TagType::SYMBOL, false); + auto additionalTags = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::TagType::ADDITIONALELEMENT | GNETagProperties::TagType::SYMBOL); for (const auto& additionalTag : additionalTags) { - myAdditionals.insert(std::make_pair(additionalTag.first.getTag(), std::set())); + myAdditionals.insert(std::make_pair(additionalTag.getTag(), std::set())); } // fill shapes with tags - auto shapeTags = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::TagType::SHAPE, false); + auto shapeTags = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::TagType::SHAPE); for (const auto& shapeTag : shapeTags) { - myShapes.insert(std::make_pair(shapeTag.first.getTag(), std::set())); + myShapes.insert(std::make_pair(shapeTag.getTag(), std::set())); } // fill TAZElements with tags - auto TAZElementTags = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::TagType::TAZELEMENT, false); + auto TAZElementTags = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::TagType::TAZELEMENT); for (const auto& TAZElementTag : TAZElementTags) { - myTAZElements.insert(std::make_pair(TAZElementTag.first.getTag(), std::set())); + myTAZElements.insert(std::make_pair(TAZElementTag.getTag(), std::set())); } // fill demand elements with tags - auto demandElementTags = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::TagType::DEMANDELEMENT, false); + auto demandElementTags = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::TagType::DEMANDELEMENT); for (const auto& demandElementTag : demandElementTags) { - myDemandElements.insert(std::make_pair(demandElementTag.first.getTag(), std::set())); + myDemandElements.insert(std::make_pair(demandElementTag.getTag(), std::set())); } - auto stopTags = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::TagType::STOP, false); + auto stopTags = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::TagType::STOP); for (const auto& stopTag : stopTags) { - myDemandElements.insert(std::make_pair(stopTag.first.getTag(), std::set())); + myDemandElements.insert(std::make_pair(stopTag.getTag(), std::set())); } // fill data elements with tags - auto genericDataElementTags = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::TagType::GENERICDATA, false); + auto genericDataElementTags = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::TagType::GENERICDATA); for (const auto& genericDataElementTag : genericDataElementTags) { - myGenericDatas.insert(std::make_pair(genericDataElementTag.first.getTag(), std::set())); + myGenericDatas.insert(std::make_pair(genericDataElementTag.getTag(), std::set())); } } @@ -133,7 +136,7 @@ // decrease reference manually (because it was increased manually in GNERouteHandler) demandElement->decRef(); // show extra information for tests (except for default IDs) - if ((demandElement->getID() != DEFAULT_VTYPE_ID) && (demandElement->getID() != DEFAULT_BIKETYPE_ID) && (demandElement->getID() != DEFAULT_PEDTYPE_ID)) { + if (DEFAULT_VTYPES.count(demandElement->getID()) == 0) { WRITE_DEBUG("Deleting unreferenced " + demandElement->getTagStr() + " in AttributeCarriers destructor"); } delete demandElement; @@ -268,19 +271,19 @@ for (const auto& crossing : myCrossings) { result.push_back(crossing); } - } else if ((tag == SUMO_TAG_NOTHING) || (GNEAttributeCarrier::getTagProperties(tag).isAdditionalElement())) { + } else if ((tag == SUMO_TAG_NOTHING) || (GNEAttributeCarrier::getTagProperty(tag).isAdditionalElement())) { for (const auto& additional : myAdditionals.at(tag)) { result.push_back(additional); } - } else if ((tag == SUMO_TAG_NOTHING) || (GNEAttributeCarrier::getTagProperties(tag).isShape())) { + } else if ((tag == SUMO_TAG_NOTHING) || (GNEAttributeCarrier::getTagProperty(tag).isShape())) { for (const auto& shape : myShapes.at(tag)) { result.push_back(shape); } - } else if ((tag == SUMO_TAG_NOTHING) || (GNEAttributeCarrier::getTagProperties(tag).isTAZElement())) { + } else if ((tag == SUMO_TAG_NOTHING) || (GNEAttributeCarrier::getTagProperty(tag).isTAZElement())) { for (const auto& TAZElement : myTAZElements.at(tag)) { result.push_back(TAZElement); } - } else if ((tag == SUMO_TAG_NOTHING) || (GNEAttributeCarrier::getTagProperties(tag).isDemandElement())) { + } else if ((tag == SUMO_TAG_NOTHING) || (GNEAttributeCarrier::getTagProperty(tag).isDemandElement())) { for (const auto& demandElemet : myDemandElements.at(tag)) { result.push_back(demandElemet); } @@ -292,7 +295,7 @@ for (const auto& dataInterval : myDataIntervals) { result.push_back(dataInterval); } - } else if ((tag == SUMO_TAG_NOTHING) || (GNEAttributeCarrier::getTagProperties(tag).isGenericData())) { + } else if ((tag == SUMO_TAG_NOTHING) || (GNEAttributeCarrier::getTagProperty(tag).isGenericData())) { for (const auto& genericData : myGenericDatas.at(tag)) { result.push_back(genericData); } @@ -1044,12 +1047,51 @@ std::string -GNENetHelper::AttributeCarriers::generateAdditionalID(SumoXMLTag type) const { - int counter = 0; - while (retrieveAdditional(type, toString(type) + "_" + toString(counter), false) != nullptr) { - counter++; +GNENetHelper::AttributeCarriers::generateAdditionalID(SumoXMLTag tag) const { + // obtain option container + OptionsCont& oc = OptionsCont::getOptions(); + // get prefix + std::string prefix; + if (tag == SUMO_TAG_BUS_STOP) { + prefix = oc.getString("busStop-prefix"); + } else if (tag == SUMO_TAG_TRAIN_STOP) { + prefix = oc.getString("trainStop-prefix"); + } else if (tag == SUMO_TAG_CONTAINER_STOP) { + prefix = oc.getString("containerStop-prefix"); + } else if (tag == SUMO_TAG_CHARGING_STATION) { + prefix = oc.getString("chargingStation-prefix"); + } else if (tag == SUMO_TAG_PARKING_AREA) { + prefix = oc.getString("parkingArea-prefix"); + } else if (tag == SUMO_TAG_E1DETECTOR) { + prefix = oc.getString("e1Detector-prefix"); + } else if ((tag == SUMO_TAG_E2DETECTOR) || (tag == GNE_TAG_E2DETECTOR_MULTILANE)) { + prefix = oc.getString("e2Detector-prefix"); + } else if (tag == SUMO_TAG_E3DETECTOR) { + prefix = oc.getString("e3Detector-prefix"); + } else if (tag == SUMO_TAG_INSTANT_INDUCTION_LOOP) { + prefix = oc.getString("e1InstantDetector-prefix"); + } else if (tag == SUMO_TAG_REROUTER) { + prefix = oc.getString("rerouter-prefix"); + } else if ((tag == SUMO_TAG_CALIBRATOR) || (tag == SUMO_TAG_LANECALIBRATOR)) { + prefix = oc.getString("calibrator-prefix"); + } else if (tag == SUMO_TAG_ROUTEPROBE) { + prefix = oc.getString("routeProbe-prefix"); + } else if (tag == SUMO_TAG_VSS) { + prefix = oc.getString("vss-prefix"); + } + int counter = 0; + // special case for calibrators + if ((tag == SUMO_TAG_CALIBRATOR) || (tag == SUMO_TAG_LANECALIBRATOR)) { + while ((retrieveAdditional(SUMO_TAG_CALIBRATOR, prefix + "_" + toString(counter), false) != nullptr) || + (retrieveAdditional(SUMO_TAG_LANECALIBRATOR, prefix + "_" + toString(counter), false) != nullptr)) { + counter++; + } + } else { + while ((retrieveAdditional(tag, prefix + "_" + toString(counter), false) != nullptr)) { + counter++; + } } - return (toString(type) + "_" + toString(counter)); + return (prefix + "_" + toString(counter)); } @@ -1106,22 +1148,30 @@ std::string GNENetHelper::AttributeCarriers::generateShapeID(SumoXMLTag tag) const { int counter = 0; + // obtain option container + OptionsCont& oc = OptionsCont::getOptions(); + // get prefix + std::string prefix; + if (tag == SUMO_TAG_POLY) { + prefix = oc.getString("polygon-prefix"); + } else { + prefix = oc.getString("poi-prefix"); + } // generate tag depending of shape tag if (tag == SUMO_TAG_POLY) { // Polys and TAZs share namespace - while ((retrieveShape(SUMO_TAG_POLY, toString(tag) + "_" + toString(counter), false) != nullptr) || - (retrieveTAZElement(SUMO_TAG_TAZ, toString(tag) + "_" + toString(counter), false) != nullptr)) { + while ((retrieveShape(SUMO_TAG_POLY, prefix + "_" + toString(counter), false) != nullptr) || + (retrieveTAZElement(SUMO_TAG_TAZ, prefix + "_" + toString(counter), false) != nullptr)) { counter++; } - return (toString(tag) + "_" + toString(counter)); + return (prefix + "_" + toString(counter)); } else { - const std::string POI = toString(SUMO_TAG_POI); - while ((retrieveShape(SUMO_TAG_POI, POI + "_" + toString(counter), false) != nullptr) || - (retrieveShape(GNE_TAG_POILANE, POI + "_" + toString(counter), false) != nullptr) || - (retrieveShape(GNE_TAG_POIGEO, POI + "_" + toString(counter), false) != nullptr)) { + while ((retrieveShape(SUMO_TAG_POI, prefix + "_" + toString(counter), false) != nullptr) || + (retrieveShape(GNE_TAG_POILANE, prefix + "_" + toString(counter), false) != nullptr) || + (retrieveShape(GNE_TAG_POIGEO, prefix + "_" + toString(counter), false) != nullptr)) { counter++; } - return (toString(tag) + "_" + toString(counter)); + return (prefix + "_" + toString(counter)); } } @@ -1368,50 +1418,71 @@ std::string GNENetHelper::AttributeCarriers::generateDemandElementID(SumoXMLTag tag) const { - // declare flags - const bool isVehicle = ((tag == SUMO_TAG_VEHICLE) || (tag == SUMO_TAG_TRIP) || (tag == GNE_TAG_VEHICLE_WITHROUTE)); - const bool isFlow = ((tag == GNE_TAG_FLOW_ROUTE) || (tag == SUMO_TAG_FLOW) || (tag == GNE_TAG_FLOW_WITHROUTE)); - const bool isPerson = ((tag == SUMO_TAG_PERSON) || (tag == SUMO_TAG_PERSONFLOW)); + // obtain option container + OptionsCont& oc = OptionsCont::getOptions(); + // get tag property + const auto tagProperty = GNEAttributeCarrier::getTagProperty(tag); + // get prefix + std::string prefix; + if (tag == SUMO_TAG_ROUTE) { + prefix = oc.getString("route-prefix"); + } else if (tag == SUMO_TAG_VTYPE) { + prefix = oc.getString("vType-prefix"); + } else if (tag == SUMO_TAG_TRIP) { + prefix = oc.getString("trip-prefix"); + } else if (tagProperty.isVehicle() && !tagProperty.isFlow()) { + prefix = oc.getString("vehicle-prefix"); + } else if (tagProperty.isFlow()) { + prefix = oc.getString("flow-prefix"); + } else if (tagProperty.isPerson()) { + prefix = oc.getString("person-prefix"); + } else if (tagProperty.isContainer()) { + prefix = oc.getString("container-prefix"); + } // declare counter int counter = 0; - if (isVehicle || isFlow) { - // get vehicle tag in string format - const std::string tagStr = isVehicle ? toString(SUMO_TAG_VEHICLE) : toString(SUMO_TAG_FLOW); - // special case for vehicles (Vehicles, Flows, Trips and routeFlows share nameSpaces) - while ((retrieveDemandElement(SUMO_TAG_VEHICLE, tagStr + "_" + toString(counter), false) != nullptr) || - (retrieveDemandElement(SUMO_TAG_TRIP, tagStr + "_" + toString(counter), false) != nullptr) || - (retrieveDemandElement(GNE_TAG_VEHICLE_WITHROUTE, tagStr + "_" + toString(counter), false) != nullptr) || - (retrieveDemandElement(GNE_TAG_FLOW_ROUTE, tagStr + "_" + toString(counter), false) != nullptr) || - (retrieveDemandElement(SUMO_TAG_FLOW, tagStr + "_" + toString(counter), false) != nullptr) || - (retrieveDemandElement(GNE_TAG_FLOW_WITHROUTE, tagStr + "_" + toString(counter), false) != nullptr)) { + if (tagProperty.isVehicle() || tagProperty.isFlow()) { + // check all vehicles, because share nameSpaces + while ((retrieveDemandElement(SUMO_TAG_VEHICLE, prefix + "_" + toString(counter), false) != nullptr) || + (retrieveDemandElement(SUMO_TAG_TRIP, prefix + "_" + toString(counter), false) != nullptr) || + (retrieveDemandElement(GNE_TAG_VEHICLE_WITHROUTE, prefix + "_" + toString(counter), false) != nullptr) || + (retrieveDemandElement(GNE_TAG_TRIP_JUNCTIONS, prefix + "_" + toString(counter), false) != nullptr) || + (retrieveDemandElement(GNE_TAG_FLOW_ROUTE, prefix + "_" + toString(counter), false) != nullptr) || + (retrieveDemandElement(SUMO_TAG_FLOW, prefix + "_" + toString(counter), false) != nullptr) || + (retrieveDemandElement(GNE_TAG_FLOW_WITHROUTE, prefix + "_" + toString(counter), false) != nullptr) || + (retrieveDemandElement(GNE_TAG_FLOW_JUNCTIONS, prefix + "_" + toString(counter), false) != nullptr)) { counter++; } // return new vehicle ID - return (tagStr + "_" + toString(counter)); - } else if (isPerson) { - // get person tag in string format - const std::string tagStr = toString(tag); + return (prefix + "_" + toString(counter)); + } else if (tagProperty.isPerson()) { // special case for persons (person and personFlows share nameSpaces) - while ((retrieveDemandElement(SUMO_TAG_PERSON, tagStr + "_" + toString(counter), false) != nullptr) || - (retrieveDemandElement(SUMO_TAG_PERSONFLOW, tagStr + "_" + toString(counter), false) != nullptr)) { + while ((retrieveDemandElement(SUMO_TAG_PERSON, prefix + "_" + toString(counter), false) != nullptr) || + (retrieveDemandElement(SUMO_TAG_PERSONFLOW, prefix + "_" + toString(counter), false) != nullptr)) { counter++; } // return new person ID - return (tagStr + "_" + toString(counter)); + return (prefix + "_" + toString(counter)); + } else if (tagProperty.isContainer()) { + // special case for containers (container and containerFlows share nameSpaces) + while ((retrieveDemandElement(SUMO_TAG_CONTAINER, prefix + "_" + toString(counter), false) != nullptr) || + (retrieveDemandElement(SUMO_TAG_CONTAINERFLOW, prefix + "_" + toString(counter), false) != nullptr)) { + counter++; + } + // return new container ID + return (prefix + "_" + toString(counter)); } else { - // get tag in string format - const std::string tagStr = toString(tag); - while (retrieveDemandElement(tag, tagStr + "_" + toString(counter), false) != nullptr) { + while (retrieveDemandElement(tag, prefix + "_" + toString(counter), false) != nullptr) { counter++; } // return new element ID - return (tagStr + "_" + toString(counter)); + return (prefix + "_" + toString(counter)); } } GNEDemandElement* -GNENetHelper::AttributeCarriers::getDefaultVType() const { +GNENetHelper::AttributeCarriers::getDefaultType() const { for (const auto& vType : myDemandElements.at(SUMO_TAG_VTYPE)) { if (vType->getID() == DEFAULT_VTYPE_ID) { return vType; @@ -1421,17 +1492,6 @@ } -GNEDemandElement* -GNENetHelper::AttributeCarriers::getDefaultPType() const { - for (const auto& pType : myDemandElements.at(SUMO_TAG_PTYPE)) { - if (pType->getID() == DEFAULT_PEDTYPE_ID) { - return pType; - } - } - throw ProcessError("Default pType doesn't exist"); -} - - void GNENetHelper::AttributeCarriers::clearDemandElements() { // clear elements in grid @@ -1450,19 +1510,29 @@ void GNENetHelper::AttributeCarriers::addDefaultVTypes() { // Create default vehicle Type (it has to be created here due myViewNet was previously nullptr) - GNEVehicleType* defaultVehicleType = new GNEVehicleType(myNet, DEFAULT_VTYPE_ID, SVC_PASSENGER, SUMO_TAG_VTYPE); + GNEVType* defaultVehicleType = new GNEVType(myNet, DEFAULT_VTYPE_ID, SVC_PASSENGER); myDemandElements.at(defaultVehicleType->getTagProperty().getTag()).insert(defaultVehicleType); defaultVehicleType->incRef("GNENet::DEFAULT_VEHTYPE"); // Create default Bike Type (it has to be created here due myViewNet was previously nullptr) - GNEVehicleType* defaultBikeType = new GNEVehicleType(myNet, DEFAULT_BIKETYPE_ID, SVC_BICYCLE, SUMO_TAG_VTYPE); + GNEVType* defaultBikeType = new GNEVType(myNet, DEFAULT_BIKETYPE_ID, SVC_BICYCLE); myDemandElements.at(defaultBikeType->getTagProperty().getTag()).insert(defaultBikeType); defaultBikeType->incRef("GNENet::DEFAULT_BIKETYPE_ID"); + // Create default taxi Type (it has to be created here due myViewNet was previously nullptr) + GNEVType* defaultTaxiType = new GNEVType(myNet, DEFAULT_TAXITYPE_ID, SVC_TAXI); + myDemandElements.at(defaultBikeType->getTagProperty().getTag()).insert(defaultTaxiType); + defaultTaxiType->incRef("GNENet::DEFAULT_TAXITYPE_ID"); + // Create default person Type (it has to be created here due myViewNet was previously nullptr) - GNEVehicleType* defaultPersonType = new GNEVehicleType(myNet, DEFAULT_PEDTYPE_ID, SVC_PEDESTRIAN, SUMO_TAG_PTYPE); + GNEVType* defaultPersonType = new GNEVType(myNet, DEFAULT_PEDTYPE_ID, SVC_PEDESTRIAN); myDemandElements.at(defaultPersonType->getTagProperty().getTag()).insert(defaultPersonType); defaultPersonType->incRef("GNENet::DEFAULT_PEDTYPE_ID"); + + // Create default container Type (it has to be created here due myViewNet was previously nullptr) + GNEVType* defaultContainerType = new GNEVType(myNet, DEFAULT_CONTAINERTYPE_ID, SVC_IGNORING); + myDemandElements.at(defaultContainerType->getTagProperty().getTag()).insert(defaultContainerType); + defaultContainerType->incRef("GNENet::DEFAULT_CONTAINERTYPE_ID"); } @@ -2084,12 +2154,16 @@ void GNENetHelper::AttributeCarriers::insertEdgeType(GNEEdgeType* edgeType) { + // get pointer to create edge frame + const auto& createEdgeFrame = myNet->getViewNet()->getViewParent()->getCreateEdgeFrame(); // insert in myEdgeTypes myEdgeTypes[edgeType->getMicrosimID()] = edgeType; // update edge selector if (myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->shown()) { myNet->getViewNet()->getViewParent()->getCreateEdgeFrame()->getEdgeTypeSelector()->refreshEdgeTypeSelector(); } + // set current edge type inspected + createEdgeFrame->getEdgeTypeSelector()->setCurrentEdgeType(edgeType); } @@ -2105,12 +2179,9 @@ // check if this is the selected edge type in edgeSelector if (createEdgeFrame->getEdgeTypeSelector()->getEdgeTypeSelected() == edgeType) { createEdgeFrame->getEdgeTypeSelector()->clearEdgeTypeSelected(); - createEdgeFrame->getEdgeTypeSelector()->refreshEdgeTypeSelector(); } // update edge selector - if (createEdgeFrame->shown()) { - createEdgeFrame->getEdgeTypeSelector()->refreshEdgeTypeSelector(); - } + createEdgeFrame->getEdgeTypeSelector()->refreshEdgeTypeSelector(); } @@ -2145,6 +2216,12 @@ // Remove refrences from GNEJunctions edge->getFromJunction()->removeOutgoingGNEEdge(edge); edge->getToJunction()->removeIncomingGNEEdge(edge); + // get template editor + GNEInspectorFrame::TemplateEditor* templateEditor = myNet->getViewNet()->getViewParent()->getInspectorFrame()->getTemplateEditor(); + // check if we have to remove template + if (templateEditor->getEdgeTemplate() && (templateEditor->getEdgeTemplate()->getID() == edge->getID())) { + templateEditor->setEdgeTemplate(nullptr); + } } diff -Nru sumo-1.11.0/src/netedit/GNENetHelper.h sumo-1.12.0/src/netedit/GNENetHelper.h --- sumo-1.11.0/src/netedit/GNENetHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNENetHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -78,7 +78,6 @@ friend class GNEDataHandler; friend class GNEChange_Junction; friend class GNEChange_EdgeType; - friend class GNEChange_LaneType; friend class GNEChange_Edge; friend class GNEChange_Additional; friend class GNEChange_Shape; @@ -457,11 +456,8 @@ /// @brief generate demand element id std::string generateDemandElementID(SumoXMLTag tag) const; - /// @brief get default vType - GNEDemandElement* getDefaultVType() const; - - /// @brief get default personType - GNEDemandElement* getDefaultPType() const; + /// @brief get default type + GNEDemandElement* getDefaultType() const; /// @brief clear demand elements void clearDemandElements(); diff -Nru sumo-1.11.0/src/netedit/GNEPathManager.cpp sumo-1.12.0/src/netedit/GNEPathManager.cpp --- sumo-1.11.0/src/netedit/GNEPathManager.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEPathManager.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -319,6 +319,14 @@ } +std::vector +GNEPathManager::PathCalculator::calculateDijkstraPath(const SUMOVehicleClass /*vClass*/, const GNEJunction* /*fromJunction*/, const GNEJunction* /*toJunction*/) const { + // implement path between junction here + return std::vector (); +} + + + void GNEPathManager::PathCalculator::calculateReachability(const SUMOVehicleClass vClass, GNEEdge* originEdge) { // first reset reachability of all lanes diff -Nru sumo-1.11.0/src/netedit/GNEPathManager.h sumo-1.12.0/src/netedit/GNEPathManager.h --- sumo-1.11.0/src/netedit/GNEPathManager.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEPathManager.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -234,6 +234,9 @@ /// @brief calculate Dijkstra path between a list of partial edges std::vector calculateDijkstraPath(const SUMOVehicleClass vClass, const std::vector& partialEdges) const; + /// @brief calculate Dijkstra path between two Junctions + std::vector calculateDijkstraPath(const SUMOVehicleClass vClass, const GNEJunction* fromJunction, const GNEJunction* toJunction) const; + /// @brief calculate reachability for given edge void calculateReachability(const SUMOVehicleClass vClass, GNEEdge* originEdge); diff -Nru sumo-1.11.0/src/netedit/GNEReferenceCounter.h sumo-1.12.0/src/netedit/GNEReferenceCounter.h --- sumo-1.11.0/src/netedit/GNEReferenceCounter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEReferenceCounter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/GNEUndoList.cpp sumo-1.12.0/src/netedit/GNEUndoList.cpp --- sumo-1.11.0/src/netedit/GNEUndoList.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEUndoList.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/GNEUndoList.h sumo-1.12.0/src/netedit/GNEUndoList.h --- sumo-1.11.0/src/netedit/GNEUndoList.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEUndoList.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netedit/GNEViewNet.cpp sumo-1.12.0/src/netedit/GNEViewNet.cpp --- sumo-1.11.0/src/netedit/GNEViewNet.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEViewNet.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -39,11 +40,10 @@ #include #include #include -#include #include #include #include -#include +#include #include #include #include @@ -93,9 +93,9 @@ FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_P_MODES_POLYGON_PERSON, GNEViewNet::onCmdSetMode), FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA, GNEViewNet::onCmdSetMode), FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_S_MODES_SELECT, GNEViewNet::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_T_MODES_TLS_VTYPE, GNEViewNet::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_T_MODES_TLS_TYPE, GNEViewNet::onCmdSetMode), FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_V_MODES_VEHICLE, GNEViewNet::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE, GNEViewNet::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_W_MODES_PROHIBITION, GNEViewNet::onCmdSetMode), FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_Z_MODES_TAZ_TAZREL, GNEViewNet::onCmdSetMode), // Network view options FXMAPFUNC(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID, GNEViewNet::onCmdToggleShowGrid), @@ -164,6 +164,7 @@ FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGE_RESET_LENGTH, GNEViewNet::onCmdResetLength), // Lanes FXMAPFUNC(SEL_COMMAND, MID_GNE_LANE_DUPLICATE, GNEViewNet::onCmdDuplicateLane), + FXMAPFUNC(SEL_COMMAND, MID_GNE_LANE_EDIT_SHAPE, GNEViewNet::onCmdEditLaneShape), FXMAPFUNC(SEL_COMMAND, MID_GNE_LANE_RESET_CUSTOMSHAPE, GNEViewNet::onCmdResetLaneCustomShape), FXMAPFUNC(SEL_COMMAND, MID_GNE_LANE_RESET_OPPOSITELANE, GNEViewNet::onCmdResetOppositeLane), FXMAPFUNC(SEL_COMMAND, MID_GNE_LANE_TRANSFORM_SIDEWALK, GNEViewNet::onCmdLaneOperation), @@ -993,7 +994,7 @@ myMouseButtonKeyPressed.update(eventData); // update cursor updateCursor(); - if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { + if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModule()->isDrawing()) { // disable right button press during drawing polygon return 1; } else { @@ -1009,7 +1010,7 @@ // update cursor updateCursor(); // disable right button release during drawing polygon - if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { + if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModule()->isDrawing()) { return 1; } else { return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData); @@ -1049,13 +1050,13 @@ if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_CREATE_EDGE) { // update viewNet (for temporal junction) updateViewNet(); - } else if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { + } else if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModule()->isDrawing()) { // change "delete last created point" depending of shift key - myViewParent->getPolygonFrame()->getDrawingShapeModul()->setDeleteLastCreatedPoint(myMouseButtonKeyPressed.shiftKeyPressed()); + myViewParent->getPolygonFrame()->getDrawingShapeModule()->setDeleteLastCreatedPoint(myMouseButtonKeyPressed.shiftKeyPressed()); updateViewNet(); - } else if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_TAZ) && myViewParent->getTAZFrame()->getDrawingShapeModul()->isDrawing()) { + } else if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_TAZ) && myViewParent->getTAZFrame()->getDrawingShapeModule()->isDrawing()) { // change "delete last created point" depending of shift key - myViewParent->getTAZFrame()->getDrawingShapeModul()->setDeleteLastCreatedPoint(myMouseButtonKeyPressed.shiftKeyPressed()); + myViewParent->getTAZFrame()->getDrawingShapeModule()->setDeleteLastCreatedPoint(myMouseButtonKeyPressed.shiftKeyPressed()); updateViewNet(); } else if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) || (myEditModes.demandEditMode == DemandEditMode::DEMAND_MOVE)) { updateViewNet(); @@ -1074,13 +1075,13 @@ if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_CREATE_EDGE) { // update viewNet (for temporal junction) updateViewNet(); - } else if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { + } else if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModule()->isDrawing()) { // change "delete last created point" depending of shift key - myViewParent->getPolygonFrame()->getDrawingShapeModul()->setDeleteLastCreatedPoint(myMouseButtonKeyPressed.shiftKeyPressed()); + myViewParent->getPolygonFrame()->getDrawingShapeModule()->setDeleteLastCreatedPoint(myMouseButtonKeyPressed.shiftKeyPressed()); updateViewNet(); - } else if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_TAZ) && myViewParent->getTAZFrame()->getDrawingShapeModul()->isDrawing()) { + } else if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_TAZ) && myViewParent->getTAZFrame()->getDrawingShapeModule()->isDrawing()) { // change "delete last created point" depending of shift key - myViewParent->getTAZFrame()->getDrawingShapeModul()->setDeleteLastCreatedPoint(myMouseButtonKeyPressed.shiftKeyPressed()); + myViewParent->getTAZFrame()->getDrawingShapeModule()->setDeleteLastCreatedPoint(myMouseButtonKeyPressed.shiftKeyPressed()); updateViewNet(); } else if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) || (myEditModes.demandEditMode == DemandEditMode::DEMAND_MOVE)) { updateViewNet(); @@ -1119,14 +1120,14 @@ myEditNetworkElementShapes.stopEditCustomShape(); } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) { // abort current drawing - myViewParent->getPolygonFrame()->getDrawingShapeModul()->abortDrawing(); + myViewParent->getPolygonFrame()->getDrawingShapeModule()->abortDrawing(); } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_TAZ) { - if (myViewParent->getTAZFrame()->getDrawingShapeModul()->isDrawing()) { + if (myViewParent->getTAZFrame()->getDrawingShapeModule()->isDrawing()) { // abort current drawing - myViewParent->getTAZFrame()->getDrawingShapeModul()->abortDrawing(); - } else if (myViewParent->getTAZFrame()->getCurrentTAZModul()->getTAZ() != nullptr) { + myViewParent->getTAZFrame()->getDrawingShapeModule()->abortDrawing(); + } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr) { // finish current editing TAZ - myViewParent->getTAZFrame()->getCurrentTAZModul()->setTAZ(nullptr); + myViewParent->getTAZFrame()->getCurrentTAZModule()->setTAZ(nullptr); } } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_PROHIBITION) { myViewParent->getProhibitionFrame()->onCmdCancel(nullptr, 0, nullptr); @@ -1250,25 +1251,25 @@ } else if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) && (myEditNetworkElementShapes.getEditedNetworkElement() != nullptr)) { myEditNetworkElementShapes.commitEditedShape(); } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) { - if (myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { + if (myViewParent->getPolygonFrame()->getDrawingShapeModule()->isDrawing()) { // stop current drawing - myViewParent->getPolygonFrame()->getDrawingShapeModul()->stopDrawing(); + myViewParent->getPolygonFrame()->getDrawingShapeModule()->stopDrawing(); } else { // start drawing - myViewParent->getPolygonFrame()->getDrawingShapeModul()->startDrawing(); + myViewParent->getPolygonFrame()->getDrawingShapeModule()->startDrawing(); } } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_CROSSING) { myViewParent->getCrossingFrame()->createCrossingHotkey(); } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_TAZ) { - if (myViewParent->getTAZFrame()->getDrawingShapeModul()->isDrawing()) { + if (myViewParent->getTAZFrame()->getDrawingShapeModule()->isDrawing()) { // stop current drawing - myViewParent->getTAZFrame()->getDrawingShapeModul()->stopDrawing(); - } else if (myViewParent->getTAZFrame()->getCurrentTAZModul()->getTAZ() == nullptr) { + myViewParent->getTAZFrame()->getDrawingShapeModule()->stopDrawing(); + } else if (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() == nullptr) { // start drawing - myViewParent->getTAZFrame()->getDrawingShapeModul()->startDrawing(); - } else if (myViewParent->getTAZFrame()->getTAZSaveChangesModul()->isChangesPending()) { + myViewParent->getTAZFrame()->getDrawingShapeModule()->startDrawing(); + } else if (myViewParent->getTAZFrame()->getTAZSaveChangesModule()->isChangesPending()) { // save pending changes - myViewParent->getTAZFrame()->getTAZSaveChangesModul()->onCmdSaveChanges(0, 0, 0); + myViewParent->getTAZFrame()->getTAZSaveChangesModule()->onCmdSaveChanges(0, 0, 0); } } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_ADDITIONAL) { if (myViewParent->getAdditionalFrame()->getConsecutiveLaneSelector()->isSelectingLanes()) { @@ -1635,7 +1636,7 @@ case MID_HOTKEY_C_MODES_CONNECT_PERSONPLAN: myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_CONNECT); break; - case MID_HOTKEY_T_MODES_TLS_VTYPE: + case MID_HOTKEY_T_MODES_TLS_TYPE: myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_TLS); break; case MID_HOTKEY_A_MODES_ADDITIONAL_STOP: @@ -1650,7 +1651,7 @@ case MID_HOTKEY_P_MODES_POLYGON_PERSON: myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_POLYGON); break; - case MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE: + case MID_HOTKEY_W_MODES_PROHIBITION: myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_PROHIBITION); break; default: @@ -1683,17 +1684,12 @@ case MID_HOTKEY_V_MODES_VEHICLE: myEditModes.setDemandEditMode(DemandEditMode::DEMAND_VEHICLE); break; - case MID_HOTKEY_T_MODES_TLS_VTYPE: - myEditModes.setDemandEditMode(DemandEditMode::DEMAND_VEHICLETYPES); + case MID_HOTKEY_T_MODES_TLS_TYPE: + myEditModes.setDemandEditMode(DemandEditMode::DEMAND_TYPE); break; case MID_HOTKEY_A_MODES_ADDITIONAL_STOP: myEditModes.setDemandEditMode(DemandEditMode::DEMAND_STOP); break; -/* - case MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE: - myEditModes.setDemandEditMode(DemandEditMode::DEMAND_PERSONTYPES); - break; -*/ case MID_HOTKEY_P_MODES_POLYGON_PERSON: myEditModes.setDemandEditMode(DemandEditMode::DEMAND_PERSON); break; @@ -2306,6 +2302,20 @@ long +GNEViewNet::onCmdEditLaneShape(FXObject*, FXSelector, void*) { + // Obtain lane under mouse + GNELane* lane = getLaneAtPopupPosition(); + if (lane) { + myEditNetworkElementShapes.startEditCustomShape(lane); + } + // destroy pop-up and update view Net + destroyPopup(); + setFocus(); + return 1; +} + + +long GNEViewNet::onCmdResetLaneCustomShape(FXObject*, FXSelector, void*) { GNELane* laneAtPopupPosition = getLaneAtPopupPosition(); if (laneAtPopupPosition != nullptr) { @@ -4071,12 +4081,12 @@ // set checkable button myDemandCheckableButtons.vehicleButton->setChecked(true); break; - case DemandEditMode::DEMAND_VEHICLETYPES: - myViewParent->getVehicleTypeFrame()->show(); - myViewParent->getVehicleTypeFrame()->focusUpperElement(); - myCurrentFrame = myViewParent->getVehicleTypeFrame(); + case DemandEditMode::DEMAND_TYPE: + myViewParent->getTypeFrame()->show(); + myViewParent->getTypeFrame()->focusUpperElement(); + myCurrentFrame = myViewParent->getTypeFrame(); // set checkable button - myDemandCheckableButtons.vehicleTypeButton->setChecked(true); + myDemandCheckableButtons.typeButton->setChecked(true); break; case DemandEditMode::DEMAND_STOP: myViewParent->getStopFrame()->show(); @@ -4085,14 +4095,6 @@ // set checkable button myDemandCheckableButtons.stopButton->setChecked(true); break; - case DemandEditMode::DEMAND_PERSONTYPES: - myViewParent->getPersonTypeFrame()->show(); - myViewParent->getPersonTypeFrame()->focusUpperElement(); - myCurrentFrame = myViewParent->getPersonTypeFrame(); - // set checkable button - myDemandCheckableButtons.personTypeButton->setChecked(true); - myDemandCheckableButtons.personTypeButton->disable(); - break; case DemandEditMode::DEMAND_PERSON: myViewParent->getPersonFrame()->show(); myViewParent->getPersonFrame()->focusUpperElement(); @@ -4470,12 +4472,12 @@ PositionVector temporalShape; bool deleteLastCreatedPoint = false; // obtain temporal shape and delete last created point flag - if (myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { - temporalShape = myViewParent->getPolygonFrame()->getDrawingShapeModul()->getTemporalShape(); - deleteLastCreatedPoint = myViewParent->getPolygonFrame()->getDrawingShapeModul()->getDeleteLastCreatedPoint(); - } else if (myViewParent->getTAZFrame()->getDrawingShapeModul()->isDrawing()) { - temporalShape = myViewParent->getTAZFrame()->getDrawingShapeModul()->getTemporalShape(); - deleteLastCreatedPoint = myViewParent->getTAZFrame()->getDrawingShapeModul()->getDeleteLastCreatedPoint(); + if (myViewParent->getPolygonFrame()->getDrawingShapeModule()->isDrawing()) { + temporalShape = myViewParent->getPolygonFrame()->getDrawingShapeModule()->getTemporalShape(); + deleteLastCreatedPoint = myViewParent->getPolygonFrame()->getDrawingShapeModule()->getDeleteLastCreatedPoint(); + } else if (myViewParent->getTAZFrame()->getDrawingShapeModule()->isDrawing()) { + temporalShape = myViewParent->getTAZFrame()->getDrawingShapeModule()->getTemporalShape(); + deleteLastCreatedPoint = myViewParent->getTAZFrame()->getDrawingShapeModule()->getDeleteLastCreatedPoint(); } // check if we're in drawing mode if (temporalShape.size() > 0) { @@ -4686,7 +4688,10 @@ case NetworkEditMode::NETWORK_MOVE: { // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed if (myNetworkViewOptions.selectEdges() && (myMouseButtonKeyPressed.shiftKeyPressed() == false)) { - myObjectsUnderCursor.swapLane2Edge(); + // swap lane to edge (except if we're editing a shape lane) + if (!(myObjectsUnderCursor.getLaneFront() && myObjectsUnderCursor.getLaneFront()->isShapeEdited())) { + myObjectsUnderCursor.swapLane2Edge(); + } // update AC under cursor AC = myObjectsUnderCursor.getAttributeCarrierFront(); } @@ -4780,7 +4785,7 @@ // avoid create TAZs if control key is pressed if (!myMouseButtonKeyPressed.controlKeyPressed()) { // check if we want to create a rect for selecting edges - if (myMouseButtonKeyPressed.shiftKeyPressed() && (myViewParent->getTAZFrame()->getCurrentTAZModul()->getTAZ() != nullptr)) { + if (myMouseButtonKeyPressed.shiftKeyPressed() && (myViewParent->getTAZFrame()->getCurrentTAZModule()->getTAZ() != nullptr)) { // begin rectangle selection mySelectingArea.beginRectangleSelection(); } else { @@ -4882,10 +4887,10 @@ void GNEViewNet::processMoveMouseNetwork(const bool mouseLeftButtonPressed) { // change "delete last created point" depending if during movement shift key is pressed - if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { - myViewParent->getPolygonFrame()->getDrawingShapeModul()->setDeleteLastCreatedPoint(myMouseButtonKeyPressed.shiftKeyPressed()); - } else if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_TAZ) && myViewParent->getTAZFrame()->getDrawingShapeModul()->isDrawing()) { - myViewParent->getTAZFrame()->getDrawingShapeModul()->setDeleteLastCreatedPoint(myMouseButtonKeyPressed.shiftKeyPressed()); + if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModule()->isDrawing()) { + myViewParent->getPolygonFrame()->getDrawingShapeModule()->setDeleteLastCreatedPoint(myMouseButtonKeyPressed.shiftKeyPressed()); + } else if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_TAZ) && myViewParent->getTAZFrame()->getDrawingShapeModule()->isDrawing()) { + myViewParent->getTAZFrame()->getDrawingShapeModule()->setDeleteLastCreatedPoint(myMouseButtonKeyPressed.shiftKeyPressed()); } // check what type of additional is moved if (myMoveMultipleElementValues.isMovingSelection()) { diff -Nru sumo-1.11.0/src/netedit/GNEViewNet.h sumo-1.12.0/src/netedit/GNEViewNet.h --- sumo-1.11.0/src/netedit/GNEViewNet.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEViewNet.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -233,6 +233,9 @@ /// @brief duplicate selected lane long onCmdDuplicateLane(FXObject*, FXSelector, void*); + /// @brief edit lane shape + long onCmdEditLaneShape(FXObject*, FXSelector, void*); + /// @brief reset custom shapes of selected lanes long onCmdResetLaneCustomShape(FXObject*, FXSelector, void*); diff -Nru sumo-1.11.0/src/netedit/GNEViewNetHelper.cpp sumo-1.12.0/src/netedit/GNEViewNetHelper.cpp --- sumo-1.11.0/src/netedit/GNEViewNetHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEViewNetHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -951,6 +951,16 @@ } else { return false; } + } else if (myViewNet->myObjectsUnderCursor.getLaneFront() && (myViewNet->myObjectsUnderCursor.getLaneFront() == editedElement)) { + // get move operation + GNEMoveOperation* moveOperation = myViewNet->myObjectsUnderCursor.getLaneFront()->getMoveOperation(); + // continue if move operation is valid + if (moveOperation) { + myMoveOperations.push_back(moveOperation); + return true; + } else { + return false; + } } else if (myViewNet->myObjectsUnderCursor.getCrossingFront() && (myViewNet->myObjectsUnderCursor.getCrossingFront() == editedElement)) { // get move operation GNEMoveOperation* moveOperation = myViewNet->myObjectsUnderCursor.getCrossingFront()->getMoveOperation(); @@ -1487,8 +1497,8 @@ ACToSelect.reserve(ACsInBoundaryFiltered.size()); ACToUnselect.reserve(ACsInBoundaryFiltered.size()); // in restrict AND replace mode all current selected attribute carriers will be unselected - if ((myViewNet->myViewParent->getSelectorFrame()->getModificationModeModul()->getModificationMode() == GNESelectorFrame::ModificationMode::Operation::RESTRICT) || - (myViewNet->myViewParent->getSelectorFrame()->getModificationModeModul()->getModificationMode() == GNESelectorFrame::ModificationMode::Operation::REPLACE)) { + if ((myViewNet->myViewParent->getSelectorFrame()->getModificationModeModule()->getModificationMode() == GNESelectorFrame::ModificationMode::Operation::RESTRICT) || + (myViewNet->myViewParent->getSelectorFrame()->getModificationModeModule()->getModificationMode() == GNESelectorFrame::ModificationMode::Operation::REPLACE)) { // obtain selected ACs depending of current supermode const auto selectedAC = myViewNet->getNet()->getAttributeCarriers()->getSelectedAttributeCarriers(false); // add id into ACs to unselect @@ -1498,7 +1508,7 @@ } // iterate over AtributeCarriers obtained of boundary an place it in ACToSelect or ACToUnselect for (const auto& AC : ACsInBoundaryFiltered) { - switch (myViewNet->myViewParent->getSelectorFrame()->getModificationModeModul()->getModificationMode()) { + switch (myViewNet->myViewParent->getSelectorFrame()->getModificationModeModule()->getModificationMode()) { case GNESelectorFrame::ModificationMode::Operation::SUB: ACToUnselect.push_back(AC.second); break; @@ -1513,7 +1523,7 @@ } } // select junctions and their connections and crossings if Auto select junctions is enabled (note: only for "add mode") - if (myViewNet->autoSelectNodes() && (myViewNet->myViewParent->getSelectorFrame()->getModificationModeModul()->getModificationMode() == GNESelectorFrame::ModificationMode::Operation::ADD)) { + if (myViewNet->autoSelectNodes() && (myViewNet->myViewParent->getSelectorFrame()->getModificationModeModule()->getModificationMode() == GNESelectorFrame::ModificationMode::Operation::ADD)) { std::vector edgesToSelect; // iterate over ACToSelect and extract edges for (const auto& AC : ACToSelect) { @@ -1600,6 +1610,8 @@ GLHelper::pushMatrix(); const double size = myViewNet->p2m(32); Position center = myViewNet->screenPos2NetPos(8, 8); + // magenta + GLHelper::pushMatrix(); GLHelper::setColor(RGBColor::MAGENTA); glTranslated(center.x(), center.y(), GLO_TESTELEMENT); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); @@ -1610,8 +1622,34 @@ glVertex2d(size, 0); glEnd(); GLHelper::popMatrix(); + // blue GLHelper::pushMatrix(); + GLHelper::setColor(RGBColor::BLUE); + glTranslated(center.x(), center.y(), GLO_TESTELEMENT + 1); + glScaled(0.7, 0.7, 0); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glBegin(GL_QUADS); + glVertex2d(0, 0); + glVertex2d(0, -size); + glVertex2d(size, -size); + glVertex2d(size, 0); + glEnd(); + GLHelper::popMatrix(); + // yellow + GLHelper::pushMatrix(); + GLHelper::setColor(RGBColor::YELLOW); + glTranslated(center.x(), center.y(), GLO_TESTELEMENT + 2); + glScaled(0.4, 0.4, 0); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glBegin(GL_QUADS); + glVertex2d(0, 0); + glVertex2d(0, -size); + glVertex2d(size, -size); + glVertex2d(size, 0); + glEnd(); + GLHelper::popMatrix(); // show box with the current position relative to pink square + GLHelper::pushMatrix(); Position posRelative = myViewNet->screenPos2NetPos(myViewNet->getWidth() - 40, myViewNet->getHeight() - 20); // adjust cursor position (24,25) to show exactly the same position as in function netedit.leftClick(match, X, Y) GLHelper::drawTextBox(toString(myViewNet->getWindowCursorPosition().x() - 24) + " " + toString(myViewNet->getWindowCursorPosition().y() - 25), posRelative, GLO_TESTELEMENT, myViewNet->p2m(20), RGBColor::BLACK, RGBColor::WHITE); @@ -2802,10 +2840,10 @@ myGenericDataTypesComboBox->appendItem(myAllGenericDatas); myDataSetsComboBox->appendItem(myAllDataSets); // get all generic data types - const auto genericDataTags = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::GENERICDATA, false); + const auto genericDataTags = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::GENERICDATA); // add all generic data types for (const auto& dataTag : genericDataTags) { - myGenericDataTypesComboBox->appendItem(dataTag.second.c_str()); + myGenericDataTypesComboBox->appendItem(dataTag.getFieldString().c_str()); } myGenericDataTypesComboBox->setNumVisible(myGenericDataTypesComboBox->getNumItems()); // add data sets @@ -2893,12 +2931,12 @@ myGenericDataTypesComboBox->setText(myAllGenericDatas); } else { // get all generic data types - const auto genericDataTags = GNEAttributeCarrier::getAllowedTagPropertiesByCategory(GNETagProperties::GENERICDATA, false); + const auto genericDataTags = GNEAttributeCarrier::getTagPropertiesByType(GNETagProperties::GENERICDATA); // set invalid color myGenericDataTypesComboBox->setTextColor(FXRGB(255, 0, 0)); // set valid color depending of myGenericDataTypesComboBox for (const auto& genericDataTag : genericDataTags) { - if (genericDataTag.second == myGenericDataTypesComboBox->getText().text()) { + if (genericDataTag.getFieldString() == myGenericDataTypesComboBox->getText().text()) { myGenericDataTypesComboBox->setTextColor(FXRGB(0, 0, 0)); } } @@ -3117,12 +3155,12 @@ // prohibition mode prohibitionButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset prohibition mode\tMode for editing connection prohibitions. (W)", - GUIIconSubSys::getIcon(GUIIcon::MODEPROHIBITION), myViewNet, MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE, GUIDesignMFXCheckableButton); + GUIIconSubSys::getIcon(GUIIcon::MODEPROHIBITION), myViewNet, MID_HOTKEY_W_MODES_PROHIBITION, GUIDesignMFXCheckableButton); prohibitionButton->create(); // traffic light mode trafficLightButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset traffic light mode\tMode for edit traffic lights over junctions. (T)", - GUIIconSubSys::getIcon(GUIIcon::MODETLS), myViewNet, MID_HOTKEY_T_MODES_TLS_VTYPE, GUIDesignMFXCheckableButton); + GUIIconSubSys::getIcon(GUIIcon::MODETLS), myViewNet, MID_HOTKEY_T_MODES_TLS_TYPE, GUIDesignMFXCheckableButton); trafficLightButton->create(); // additional mode additionalButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, @@ -3212,9 +3250,8 @@ moveDemandElementsButton(nullptr), routeButton(nullptr), vehicleButton(nullptr), - vehicleTypeButton(nullptr), + typeButton(nullptr), stopButton(nullptr), - personTypeButton(nullptr), personButton(nullptr), personPlanButton(nullptr), containerButton(nullptr), @@ -3240,22 +3277,16 @@ "\tcreate vehicle mode\tMode for creating vehicles. (V)", GUIIconSubSys::getIcon(GUIIcon::MODEVEHICLE), myViewNet, MID_HOTKEY_V_MODES_VEHICLE, GUIDesignMFXCheckableButton); vehicleButton->create(); - // vehicle type mode - vehicleTypeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, - "\tcreate vehicle type mode\tMode for creating vehicle types. (T)", - GUIIconSubSys::getIcon(GUIIcon::MODEVEHICLETYPE), myViewNet, MID_HOTKEY_T_MODES_TLS_VTYPE, GUIDesignMFXCheckableButton); - vehicleTypeButton->create(); + // type mode + typeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tcreate type mode\tMode for creating types (vehicles, person and containers). (T)", + GUIIconSubSys::getIcon(GUIIcon::MODETYPE), myViewNet, MID_HOTKEY_T_MODES_TLS_TYPE, GUIDesignMFXCheckableButton); + typeButton->create(); // stop mode stopButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate stop mode\tMode for creating stops. (A)", GUIIconSubSys::getIcon(GUIIcon::MODESTOP), myViewNet, MID_HOTKEY_A_MODES_ADDITIONAL_STOP, GUIDesignMFXCheckableButton); stopButton->create(); - // person type mode - personTypeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, - "\tcreate person type mode\tMode for creating person types. (W)", - GUIIconSubSys::getIcon(GUIIcon::MODEPERSONTYPE), myViewNet, MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE, GUIDesignMFXCheckableButton); - personTypeButton->create(); - personTypeButton->disable(); // person mode personButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate person mode\tMode for creating persons. (P)", @@ -3286,10 +3317,8 @@ moveDemandElementsButton->show(); routeButton->show(); vehicleButton->show(); - vehicleTypeButton->show(); + typeButton->show(); stopButton->show(); - personTypeButton->show(); - personTypeButton->disable(); personButton->show(); personPlanButton->show(); containerButton->show(); @@ -3302,9 +3331,8 @@ moveDemandElementsButton->hide(); routeButton->hide(); vehicleButton->hide(); - vehicleTypeButton->hide(); + typeButton->hide(); stopButton->hide(); - personTypeButton->hide(); personButton->hide(); personPlanButton->hide(); containerButton->hide(); @@ -3317,9 +3345,8 @@ moveDemandElementsButton->setChecked(false); routeButton->setChecked(false); vehicleButton->setChecked(false); - vehicleTypeButton->setChecked(false); + typeButton->setChecked(false); stopButton->setChecked(false); - personTypeButton->setChecked(false); personButton->setChecked(false); personPlanButton->setChecked(false); containerButton->setChecked(false); @@ -3332,9 +3359,8 @@ moveDemandElementsButton->update(); routeButton->update(); vehicleButton->update(); - vehicleTypeButton->update(); + typeButton->update(); stopButton->update(); - personTypeButton->update(); personButton->update(); personPlanButton->update(); containerButton->update(); diff -Nru sumo-1.11.0/src/netedit/GNEViewNetHelper.h sumo-1.12.0/src/netedit/GNEViewNetHelper.h --- sumo-1.11.0/src/netedit/GNEViewNetHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEViewNetHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -85,12 +85,10 @@ DEMAND_ROUTE, ///@brief Mode for editing vehicles DEMAND_VEHICLE, - ///@brief Mode for editing vehicle types - DEMAND_VEHICLETYPES, + ///@brief Mode for editing types + DEMAND_TYPE, ///@brief Mode for editing stops DEMAND_STOP, - ///@brief Mode for editing person types - DEMAND_PERSONTYPES, ///@brief Mode for editing person DEMAND_PERSON, ///@brief Mode for editing person plan @@ -1196,15 +1194,12 @@ /// @brief chekable button for edit mode create vehicles MFXCheckableButton* vehicleButton; - /// @brief chekable button for edit mode create vehicle type - MFXCheckableButton* vehicleTypeButton; + /// @brief chekable button for edit mode create type + MFXCheckableButton* typeButton; /// @brief chekable button for edit mode create stops MFXCheckableButton* stopButton; - /// @brief chekable button for edit mode create person type - MFXCheckableButton* personTypeButton; - /// @brief chekable button for edit mode create persons MFXCheckableButton* personButton; diff -Nru sumo-1.11.0/src/netedit/GNEViewParent.cpp sumo-1.12.0/src/netedit/GNEViewParent.cpp --- sumo-1.11.0/src/netedit/GNEViewParent.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEViewParent.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -33,11 +34,10 @@ #include #include #include -#include #include #include #include -#include +#include #include #include #include @@ -264,8 +264,8 @@ } -GNEVehicleTypeFrame* -GNEViewParent::getVehicleTypeFrame() const { +GNETypeFrame* +GNEViewParent::getTypeFrame() const { return myDemandFrames.vehicleTypeFrame; } @@ -276,12 +276,6 @@ } -GNEPersonTypeFrame* -GNEViewParent::getPersonTypeFrame() const { - return myDemandFrames.personTypeFrame; -} - - GNEPersonFrame* GNEViewParent::getPersonFrame() const { return myDemandFrames.personFrame; @@ -424,6 +418,10 @@ } gCurrentFolder = opendialog.getDirectory(); std::string file = opendialog.getFilename().text(); + if (file.find(".") == std::string::npos) { + file.append(".png"); + WRITE_MESSAGE("No file extension was specified - saving Snapshot as PNG."); + } std::string error = myView->makeSnapshot(file); if (error != "") { // write warning if netedit is running in testing mode @@ -881,7 +879,6 @@ vehicleFrame(nullptr), vehicleTypeFrame(nullptr), stopFrame(nullptr), - personTypeFrame(nullptr), personFrame(nullptr), personPlanFrame(nullptr), containerFrame(nullptr), @@ -893,9 +890,8 @@ GNEViewParent::DemandFrames::buildDemandFrames(GNEViewParent* viewParent, GNEViewNet* viewNet) { routeFrame = new GNERouteFrame(viewParent->myFramesArea, viewNet); vehicleFrame = new GNEVehicleFrame(viewParent->myFramesArea, viewNet); - vehicleTypeFrame = new GNEVehicleTypeFrame(viewParent->myFramesArea, viewNet); + vehicleTypeFrame = new GNETypeFrame(viewParent->myFramesArea, viewNet); stopFrame = new GNEStopFrame(viewParent->myFramesArea, viewNet); - personTypeFrame = new GNEPersonTypeFrame(viewParent->myFramesArea, viewNet); personFrame = new GNEPersonFrame(viewParent->myFramesArea, viewNet); personPlanFrame = new GNEPersonPlanFrame(viewParent->myFramesArea, viewNet); containerFrame = new GNEContainerFrame(viewParent->myFramesArea, viewNet); @@ -909,7 +905,6 @@ vehicleFrame->hide(); vehicleTypeFrame->hide(); stopFrame->hide(); - personTypeFrame->hide(); personFrame->hide(); personPlanFrame->hide(); containerFrame->hide(); @@ -924,7 +919,6 @@ vehicleFrame->setFrameWidth(frameWidth); vehicleTypeFrame->setFrameWidth(frameWidth); stopFrame->setFrameWidth(frameWidth); - personTypeFrame->setFrameWidth(frameWidth); personFrame->setFrameWidth(frameWidth); personPlanFrame->setFrameWidth(frameWidth); containerFrame->setFrameWidth(frameWidth); @@ -943,8 +937,6 @@ return true; } else if (stopFrame->shown()) { return true; - } else if (personTypeFrame->shown()) { - return true; } else if (personFrame->shown()) { return true; } else if (personPlanFrame->shown()) { @@ -968,8 +960,6 @@ return vehicleFrame; } else if (vehicleTypeFrame->shown()) { return vehicleTypeFrame; - } else if (personTypeFrame->shown()) { - return personTypeFrame; } else if (stopFrame->shown()) { return stopFrame; } else if (personFrame->shown()) { diff -Nru sumo-1.11.0/src/netedit/GNEViewParent.h sumo-1.12.0/src/netedit/GNEViewParent.h --- sumo-1.11.0/src/netedit/GNEViewParent.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/GNEViewParent.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -51,7 +51,6 @@ class GNETAZFrame; class GNETLSEditorFrame; // demand frames -class GNEPersonTypeFrame; class GNEPersonFrame; class GNEPersonPlanFrame; class GNEContainerFrame; @@ -59,7 +58,7 @@ class GNERouteFrame; class GNEStopFrame; class GNEVehicleFrame; -class GNEVehicleTypeFrame; +class GNETypeFrame; // data frames class GNEGenericDataFrame; class GNEEdgeDataFrame; @@ -158,14 +157,11 @@ GNEVehicleFrame* getVehicleFrame() const; /// @brief get frame for DEMAND_VEHICLETYPE - GNEVehicleTypeFrame* getVehicleTypeFrame() const; + GNETypeFrame* getTypeFrame() const; /// @brief get frame for DEMAND_STOP GNEStopFrame* getStopFrame() const; - /// @brief get frame for DEMAND_PERSONTYPE - GNEPersonTypeFrame* getPersonTypeFrame() const; - /// @brief get frame for DEMAND_PERSON GNEPersonFrame* getPersonFrame() const; @@ -345,14 +341,11 @@ GNEVehicleFrame* vehicleFrame; /// @brief frame for DEMAND_VEHICLETYPE - GNEVehicleTypeFrame* vehicleTypeFrame; + GNETypeFrame* vehicleTypeFrame; /// @brief frame for DEMAND_STOP GNEStopFrame* stopFrame; - /// @brief frame for DEMAND_PERSONTYPE - GNEPersonTypeFrame* personTypeFrame; - /// @brief frame for DEMAND_PERSON GNEPersonFrame* personFrame; diff -Nru sumo-1.11.0/src/netedit/netedit_main.cpp sumo-1.12.0/src/netedit/netedit_main.cpp --- sumo-1.11.0/src/netedit/netedit_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netedit/netedit_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netgen/CMakeLists.txt sumo-1.12.0/src/netgen/CMakeLists.txt --- sumo-1.11.0/src/netgen/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netgen/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -16,6 +16,6 @@ set_target_properties(netgenerate PROPERTIES OUTPUT_NAME netgenerate${BINARY_SUFFIX}) set_target_properties(netgenerate PROPERTIES OUTPUT_NAME_DEBUG netgenerate${BINARY_SUFFIX}D) target_link_libraries(netgenerate netbuild netimport netwrite ${GDAL_LIBRARY} ${commonlibs}) -add_dependencies(netgenerate generate-version-h) +add_dependencies(netgenerate generate-version-h install_dll) install(TARGETS netgenerate RUNTIME DESTINATION bin) diff -Nru sumo-1.11.0/src/netgen/netgen_main.cpp sumo-1.12.0/src/netgen/netgen_main.cpp --- sumo-1.11.0/src/netgen/netgen_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netgen/netgen_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netgen/NGEdge.cpp sumo-1.12.0/src/netgen/NGEdge.cpp --- sumo-1.11.0/src/netgen/NGEdge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netgen/NGEdge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2003-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2003-2022 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/ diff -Nru sumo-1.11.0/src/netgen/NGEdge.h sumo-1.12.0/src/netgen/NGEdge.h --- sumo-1.11.0/src/netgen/NGEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netgen/NGEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netgen/NGFrame.cpp sumo-1.12.0/src/netgen/NGFrame.cpp --- sumo-1.11.0/src/netgen/NGFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netgen/NGFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2011-2022 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/ diff -Nru sumo-1.11.0/src/netgen/NGFrame.h sumo-1.12.0/src/netgen/NGFrame.h --- sumo-1.11.0/src/netgen/NGFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netgen/NGFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netgen/NGNet.cpp sumo-1.12.0/src/netgen/NGNet.cpp --- sumo-1.11.0/src/netgen/NGNet.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netgen/NGNet.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2003-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2003-2022 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/ diff -Nru sumo-1.11.0/src/netgen/NGNet.h sumo-1.12.0/src/netgen/NGNet.h --- sumo-1.11.0/src/netgen/NGNet.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netgen/NGNet.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netgen/NGNode.cpp sumo-1.12.0/src/netgen/NGNode.cpp --- sumo-1.11.0/src/netgen/NGNode.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netgen/NGNode.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netgen/NGNode.h sumo-1.12.0/src/netgen/NGNode.h --- sumo-1.11.0/src/netgen/NGNode.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netgen/NGNode.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netgen/NGRandomNetBuilder.cpp sumo-1.12.0/src/netgen/NGRandomNetBuilder.cpp --- sumo-1.11.0/src/netgen/NGRandomNetBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netgen/NGRandomNetBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netgen/NGRandomNetBuilder.h sumo-1.12.0/src/netgen/NGRandomNetBuilder.h --- sumo-1.11.0/src/netgen/NGRandomNetBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netgen/NGRandomNetBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIFrame.cpp sumo-1.12.0/src/netimport/NIFrame.cpp --- sumo-1.11.0/src/netimport/NIFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -198,6 +198,9 @@ oc.doRegister("osm.sidewalks", new Option_Bool(false)); oc.addDescription("osm.sidewalks", "Formats", "Import sidewalks"); + oc.doRegister("osm.turn-lanes", new Option_Bool(false)); + oc.addDescription("osm.turn-lanes", "Formats", "Import turning arrows from OSM to help with connection building"); + oc.doRegister("osm.stop-output.length", new Option_Float(25)); oc.addDescription("osm.stop-output.length", "Formats", "The default length of a public transport stop in FLOAT m"); oc.doRegister("osm.stop-output.length.bus", new Option_Float(15)); @@ -343,6 +346,10 @@ oc.addDescription("opendrive.min-width", "Formats", "The minimum lane width for determining start or end of variable-width lanes"); oc.doRegister("opendrive.internal-shapes", new Option_Bool(false)); oc.addDescription("opendrive.internal-shapes", "Formats", "Import internal lane shapes"); + oc.doRegister("opendrive.position-ids", new Option_Bool(false)); + oc.addDescription("opendrive.position-ids", "Formats", "Sets edge-id based on road-id and offset in m (legacy)"); + oc.doRegister("opendrive.lane-shapes", new Option_Bool(false)); + oc.addDescription("opendrive.lane-shapes", "Formats", "Use custom lane shapes to compensate discarded lane types"); // register some additional options oc.doRegister("tls.discard-loaded", new Option_Bool(false)); diff -Nru sumo-1.11.0/src/netimport/NIFrame.h sumo-1.12.0/src/netimport/NIFrame.h --- sumo-1.11.0/src/netimport/NIFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIImporter_ArcView.cpp sumo-1.12.0/src/netimport/NIImporter_ArcView.cpp --- sumo-1.11.0/src/netimport/NIImporter_ArcView.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_ArcView.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIImporter_ArcView.h sumo-1.12.0/src/netimport/NIImporter_ArcView.h --- sumo-1.11.0/src/netimport/NIImporter_ArcView.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_ArcView.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIImporter_DlrNavteq.cpp sumo-1.12.0/src/netimport/NIImporter_DlrNavteq.cpp --- sumo-1.11.0/src/netimport/NIImporter_DlrNavteq.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_DlrNavteq.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -236,7 +236,11 @@ NBNode* n = new NBNode(id, geoms[0]); if (!myNodeCont.insert(n)) { delete n; - throw ProcessError("Could not add node '" + id + "'."); + if (OptionsCont::getOptions().getBool("ignore-errors")) { + WRITE_WARNINGF("Could not add add node '%'", id); + } else { + throw ProcessError("Could not add node '" + id + "'."); + } } } else { myGeoms[id] = geoms; diff -Nru sumo-1.11.0/src/netimport/NIImporter_DlrNavteq.h sumo-1.12.0/src/netimport/NIImporter_DlrNavteq.h --- sumo-1.11.0/src/netimport/NIImporter_DlrNavteq.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_DlrNavteq.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIImporter_ITSUMO.cpp sumo-1.12.0/src/netimport/NIImporter_ITSUMO.cpp --- sumo-1.11.0/src/netimport/NIImporter_ITSUMO.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_ITSUMO.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2011-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIImporter_ITSUMO.h sumo-1.12.0/src/netimport/NIImporter_ITSUMO.h --- sumo-1.11.0/src/netimport/NIImporter_ITSUMO.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_ITSUMO.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIImporter_MATSim.cpp sumo-1.12.0/src/netimport/NIImporter_MATSim.cpp --- sumo-1.11.0/src/netimport/NIImporter_MATSim.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_MATSim.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIImporter_MATSim.h sumo-1.12.0/src/netimport/NIImporter_MATSim.h --- sumo-1.11.0/src/netimport/NIImporter_MATSim.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_MATSim.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIImporter_OpenDrive.cpp sumo-1.12.0/src/netimport/NIImporter_OpenDrive.cpp --- sumo-1.11.0/src/netimport/NIImporter_OpenDrive.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_OpenDrive.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -56,10 +56,11 @@ //#define DEBUG_CONNECTIONS //#define DEBUG_SPIRAL //#define DEBUG_INTERNALSHAPES +//#define DEBUG_SHAPE -#define DEBUG_COND(road) ((road)->id == "18") -#define DEBUG_COND2(edgeID) (StringUtils::startsWith((edgeID), "-18.")) -#define DEBUG_COND3(roadID) (roadID == "18") +#define DEBUG_COND(road) ((road)->id == "32") +#define DEBUG_COND2(edgeID) (StringUtils::startsWith((edgeID), "67")) +#define DEBUG_COND3(roadID) (roadID == "32") // =========================================================================== // definitions @@ -95,6 +96,7 @@ { "speed", NIImporter_OpenDrive::OPENDRIVE_TAG_SPEED }, { "elevation", NIImporter_OpenDrive::OPENDRIVE_TAG_ELEVATION }, { "geoReference", NIImporter_OpenDrive::OPENDRIVE_TAG_GEOREFERENCE }, + { "offset", NIImporter_OpenDrive::OPENDRIVE_TAG_OFFSET }, { "object", NIImporter_OpenDrive::OPENDRIVE_TAG_OBJECT }, { "repeat", NIImporter_OpenDrive::OPENDRIVE_TAG_REPEAT }, @@ -181,6 +183,7 @@ myImportWidths = !oc.getBool("opendrive.ignore-widths"); myMinWidth = oc.getFloat("opendrive.min-width"); myImportInternalShapes = oc.getBool("opendrive.internal-shapes"); + bool customLaneShapes = oc.getBool("opendrive.lane-shapes"); NBTypeCont& tc = nb.getTypeCont(); NBNodeCont& nc = nb.getNodeCont(); // build the handler @@ -396,6 +399,7 @@ // ------------------------- const double defaultSpeed = tc.getEdgeTypeSpeed(""); const bool saveOrigIDs = OptionsCont::getOptions().getBool("output.original-names"); + const bool positionIDs = OptionsCont::getOptions().getBool("opendrive.position-ids"); // lane-id-map sumoEdge,sumoLaneIndex->odrLaneIndex std::map, int> laneIndexMap; // build edges @@ -423,12 +427,15 @@ PositionVector geomWithOffset = e->geom; if (e->laneOffsets.size() > 0) { try { - geomWithOffset.move2side(e->laneOffsets); + geomWithOffset.move2sideCustom(e->laneOffsets); //std::cout << " e=" << e->id << " offsets=" << e->laneOffsets << " geom=" << e->geom << " geom2=" << geomWithOffset << "\n"; } catch (InvalidArgument&) { WRITE_WARNING("Could not apply laneOffsets for edge '" + e->id + "'"); } } +#ifdef DEBUG_SHAPE + if (DEBUG_COND3(e->id)) std::cout << " geomWithOffset=" << geomWithOffset << "\n"; +#endif const double length2D = geomWithOffset.length2D(); double cF = length2D == 0 ? 1 : e->length / length2D; NBEdge* prevRight = nullptr; @@ -449,6 +456,7 @@ } // build along lane sections + int sectionIndex = 0; for (std::vector::iterator j = e->laneSections.begin(); j != e->laneSections.end(); ++j) { // add internal node if needed if (j == e->laneSections.end() - 1) { @@ -456,7 +464,8 @@ sE = e->length / cF; } else { double nextS = (j + 1)->s; - sTo = new NBNode(e->id + "." + toString(nextS), geomWithOffset.positionAtOffset(nextS)); + const std::string nodeID = e->id + (positionIDs ? "." + toString(nextS) : "#" + toString(sectionIndex + 1)); + sTo = new NBNode(nodeID, geomWithOffset.positionAtOffset(nextS)); if (!nb.getNodeCont().insert(sTo)) { throw ProcessError("Could not add node '" + sTo->getID() + "'."); } @@ -464,10 +473,14 @@ } PositionVector geom = geomWithOffset.getSubpart2D(sB, sE); std::string id = e->id; - if (sFrom != e->from || sTo != e->to) { - id = id + "." + toString((*j).s); - } else if (e->laneSections.size() == 1) { - id = id + ".0.00"; + if (positionIDs) { + if (sFrom != e->from || sTo != e->to) { + id = id + "." + toString((*j).s); + } else if (e->laneSections.size() == 1) { + id = id + ".0.00"; + } + } else if (e->laneSections.size() > 1) { + id = id + "#" + toString(sectionIndex++); } #ifdef DEBUG_VARIABLE_WIDTHS if (DEBUG_COND(e)) { @@ -478,16 +491,41 @@ // build lanes to right NBEdge* currRight = nullptr; if ((*j).rightLaneNumber > 0) { + std::vector offsets(geom.size(), 0); + bool useOffsets = false; + PositionVector rightGeom = geom; +#ifdef DEBUG_SHAPE + if (DEBUG_COND3(e->id)) gDebugFlag1 = true; +#endif + rightGeom.move2side((*j).discardedInnerWidthRight); +#ifdef DEBUG_SHAPE + if (DEBUG_COND3(e->id)) { + std::cout << " -" << id << "_geom=" << geom << " -" << id << "_rightGeom=" << rightGeom << "\n"; + gDebugFlag1 = false; + } +#endif + PositionVector laneGeom = rightGeom; currRight = new NBEdge("-" + id, sFrom, sTo, (*j).rightType, defaultSpeed, (*j).rightLaneNumber, priorityR, - NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, geom, LaneSpreadFunction::RIGHT, e->streetName, "", true); + NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, rightGeom, LaneSpreadFunction::RIGHT, e->streetName, "", true); lanesBuilt = true; - const std::vector& lanes = (*j).lanesByDir[OPENDRIVE_TAG_RIGHT]; + std::vector& lanes = (*j).lanesByDir[OPENDRIVE_TAG_RIGHT]; + std::sort(lanes.begin(), lanes.end(), LaneSorter()); for (std::vector::const_iterator k = lanes.begin(); k != lanes.end(); ++k) { std::map::const_iterator lp = (*j).laneMap.find((*k).id); if (lp != (*j).laneMap.end()) { int sumoLaneIndex = lp->second; setLaneAttributes(e, currRight->getLaneStruct(sumoLaneIndex), *k, saveOrigIDs, tc); laneIndexMap[std::make_pair(currRight, sumoLaneIndex)] = (*k).id; + if (useOffsets) { + PositionVector laneShape = laneGeom; + laneShape.move2sideCustom(offsets); + currRight->getLaneStruct(sumoLaneIndex).customShape = laneShape; + } + } else if (customLaneShapes) { + useOffsets = true; + } + if (customLaneShapes) { + addOffsets(false, laneGeom, (*k).widthData, e->id + "_" + toString((*k).id), offsets); } } if (!nb.getEdgeCont().insert(currRight, myImportAllTypes)) { @@ -515,16 +553,35 @@ // build lanes to left NBEdge* currLeft = nullptr; if ((*j).leftLaneNumber > 0) { + std::vector offsets(geom.size(), 0); + bool useOffsets = false; + PositionVector leftGeom = geom; + leftGeom.move2side(-(*j).discardedInnerWidthLeft); + PositionVector laneGeom = leftGeom; +#ifdef DEBUG_SHAPE + if (DEBUG_COND3(e->id)) std::cout << " " << id << "_geom=" << geom << " " << id << "_leftGeom=" << leftGeom << "\n"; +#endif currLeft = new NBEdge(id, sTo, sFrom, (*j).leftType, defaultSpeed, (*j).leftLaneNumber, priorityL, - NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, geom.reverse(), LaneSpreadFunction::RIGHT, e->streetName, "", true); + NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, leftGeom.reverse(), LaneSpreadFunction::RIGHT, e->streetName, "", true); lanesBuilt = true; - const std::vector& lanes = (*j).lanesByDir[OPENDRIVE_TAG_LEFT]; + std::vector& lanes = (*j).lanesByDir[OPENDRIVE_TAG_LEFT]; + std::sort(lanes.begin(), lanes.end(), LaneSorter()); for (std::vector::const_iterator k = lanes.begin(); k != lanes.end(); ++k) { std::map::const_iterator lp = (*j).laneMap.find((*k).id); if (lp != (*j).laneMap.end()) { int sumoLaneIndex = lp->second; setLaneAttributes(e, currLeft->getLaneStruct(sumoLaneIndex), *k, saveOrigIDs, tc); laneIndexMap[std::make_pair(currLeft, sumoLaneIndex)] = (*k).id; + if (useOffsets) { + PositionVector laneShape = laneGeom; + laneShape.move2sideCustom(offsets); + currLeft->getLaneStruct(sumoLaneIndex).customShape = laneShape.reverse(); + } + } else if (customLaneShapes) { + useOffsets = true; + } + if (customLaneShapes) { + addOffsets(true, laneGeom, (*k).widthData, e->id + "_" + toString((*k).id), offsets); } } if (!nb.getEdgeCont().insert(currLeft, myImportAllTypes)) { @@ -1103,7 +1160,7 @@ s = finalS; } try { - cn.shape.move2side(offsets); + cn.shape.move2sideCustom(offsets); } catch (InvalidArgument&) { WRITE_WARNING("Could not import internal lane shape from edge '" + c.fromEdge + "' to edge '" + c.toEdge); cn.shape.clear(); @@ -1388,13 +1445,19 @@ // avoid length-1 geometry due to almostSame check e.geom.push_back(last); } +#ifdef DEBUG_SHAPE + if (DEBUG_COND3(e.id)) std::cout << " initialGeom=" << e.geom << "\n"; +#endif if (oc.exists("geometry.min-dist") && !oc.isDefault("geometry.min-dist")) { // simplify geometry for both directions consistently but ensure // that start and end angles are preserved if (e.geom.size() > 4) { - e.geom.removeDoublePoints(oc.getFloat("geometry.min-dist"), true, 1, 1); + e.geom.removeDoublePoints(oc.getFloat("geometry.min-dist"), true, 1, 1, true); } } +#ifdef DEBUG_SHAPE + if (DEBUG_COND3(e.id)) std::cout << " reducedGeom=" << e.geom << "\n"; +#endif if (!NBNetBuilder::transformCoordinates(e.geom)) { WRITE_ERROR("Unable to project coordinates for edge '" + e.id + "'."); } @@ -1421,42 +1484,94 @@ } // add laneoffset if (e.offsets.size() > 0) { - // make sure there are intermediate points for each offset-section - for (std::vector::iterator j = e.offsets.begin(); j != e.offsets.end(); ++j) { - const OpenDriveLaneOffset& el = *j; - // check wether we need to insert a new point at dist - Position pS = e.geom.positionAtOffset2D(el.s); - int iS = e.geom.indexOfClosest(pS); - // prevent close spacing to reduce impact of rounding errors in z-axis - if (pS.distanceTo2D(e.geom[iS]) > POSITION_EPS) { - e.geom.insertAtClosest(pS, false); - //std::cout << " edge=" << e.id << " inserting pos=" << pS << " s=" << el.s << " iS=" << iS << " dist=" << pS.distanceTo2D(e.geom[iS]) << "\n"; - } - } - // XXX add further points for sections with non-constant offset - // shift each point orthogonally by the specified offset - int kk = 0; - double ppos = 0; - for (std::vector::iterator j = e.offsets.begin(); j != e.offsets.end(); ++j) { - const OpenDriveLaneOffset& el = *j; - const double sNext = (j + 1) == e.offsets.end() ? std::numeric_limits::max() : (*(j + 1)).s; - while (kk < (int)e.geom.size() && ppos < sNext) { - const double offset = el.computeAt(ppos); - e.laneOffsets.push_back(fabs(offset) > POSITION_EPS ? -offset : 0); - kk++; - if (kk < (int)e.geom.size()) { - // XXX pos understimates the actual position since the - // actual geometry between k-1 and k could be curved - ppos += e.geom[kk - 1].distanceTo2D(e.geom[kk]); - } - } - } + e.laneOffsets = discretizeOffsets(e.geom, e.offsets, e.id); } //std::cout << " loaded geometry " << e.id << "=" << e.geom << "\n"; } } +std::vector +NIImporter_OpenDrive::discretizeOffsets(PositionVector& geom, const std::vector& offsets, const std::string& id) { + UNUSED_PARAMETER(id); + std::vector laneOffsets; + // make sure there are intermediate points for each offset-section + for (const OpenDriveLaneOffset& el : offsets) { + // check wether we need to insert a new point at dist + Position pS = geom.positionAtOffset2D(el.s); + int iS = geom.indexOfClosest(pS); + // prevent close spacing to reduce impact of rounding errors in z-axis + if (pS.distanceTo2D(geom[iS]) > POSITION_EPS) { + geom.insertAtClosest(pS, false); + //std::cout << " edge=" << e.id << " inserting pos=" << pS << " s=" << el.s << " iS=" << iS << " dist=" << pS.distanceTo2D(geom[iS]) << "\n"; + } + } + // XXX add further points for sections with non-constant offset + // shift each point orthogonally by the specified offset + int kk = 0; + double ppos = 0; + for (auto j = offsets.begin(); j != offsets.end(); ++j) { + const OpenDriveLaneOffset& el = *j; + const double sNext = (j + 1) == offsets.end() ? std::numeric_limits::max() : (*(j + 1)).s; + while (kk < (int)geom.size() && ppos < sNext) { + const double offset = el.computeAt(ppos); + laneOffsets.push_back(fabs(offset) > POSITION_EPS ? -offset : 0); + kk++; + if (kk < (int)geom.size()) { + // XXX pos understimates the actual position since the + // actual geometry between k-1 and k could be curved + ppos += geom[kk - 1].distanceTo2D(geom[kk]); + } + } + } + return laneOffsets; +} + + +void +NIImporter_OpenDrive::addOffsets(bool left, PositionVector& geom, const std::vector& offsets, const std::string& id, std::vector& result) { + UNUSED_PARAMETER(id); + // make sure there are intermediate points for each offset-section + for (const OpenDriveLaneOffset& el : offsets) { + // check wether we need to insert a new point at dist + Position pS = geom.positionAtOffset2D(el.s); + int iS = geom.indexOfClosest(pS); + // prevent close spacing to reduce impact of rounding errors in z-axis + if (pS.distanceTo2D(geom[iS]) > POSITION_EPS) { + //std::cout << " edge=" << id << " inserting pos=" << pS << " s=" << el.s << " iS=" << iS << " dist=" << pS.distanceTo2D(geom[iS]) << "\n"; + int at = geom.insertAtClosest(pS, false); + double interpolatedOffset = 0; + if (at == 0) { + interpolatedOffset = result.front(); + } else if (at == (int)geom.size() - 1) { + interpolatedOffset = result.back(); + } else { + interpolatedOffset = (result[at - 1] + result[at]) / 2; + } + result.insert(result.begin() + at, interpolatedOffset); + } + } + // shift each point orthogonally by the specified offset + int kk = 0; + double ppos = 0; + const int sign = left ? -1 : 1; + for (auto j = offsets.begin(); j != offsets.end(); ++j) { + const OpenDriveWidth& el = *j; + const double sNext = (j + 1) == offsets.end() ? std::numeric_limits::max() : (*(j + 1)).s; + while (kk < (int)geom.size() && ppos < sNext) { + const double offset = el.computeAt(ppos); + result[kk] += fabs(offset) > POSITION_EPS ? sign * offset : 0; + kk++; + if (kk < (int)geom.size()) { + // XXX pos understimates the actual position since the + // actual geometry between k-1 and k could be curved + ppos += geom[kk - 1].distanceTo2D(geom[kk]); + } + } + } +} + + void NIImporter_OpenDrive::revisitLaneSections(const NBTypeCont& tc, std::map& edges) { for (std::map::iterator i = edges.begin(); i != edges.end(); ++i) { @@ -1755,19 +1870,24 @@ void NIImporter_OpenDrive::OpenDriveLaneSection::buildLaneMapping(const NBTypeCont& tc) { + discardedInnerWidthRight = 0; int sumoLane = 0; bool singleType = true; std::vector types; const std::vector& dirLanesR = lanesByDir.find(OPENDRIVE_TAG_RIGHT)->second; for (std::vector::const_reverse_iterator i = dirLanesR.rbegin(); i != dirLanesR.rend(); ++i) { if (myImportAllTypes || (tc.knows((*i).type) && !tc.getEdgeTypeShallBeDiscarded((*i).type))) { + discardedInnerWidthRight = 0; laneMap[(*i).id] = sumoLane++; types.push_back((*i).type); if (types.front() != types.back()) { singleType = false; } + } else { + discardedInnerWidthRight += (*i).width; } } + discardedInnerWidthLeft = 0; rightLaneNumber = sumoLane; rightType = sumoLane > 0 ? (singleType ? types.front() : joinToString(types, "|")) : ""; sumoLane = 0; @@ -1776,11 +1896,14 @@ const std::vector& dirLanesL = lanesByDir.find(OPENDRIVE_TAG_LEFT)->second; for (std::vector::const_iterator i = dirLanesL.begin(); i != dirLanesL.end(); ++i) { if (myImportAllTypes || (tc.knows((*i).type) && !tc.getEdgeTypeShallBeDiscarded((*i).type))) { + discardedInnerWidthLeft = 0; laneMap[(*i).id] = sumoLane++; types.push_back((*i).type); if (types.front() != types.back()) { singleType = false; } + } else { + discardedInnerWidthLeft += (*i).width; } } leftLaneNumber = sumoLane; @@ -1945,7 +2068,7 @@ // --------------------------------------------------------------------------- NIImporter_OpenDrive::NIImporter_OpenDrive(const NBTypeCont& tc, std::map& edges) : GenericSAXHandler(openDriveTags, OPENDRIVE_TAG_NOTHING, openDriveAttrs, OPENDRIVE_ATTR_NOTHING, "opendrive"), - myTypeContainer(tc), myCurrentEdge("", "", "", -1), myEdges(edges) { + myTypeContainer(tc), myCurrentEdge("", "", "", -1), myEdges(edges), myOffset(0, 0) { } @@ -1969,6 +2092,15 @@ */ } break; + case OPENDRIVE_TAG_OFFSET: { + double x = attrs.get(OPENDRIVE_ATTR_X, "offset", ok); + double y = attrs.get(OPENDRIVE_ATTR_Y, "offset", ok); + myOffset.set(x, y); + if (GeoConvHelper::getNumLoaded()) { + GeoConvHelper::getLoaded().moveConvertedBy(x, y); + } + } + break; case OPENDRIVE_TAG_ROAD: { std::string id = attrs.get(OPENDRIVE_ATTR_ID, nullptr, ok); std::string streetName = attrs.getOpt(OPENDRIVE_ATTR_NAME, nullptr, ok, "", false); @@ -2296,12 +2428,11 @@ GeoConvHelper* result = nullptr; Boundary convBoundary; Boundary origBoundary; - Position networkOffset(0, 0); // XXX read values from the header convBoundary.add(Position(0, 0)); origBoundary.add(Position(0, 0)); try { - result = new GeoConvHelper(proj, networkOffset, origBoundary, convBoundary); + result = new GeoConvHelper(proj, myOffset, origBoundary, convBoundary); GeoConvHelper::setLoaded(*result); } catch (ProcessError& e) { WRITE_ERROR("Could not set projection. (" + std::string(e.what()) + ")"); diff -Nru sumo-1.11.0/src/netimport/NIImporter_OpenDrive.h sumo-1.12.0/src/netimport/NIImporter_OpenDrive.h --- sumo-1.11.0/src/netimport/NIImporter_OpenDrive.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_OpenDrive.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -105,6 +105,7 @@ OPENDRIVE_TAG_SPEED, OPENDRIVE_TAG_ELEVATION, OPENDRIVE_TAG_GEOREFERENCE, + OPENDRIVE_TAG_OFFSET, OPENDRIVE_TAG_OBJECT, OPENDRIVE_TAG_REPEAT }; @@ -360,6 +361,9 @@ /// @brief the composite type built from all used lane types std::string rightType; std::string leftType; + /// @brief average width of removed inside lanes + double discardedInnerWidthLeft; + double discardedInnerWidthRight; }; @@ -602,6 +606,7 @@ ContactPoint myCurrentContactPoint; bool myConnectionWasEmpty; std::map mySignals; + Position myOffset; static bool myImportAllTypes; static bool myImportWidths; @@ -644,6 +649,11 @@ static bool hasNonLinearElevation(OpenDriveEdge& e); + /// transform Poly3 into a list of offsets, adding intermediate points to geom if needed + static std::vector discretizeOffsets(PositionVector& geom, const std::vector& offsets, const std::string& id); + + static void addOffsets(bool left, PositionVector& geom, const std::vector& offsets, const std::string& id, std::vector& result); + /** @brief Rechecks lane sections of the given edges * * @@ -680,5 +690,17 @@ static StringBijection::Entry openDriveAttrs[]; + class LaneSorter { + public: + /// constructor + explicit LaneSorter() {} + + /// comparing operation + int operator()(const OpenDriveLane& a, const OpenDriveLane& b) const { + // sort from the reference line outwards (desceding order of sumo lane ids) + return abs(a.id) < abs(b.id); + } + + }; }; diff -Nru sumo-1.11.0/src/netimport/NIImporter_OpenStreetMap.cpp sumo-1.12.0/src/netimport/NIImporter_OpenStreetMap.cpp --- sumo-1.11.0/src/netimport/NIImporter_OpenStreetMap.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_OpenStreetMap.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -133,6 +133,7 @@ std::vector files = oc.getStringVector("osm-files"); myImportLaneAccess = oc.getBool("osm.lane-access"); + myImportTurnSigns = oc.getBool("osm.turn-lanes"); myImportSidewalks = OptionsCont::getOptions().getBool("osm.sidewalks"); // load nodes, first @@ -230,15 +231,16 @@ // build nodes; // - the from- and to-nodes must be built in any case // - the in-between nodes are only built if more than one edge references them - NBNode* currentFrom = insertNodeChecking(*e->myCurrentNodes.begin(), nc, tlsc); + NBNode* first = insertNodeChecking(*e->myCurrentNodes.begin(), nc, tlsc); NBNode* last = insertNodeChecking(*(e->myCurrentNodes.end() - 1), nc, tlsc); + NBNode* currentFrom = first; int running = 0; std::vector passed; for (auto j = e->myCurrentNodes.begin(); j != e->myCurrentNodes.end(); ++j) { passed.push_back(*j); if (nodeUsage[*j] > 1 && j != e->myCurrentNodes.end() - 1 && j != e->myCurrentNodes.begin()) { NBNode* currentTo = insertNodeChecking(*j, nc, tlsc); - running = insertEdge(e, running, currentFrom, currentTo, passed, nb); + running = insertEdge(e, running, currentFrom, currentTo, passed, nb, first, last); currentFrom = currentTo; passed.clear(); passed.push_back(*j); @@ -247,7 +249,7 @@ if (running == 0) { running = -1; } - insertEdge(e, running, currentFrom, last, passed, nb); + insertEdge(e, running, currentFrom, last, passed, nb, first, last); } const double layerElevation = oc.getFloat("osm.layer-elevation"); @@ -316,7 +318,8 @@ int NIImporter_OpenStreetMap::insertEdge(Edge* e, int index, NBNode* from, NBNode* to, - const std::vector& passed, NBNetBuilder& nb) { + const std::vector& passed, NBNetBuilder& nb, + const NBNode* first, const NBNode* last) { NBNodeCont& nc = nb.getNodeCont(); NBEdgeCont& ec = nb.getEdgeCont(); NBTypeCont& tc = nb.getTypeCont(); @@ -345,8 +348,8 @@ NBNode* intermediate = insertNodeChecking(passed[intermediateIndex], nc, tlsc); std::vector part1(passed.begin(), passed.begin() + intermediateIndex + 1); std::vector part2(passed.begin() + intermediateIndex, passed.end()); - index = insertEdge(e, index, from, intermediate, part1, nb); - return insertEdge(e, index, intermediate, to, part2, nb); + index = insertEdge(e, index, from, intermediate, part1, nb, first, last); + return insertEdge(e, index, intermediate, to, part2, nb, first, last); } const int newIndex = index + 1; @@ -591,6 +594,8 @@ } applyChangeProhibition(nbe, e->myChangeForward); applyLaneUseInformation(nbe, e->myLaneUseForward); + applyTurnSigns(nbe, e->myTurnSignsForward); + nbe->setTurnSignTarget(last->getID()); if (addBikeLane && (cyclewayType == WAY_UNKNOWN || (cyclewayType & WAY_FORWARD) != 0)) { nbe->addBikeLane(tc.getEdgeTypeBikeLaneWidth(type) * offsetFactor); } else if (nbe->getPermissions(0) == SVC_BUS) { @@ -619,6 +624,8 @@ } applyChangeProhibition(nbe, e->myChangeBackward); applyLaneUseInformation(nbe, e->myLaneUseBackward); + applyTurnSigns(nbe, e->myTurnSignsBackward); + nbe->setTurnSignTarget(first->getID()); if (addBikeLane && (cyclewayType == WAY_UNKNOWN || (cyclewayType & WAY_BACKWARD) != 0)) { nbe->addBikeLane(tc.getEdgeTypeBikeLaneWidth(type) * offsetFactor); } else if (nbe->getPermissions(0) == SVC_BUS) { @@ -1015,6 +1022,7 @@ && key != "foot" && key != "bicycle" && key != "oneway:bicycle" + && !StringUtils::startsWith(key, "turn:lanes") && key != "public_transport") { return; } @@ -1022,7 +1030,7 @@ if ((key == "highway" && value != "platform") || key == "railway" || key == "waterway" || key == "cycleway" || key == "busway" || key == "route" || key == "sidewalk" || key == "highspeed" - || key == "usage") { + || key == "aeroway" || key == "usage") { // build type id std::string singleTypeID = key + "." + value; myCurrentEdge->myCurrentIsRoad = true; @@ -1242,9 +1250,40 @@ interpretLaneUse(value, SVC_PASSENGER, myCurrentEdge->myLaneUseForward); } else if (key == "vehicle:lanes:backward") { interpretLaneUse(value, SVC_PASSENGER, myCurrentEdge->myLaneUseBackward); + } else if (StringUtils::startsWith(key, "turn:lanes")) { + const std::vector values = StringTokenizer(value, "|").getVector(); + std::vector turnCodes; + for (std::string codeList : values) { + const std::vector codes = StringTokenizer(codeList, ";").getVector(); + int turnCode = 0; + for (std::string code : codes) { + if (code == "" || code == "none" || code == "through") { + turnCode |= (int)LinkDirection::STRAIGHT; + } else if (code == "left" || code == "sharp_left") { + turnCode |= (int)LinkDirection::LEFT; + } else if (code == "right" || code == "sharp_right") { + turnCode |= (int)LinkDirection::RIGHT; + } else if (code == "slight_left") { + turnCode |= (int)LinkDirection::PARTLEFT; + } else if (code == "slight_right") { + turnCode |= (int)LinkDirection::PARTRIGHT; + } else if (code == "reverse") { + turnCode |= (int)LinkDirection::TURN; + } else if (code == "merge_to_left" || code == "merge_to_right") { + turnCode |= (int)LinkDirection::NODIR; + } + } + turnCodes.push_back(turnCode); + } + if (key == "turn:lanes" || key == "turn:lanes:forward") { + myCurrentEdge->myTurnSignsForward = turnCodes; + } else if (key == "turn:lanes:backward") { + myCurrentEdge->myTurnSignsBackward = turnCodes; + } else if (key == "turn:lanes:both_ways") { + myCurrentEdge->myTurnSignsForward = turnCodes; + myCurrentEdge->myTurnSignsBackward = turnCodes; + } } - - } } @@ -1485,7 +1524,7 @@ } else if (key == "route") { std::string value = attrs.get(SUMO_ATTR_V, toString(myCurrentRelation).c_str(), ok, false); if (value == "train" || value == "subway" || value == "light_rail" || value == "monorail" || value == "tram" || value == "bus" - || value == "trolleybus" || value == "arialway" || value == "ferry") { + || value == "trolleybus" || value == "arialway" || value == "ferry" || value == "share_taxi" || value == "minibus") { myPTRouteType = value; } @@ -2141,6 +2180,10 @@ result = SVC_RAIL; } else if (type == "subway" || type == "light_rail") { result = SVC_RAIL_URBAN; + } else if (type == "share_taxi") { + result = SVC_TAXI; + } else if (type == "minibus") { + result = SVC_BUS; } else if (SumoVehicleClassStrings.hasString(type)) { result = SumoVehicleClassStrings.get(type); } @@ -2195,5 +2238,24 @@ } } } + +void +NIImporter_OpenStreetMap::applyTurnSigns(NBEdge* e, const std::vector& turnSigns) { + if (myImportTurnSigns && turnSigns.size() > 0) { + // no sidewalks and bike lanes have been added yet + if ((int)turnSigns.size() == e->getNumLanes()) { + const bool lefthand = OptionsCont::getOptions().getBool("lefthand"); + //std::cout << "apply turnSigns for " << e->getID() << " turnSigns=" << toString(turnSigns) << "\n"; + for (int i = 0; i < (int)turnSigns.size(); i++) { + // laneUse stores from left to right + const int laneIndex = lefthand ? i : e->getNumLanes() - 1 - i; + NBEdge::Lane& lane = e->getLaneStruct(laneIndex); + lane.turnSigns = turnSigns[i]; + } + } else { + WRITE_WARNINGF("Ignoring turn sign information for % lanes on edge % with % driving lanes", turnSigns.size(), e->getID(), e->getNumLanes()); + } + } +} /****************************************************************************/ diff -Nru sumo-1.11.0/src/netimport/NIImporter_OpenStreetMap.h sumo-1.12.0/src/netimport/NIImporter_OpenStreetMap.h --- sumo-1.11.0/src/netimport/NIImporter_OpenStreetMap.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_OpenStreetMap.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -232,6 +232,9 @@ bool myCurrentIsPlatform; /// @brief Information whether this is railway is electrified bool myCurrentIsElectrified; + /// @brief turning direction (arrows printed on the road) + std::vector myTurnSignsForward; + std::vector myTurnSignsBackward; private: /// invalidated assignment operator @@ -289,6 +292,8 @@ /// @brief import sidewalks bool myImportSidewalks; + /// @brief import turning signals (turn:lanes) to guide connection building + bool myImportTurnSigns; /** @brief Builds an NBNode * @@ -316,11 +321,14 @@ * @param[in] passed The list of passed nodes (geometry information) * @param[in] osmNodes Container of node definitions for getting information about nodes from * @param[in, out] The NetBuilder instance + * @param[in] first The first node of the way + * @param[in] last The last node of the way * @return the new index if the edge is split * @exception ProcessError If the edge could not be added to the container */ int insertEdge(Edge* e, int index, NBNode* from, NBNode* to, - const std::vector& passed, NBNetBuilder& nb); + const std::vector& passed, NBNetBuilder& nb, + const NBNode* first, const NBNode* last); /// @brief reconstruct elevation from layer info void reconstructLayerElevation(double layerElevation, NBNetBuilder& nb); @@ -344,6 +352,7 @@ static void applyChangeProhibition(NBEdge* e, int changeProhibition); void applyLaneUseInformation(NBEdge* e, const std::vector& laneUse); + void applyTurnSigns(NBEdge* e, const std::vector& turnSigns); /** * @class NodesHandler diff -Nru sumo-1.11.0/src/netimport/NIImporter_SUMO.cpp sumo-1.12.0/src/netimport/NIImporter_SUMO.cpp --- sumo-1.11.0/src/netimport/NIImporter_SUMO.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_SUMO.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -86,7 +86,8 @@ myTlsIgnoreInternalJunctionJam(false), myDefaultSpreadType(toString(LaneSpreadFunction::RIGHT)), myGeomAvoidOverlap(true), - myJunctionsHigherSpeed(false) { + myJunctionsHigherSpeed(false), + myInternalJunctionsVehicleWidth(OptionsCont::getOptions().getFloat("internal-junctions.vehicle-width")) { } @@ -337,6 +338,9 @@ if (oc.isDefault("junctions.higher-speed") && oc.getBool("junctions.higher-speed") != myJunctionsHigherSpeed) { oc.set("junctions.higher-speed", toString(myJunctionsHigherSpeed)); } + if (oc.isDefault("internal-junctions.vehicle-width") && oc.getFloat("internal-junctions.vehicle-width") != myInternalJunctionsVehicleWidth) { + oc.set("internal-junctions.vehicle-width", toString(myInternalJunctionsVehicleWidth)); + } if (!deprecatedVehicleClassesSeen.empty()) { WRITE_WARNING("Deprecated vehicle class(es) '" + toString(deprecatedVehicleClassesSeen) + "' in input network."); deprecatedVehicleClassesSeen.clear(); @@ -441,6 +445,7 @@ myDefaultSpreadType = attrs.getOpt(SUMO_ATTR_SPREADTYPE, nullptr, ok, myDefaultSpreadType); myGeomAvoidOverlap = attrs.getOpt(SUMO_ATTR_AVOID_OVERLAP, nullptr, ok, myGeomAvoidOverlap); myJunctionsHigherSpeed = attrs.getOpt(SUMO_ATTR_HIGHER_SPEED, nullptr, ok, myJunctionsHigherSpeed); + myInternalJunctionsVehicleWidth = attrs.getOpt(SUMO_ATTR_INTERNAL_JUNCTIONS_VEHICLE_WIDTH, nullptr, ok, myInternalJunctionsVehicleWidth); // derived const OptionsCont& oc = OptionsCont::getOptions(); myChangeLefthand = !oc.isDefault("lefthand") && (oc.getBool("lefthand") != myAmLefthand); diff -Nru sumo-1.11.0/src/netimport/NIImporter_SUMO.h sumo-1.12.0/src/netimport/NIImporter_SUMO.h --- sumo-1.11.0/src/netimport/NIImporter_SUMO.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_SUMO.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -416,6 +416,8 @@ bool myGeomAvoidOverlap; /// @brief higherSpeed option for loaded network bool myJunctionsHigherSpeed; + /// @brief custom settings for internal junction computation + double myInternalJunctionsVehicleWidth; /// @brief loaded roundabout edges std::vector > myRoundabouts; diff -Nru sumo-1.11.0/src/netimport/NIImporter_VISUM.cpp sumo-1.12.0/src/netimport/NIImporter_VISUM.cpp --- sumo-1.11.0/src/netimport/NIImporter_VISUM.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_VISUM.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIImporter_VISUM.h sumo-1.12.0/src/netimport/NIImporter_VISUM.h --- sumo-1.11.0/src/netimport/NIImporter_VISUM.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIImporter_VISUM.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NILoader.cpp sumo-1.12.0/src/netimport/NILoader.cpp --- sumo-1.11.0/src/netimport/NILoader.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NILoader.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -68,6 +68,7 @@ void NILoader::load(OptionsCont& oc) { + bool ok = true; // load types first NIXMLTypesHandler* handler = new NIXMLTypesHandler(myNetBuilder.getTypeCont()); @@ -79,9 +80,9 @@ if (oc.isSet("opendrive-files")) { files.push_back(opendriveTypemap); } - NITypeLoader::load(handler, files, "types", true); + ok &= NITypeLoader::load(handler, files, "types", true); } else { - NITypeLoader::load(handler, oc.getStringVector("type-files"), "types"); + ok &= NITypeLoader::load(handler, oc.getStringVector("type-files"), "types"); } // try to load height data so it is ready for use by other importers NBHeightMapper::loadIfSet(oc); @@ -106,7 +107,7 @@ if (oc.getBool("railway.signals.discard")) { myNetBuilder.getNodeCont().discardRailSignals(); } - loadXML(oc); + ok &= loadXML(oc); // check the loaded structures if (myNetBuilder.getNodeCont().size() == 0) { throw ProcessError("No nodes loaded."); @@ -117,6 +118,9 @@ if (!myNetBuilder.getEdgeCont().checkConsistency(myNetBuilder.getNodeCont())) { throw ProcessError(); } + if (!ok && !oc.getBool("ignore-errors")) { + throw ProcessError(); + } // report loaded structures WRITE_MESSAGE(" Import done:"); if (myNetBuilder.getDistrictCont().size() > 0) { diff -Nru sumo-1.11.0/src/netimport/NILoader.h sumo-1.12.0/src/netimport/NILoader.h --- sumo-1.11.0/src/netimport/NILoader.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NILoader.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NINavTeqHelper.cpp sumo-1.12.0/src/netimport/NINavTeqHelper.cpp --- sumo-1.11.0/src/netimport/NINavTeqHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NINavTeqHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NINavTeqHelper.h sumo-1.12.0/src/netimport/NINavTeqHelper.h --- sumo-1.11.0/src/netimport/NINavTeqHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NINavTeqHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NITypeLoader.cpp sumo-1.12.0/src/netimport/NITypeLoader.cpp --- sumo-1.11.0/src/netimport/NITypeLoader.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NITypeLoader.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NITypeLoader.h sumo-1.12.0/src/netimport/NITypeLoader.h --- sumo-1.11.0/src/netimport/NITypeLoader.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NITypeLoader.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIVisumTL.cpp sumo-1.12.0/src/netimport/NIVisumTL.cpp --- sumo-1.11.0/src/netimport/NIVisumTL.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIVisumTL.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2003-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2003-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIVisumTL.h sumo-1.12.0/src/netimport/NIVisumTL.h --- sumo-1.11.0/src/netimport/NIVisumTL.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIVisumTL.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIXMLConnectionsHandler.cpp sumo-1.12.0/src/netimport/NIXMLConnectionsHandler.cpp --- sumo-1.11.0/src/netimport/NIXMLConnectionsHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIXMLConnectionsHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIXMLConnectionsHandler.h sumo-1.12.0/src/netimport/NIXMLConnectionsHandler.h --- sumo-1.11.0/src/netimport/NIXMLConnectionsHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIXMLConnectionsHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIXMLEdgesHandler.cpp sumo-1.12.0/src/netimport/NIXMLEdgesHandler.cpp --- sumo-1.11.0/src/netimport/NIXMLEdgesHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIXMLEdgesHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIXMLEdgesHandler.h sumo-1.12.0/src/netimport/NIXMLEdgesHandler.h --- sumo-1.11.0/src/netimport/NIXMLEdgesHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIXMLEdgesHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIXMLNodesHandler.cpp sumo-1.12.0/src/netimport/NIXMLNodesHandler.cpp --- sumo-1.11.0/src/netimport/NIXMLNodesHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIXMLNodesHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIXMLNodesHandler.h sumo-1.12.0/src/netimport/NIXMLNodesHandler.h --- sumo-1.11.0/src/netimport/NIXMLNodesHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIXMLNodesHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIXMLPTHandler.cpp sumo-1.12.0/src/netimport/NIXMLPTHandler.cpp --- sumo-1.11.0/src/netimport/NIXMLPTHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIXMLPTHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIXMLPTHandler.h sumo-1.12.0/src/netimport/NIXMLPTHandler.h --- sumo-1.11.0/src/netimport/NIXMLPTHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIXMLPTHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIXMLShapeHandler.cpp sumo-1.12.0/src/netimport/NIXMLShapeHandler.cpp --- sumo-1.11.0/src/netimport/NIXMLShapeHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIXMLShapeHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIXMLShapeHandler.h sumo-1.12.0/src/netimport/NIXMLShapeHandler.h --- sumo-1.11.0/src/netimport/NIXMLShapeHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIXMLShapeHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIXMLTrafficLightsHandler.cpp sumo-1.12.0/src/netimport/NIXMLTrafficLightsHandler.cpp --- sumo-1.11.0/src/netimport/NIXMLTrafficLightsHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIXMLTrafficLightsHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2011-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIXMLTrafficLightsHandler.h sumo-1.12.0/src/netimport/NIXMLTrafficLightsHandler.h --- sumo-1.11.0/src/netimport/NIXMLTrafficLightsHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIXMLTrafficLightsHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIXMLTypesHandler.cpp sumo-1.12.0/src/netimport/NIXMLTypesHandler.cpp --- sumo-1.11.0/src/netimport/NIXMLTypesHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIXMLTypesHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/NIXMLTypesHandler.h sumo-1.12.0/src/netimport/NIXMLTypesHandler.h --- sumo-1.11.0/src/netimport/NIXMLTypesHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/NIXMLTypesHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/NIImporter_Vissim.cpp sumo-1.12.0/src/netimport/vissim/NIImporter_Vissim.cpp --- sumo-1.11.0/src/netimport/vissim/NIImporter_Vissim.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/NIImporter_Vissim.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/NIImporter_Vissim.h sumo-1.12.0/src/netimport/vissim/NIImporter_Vissim.h --- sumo-1.11.0/src/netimport/vissim/NIImporter_Vissim.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/NIImporter_Vissim.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/NIVissimElements.h sumo-1.12.0/src/netimport/vissim/NIVissimElements.h --- sumo-1.11.0/src/netimport/vissim/NIVissimElements.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/NIVissimElements.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimClosedLanesVector.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimClosedLanesVector.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimClosedLanesVector.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimClosedLanesVector.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimClosures.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimClosures.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimClosures.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimClosures.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimClosures.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimClosures.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimClosures.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimClosures.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimConflictArea.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimConflictArea.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimConflictArea.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimConflictArea.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimConflictArea.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimConflictArea.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimConflictArea.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimConflictArea.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimConnection.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimConnection.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimConnection.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimConnection.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimConnection.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimConnection.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimConnection.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimConnection.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimDisturbance.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimDisturbance.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimDisturbance.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimDisturbance.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimEdge.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimEdge.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimEdge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimEdge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimEdge.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimEdge.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePointVector.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePointVector.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePointVector.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePointVector.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeCluster.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeCluster.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeCluster.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeCluster.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeDef.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeDef.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeDef.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeDef.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeDef.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeDef.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeDef.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeDef.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdgeVector.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdgeVector.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdgeVector.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdgeVector.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimSource.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimSource.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimSource.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimSource.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimSource.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimSource.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimSource.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimSource.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimTL.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimTL.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimTL.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimTL.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimTL.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimTL.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimTL.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimTL.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimVehicleClass.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimVehicleClass.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimVehicleClass.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimVehicleClass.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimVehicleClass.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimVehicleClass.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimVehicleClass.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimVehicleClass.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimVehicleClassVector.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimVehicleClassVector.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimVehicleClassVector.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimVehicleClassVector.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimVehicleType.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimVehicleType.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimVehicleType.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimVehicleType.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimVehicleType.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimVehicleType.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimVehicleType.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimVehicleType.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.cpp sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.cpp --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.h sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.h --- sumo-1.11.0/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.cpp sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.cpp --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.h sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.h --- sumo-1.11.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netload/NLBuilder.cpp sumo-1.12.0/src/netload/NLBuilder.cpp --- sumo-1.11.0/src/netload/NLBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netload/NLBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -145,7 +145,7 @@ } } else { if (stateTime != string2time(myOptions.getString("begin"))) { - WRITE_WARNING("State was written at a different time " + time2string(stateTime) + " than the begin time " + myOptions.getString("begin") + "!"); + WRITE_WARNING("State was written at a different time=" + time2string(stateTime) + " than the begin time " + myOptions.getString("begin") + "!"); stateBeginMismatch = true; } } @@ -277,7 +277,17 @@ return nullptr; } SystemFrame::checkOptions(); - XMLSubSys::setValidation(oc.getString("xml-validation"), oc.getString("xml-validation.net"), oc.getString("xml-validation.routes")); + std::string validation = oc.getString("xml-validation"); + std::string routeValidation = oc.getString("xml-validation.routes"); + if (isLibsumo) { + if (oc.isDefault("xml-validation")) { + validation = "never"; + } + if (oc.isDefault("xml-validation.routes")) { + routeValidation = "never"; + } + } + XMLSubSys::setValidation(validation, oc.getString("xml-validation.net"), routeValidation); if (!MSFrame::checkOptions()) { throw ProcessError(); } diff -Nru sumo-1.11.0/src/netload/NLBuilder.h sumo-1.12.0/src/netload/NLBuilder.h --- sumo-1.11.0/src/netload/NLBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netload/NLBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netload/NLDetectorBuilder.cpp sumo-1.12.0/src/netload/NLDetectorBuilder.cpp --- sumo-1.11.0/src/netload/NLDetectorBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netload/NLDetectorBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -90,7 +90,7 @@ } -void +Parameterised* NLDetectorBuilder::buildInductLoop(const std::string& id, const std::string& lane, double pos, SUMOTime splInterval, const std::string& device, bool friendlyPos, @@ -99,15 +99,16 @@ // get and check the lane MSLane* clane = getLaneChecking(lane, SUMO_TAG_E1DETECTOR, id); // get and check the position - pos = getPositionChecking(pos, clane, friendlyPos, id); + pos = getPositionChecking(pos, clane, friendlyPos, SUMO_TAG_E1DETECTOR, id); // build the loop MSDetectorFileOutput* loop = createInductLoop(id, clane, pos, vTypes, detectPersons); // add the file output myNet.getDetectorControl().add(SUMO_TAG_INDUCTION_LOOP, loop, device, splInterval); + return loop; } -void +Parameterised* NLDetectorBuilder::buildInstantInductLoop(const std::string& id, const std::string& lane, double pos, const std::string& device, bool friendlyPos, @@ -115,15 +116,16 @@ // get and check the lane MSLane* clane = getLaneChecking(lane, SUMO_TAG_INSTANT_INDUCTION_LOOP, id); // get and check the position - pos = getPositionChecking(pos, clane, friendlyPos, id); + pos = getPositionChecking(pos, clane, friendlyPos, SUMO_TAG_INSTANT_INDUCTION_LOOP, id); // build the loop MSDetectorFileOutput* loop = createInstantInductLoop(id, clane, pos, device, vTypes); // add the file output myNet.getDetectorControl().add(SUMO_TAG_INSTANT_INDUCTION_LOOP, loop); + return loop; } -void +Parameterised* NLDetectorBuilder::buildE2Detector(const std::string& id, MSLane* lane, double pos, double endPos, double length, const std::string& device, SUMOTime frequency, SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, @@ -199,10 +201,11 @@ det = createE2Detector(id, DU_USER_DEFINED, lane, pos, endPos, length, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, vTypes, detectPersons, showDetector); myNet.getDetectorControl().add(SUMO_TAG_LANE_AREA_DETECTOR, det, device, frequency); } - + return det; } -void + +Parameterised* NLDetectorBuilder::buildE2Detector(const std::string& id, std::vector lanes, double pos, double endPos, const std::string& device, SUMOTime frequency, SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, @@ -277,12 +280,12 @@ det = createE2Detector(id, DU_USER_DEFINED, lanes, pos, endPos, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, vTypes, detectPersons, showDetector); myNet.getDetectorControl().add(SUMO_TAG_LANE_AREA_DETECTOR, det, device, frequency); } - + return det; } -void +Parameterised* NLDetectorBuilder::beginE3Detector(const std::string& id, const std::string& device, SUMOTime splInterval, double haltingSpeedThreshold, @@ -290,6 +293,7 @@ const std::string& vTypes, int detectPersons, bool openEntry) { checkSampleInterval(splInterval, SUMO_TAG_E3DETECTOR, id); myE3Definition = new E3DetectorDefinition(id, device, haltingSpeedThreshold, haltingTimeThreshold, splInterval, vTypes, detectPersons, openEntry); + return myE3Definition; } @@ -301,7 +305,7 @@ } MSLane* clane = getLaneChecking(lane, SUMO_TAG_E3DETECTOR, myE3Definition->myID); // get and check the position - pos = getPositionChecking(pos, clane, friendlyPos, myE3Definition->myID); + pos = getPositionChecking(pos, clane, friendlyPos, SUMO_TAG_DET_ENTRY, myE3Definition->myID); // build and save the entry myE3Definition->myEntries.push_back(MSCrossSection(clane, pos)); } @@ -315,7 +319,7 @@ } MSLane* clane = getLaneChecking(lane, SUMO_TAG_E3DETECTOR, myE3Definition->myID); // get and check the position - pos = getPositionChecking(pos, clane, friendlyPos, myE3Definition->myID); + pos = getPositionChecking(pos, clane, friendlyPos, SUMO_TAG_DET_EXIT, myE3Definition->myID); // build and save the exit myE3Definition->myExits.push_back(MSCrossSection(clane, pos)); } @@ -343,6 +347,7 @@ myE3Definition->myHaltingSpeedThreshold, myE3Definition->myHaltingTimeThreshold, myE3Definition->myVehicleTypes, myE3Definition->myDetectPersons, myE3Definition->myOpenEntry); + det->updateParameters(myE3Definition->getParametersMap()); // add to net myNet.getDetectorControl().add(SUMO_TAG_ENTRY_EXIT_DETECTOR, det, myE3Definition->myDevice, myE3Definition->mySampleInterval); } else @@ -427,6 +432,7 @@ double NLDetectorBuilder::getPositionChecking(double pos, MSLane* lane, bool friendlyPos, + SumoXMLTag tag, const std::string& detid) { // check whether it is given from the end if (pos < 0) { @@ -437,14 +443,14 @@ if (friendlyPos) { pos = lane->getLength(); } else { - throw InvalidArgument("The position of detector '" + detid + "' lies beyond the lane's '" + lane->getID() + "' end."); + throw InvalidArgument("The position of " + toString(tag) + " '" + detid + "' lies beyond the lane's '" + lane->getID() + "' end."); } } if (pos < 0) { if (friendlyPos) { pos = 0.; } else { - throw InvalidArgument("The position of detector '" + detid + "' lies before the lane's '" + lane->getID() + "' begin."); + throw InvalidArgument("The position of " + toString(tag) + " '" + detid + "' lies before the lane's '" + lane->getID() + "' begin."); } } return pos; diff -Nru sumo-1.11.0/src/netload/NLDetectorBuilder.h sumo-1.12.0/src/netload/NLDetectorBuilder.h --- sumo-1.11.0/src/netload/NLDetectorBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netload/NLDetectorBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -85,11 +85,12 @@ * @param[in] friendlyPos Whether the position information shall be used "friendly" (see user docs) * @param[in] vTypes which vehicle types are considered * @exception InvalidArgument If one of the values is invalid + * @return The created detector */ - void buildInductLoop(const std::string& id, - const std::string& lane, double pos, SUMOTime splInterval, - const std::string& device, bool friendlyPos, - const std::string& vTypes, int detectPersons); + Parameterised* buildInductLoop(const std::string& id, + const std::string& lane, double pos, SUMOTime splInterval, + const std::string& device, bool friendlyPos, + const std::string& vTypes, int detectPersons); /** @brief Builds an instantenous induction and adds it to the net @@ -106,11 +107,12 @@ * @param[in] device The output device the detector shall write into * @param[in] friendlyPos Whether the position information shall be used "friendly" (see user docs) * @exception InvalidArgument If one of the values is invalid + * @return The created detector */ - void buildInstantInductLoop(const std::string& id, - const std::string& lane, double pos, - const std::string& device, bool friendlyPos, - const std::string& vTypes); + Parameterised* buildInstantInductLoop(const std::string& id, + const std::string& lane, double pos, + const std::string& device, bool friendlyPos, + const std::string& vTypes); @@ -126,17 +128,17 @@ * @todo Add parameter showDetector to indicate whether the detector should be visible in the GUI * */ - void buildE2Detector(const std::string& id, MSLane* lane, double pos, double endPos, double length, - const std::string& device, SUMOTime frequency, - SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, - const std::string& vTypes, int detectPersons, bool friendlyPos, bool showDetector, - MSTLLogicControl::TLSLogicVariants* tlls = 0, MSLane* toLane = 0); - - void buildE2Detector(const std::string& id, std::vector lanes, double pos, double endPos, - const std::string& device, SUMOTime frequency, - SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, - const std::string& vTypes, int detectPersons, bool friendlyPos, bool showDetector, - MSTLLogicControl::TLSLogicVariants* tlls = 0, MSLane* toLane = 0); + Parameterised* buildE2Detector(const std::string& id, MSLane* lane, double pos, double endPos, double length, + const std::string& device, SUMOTime frequency, + SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, + const std::string& vTypes, int detectPersons, bool friendlyPos, bool showDetector, + MSTLLogicControl::TLSLogicVariants* tlls = 0, MSLane* toLane = 0); + + Parameterised* buildE2Detector(const std::string& id, std::vector lanes, double pos, double endPos, + const std::string& device, SUMOTime frequency, + SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, + const std::string& vTypes, int detectPersons, bool friendlyPos, bool showDetector, + MSTLLogicControl::TLSLogicVariants* tlls = 0, MSLane* toLane = 0); /** @brief Stores temporary the initial information about an e3 detector to build @@ -152,9 +154,9 @@ * @param[in] haltingSpeedThreshold Detector parameter: the speed a vehicle's speed must be below to be assigned as jammed * @exception InvalidArgument If one of the values is invalid */ - void beginE3Detector(const std::string& id, const std::string& device, SUMOTime splInterval, - double haltingSpeedThreshold, SUMOTime haltingTimeThreshold, - const std::string& vTypes, int detectPersons, bool openEntry); + Parameterised* beginE3Detector(const std::string& id, const std::string& device, SUMOTime splInterval, + double haltingSpeedThreshold, SUMOTime haltingTimeThreshold, + const std::string& vTypes, int detectPersons, bool openEntry); /** @brief Builds an entry point of an e3 detector @@ -346,32 +348,12 @@ /// @} - - /** @brief Builds an e2 detector that lies on only one lane - * - * @param[in] id The id the detector shall have - * @param[in] usage Information how the detector is used within the simulation - * @param[in] lane The lane the detector is placed at - * @param[in] pos The position on the lane the detector is placed at - * @param[in] length The length the detector has - * @param[in] haltingTimeThreshold Detector parameter: the time a vehicle's speed must be below haltingSpeedThreshold to be assigned as jammed - * @param[in] haltingSpeedThreshold Detector parameter: the speed a vehicle's speed must be below to be assigned as jammed - * @param[in] jamDistThreshold Detector parameter: the distance between two vehicles in order to not count them to one jam - * @todo Check whether this method is really needful - */ - MSE2Collector* buildSingleLaneE2Det(const std::string& id, - DetectorUsage usage, MSLane* lane, double pos, double length, - SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, - double jamDistThreshold, - const std::string& vTypes); - - protected: /** * @class E3DetectorDefinition * @brief Holds the incoming definitions of an e3 detector unless the detector is build. */ - class E3DetectorDefinition { + class E3DetectorDefinition : public Parameterised { public: /** @brief Constructor * @param[in] id The id the detector shall have @@ -386,7 +368,7 @@ const std::string& vTypes, int detectPersons, bool openEntry); /// @brief Destructor - ~E3DetectorDefinition(); + virtual ~E3DetectorDefinition(); /// @brief The id of the detector const std::string myID; @@ -438,6 +420,7 @@ * @exception InvalidArgument If the defined position is invalid */ double getPositionChecking(double pos, MSLane* lane, bool friendlyPos, + SumoXMLTag tag, const std::string& detid); diff -Nru sumo-1.11.0/src/netload/NLDiscreteEventBuilder.cpp sumo-1.12.0/src/netload/NLDiscreteEventBuilder.cpp --- sumo-1.11.0/src/netload/NLDiscreteEventBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netload/NLDiscreteEventBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netload/NLDiscreteEventBuilder.h sumo-1.12.0/src/netload/NLDiscreteEventBuilder.h --- sumo-1.11.0/src/netload/NLDiscreteEventBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netload/NLDiscreteEventBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netload/NLEdgeControlBuilder.cpp sumo-1.12.0/src/netload/NLEdgeControlBuilder.cpp --- sumo-1.11.0/src/netload/NLEdgeControlBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netload/NLEdgeControlBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -33,6 +33,7 @@ #include #include #include +#include #include "NLBuilder.h" #include "NLEdgeControlBuilder.h" #include @@ -178,6 +179,9 @@ MSEdgeControl* NLEdgeControlBuilder::build(double networkVersion) { + if (MSGlobals::gUseMesoSim && !OptionsCont::getOptions().getBool("meso-lane-queue")) { + MSEdge::setMesoIgnoredVClasses(parseVehicleClasses(OptionsCont::getOptions().getStringVector("meso-ignore-lanes-by-vclass"))); + } for (MSEdgeVector::iterator i1 = myEdges.begin(); i1 != myEdges.end(); i1++) { (*i1)->closeBuilding(); } diff -Nru sumo-1.11.0/src/netload/NLEdgeControlBuilder.h sumo-1.12.0/src/netload/NLEdgeControlBuilder.h --- sumo-1.11.0/src/netload/NLEdgeControlBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netload/NLEdgeControlBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netload/NLHandler.cpp sumo-1.12.0/src/netload/NLHandler.cpp --- sumo-1.11.0/src/netload/NLHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netload/NLHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -114,6 +115,9 @@ case SUMO_TAG_PHASE: addPhase(attrs); break; + case SUMO_TAG_CONDITION: + addCondition(attrs); + break; case SUMO_TAG_CONNECTION: addConnection(attrs); break; @@ -278,6 +282,7 @@ break; } } catch (InvalidArgument& e) { + myCurrentIsBroken = true; WRITE_ERROR(e.what()); } MSRouteHandler::myStartElement(element, attrs); @@ -326,9 +331,21 @@ case SUMO_TAG_RAILSIGNAL_CONSTRAINTS: myConstrainedSignal = nullptr; break; + case SUMO_TAG_E1DETECTOR: + case SUMO_TAG_INDUCTION_LOOP: + case SUMO_TAG_INSTANT_INDUCTION_LOOP: + case SUMO_TAG_E2DETECTOR: + case SUMO_TAG_LANE_AREA_DETECTOR: + if (!myCurrentIsBroken) { + myLastParameterised.pop_back(); + } + break; case SUMO_TAG_E3DETECTOR: case SUMO_TAG_ENTRY_EXIT_DETECTOR: endE3Detector(); + if (!myCurrentIsBroken) { + myLastParameterised.pop_back(); + } break; case SUMO_TAG_PARKING_AREA: myTriggerBuilder.endParkingArea(); @@ -767,110 +784,101 @@ NLHandler::addPhase(const SUMOSAXAttributes& attrs) { // try to get the phase definition bool ok = true; - std::string state = attrs.get(SUMO_ATTR_STATE, nullptr, ok); - if (!ok) { - return; - } - // try to get the phase duration + const std::string& id = myJunctionControlBuilder.getActiveKey(); + const SUMOTime tDefault = MSPhaseDefinition::UNSPECIFIED_DURATION; + const SUMOTime duration = attrs.getSUMOTimeReporting(SUMO_ATTR_DURATION, myJunctionControlBuilder.getActiveKey().c_str(), ok); + const std::string state = attrs.get(SUMO_ATTR_STATE, nullptr, ok); if (duration == 0) { WRITE_ERROR("Duration of phase " + toString(myJunctionControlBuilder.getNumberOfLoadedPhases()) + " for tlLogic '" + myJunctionControlBuilder.getActiveKey() + "' program '" + myJunctionControlBuilder.getActiveSubKey() + "' is zero."); return; } + if (!ok) { + return; + } + MSPhaseDefinition* phase = new MSPhaseDefinition(duration, state); + // if the traffic light is an actuated traffic light, try to get // the minimum and maximum durations - const SUMOTime minDuration = attrs.getOptSUMOTimeReporting( - SUMO_ATTR_MINDURATION, myJunctionControlBuilder.getActiveKey().c_str(), ok, duration); - const SUMOTime maxDuration = attrs.getOptSUMOTimeReporting( - SUMO_ATTR_MAXDURATION, myJunctionControlBuilder.getActiveKey().c_str(), ok, duration); - - - const std::vector nextPhases = attrs.getOptIntVector(SUMO_ATTR_NEXT, nullptr, ok); - const std::string name = attrs.getOpt(SUMO_ATTR_NAME, nullptr, ok, ""); - - SUMOTime vehextTime = attrs.getOptSUMOTimeReporting( - SUMO_ATTR_VEHICLEEXTENSION, myJunctionControlBuilder.getActiveKey().c_str(), ok, string2time("999")); - SUMOTime yellowTime = attrs.getOptSUMOTimeReporting( - SUMO_ATTR_YELLOW, myJunctionControlBuilder.getActiveKey().c_str(), ok, string2time("999")); - SUMOTime redTime = attrs.getOptSUMOTimeReporting( - SUMO_ATTR_RED, myJunctionControlBuilder.getActiveKey().c_str(), ok, string2time("999")); - if (vehextTime != string2time("999")) { - myJunctionControlBuilder.addPhase(duration, state, nextPhases, minDuration, maxDuration, name, vehextTime, yellowTime, redTime); - } else { + phase->minDuration = attrs.getOptSUMOTimeReporting(SUMO_ATTR_MINDURATION, id.c_str(), ok, duration); + phase->maxDuration = attrs.getOptSUMOTimeReporting(SUMO_ATTR_MAXDURATION, id.c_str(), ok, duration); + phase->earliestEnd = attrs.getOptSUMOTimeReporting(SUMO_ATTR_EARLIEST_END, id.c_str(), ok, tDefault); + phase->latestEnd = attrs.getOptSUMOTimeReporting(SUMO_ATTR_LATEST_END, id.c_str(), ok, tDefault); + phase->nextPhases = attrs.getOptIntVector(SUMO_ATTR_NEXT, id.c_str(), ok); + phase->earlyTarget = attrs.getOpt(SUMO_ATTR_EARLY_TARGET, id.c_str(), ok, ""); + phase->finalTarget = attrs.getOpt(SUMO_ATTR_FINAL_TARGET, id.c_str(), ok, ""); + phase->name = attrs.getOpt(SUMO_ATTR_NAME, id.c_str(), ok, ""); + + phase->vehext = attrs.getOptSUMOTimeReporting(SUMO_ATTR_VEHICLEEXTENSION, id.c_str(), ok, tDefault); + phase->yellow = attrs.getOptSUMOTimeReporting(SUMO_ATTR_YELLOW, id.c_str(), ok, tDefault); + phase->red = attrs.getOptSUMOTimeReporting(SUMO_ATTR_RED, id.c_str(), ok, tDefault); + + if (attrs.hasAttribute(SUMO_ATTR_TYPE)) { //SOTL attributes //If the type attribute is not present, the parsed phase is of type "undefined" (MSPhaseDefinition constructor), //in this way SOTL traffic light logic can recognize the phase as unsuitable or decides other //behaviors. See SOTL traffic light logic implementations. - if (attrs.hasAttribute(SUMO_ATTR_TYPE)) { - std::string phaseTypeString; - bool transient_notdecisional_bit; - bool commit_bit; - std::vector laneIdVector; + std::string phaseTypeString; + try { + phaseTypeString = attrs.get(SUMO_ATTR_TYPE, id.c_str(), ok, false); + } catch (EmptyData&) { + MsgHandler::getWarningInstance()->inform("Empty type definition. Assuming phase type as SUMOSOTL_TagAttrDefinitions::SOTL_ATTL_TYPE_TRANSIENT"); + phase->myTransientNotDecisional = false; + } + if (phaseTypeString.find("decisional") != std::string::npos) { + phase->myTransientNotDecisional = false; + } else if (phaseTypeString.find("transient") != std::string::npos) { + phase->myTransientNotDecisional = true; + } else { + MsgHandler::getWarningInstance()->inform("SOTL_ATTL_TYPE_DECISIONAL nor SOTL_ATTL_TYPE_TRANSIENT. Assuming phase type as SUMOSOTL_TagAttrDefinitions::SOTL_ATTL_TYPE_TRANSIENT"); + phase->myTransientNotDecisional = false; + } + phase->myCommit = (phaseTypeString.find("commit") != std::string::npos); + + if (phaseTypeString.find("target") != std::string::npos) { + std::string delimiter(" ,;"); + //Phase declared as target, getting targetLanes attribute try { - phaseTypeString = attrs.get(SUMO_ATTR_TYPE, "phase", ok, false); + phase->myTargetLaneSet = StringTokenizer(attrs.getStringSecure(SUMO_ATTR_TARGETLANE, ""), " ,;", true).getVector(); } catch (EmptyData&) { - MsgHandler::getWarningInstance()->inform("Empty type definition. Assuming phase type as SUMOSOTL_TagAttrDefinitions::SOTL_ATTL_TYPE_TRANSIENT"); - transient_notdecisional_bit = false; - } - if (phaseTypeString.find("decisional") != std::string::npos) { - transient_notdecisional_bit = false; - } else if (phaseTypeString.find("transient") != std::string::npos) { - transient_notdecisional_bit = true; - } else { - MsgHandler::getWarningInstance()->inform("SOTL_ATTL_TYPE_DECISIONAL nor SOTL_ATTL_TYPE_TRANSIENT. Assuming phase type as SUMOSOTL_TagAttrDefinitions::SOTL_ATTL_TYPE_TRANSIENT"); - transient_notdecisional_bit = false; - } - commit_bit = (phaseTypeString.find("commit") != std::string::npos); - - if (phaseTypeString.find("target") != std::string::npos) { - std::string delimiter(" ,;"); - //Phase declared as target, getting targetLanes attribute - try { - /// @todo: the following should be moved to StringTok - std::string targetLanesString = attrs.getStringSecure(SUMO_ATTR_TARGETLANE, ""); - //TOKENIZING - std::vector targetLanesVector; - //Skip delimiters at the beginning - std::string::size_type firstPos = targetLanesString.find_first_not_of(delimiter, 0); - //Find first "non-delimiter". - std::string::size_type pos = targetLanesString.find_first_of(delimiter, firstPos); - - while (std::string::npos != pos || std::string::npos != firstPos) { - //Found a token, add it to the vector - targetLanesVector.push_back(targetLanesString.substr(firstPos, pos - firstPos)); - - //Skip delimiters - firstPos = targetLanesString.find_first_not_of(delimiter, pos); - - //Find next "non-delimiter" - pos = targetLanesString.find_first_of(delimiter, firstPos); - } - //Adding the SOTL parsed phase to have a new MSPhaseDefinition that is SOTL compliant for target phases - myJunctionControlBuilder.addPhase(duration, state, nextPhases, minDuration, maxDuration, name, transient_notdecisional_bit, commit_bit, &targetLanesVector); - } catch (EmptyData&) { - MsgHandler::getErrorInstance()->inform("Missing targetLane definition for the target phase."); - return; - } - } else { - //Adding the SOTL parsed phase to have a new MSPhaseDefinition that is SOTL compliant for non target phases - myJunctionControlBuilder.addPhase(duration, state, nextPhases, minDuration, maxDuration, name, transient_notdecisional_bit, commit_bit); + MsgHandler::getErrorInstance()->inform("Missing targetLane definition for the target phase."); + delete phase; + return; } - } else { - //Adding the standard parsed phase to have a new MSPhaseDefinition - myJunctionControlBuilder.addPhase(duration, state, nextPhases, minDuration, maxDuration, name); } } + + if (phase->maxDuration < phase->minDuration) { + WRITE_WARNINGF("maxDur % should not be smaller than minDir % in phase of tlLogic %", phase->maxDuration, phase->minDuration, id); + phase->maxDuration = phase->duration; + } + + phase->myLastSwitch = string2time(OptionsCont::getOptions().getString("begin")) - 1; // SUMOTime-option + myJunctionControlBuilder.addPhase(phase); +} + + +void +NLHandler::addCondition(const SUMOSAXAttributes& attrs) { + bool ok = true; + const std::string id = attrs.get(SUMO_ATTR_ID, nullptr, ok); + const std::string value = attrs.get(SUMO_ATTR_VALUE, id.c_str(), ok); + if (!myJunctionControlBuilder.addCondition(id, value)) { + WRITE_ERROR("Duplicate condition '" + id + "' in tlLogic '" + myJunctionControlBuilder.getActiveKey() + "'"); + } } void NLHandler::addE1Detector(const SUMOSAXAttributes& attrs) { + myCurrentIsBroken = false; bool ok = true; // get the id, report an error if not given or empty... - std::string id = attrs.get(SUMO_ATTR_ID, nullptr, ok); + const std::string id = attrs.get(SUMO_ATTR_ID, nullptr, ok); if (!ok) { + myCurrentIsBroken = true; return; } const SUMOTime frequency = attrs.getSUMOTimeReporting(SUMO_ATTR_FREQUENCY, id.c_str(), ok); @@ -886,19 +894,24 @@ detectPersons |= (int)SUMOXMLDefinitions::PersonModeValues.get(mode); } else { WRITE_ERROR("Invalid person mode '" + mode + "' in E1 detector definition '" + id + "'"); + myCurrentIsBroken = true; return; } } if (!ok) { + myCurrentIsBroken = true; return; } try { - myDetectorBuilder.buildInductLoop(id, lane, position, frequency, - FileHelpers::checkForRelativity(file, getFileName()), - friendlyPos, vTypes, detectPersons); + Parameterised* det = myDetectorBuilder.buildInductLoop(id, lane, position, frequency, + FileHelpers::checkForRelativity(file, getFileName()), + friendlyPos, vTypes, detectPersons); + myLastParameterised.push_back(det); } catch (InvalidArgument& e) { + myCurrentIsBroken = true; WRITE_ERROR(e.what()); } catch (IOError& e) { + myCurrentIsBroken = true; WRITE_ERROR(e.what()); } } @@ -906,10 +919,12 @@ void NLHandler::addInstantE1Detector(const SUMOSAXAttributes& attrs) { + myCurrentIsBroken = false; bool ok = true; // get the id, report an error if not given or empty... std::string id = attrs.get(SUMO_ATTR_ID, nullptr, ok); if (!ok) { + myCurrentIsBroken = true; return; } const double position = attrs.get(SUMO_ATTR_POSITION, id.c_str(), ok); @@ -918,15 +933,18 @@ const std::string file = attrs.get(SUMO_ATTR_FILE, id.c_str(), ok); const std::string vTypes = attrs.getOpt(SUMO_ATTR_VTYPES, id.c_str(), ok, ""); if (!ok) { + myCurrentIsBroken = true; return; } try { - myDetectorBuilder.buildInstantInductLoop(id, lane, position, FileHelpers::checkForRelativity(file, getFileName()), friendlyPos, vTypes); + Parameterised* det = myDetectorBuilder.buildInstantInductLoop(id, lane, position, FileHelpers::checkForRelativity(file, getFileName()), friendlyPos, vTypes); + myLastParameterised.push_back(det); } catch (InvalidArgument& e) { WRITE_ERROR(e.what()); } catch (IOError& e) { WRITE_ERROR(e.what()); } + myCurrentIsBroken = true; } @@ -977,7 +995,7 @@ void NLHandler::addE2Detector(const SUMOSAXAttributes& attrs) { - + myCurrentIsBroken = false; // check whether this is a detector connected to a tls and optionally to a link bool ok = true; const std::string id = attrs.get(SUMO_ATTR_ID, nullptr, ok); @@ -1007,10 +1025,12 @@ detectPersons |= (int)SUMOXMLDefinitions::PersonModeValues.get(mode); } else { WRITE_ERROR("Invalid person mode '" + mode + "' in E2 detector definition '" + id + "'"); + myCurrentIsBroken = true; return; } } if (!ok) { + myCurrentIsBroken = true; return; } @@ -1117,6 +1137,7 @@ if (!lsaGiven) { frequency = attrs.getSUMOTimeReporting(SUMO_ATTR_FREQUENCY, id.c_str(), ok); if (!ok) { + myCurrentIsBroken = true; return; } } else { @@ -1150,26 +1171,28 @@ WRITE_ERROR(e.what()); } + Parameterised* det; // Build detector if (lanesGiven) { // specification by a lane sequence - myDetectorBuilder.buildE2Detector(id, clanes, position, endPosition, filename, frequency, - haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, - vTypes, detectPersons, friendlyPos, showDetector, - tlls, cToLane); + det = myDetectorBuilder.buildE2Detector(id, clanes, position, endPosition, filename, frequency, + haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, + vTypes, detectPersons, friendlyPos, showDetector, + tlls, cToLane); } else { // specification by start or end lane - myDetectorBuilder.buildE2Detector(id, clane, position, endPosition, length, filename, frequency, - haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, - vTypes, detectPersons, friendlyPos, showDetector, - tlls, cToLane); + det = myDetectorBuilder.buildE2Detector(id, clane, position, endPosition, length, filename, frequency, + haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, + vTypes, detectPersons, friendlyPos, showDetector, + tlls, cToLane); } - + myLastParameterised.push_back(det); } void NLHandler::beginE3Detector(const SUMOSAXAttributes& attrs) { + myCurrentIsBroken = false; bool ok = true; std::string id = attrs.get(SUMO_ATTR_ID, nullptr, ok); const SUMOTime frequency = attrs.getSUMOTimeReporting(SUMO_ATTR_FREQUENCY, id.c_str(), ok); @@ -1185,19 +1208,24 @@ detectPersons |= (int)SUMOXMLDefinitions::PersonModeValues.get(mode); } else { WRITE_ERROR("Invalid person mode '" + mode + "' in E3 detector definition '" + id + "'"); + myCurrentIsBroken = true; return; } } if (!ok) { + myCurrentIsBroken = true; return; } try { - myDetectorBuilder.beginE3Detector(id, - FileHelpers::checkForRelativity(file, getFileName()), - frequency, haltingSpeedThreshold, haltingTimeThreshold, vTypes, detectPersons, openEntry); + Parameterised* det = myDetectorBuilder.beginE3Detector(id, + FileHelpers::checkForRelativity(file, getFileName()), + frequency, haltingSpeedThreshold, haltingTimeThreshold, vTypes, detectPersons, openEntry); + myLastParameterised.push_back(det); } catch (InvalidArgument& e) { + myCurrentIsBroken = true; WRITE_ERROR(e.what()); } catch (IOError& e) { + myCurrentIsBroken = true; WRITE_ERROR(e.what()); } } @@ -1525,7 +1553,7 @@ void NLHandler::addMesoEdgeType(const SUMOSAXAttributes& attrs) { bool ok = true; - MSNet::MesoEdgeType edgeType = myNet.getMesoType(""); // init defaults + MESegment::MesoEdgeType edgeType = myNet.getMesoType(""); // init defaults edgeType.tauff = attrs.getOptSUMOTimeReporting(SUMO_ATTR_MESO_TAUFF, myCurrentTypeID.c_str(), ok, edgeType.tauff); edgeType.taufj = attrs.getOptSUMOTimeReporting(SUMO_ATTR_MESO_TAUFJ, myCurrentTypeID.c_str(), ok, edgeType.taufj); edgeType.taujf = attrs.getOptSUMOTimeReporting(SUMO_ATTR_MESO_TAUJF, myCurrentTypeID.c_str(), ok, edgeType.taujf); diff -Nru sumo-1.11.0/src/netload/NLHandler.h sumo-1.12.0/src/netload/NLHandler.h --- sumo-1.11.0/src/netload/NLHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netload/NLHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -242,6 +242,8 @@ /// adds a phase to the traffic lights logic currently build void addPhase(const SUMOSAXAttributes& attrs); + /// adds a switching condition to the traffic lights logic currently build + void addCondition(const SUMOSAXAttributes& attrs); /// opens a junction for processing virtual void openJunction(const SUMOSAXAttributes& attrs); diff -Nru sumo-1.11.0/src/netload/NLJunctionControlBuilder.cpp sumo-1.12.0/src/netload/NLJunctionControlBuilder.cpp --- sumo-1.11.0/src/netload/NLJunctionControlBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netload/NLJunctionControlBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -294,25 +294,26 @@ // @note it is unclear how to apply the given offset in the context // of variable-length phases tlLogic = new MSActuatedTrafficLightLogic(getTLLogicControlToUse(), - myActiveKey, myActiveProgram, + myActiveKey, myActiveProgram, myOffset, myActivePhases, step, (*i)->minDuration + myNet.getCurrentTimeStep(), - myAdditionalParameter, basePath); + myAdditionalParameter, basePath, myActiveConditions); break; case TrafficLightType::NEMA: tlLogic = new NEMALogic(getTLLogicControlToUse(), - myActiveKey, myActiveProgram, + myActiveKey, myActiveProgram, myOffset, myActivePhases, step, (*i)->minDuration + myNet.getCurrentTimeStep(), myAdditionalParameter, basePath); break; case TrafficLightType::DELAYBASED: tlLogic = new MSDelayBasedTrafficLightLogic(getTLLogicControlToUse(), - myActiveKey, myActiveProgram, + myActiveKey, myActiveProgram, myOffset, myActivePhases, step, (*i)->minDuration + myNet.getCurrentTimeStep(), myAdditionalParameter, basePath); break; case TrafficLightType::STATIC: tlLogic = new MSSimpleTrafficLightLogic(getTLLogicControlToUse(), - myActiveKey, myActiveProgram, TrafficLightType::STATIC, + myActiveKey, myActiveProgram, myOffset, + TrafficLightType::STATIC, myActivePhases, step, firstEventOffset, myAdditionalParameter); break; @@ -409,6 +410,7 @@ myActiveKey = id; myActiveProgram = programID; myActivePhases.clear(); + myActiveConditions.clear(); myAbsDuration = 0; myRequestSize = NO_REQUEST_SIZE; myLogicType = type; @@ -418,31 +420,22 @@ void -NLJunctionControlBuilder::addPhase(SUMOTime duration, const std::string& state, const std::vector& nextPhases, SUMOTime minDuration, SUMOTime maxDuration, const std::string& name, bool transient_notdecisional, bool commit, std::vector* targetLanes) { +NLJunctionControlBuilder::addPhase(MSPhaseDefinition* phase) { // build and add the phase definition to the list - myActivePhases.push_back(new MSPhaseDefinition(duration, state, minDuration, maxDuration, nextPhases, name, transient_notdecisional, commit, targetLanes)); + myActivePhases.push_back(phase); // add phase duration to the absolute duration - myAbsDuration += duration; + myAbsDuration += phase->duration; } -void -NLJunctionControlBuilder::addPhase(SUMOTime duration, const std::string& state, const std::vector& nextPhases, - SUMOTime minDuration, SUMOTime maxDuration, const std::string& name) { - // build and add the phase definition to the list - myActivePhases.push_back(new MSPhaseDefinition(duration, state, minDuration, maxDuration, nextPhases, name)); - // add phase duration to the absolute duration - myAbsDuration += duration; -} - -void -NLJunctionControlBuilder::addPhase(SUMOTime duration, const std::string& state, const std::vector& nextPhases, - SUMOTime minDuration, SUMOTime maxDuration, const std::string& name, - SUMOTime vehextTime, SUMOTime yellowTime, SUMOTime redTime) { - // build and add the phase definition to the list - myActivePhases.push_back(new MSPhaseDefinition(duration, state, minDuration, maxDuration, vehextTime, redTime, yellowTime, nextPhases, name)); - // add phase duration to the absolute duration - myAbsDuration += duration; +bool +NLJunctionControlBuilder::addCondition(const std::string& id, const std::string& value) { + if (myActiveConditions.count(id) == 0) { + myActiveConditions[id] = value; + return true; + } else { + return false; + } } void diff -Nru sumo-1.11.0/src/netload/NLJunctionControlBuilder.h sumo-1.12.0/src/netload/NLJunctionControlBuilder.h --- sumo-1.11.0/src/netload/NLJunctionControlBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netload/NLJunctionControlBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -164,30 +164,16 @@ /** @brief Adds a phase to the currently built traffic lights logic * - * @param[in] duration The duration of the phase - * @param[in] state The state of the tls - * @param[in] min The minimum duration of the phase - * @param[in] max The maximum duration of the phase - * @todo min/max is used only by one junction type. Recheck - * @todo min/max: maybe only one type of a phase definition should be built + * @param[in] phase The new phase */ - void addPhase(SUMOTime duration, const std::string& state, const std::vector& nextPhases, - SUMOTime min, SUMOTime max, const std::string& name); + void addPhase(MSPhaseDefinition* phase); - /** @brief Adds a phase to the currently built traffic lights logic + /** @brief Adds a condition to the currently built traffic lights logic * - * @param[in] duration The duration of the phase - * @param[in] state The state of the tls - * @param[in] minDuration The minimum duration of the phase - * @param[in] maxDuration The maximum duration of the phase - * @param[in] transient_notdecisional Specifies if this is a transient phase (true) or a decisional one (false) - * @param[in] commit Specifies if this is a commit phase - * @param[in] targetLanes A reference to the vector containing targeted sensor lanes for this phase, given by lane id + * @param[in] id the condition id + * @param[in] value the condition expression */ - void addPhase(SUMOTime duration, const std::string& state, const std::vector& nextPhases, SUMOTime minDuration, SUMOTime maxDuration, const std::string& name, bool transient_notdecisional, bool commit, std::vector* targetLanes = nullptr); - - //for NEMA compliant phase - void addPhase(SUMOTime duration, const std::string& state, const std::vector& nextPhases, SUMOTime minDuration, SUMOTime maxDuration, const std::string& name, SUMOTime vehextTime, SUMOTime yellowTime, SUMOTime redTime); + bool addCondition(const std::string& id, const std::string& value); /** @brief Returns a previously build tls logic * @@ -350,6 +336,9 @@ /// @brief The current phase definitions for a simple traffic light MSSimpleTrafficLightLogic::Phases myActivePhases; + /// @brief The current switching conditions for an actuated traffic light + std::map myActiveConditions; + /// @brief The size of the request int myRequestSize; diff -Nru sumo-1.11.0/src/netload/NLTriggerBuilder.cpp sumo-1.12.0/src/netload/NLTriggerBuilder.cpp --- sumo-1.11.0/src/netload/NLTriggerBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netload/NLTriggerBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netload/NLTriggerBuilder.h sumo-1.12.0/src/netload/NLTriggerBuilder.h --- sumo-1.11.0/src/netload/NLTriggerBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netload/NLTriggerBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/netwrite/NWFrame.cpp sumo-1.12.0/src/netwrite/NWFrame.cpp --- sumo-1.11.0/src/netwrite/NWFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netwrite/NWFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netwrite/NWFrame.h sumo-1.12.0/src/netwrite/NWFrame.h --- sumo-1.11.0/src/netwrite/NWFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netwrite/NWFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netwrite/NWWriter_Amitran.cpp sumo-1.12.0/src/netwrite/NWWriter_Amitran.cpp --- sumo-1.11.0/src/netwrite/NWWriter_Amitran.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netwrite/NWWriter_Amitran.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/netwrite/NWWriter_Amitran.h sumo-1.12.0/src/netwrite/NWWriter_Amitran.h --- sumo-1.11.0/src/netwrite/NWWriter_Amitran.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netwrite/NWWriter_Amitran.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/netwrite/NWWriter_DlrNavteq.cpp sumo-1.12.0/src/netwrite/NWWriter_DlrNavteq.cpp --- sumo-1.11.0/src/netwrite/NWWriter_DlrNavteq.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netwrite/NWWriter_DlrNavteq.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/netwrite/NWWriter_DlrNavteq.h sumo-1.12.0/src/netwrite/NWWriter_DlrNavteq.h --- sumo-1.11.0/src/netwrite/NWWriter_DlrNavteq.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netwrite/NWWriter_DlrNavteq.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/netwrite/NWWriter_MATSim.cpp sumo-1.12.0/src/netwrite/NWWriter_MATSim.cpp --- sumo-1.11.0/src/netwrite/NWWriter_MATSim.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netwrite/NWWriter_MATSim.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netwrite/NWWriter_MATSim.h sumo-1.12.0/src/netwrite/NWWriter_MATSim.h --- sumo-1.11.0/src/netwrite/NWWriter_MATSim.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netwrite/NWWriter_MATSim.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netwrite/NWWriter_OpenDrive.cpp sumo-1.12.0/src/netwrite/NWWriter_OpenDrive.cpp --- sumo-1.11.0/src/netwrite/NWWriter_OpenDrive.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netwrite/NWWriter_OpenDrive.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2011-2022 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/ @@ -88,20 +88,24 @@ device.writeAttr("maxJunc", nc.size()); device.writeAttr("maxPrg", 0); */ - device.closeTag(); // write optional geo reference const GeoConvHelper& gch = GeoConvHelper::getFinal(); if (gch.usingGeoProjection()) { - if (gch.getOffsetBase() == Position(0, 0)) { - device.openTag("geoReference"); - device.writePreformattedTag(" \n"); + device.openTag("geoReference"); + device.writePreformattedTag(" \n"); + device.closeTag(); + if (gch.getOffsetBase() != Position(0, 0)) { + device.openTag("offset"); + device.writeAttr("x", gch.getOffsetBase().x()); + device.writeAttr("y", gch.getOffsetBase().y()); + device.writeAttr("z", gch.getOffsetBase().z()); + device.writeAttr("hdg", 0); device.closeTag(); - } else { - WRITE_WARNING("Could not write OpenDRIVE geoReference. Only unshifted Coordinate systems are supported (offset=" + toString(gch.getOffsetBase()) + ")"); } } + device.closeTag(); // write normal edges (road) for (std::map::const_iterator i = ec.begin(); i != ec.end(); ++i) { @@ -431,7 +435,9 @@ device << " \n"; writeEmptyCenterLane(device, centerMark, 0); device << " \n"; + int toIndexInternal = 0; for (int j = (int)parallel.size(); --j >= 0;) { + toIndexInternal--; const NBEdge::Connection& c = parallel[j]; const int fromIndex = c.fromLane - inEdge->getNumLanes(); const int toIndex = c.toLane - outEdge->getNumLanes(); @@ -466,7 +472,7 @@ device << " \n"; device << " \n"; - junctionDevice << " \n"; + junctionDevice << " \n"; connectionID++; } device << " \n"; diff -Nru sumo-1.11.0/src/netwrite/NWWriter_OpenDrive.h sumo-1.12.0/src/netwrite/NWWriter_OpenDrive.h --- sumo-1.11.0/src/netwrite/NWWriter_OpenDrive.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netwrite/NWWriter_OpenDrive.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netwrite/NWWriter_SUMO.cpp sumo-1.12.0/src/netwrite/NWWriter_SUMO.cpp --- sumo-1.11.0/src/netwrite/NWWriter_SUMO.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netwrite/NWWriter_SUMO.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -101,6 +101,9 @@ if (oc.exists("junctions.higher-speed") && oc.getBool("junctions.higher-speed")) { attrs[SUMO_ATTR_HIGHER_SPEED] = toString(oc.getBool("junctions.higher-speed")); } + if (oc.exists("internal-junctions.vehicle-width") && !oc.isDefault("internal-junctions.vehicle-width")) { + attrs[SUMO_ATTR_INTERNAL_JUNCTIONS_VEHICLE_WIDTH] = toString(oc.getFloat("internal-junctions.vehicle-width")); + } device.writeXMLHeader("net", "net_file.xsd", attrs); // street names may contain non-ascii chars device.lf(); // get involved container @@ -811,8 +814,8 @@ linkIndex2 = c.tlLinkIndex2; tlID = c.tlID; } - writeInternalConnection(into, c.id, c.toEdge->getID(), c.internalLaneIndex, c.toLane, c.viaID + "_0", dir, tlID, linkIndex2, c.visibility); - writeInternalConnection(into, c.viaID, c.toEdge->getID(), 0, c.toLane, "", dir); + writeInternalConnection(into, c.id, c.toEdge->getID(), c.internalLaneIndex, c.toLane, c.viaID + "_0", dir, tlID, linkIndex2, false, c.visibility); + writeInternalConnection(into, c.viaID, c.toEdge->getID(), 0, c.toLane, "", dir, "", NBConnection::InvalidTlIndex, n.brakeForCrossingOnExit(c.toEdge)); } else { // no internal split writeInternalConnection(into, c.id, c.toEdge->getID(), c.internalLaneIndex, c.toLane, "", dir); @@ -828,7 +831,9 @@ NWWriter_SUMO::writeInternalConnection(OutputDevice& into, const std::string& from, const std::string& to, int fromLane, int toLane, const std::string& via, - LinkDirection dir, const std::string& tlID, int linkIndex, + LinkDirection dir, + const std::string& tlID, int linkIndex, + bool minor, double visibility) { into.openTag(SUMO_TAG_CONNECTION); into.writeAttr(SUMO_ATTR_FROM, from); @@ -844,7 +849,7 @@ into.writeAttr(SUMO_ATTR_TLLINKINDEX, linkIndex); } into.writeAttr(SUMO_ATTR_DIR, dir); - into.writeAttr(SUMO_ATTR_STATE, (via != "" ? "m" : "M")); + into.writeAttr(SUMO_ATTR_STATE, ((via != "" || minor) ? "m" : "M")); if (visibility != NBEdge::UNSPECIFIED_VISIBILITY_DISTANCE) { into.writeAttr(SUMO_ATTR_VISIBILITY_DISTANCE, visibility); } diff -Nru sumo-1.11.0/src/netwrite/NWWriter_SUMO.h sumo-1.12.0/src/netwrite/NWWriter_SUMO.h --- sumo-1.11.0/src/netwrite/NWWriter_SUMO.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netwrite/NWWriter_SUMO.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -182,6 +182,7 @@ LinkDirection dir = LinkDirection::STRAIGHT, const std::string& tlID = "", int linkIndex = NBConnection::InvalidTlIndex, + bool minor = false, double visibility = NBEdge::UNSPECIFIED_VISIBILITY_DISTANCE); /// @brief writes a SUMOTime as int if possible, otherwise as a float diff -Nru sumo-1.11.0/src/netwrite/NWWriter_XML.cpp sumo-1.12.0/src/netwrite/NWWriter_XML.cpp --- sumo-1.11.0/src/netwrite/NWWriter_XML.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netwrite/NWWriter_XML.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/netwrite/NWWriter_XML.h sumo-1.12.0/src/netwrite/NWWriter_XML.h --- sumo-1.11.0/src/netwrite/NWWriter_XML.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/netwrite/NWWriter_XML.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/od/ODAmitranHandler.cpp sumo-1.12.0/src/od/ODAmitranHandler.cpp --- sumo-1.11.0/src/od/ODAmitranHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/od/ODAmitranHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -50,7 +50,7 @@ break; case SUMO_TAG_OD_PAIR: myMatrix.add(attrs.get(SUMO_ATTR_AMOUNT, myVehicleType.c_str(), ok), - myBegin, myEnd, attrs.get(SUMO_ATTR_ORIGIN, myVehicleType.c_str(), ok), + std::make_pair(myBegin, myEnd), attrs.get(SUMO_ATTR_ORIGIN, myVehicleType.c_str(), ok), attrs.get(SUMO_ATTR_DESTINATION, myVehicleType.c_str(), ok), myVehicleType); break; default: diff -Nru sumo-1.11.0/src/od/ODAmitranHandler.h sumo-1.12.0/src/od/ODAmitranHandler.h --- sumo-1.11.0/src/od/ODAmitranHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/od/ODAmitranHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/od/ODCell.h sumo-1.12.0/src/od/ODCell.h --- sumo-1.11.0/src/od/ODCell.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/od/ODCell.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/od/ODDistrictCont.cpp sumo-1.12.0/src/od/ODDistrictCont.cpp --- sumo-1.11.0/src/od/ODDistrictCont.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/od/ODDistrictCont.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/od/ODDistrictCont.h sumo-1.12.0/src/od/ODDistrictCont.h --- sumo-1.11.0/src/od/ODDistrictCont.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/od/ODDistrictCont.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/od/ODDistrict.cpp sumo-1.12.0/src/od/ODDistrict.cpp --- sumo-1.11.0/src/od/ODDistrict.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/od/ODDistrict.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/od/ODDistrict.h sumo-1.12.0/src/od/ODDistrict.h --- sumo-1.11.0/src/od/ODDistrict.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/od/ODDistrict.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/od/ODDistrictHandler.cpp sumo-1.12.0/src/od/ODDistrictHandler.cpp --- sumo-1.11.0/src/od/ODDistrictHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/od/ODDistrictHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/od/ODDistrictHandler.h sumo-1.12.0/src/od/ODDistrictHandler.h --- sumo-1.11.0/src/od/ODDistrictHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/od/ODDistrictHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/od/ODMatrix.cpp sumo-1.12.0/src/od/ODMatrix.cpp --- sumo-1.11.0/src/od/ODMatrix.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/od/ODMatrix.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ @@ -64,8 +64,8 @@ bool -ODMatrix::add(double vehicleNumber, SUMOTime begin, - SUMOTime end, const std::string& origin, const std::string& destination, +ODMatrix::add(double vehicleNumber, const std::pair& beginEnd, + const std::string& origin, const std::string& destination, const std::string& vehicleType, const bool originIsEdge, const bool destinationIsEdge) { myNumLoaded += vehicleNumber; if (!originIsEdge && !destinationIsEdge && myDistricts.get(origin) == nullptr && myDistricts.get(destination) == nullptr) { @@ -95,8 +95,8 @@ return false; } ODCell* cell = new ODCell(); - cell->begin = begin; - cell->end = end; + cell->begin = beginEnd.first; + cell->end = beginEnd.second; cell->origin = origin; cell->destination = destination; cell->vehicleType = vehicleType; @@ -104,6 +104,12 @@ cell->originIsEdge = originIsEdge; cell->destinationIsEdge = destinationIsEdge; myContainer.push_back(cell); + if (myBegin == -1 || cell->begin < myBegin) { + myBegin = cell->begin; + } + if (cell->end > myEnd) { + myEnd = cell->end; + } return true; } @@ -129,7 +135,8 @@ if (cell == nullptr) { const SUMOTime interval = string2time(OptionsCont::getOptions().getString("aggregation-interval")); const int intervalIdx = (int)(depart / interval); - if (add(1., intervalIdx * interval, (intervalIdx + 1) * interval, fromTaz, toTaz, vehicleType, originIsEdge, destinationIsEdge)) { + if (add(1., std::make_pair(intervalIdx * interval, (intervalIdx + 1) * interval), + fromTaz, toTaz, vehicleType, originIsEdge, destinationIsEdge)) { cell = myContainer.back(); odList.push_back(cell); } else { @@ -422,10 +429,10 @@ SUMOTime ODMatrix::parseSingleTime(const std::string& time) { if (time.find('.') == std::string::npos) { - throw OutOfBoundsException(); + throw NumberFormatException("no separator"); } - std::string hours = time.substr(0, time.find('.')); - std::string minutes = time.substr(time.find('.') + 1); + const std::string hours = time.substr(0, time.find('.')); + const std::string minutes = time.substr(time.find('.') + 1); return TIME2STEPS(StringUtils::toInt(hours) * 3600 + StringUtils::toInt(minutes) * 60); } @@ -435,16 +442,16 @@ std::string line = getNextNonCommentLine(lr); try { StringTokenizer st(line, StringTokenizer::WHITECHARS); - myBegin = parseSingleTime(st.next()); - myEnd = parseSingleTime(st.next()); - if (myBegin >= myEnd) { - throw ProcessError("Matrix begin time " + time2string(myBegin) + " is larger than end time " + time2string(myEnd) + "."); + const SUMOTime begin = parseSingleTime(st.next()); + const SUMOTime end = parseSingleTime(st.next()); + if (begin >= end) { + throw ProcessError("Matrix begin time " + time2string(begin) + " is larger than end time " + time2string(end) + "."); } - return std::make_pair(myBegin, myEnd); + return std::make_pair(begin, end); } catch (OutOfBoundsException&) { throw ProcessError("Broken period definition '" + line + "'."); - } catch (NumberFormatException&) { - throw ProcessError("Broken period definition '" + line + "'."); + } catch (NumberFormatException& e) { + throw ProcessError("Broken period definition '" + line + "' (" + e.what() + ")."); } } @@ -474,13 +481,8 @@ } } - // parse time - std::pair times = readTime(lr); - SUMOTime begin = times.first; - SUMOTime end = times.second; - - // factor - double factor = readFactor(lr, scale); + const std::pair beginEnd = readTime(lr); + const double factor = readFactor(lr, scale); // districts line = getNextNonCommentLine(lr); @@ -516,7 +518,7 @@ assert(di != names.end()); double vehNumber = StringUtils::toDouble(st2.next()) * factor; if (vehNumber != 0) { - add(vehNumber, begin, end, *si, *di, vehType); + add(vehNumber, beginEnd, *si, *di, vehType); } if (di == names.end()) { throw ProcessError("More entries than districts found."); @@ -549,13 +551,8 @@ } } - // parse time - std::pair times = readTime(lr); - SUMOTime begin = times.first; - SUMOTime end = times.second; - - // factor - double factor = readFactor(lr, scale); + const std::pair beginEnd = readTime(lr); + const double factor = readFactor(lr, scale); // parse the cells while (lr.hasMore()) { @@ -572,7 +569,7 @@ std::string destD = st2.next(); double vehNumber = StringUtils::toDouble(st2.next()) * factor; if (vehNumber != 0) { - add(vehNumber, begin, end, sourceD, destD, vehType); + add(vehNumber, beginEnd, sourceD, destD, vehType); } } catch (OutOfBoundsException&) { throw ProcessError("Missing at least one information in line '" + line + "'."); @@ -696,7 +693,7 @@ void ODMatrix::addTazRelWeight(const std::string intervalID, const std::string& from, const std::string& to, double val, double beg, double end) { - add(val, TIME2STEPS(beg), TIME2STEPS(end), from, to, myVType == "" ? intervalID : myVType); + add(val, std::make_pair(TIME2STEPS(beg), TIME2STEPS(end)), from, to, myVType == "" ? intervalID : myVType); } diff -Nru sumo-1.11.0/src/od/ODMatrix.h sumo-1.12.0/src/od/ODMatrix.h --- sumo-1.11.0/src/od/ODMatrix.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/od/ODMatrix.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ @@ -94,15 +94,14 @@ * given values. This cell is added to the list of known cells (myContainer). * * @param[in] vehicleNumber The number of vehicles to store within the cell - * @param[in] begin The begin of the interval the cell is valid for - * @param[in] end The end of the interval the cell is valid for + * @param[in] beginEnd The begin and the end of the interval the cell is valid for * @param[in] origin The origin district to use for the cell's flows * @param[in] destination The destination district to use for the cell's flows * @param[in] vehicleType The vehicle type to use for the cell's flows * @return whether the cell could be added */ - bool add(double vehicleNumber, SUMOTime begin, - SUMOTime end, const std::string& origin, const std::string& destination, + bool add(double vehicleNumber, const std::pair& beginEnd, + const std::string& origin, const std::string& destination, const std::string& vehicleType, const bool originIsEdge = false, const bool destinationIsEdge = false); diff -Nru sumo-1.11.0/src/od2trips_main.cpp sumo-1.12.0/src/od2trips_main.cpp --- sumo-1.11.0/src/od2trips_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/od2trips_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/osgview/GUIOSGBuilder.cpp sumo-1.12.0/src/osgview/GUIOSGBuilder.cpp --- sumo-1.11.0/src/osgview/GUIOSGBuilder.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/osgview/GUIOSGBuilder.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/osgview/GUIOSGBuilder.h sumo-1.12.0/src/osgview/GUIOSGBuilder.h --- sumo-1.11.0/src/osgview/GUIOSGBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/osgview/GUIOSGBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/osgview/GUIOSGHeader.h sumo-1.12.0/src/osgview/GUIOSGHeader.h --- sumo-1.11.0/src/osgview/GUIOSGHeader.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/osgview/GUIOSGHeader.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/osgview/GUIOSGView.cpp sumo-1.12.0/src/osgview/GUIOSGView.cpp --- sumo-1.11.0/src/osgview/GUIOSGView.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/osgview/GUIOSGView.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/osgview/GUIOSGView.h sumo-1.12.0/src/osgview/GUIOSGView.h --- sumo-1.11.0/src/osgview/GUIOSGView.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/osgview/GUIOSGView.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/CMakeLists.txt sumo-1.12.0/src/polyconvert/CMakeLists.txt --- sumo-1.11.0/src/polyconvert/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -25,7 +25,7 @@ set_target_properties(polyconvert PROPERTIES OUTPUT_NAME polyconvert${BINARY_SUFFIX}) set_target_properties(polyconvert PROPERTIES OUTPUT_NAME_DEBUG polyconvert${BINARY_SUFFIX}D) target_link_libraries(polyconvert ${commonlibs} ${GDAL_LIBRARY}) -add_dependencies(polyconvert generate-version-h) +add_dependencies(polyconvert generate-version-h install_dll) add_custom_command(OUTPUT pc_typemap.h COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../../tools/build/typemap.py ${CMAKE_BINARY_DIR}/src diff -Nru sumo-1.11.0/src/polyconvert/PCLoaderArcView.cpp sumo-1.12.0/src/polyconvert/PCLoaderArcView.cpp --- sumo-1.11.0/src/polyconvert/PCLoaderArcView.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCLoaderArcView.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCLoaderArcView.h sumo-1.12.0/src/polyconvert/PCLoaderArcView.h --- sumo-1.11.0/src/polyconvert/PCLoaderArcView.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCLoaderArcView.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCLoaderDlrNavteq.cpp sumo-1.12.0/src/polyconvert/PCLoaderDlrNavteq.cpp --- sumo-1.11.0/src/polyconvert/PCLoaderDlrNavteq.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCLoaderDlrNavteq.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCLoaderDlrNavteq.h sumo-1.12.0/src/polyconvert/PCLoaderDlrNavteq.h --- sumo-1.11.0/src/polyconvert/PCLoaderDlrNavteq.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCLoaderDlrNavteq.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCLoaderOSM.cpp sumo-1.12.0/src/polyconvert/PCLoaderOSM.cpp --- sumo-1.11.0/src/polyconvert/PCLoaderOSM.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCLoaderOSM.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCLoaderOSM.h sumo-1.12.0/src/polyconvert/PCLoaderOSM.h --- sumo-1.11.0/src/polyconvert/PCLoaderOSM.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCLoaderOSM.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCLoaderVisum.cpp sumo-1.12.0/src/polyconvert/PCLoaderVisum.cpp --- sumo-1.11.0/src/polyconvert/PCLoaderVisum.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCLoaderVisum.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCLoaderVisum.h sumo-1.12.0/src/polyconvert/PCLoaderVisum.h --- sumo-1.11.0/src/polyconvert/PCLoaderVisum.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCLoaderVisum.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCLoaderXML.cpp sumo-1.12.0/src/polyconvert/PCLoaderXML.cpp --- sumo-1.11.0/src/polyconvert/PCLoaderXML.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCLoaderXML.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCLoaderXML.h sumo-1.12.0/src/polyconvert/PCLoaderXML.h --- sumo-1.11.0/src/polyconvert/PCLoaderXML.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCLoaderXML.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCNetProjectionLoader.cpp sumo-1.12.0/src/polyconvert/PCNetProjectionLoader.cpp --- sumo-1.11.0/src/polyconvert/PCNetProjectionLoader.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCNetProjectionLoader.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCNetProjectionLoader.h sumo-1.12.0/src/polyconvert/PCNetProjectionLoader.h --- sumo-1.11.0/src/polyconvert/PCNetProjectionLoader.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCNetProjectionLoader.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCPolyContainer.cpp sumo-1.12.0/src/polyconvert/PCPolyContainer.cpp --- sumo-1.11.0/src/polyconvert/PCPolyContainer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCPolyContainer.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCPolyContainer.h sumo-1.12.0/src/polyconvert/PCPolyContainer.h --- sumo-1.11.0/src/polyconvert/PCPolyContainer.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCPolyContainer.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCTypeDefHandler.cpp sumo-1.12.0/src/polyconvert/PCTypeDefHandler.cpp --- sumo-1.11.0/src/polyconvert/PCTypeDefHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCTypeDefHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCTypeDefHandler.h sumo-1.12.0/src/polyconvert/PCTypeDefHandler.h --- sumo-1.11.0/src/polyconvert/PCTypeDefHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCTypeDefHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCTypeMap.cpp sumo-1.12.0/src/polyconvert/PCTypeMap.cpp --- sumo-1.11.0/src/polyconvert/PCTypeMap.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCTypeMap.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/PCTypeMap.h sumo-1.12.0/src/polyconvert/PCTypeMap.h --- sumo-1.11.0/src/polyconvert/PCTypeMap.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/PCTypeMap.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ diff -Nru sumo-1.11.0/src/polyconvert/polyconvert_main.cpp sumo-1.12.0/src/polyconvert/polyconvert_main.cpp --- sumo-1.11.0/src/polyconvert/polyconvert_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/polyconvert/polyconvert_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ diff -Nru sumo-1.11.0/src/router/ROAbstractEdgeBuilder.h sumo-1.12.0/src/router/ROAbstractEdgeBuilder.h --- sumo-1.11.0/src/router/ROAbstractEdgeBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/ROAbstractEdgeBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/router/ROEdge.cpp sumo-1.12.0/src/router/ROEdge.cpp --- sumo-1.11.0/src/router/ROEdge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/ROEdge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -199,7 +199,7 @@ return MAX2(getMinimumTravelTime(veh), lineTT); } else { if (!myHaveTTWarned) { - WRITE_WARNING("No interval matches passed time " + toString(time) + " in edge '" + myID + "'.\n Using edge's length / max speed."); + WRITE_WARNINGF("No interval matches passed time=% in edge '%'.\n Using edge's length / max speed.", time, myID); myHaveTTWarned = true; } } @@ -225,7 +225,7 @@ if (myUsingETimeLine) { if (!myEfforts.describesTime(time)) { if (!myHaveEWarned) { - WRITE_WARNING("No interval matches passed time " + toString(time) + " in edge '" + myID + "'.\n Using edge's length / edge's speed."); + WRITE_WARNINGF("No interval matches passed time=% in edge '%'.\n Using edge's length / edge's speed.", time, myID); myHaveEWarned = true; } return false; diff -Nru sumo-1.11.0/src/router/ROEdge.h sumo-1.12.0/src/router/ROEdge.h --- sumo-1.11.0/src/router/ROEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/ROEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -493,6 +493,10 @@ myInterpolate = interpolate; } + static void disableTimelineWarning() { + myHaveTTWarned = true; + } + /// @brief return the coordinates of the center of the given stop static const Position getStopPosition(const SUMOVehicleParameter::Stop& stop); diff -Nru sumo-1.11.0/src/router/ROFrame.cpp sumo-1.12.0/src/router/ROFrame.cpp --- sumo-1.11.0/src/router/ROFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/ROFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/router/ROFrame.h sumo-1.12.0/src/router/ROFrame.h --- sumo-1.11.0/src/router/ROFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/ROFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/router/ROHelper.cpp sumo-1.12.0/src/router/ROHelper.cpp --- sumo-1.11.0/src/router/ROHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/ROHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -41,15 +41,22 @@ // XXX check for departLane, departPos, departSpeed, .... // removal of edge loops within the route (edge occurs twice) - std::map lastOccurence; // index of the last occurence of this edge - for (int ii = 0; ii < (int)edges.size(); ++ii) { - std::map::iterator it_pre = lastOccurence.find(edges[ii]); - if (it_pre != lastOccurence.end() && - noMandatory(mandatory, edges.begin() + it_pre->second, edges.begin() + ii)) { - edges.erase(edges.begin() + it_pre->second, edges.begin() + ii); - ii = it_pre->second; - } else { - lastOccurence[edges[ii]] = ii; + // call repeatedly until no more loops have been found + bool findLoop = true; + while (findLoop) { + findLoop = false; + std::map lastOccurence; // index of the last occurence of this edge + for (int ii = 0; ii < (int)edges.size(); ++ii) { + std::map::iterator it_pre = lastOccurence.find(edges[ii]); + if (it_pre != lastOccurence.end() && + noMandatory(mandatory, edges.begin() + it_pre->second, edges.begin() + ii)) { + edges.erase(edges.begin() + it_pre->second, edges.begin() + ii); + ii = it_pre->second; + findLoop = true; + break; + } else { + lastOccurence[edges[ii]] = ii; + } } } diff -Nru sumo-1.11.0/src/router/ROHelper.h sumo-1.12.0/src/router/ROHelper.h --- sumo-1.11.0/src/router/ROHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/ROHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/router/ROLane.h sumo-1.12.0/src/router/ROLane.h --- sumo-1.11.0/src/router/ROLane.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/ROLane.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/router/ROLoader.cpp sumo-1.12.0/src/router/ROLoader.cpp --- sumo-1.11.0/src/router/ROLoader.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/ROLoader.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/router/ROLoader.h sumo-1.12.0/src/router/ROLoader.h --- sumo-1.11.0/src/router/ROLoader.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/ROLoader.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/router/RONet.cpp sumo-1.12.0/src/router/RONet.cpp --- sumo-1.11.0/src/router/RONet.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/RONet.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -271,14 +271,22 @@ RONet::openOutput(const OptionsCont& options) { if (options.isSet("output-file") && options.getString("output-file") != "") { myRoutesOutput = &OutputDevice::getDevice(options.getString("output-file")); - myRoutesOutput->writeHeader(SUMO_TAG_ROUTES); - myRoutesOutput->writeAttr("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance").writeAttr("xsi:noNamespaceSchemaLocation", "http://sumo.dlr.de/xsd/routes_file.xsd"); + if (myRoutesOutput->isNull()) { + myRoutesOutput = nullptr; + } else { + myRoutesOutput->writeHeader(SUMO_TAG_ROUTES); + myRoutesOutput->writeAttr("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance").writeAttr("xsi:noNamespaceSchemaLocation", "http://sumo.dlr.de/xsd/routes_file.xsd"); + } } if (options.exists("alternatives-output") && options.isSet("alternatives-output") && !(options.exists("write-trips") && options.getBool("write-trips"))) { myRouteAlternativesOutput = &OutputDevice::getDevice(options.getString("alternatives-output")); - myRouteAlternativesOutput->writeHeader(SUMO_TAG_ROUTES); - myRouteAlternativesOutput->writeAttr("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance").writeAttr("xsi:noNamespaceSchemaLocation", "http://sumo.dlr.de/xsd/routes_file.xsd"); + if (myRouteAlternativesOutput->isNull()) { + myRouteAlternativesOutput = nullptr; + } else { + myRouteAlternativesOutput->writeHeader(SUMO_TAG_ROUTES); + myRouteAlternativesOutput->writeAttr("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance").writeAttr("xsi:noNamespaceSchemaLocation", "http://sumo.dlr.de/xsd/routes_file.xsd"); + } } if (options.isSet("vtype-output")) { myTypesOutput = &OutputDevice::getDevice(options.getString("vtype-output")); @@ -692,7 +700,7 @@ // ok, check whether it has been routed if (r->getRoutingSuccess()) { // write the route - r->write(*myRoutesOutput, myRouteAlternativesOutput, myTypesOutput, options); + r->write(myRoutesOutput, myRouteAlternativesOutput, myTypesOutput, options); myWrittenRouteNo++; } else { myDiscardedRouteNo++; diff -Nru sumo-1.11.0/src/router/RONet.h sumo-1.12.0/src/router/RONet.h --- sumo-1.11.0/src/router/RONet.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/RONet.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/router/RONetHandler.cpp sumo-1.12.0/src/router/RONetHandler.cpp --- sumo-1.11.0/src/router/RONetHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/RONetHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/router/RONetHandler.h sumo-1.12.0/src/router/RONetHandler.h --- sumo-1.11.0/src/router/RONetHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/RONetHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/router/RONode.cpp sumo-1.12.0/src/router/RONode.cpp --- sumo-1.11.0/src/router/RONode.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/RONode.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/router/RONode.h sumo-1.12.0/src/router/RONode.h --- sumo-1.11.0/src/router/RONode.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/RONode.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/router/ROPerson.cpp sumo-1.12.0/src/router/ROPerson.cpp --- sumo-1.11.0/src/router/ROPerson.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/ROPerson.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -40,6 +40,7 @@ #include "ROLane.h" #include "ROPerson.h" +const std::string ROPerson::PlanItem::UNDEFINED_STOPPING_PLACE; // =========================================================================== // method definitions @@ -59,9 +60,11 @@ void ROPerson::addTrip(std::vector& plan, const std::string& id, const ROEdge* const from, const ROEdge* const to, const SVCPermissions modeSet, - const std::string& vTypes, const double departPos, const double arrivalPos, - const std::string& busStop, double walkFactor, const std::string& group) { - PersonTrip* trip = new PersonTrip(from, to, modeSet, departPos, arrivalPos, busStop, walkFactor, group); + const std::string& vTypes, + const double departPos, const std::string& stopOrigin, + const double arrivalPos, const std::string& busStop, + double walkFactor, const std::string& group) { + PersonTrip* trip = new PersonTrip(from, to, modeSet, departPos, stopOrigin, arrivalPos, busStop, walkFactor, group); RONet* net = RONet::getInstance(); SUMOVehicleParameter pars; pars.departProcedure = DEPART_TRIGGERED; @@ -112,9 +115,7 @@ void ROPerson::addRide(std::vector& plan, const ROEdge* const from, const ROEdge* const to, const std::string& lines, double arrivalPos, const std::string& destStop, const std::string& group) { - if (plan.empty() || plan.back()->isStop()) { - plan.push_back(new PersonTrip()); - } + plan.push_back(new PersonTrip(to, destStop)); plan.back()->addTripItem(new Ride(-1, from, to, lines, group, -1., arrivalPos, -1., destStop)); } @@ -122,7 +123,7 @@ void ROPerson::addWalk(std::vector& plan, const ConstROEdgeVector& edges, const double duration, const double speed, const double departPos, const double arrivalPos, const std::string& busStop) { if (plan.empty() || plan.back()->isStop()) { - plan.push_back(new PersonTrip()); + plan.push_back(new PersonTrip(edges.back(), busStop)); } plan.back()->addTripItem(new Walk(-1, edges, -1., duration, speed, departPos, arrivalPos, busStop)); } @@ -138,7 +139,7 @@ ROPerson::Ride::saveAsXML(OutputDevice& os, const bool extended, OptionsCont& options) const { os.openTag(SUMO_TAG_RIDE); std::string comment = ""; - if (extended && myCost >= 0.) { + if ((extended || options.getBool("write-costs")) && myCost >= 0.) { os.writeAttr(SUMO_ATTR_COST, myCost); } if (from != nullptr) { @@ -182,7 +183,7 @@ ROPerson::Walk::saveAsXML(OutputDevice& os, const bool extended, OptionsCont& options) const { os.openTag(SUMO_TAG_WALK); std::string comment = ""; - if (extended && myCost >= 0.) { + if ((extended || options.getBool("write-costs")) && myCost >= 0.) { os.writeAttr(SUMO_ATTR_COST, myCost); } if (dur > 0) { @@ -221,7 +222,7 @@ ROPerson::PlanItem* ROPerson::PersonTrip::clone() const { - PersonTrip* result = new PersonTrip(from, to, modes, dep, arr, stopDest, walkFactor, group); + PersonTrip* result = new PersonTrip(from, to, modes, dep, stopOrigin, arr, stopDest, walkFactor, group); for (auto* item : myTripItems) { result->myTripItems.push_back(item->clone()); } @@ -327,7 +328,9 @@ PersonTrip* const trip, const ROVehicle* const veh, MsgHandler* const errorHandler) { const double speed = getType()->maxSpeed * trip->getWalkFactor(); std::vector result; - provider.getIntermodalRouter().compute(trip->getOrigin(), trip->getDestination(), trip->getDepartPos(), trip->getArrivalPos(), trip->getStopDest(), + provider.getIntermodalRouter().compute(trip->getOrigin(), trip->getDestination(), + trip->getDepartPos(), trip->getStopOrigin(), + trip->getArrivalPos(), trip->getStopDest(), speed, veh, trip->getModes(), time, result); bool carUsed = false; SUMOTime start = time; diff -Nru sumo-1.11.0/src/router/ROPerson.h sumo-1.12.0/src/router/ROPerson.h --- sumo-1.11.0/src/router/ROPerson.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/ROPerson.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -61,9 +61,10 @@ virtual ~ROPerson(); static void addTrip(std::vector& plan, const std::string& id, - const ROEdge* const from, const ROEdge* const to, const SVCPermissions modeSet, - const std::string& vTypes, const double departPos, const double arrivalPos, - const std::string& busStop, double walkFactor, const std::string& group); + const ROEdge* const from, const ROEdge* const to, const SVCPermissions modeSet, const std::string& vTypes, + const double departPos, const std::string& stopOrigin, + const double arrivalPos, const std::string& busStop, + double walkFactor, const std::string& group); static void addRide(std::vector& plan, const ROEdge* const from, const ROEdge* const to, const std::string& lines, double arrivalPos, const std::string& destStop, const std::string& group); @@ -101,6 +102,11 @@ } virtual SUMOTime getDuration() const = 0; + virtual const std::string& getStopDest() const { + return UNDEFINED_STOPPING_PLACE; + } + + static const std::string UNDEFINED_STOPPING_PLACE; }; /** @@ -134,6 +140,9 @@ SUMOTime getDuration() const { return stopDesc.duration; } + inline const std::string& getStopDest() const { + return stopDesc.busstop; + } private: SUMOVehicleParameter::Stop stopDesc; @@ -282,11 +291,11 @@ */ class PersonTrip : public PlanItem { public: - PersonTrip() - : from(0), to(0), modes(SVC_PEDESTRIAN), dep(0), arr(0), stopDest(""), walkFactor(1.0) {} - PersonTrip(const ROEdge* const from, const ROEdge* const to, const SVCPermissions modeSet, - const double departPos, const double arrivalPos, const std::string& _stopDest, double _walkFactor, const std::string& _group) - : from(from), to(to), modes(modeSet), dep(departPos), arr(arrivalPos), stopDest(_stopDest), walkFactor(_walkFactor), group(_group) {} + PersonTrip(const ROEdge* _to, const std::string _stopDest) : + from(0), to(_to), modes(SVC_PEDESTRIAN), dep(0), arr(0), stopDest(_stopDest), walkFactor(1.0) {} + PersonTrip(const ROEdge* const _from, const ROEdge* const _to, const SVCPermissions modeSet, + const double departPos, const std::string& _stopOrigin, const double arrivalPos, const std::string& _stopDest, double _walkFactor, const std::string& _group) : + from(_from), to(_to), modes(modeSet), dep(departPos), arr(arrivalPos), stopOrigin(_stopOrigin), stopDest(_stopDest), walkFactor(_walkFactor), group(_group) { } /// @brief Destructor virtual ~PersonTrip() { for (std::vector::const_iterator it = myTripItems.begin(); it != myTripItems.end(); ++it) { @@ -339,6 +348,10 @@ return group; } + const std::string& getStopOrigin() const { + return stopOrigin; + } + const std::string& getStopDest() const { return stopDest; } @@ -360,6 +373,7 @@ const ROEdge* to; SVCPermissions modes; const double dep, arr; + const std::string stopOrigin; const std::string stopDest; /// @brief the fully specified trips std::vector myTripItems; diff -Nru sumo-1.11.0/src/router/RORoutable.h sumo-1.12.0/src/router/RORoutable.h --- sumo-1.11.0/src/router/RORoutable.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/RORoutable.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -139,14 +139,16 @@ * @param[in] typeos The types - output device to store the vehicle types into * @exception IOError If something fails (not yet implemented) */ - void write(OutputDevice& os, OutputDevice* const altos, + void write(OutputDevice* os, OutputDevice* const altos, OutputDevice* const typeos, OptionsCont& options) const { - if (altos == 0 && typeos == 0) { - saveAsXML(os, &os, false, options); - } else { - saveAsXML(os, typeos, false, options); + if (os != nullptr) { + if (altos == nullptr && typeos == nullptr) { + saveAsXML(*os, os, false, options); + } else { + saveAsXML(*os, typeos, false, options); + } } - if (altos != 0) { + if (altos != nullptr) { saveAsXML(*altos, typeos, true, options); } } diff -Nru sumo-1.11.0/src/router/RORoute.cpp sumo-1.12.0/src/router/RORoute.cpp --- sumo-1.11.0/src/router/RORoute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/RORoute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -98,7 +98,9 @@ OutputDevice& RORoute::writeXMLDefinition(OutputDevice& dev, const ROVehicle* const veh, const bool withCosts, + const bool withProb, const bool withExitTimes, + const bool withLength, const std::string& id) const { dev.openTag(SUMO_TAG_ROUTE); if (id != "") { @@ -107,6 +109,8 @@ if (withCosts) { dev.writeAttr(SUMO_ATTR_COST, myCosts); dev.setPrecision(8); + } + if (withProb) { dev.writeAttr(SUMO_ATTR_PROB, myProbability); dev.setPrecision(); } @@ -117,7 +121,7 @@ if (withExitTimes) { std::vector exitTimes; double time = STEPS2TIME(veh->getDepartureTime()); - for (const ROEdge* roe : myRoute) { + for (const ROEdge* const roe : myRoute) { time += roe->getTravelTime(veh, time); if (!roe->isInternal() && !roe->isTazConnector()) { exitTimes.push_back(time); @@ -125,6 +129,13 @@ } dev.writeAttr("exitTimes", exitTimes); } + if (withLength) { + double length = 0.; + for (const ROEdge* const roe : myRoute) { + length += roe->getLength(); + } + dev.writeAttr("routeLength", length); + } dev.closeTag(); return dev; } diff -Nru sumo-1.11.0/src/router/RORouteDef.cpp sumo-1.12.0/src/router/RORouteDef.cpp --- sumo-1.11.0/src/router/RORouteDef.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/RORouteDef.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -224,8 +224,10 @@ int lastMandatory = 0; for (ConstROEdgeVector::const_iterator i = targets.begin() + 1; i != targets.end() && nextMandatory != mandatory.end(); ++i) { - if ((*(i - 1))->isConnectedTo(**i, veh.getVClass())) { - newEdges.push_back(*i); + const ROEdge* prev = *(i - 1); + const ROEdge* cur = *i; + if (prev->isConnectedTo(*cur, veh.getVClass()) && (!isRailway(veh.getVClass()) || prev->getBidiEdge() != cur)) { + newEdges.push_back(cur); } else { if (initialSize > 2) { // only inform if the input is (probably) not a trip @@ -379,16 +381,16 @@ OutputDevice& RORouteDef::writeXMLDefinition(OutputDevice& dev, const ROVehicle* const veh, - bool asAlternatives, bool withExitTimes) const { + bool asAlternatives, bool withExitTimes, bool withCost, bool withLength) const { if (asAlternatives) { dev.openTag(SUMO_TAG_ROUTE_DISTRIBUTION).writeAttr(SUMO_ATTR_LAST, myLastUsed); for (int i = 0; i != (int)myAlternatives.size(); i++) { - myAlternatives[i]->writeXMLDefinition(dev, veh, true, withExitTimes); + myAlternatives[i]->writeXMLDefinition(dev, veh, true, true, withExitTimes, withLength); } dev.closeTag(); return dev; } else { - return myAlternatives[myLastUsed]->writeXMLDefinition(dev, veh, false, withExitTimes); + return myAlternatives[myLastUsed]->writeXMLDefinition(dev, veh, withCost, false, withExitTimes, withLength); } } diff -Nru sumo-1.11.0/src/router/RORouteDef.h sumo-1.12.0/src/router/RORouteDef.h --- sumo-1.11.0/src/router/RORouteDef.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/RORouteDef.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -115,7 +115,7 @@ * @return The same device for further usage */ OutputDevice& writeXMLDefinition(OutputDevice& dev, const ROVehicle* const veh, - bool asAlternatives, bool withExitTimes) const; + bool asAlternatives, bool withExitTimes, bool withCost, bool withLength) const; /** @brief Returns a deep copy of the route definition. diff -Nru sumo-1.11.0/src/router/RORoute.h sumo-1.12.0/src/router/RORoute.h --- sumo-1.11.0/src/router/RORoute.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/RORoute.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -168,7 +168,9 @@ OutputDevice& writeXMLDefinition(OutputDevice& dev, const ROVehicle* const veh, - const bool withCosts, const bool withExitTimes, const std::string& id = "") const; + const bool withCosts, const bool withProb, + const bool withExitTimes, const bool withLength, + const std::string& id = "") const; /** @brief add additional vehicles/probability */ diff -Nru sumo-1.11.0/src/router/RORouteHandler.cpp sumo-1.12.0/src/router/RORouteHandler.cpp --- sumo-1.11.0/src/router/RORouteHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/RORouteHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -69,6 +69,7 @@ myKeepVTypeDist(OptionsCont::getOptions().getBool("keep-vtype-distributions")), myMapMatchingDistance(OptionsCont::getOptions().getFloat("mapmatch.distance")), myMapMatchJunctions(OptionsCont::getOptions().getBool("mapmatch.junctions")), + myUnsortedInput(OptionsCont::getOptions().exists("unsorted-input") && OptionsCont::getOptions().getBool("unsorted-input")), myCurrentVTypeDistribution(nullptr), myCurrentAlternatives(nullptr), myLaneTree(nullptr) { @@ -502,6 +503,7 @@ void RORouteHandler::closeVehicle() { + checkLastDepart(); // get the vehicle id if (myVehicleParameter->departProcedure == DEPART_GIVEN && myVehicleParameter->depart < myBegin) { return; @@ -569,6 +571,7 @@ person->getPlan().push_back(item); } if (myNet.addPerson(person)) { + checkLastDepart(); registerLastDepart(); } } @@ -589,6 +592,7 @@ if (myActivePlan == nullptr || myActivePlan->empty()) { WRITE_WARNING("Discarding personFlow '" + myVehicleParameter->id + "' because it's plan is empty"); } else { + checkLastDepart(); // instantiate all persons of this flow int i = 0; std::string baseID = myVehicleParameter->id; @@ -638,6 +642,7 @@ myActiveContainerPlan->closeTag(); if (myActiveContainerPlanSize > 0) { myNet.addContainer(myVehicleParameter->depart, myActiveContainerPlan->getString()); + checkLastDepart(); registerLastDepart(); } else { WRITE_WARNING("Discarding container '" + myVehicleParameter->id + "' because it's plan is empty"); @@ -653,6 +658,7 @@ myActiveContainerPlan->closeTag(); if (myActiveContainerPlanSize > 0) { myNet.addContainer(myVehicleParameter->depart, myActiveContainerPlan->getString()); + checkLastDepart(); registerLastDepart(); } else { WRITE_WARNING("Discarding containerFlow '" + myVehicleParameter->id + "' because it's plan is empty"); @@ -667,6 +673,7 @@ void RORouteHandler::closeFlow() { + checkLastDepart(); // @todo: consider myScale? if (myVehicleParameter->repetitionNumber == 0) { delete myVehicleParameter; @@ -1190,7 +1197,9 @@ const std::string types = attrs.getOpt(SUMO_ATTR_VTYPES, id, ok, ""); double walkFactor = attrs.getOpt(SUMO_ATTR_WALKFACTOR, id, ok, OptionsCont::getOptions().getFloat("persontrip.walkfactor")); if (ok) { - ROPerson::addTrip(*myActivePlan, myVehicleParameter->id, from, to, modeSet, types, departPos, arrivalPos, busStopID, walkFactor, group); + const std::string originStopID = myActivePlan->empty() ? "" : myActivePlan->back()->getStopDest(); + ROPerson::addTrip(*myActivePlan, myVehicleParameter->id, from, to, modeSet, types, + departPos, originStopID, arrivalPos, busStopID, walkFactor, group); } } @@ -1258,5 +1267,12 @@ return myLaneTree; } +bool +RORouteHandler::checkLastDepart() { + if (!myUnsortedInput) { + return SUMORouteHandler::checkLastDepart(); + } + return true; +} /****************************************************************************/ diff -Nru sumo-1.11.0/src/router/RORouteHandler.h sumo-1.12.0/src/router/RORouteHandler.h --- sumo-1.11.0/src/router/RORouteHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/RORouteHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -66,6 +66,9 @@ /// @brief standard destructor virtual ~RORouteHandler(); + /// @brief Checks whether the route file is sorted by departure time if needed + bool checkLastDepart(); + protected: /// @name inherited from GenericSAXHandler //@{ @@ -237,6 +240,9 @@ const double myMapMatchingDistance; const bool myMapMatchJunctions; + /// @brief whether input is read all at once (no sorting check is necessary) + const bool myUnsortedInput; + /// @brief The currently parsed distribution of vehicle types (probability->vehicle type) RandomDistributor* myCurrentVTypeDistribution; diff -Nru sumo-1.11.0/src/router/ROVehicle.cpp sumo-1.12.0/src/router/ROVehicle.cpp --- sumo-1.11.0/src/router/ROVehicle.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/ROVehicle.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -211,6 +211,9 @@ const bool writeGeoTrip = writeTrip && options.getBool("write-trips.geo"); const bool writeJunctions = writeTrip && options.getBool("write-trips.junctions"); const bool writeNamedRoute = !asAlternatives && options.getBool("named-routes"); + const bool writeCosts = options.exists("write-costs") && options.getBool("write-costs"); + const bool writeExit = options.exists("exit-times") && options.getBool("exit-times"); + const bool writeLength = options.exists("route-length") && options.getBool("route-length"); std::string routeID; if (writeNamedRoute) { @@ -218,7 +221,8 @@ auto it = mySavedRoutes.find(edges); if (it == mySavedRoutes.end()) { routeID = "r" + toString(mySavedRoutes.size()); - myRoute->getUsedRoute()->writeXMLDefinition(os, this, false, options.getBool("exit-times"), routeID); + myRoute->getUsedRoute()->writeXMLDefinition(os, this, writeCosts, false, writeExit, + writeLength, routeID); mySavedRoutes[edges] = routeID; } else { routeID = it->second; @@ -324,7 +328,7 @@ } else if (writeNamedRoute) { os.writeAttr(SUMO_ATTR_ROUTE, routeID); } else { - myRoute->writeXMLDefinition(os, this, asAlternatives, options.getBool("exit-times")); + myRoute->writeXMLDefinition(os, this, asAlternatives, writeExit, writeCosts, writeLength); } for (std::vector::const_iterator stop = getParameter().stops.begin(); stop != getParameter().stops.end(); ++stop) { stop->write(os); diff -Nru sumo-1.11.0/src/router/ROVehicle.h sumo-1.12.0/src/router/ROVehicle.h --- sumo-1.11.0/src/router/ROVehicle.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/router/ROVehicle.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/sumo_main.cpp sumo-1.12.0/src/sumo_main.cpp --- sumo-1.11.0/src/sumo_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/sumo_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/tools/CMakeLists.txt sumo-1.12.0/src/tools/CMakeLists.txt --- sumo-1.11.0/src/tools/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/tools/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -2,18 +2,20 @@ emissionsDrivingCycle_main.cpp TrajectoriesHandler.cpp TrajectoriesHandler.h + VTypesHandler.cpp + VTypesHandler.h ) add_executable(emissionsDrivingCycle ${emissionsDrivingCycle_SRCS}) set_target_properties(emissionsDrivingCycle PROPERTIES OUTPUT_NAME emissionsDrivingCycle${BINARY_SUFFIX}) set_target_properties(emissionsDrivingCycle PROPERTIES OUTPUT_NAME_DEBUG emissionsDrivingCycle${BINARY_SUFFIX}D) -target_link_libraries(emissionsDrivingCycle utils_emissions foreign_phemlight ${commonlibs}) -add_dependencies(emissionsDrivingCycle generate-version-h) +target_link_libraries(emissionsDrivingCycle utils_vehicle utils_emissions foreign_phemlight ${commonlibs}) +add_dependencies(emissionsDrivingCycle generate-version-h install_dll) add_executable(emissionsMap emissionsMap_main.cpp) set_target_properties(emissionsMap PROPERTIES OUTPUT_NAME emissionsMap${BINARY_SUFFIX}) set_target_properties(emissionsMap PROPERTIES OUTPUT_NAME_DEBUG emissionsMap${BINARY_SUFFIX}D) target_link_libraries(emissionsMap utils_emissions foreign_phemlight ${commonlibs}) -add_dependencies(emissionsMap generate-version-h) +add_dependencies(emissionsMap generate-version-h install_dll) install(TARGETS emissionsDrivingCycle emissionsMap RUNTIME DESTINATION bin) diff -Nru sumo-1.11.0/src/tools/emissionsDrivingCycle_main.cpp sumo-1.12.0/src/tools/emissionsDrivingCycle_main.cpp --- sumo-1.11.0/src/tools/emissionsDrivingCycle_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/tools/emissionsDrivingCycle_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ @@ -41,9 +41,11 @@ #include #include #include +#include #include #include #include "TrajectoriesHandler.h" +#include "VTypesHandler.h" // =========================================================================== @@ -82,9 +84,14 @@ oc.addSynonyme("amitran", "netstate-file"); oc.addDescription("netstate-file", "Input", "Defines the netstate, route and trajectory files to read the driving cycles from."); + oc.doRegister("additional-files", new Option_FileName()); + oc.addDescription("additional-files", "Input", "Load emission parameters (vTypes) from FILE(s)"); + oc.doRegister("emission-class", 'e', new Option_String("unknown")); oc.addDescription("emission-class", "Input", "Defines for which emission class the emissions shall be generated. "); + oc.doRegister("vtype", new Option_String()); + oc.addDescription("vtype", "Input", "Defines the vehicle type to use for emission parameters."); oc.addOptionSubTopic("Processing"); oc.doRegister("compute-a", 'a', new Option_Bool(false)); @@ -124,6 +131,12 @@ oc.doRegister("phemlight-path", new Option_FileName(StringVector({ "./PHEMlight/" }))); oc.addDescription("phemlight-path", "Emissions", "Determines where to load PHEMlight definitions from."); + oc.doRegister("begin", new Option_String("0", "TIME")); + oc.addDescription("begin", "Processing", "Defines the begin time in seconds;"); + + oc.doRegister("end", new Option_String("-1", "TIME")); + oc.addDescription("end", "Processing", "Defines the end time in seconds;"); + SystemFrame::addReportOptions(oc); oc.doRegister("quiet", 'q', new Option_Bool(false)); oc.addDescription("quiet", "Report", "Not writing anything."); @@ -165,9 +178,30 @@ (*sumOut) << "Vehicle,Cycle,Time,Speed,Gradient,Acceleration,FC,FCel,CO2,NOx,CO,HC,PM" << std::endl; } + EnergyParams energyParams; + std::map vTypes; + if (oc.isSet("vtype")) { + if (!oc.isSet("additional-files")) { + throw ProcessError("Option --vtype requires option --additional-files for loading vehicle types"); + } + if (!oc.isUsableFileList("additional-files")) { + throw ProcessError(); + } + for (auto file : oc.getStringVector("additional-files")) { + VTypesHandler typesHandler(file, vTypes); + if (!XMLSubSys::runParser(typesHandler, file)) { + throw ProcessError("Loading of " + file + " failed."); + } + } + if (vTypes.count(oc.getString("vtype")) == 0) { + throw ProcessError("Vehicle type '" + oc.getString("vtype") + "' is not defined"); + } + energyParams = EnergyParams(vTypes[oc.getString("vtype")]); + } + const SUMOEmissionClass defaultClass = PollutantsInterface::getClassByName(oc.getString("emission-class")); const bool computeA = oc.getBool("compute-a") || oc.getBool("compute-a.forward"); - TrajectoriesHandler handler(computeA, oc.getBool("compute-a.forward"), oc.getBool("compute-a.zero-correction"), defaultClass, oc.getFloat("slope"), out, xmlOut); + TrajectoriesHandler handler(computeA, oc.getBool("compute-a.forward"), oc.getBool("compute-a.zero-correction"), defaultClass, &energyParams, oc.getFloat("slope"), out, xmlOut); if (oc.isSet("timeline-file")) { int skip = oc.getBool("skip-first") ? 1 : oc.getInt("timeline-file.skip"); @@ -201,7 +235,7 @@ } double a = !computeA && st.hasNext() ? StringUtils::toDouble(st.next()) : TrajectoriesHandler::INVALID_VALUE; double s = haveSlope && st.hasNext() ? StringUtils::toDouble(st.next()) : TrajectoriesHandler::INVALID_VALUE; - if (handler.writeEmissions(*out, "", defaultClass, t, v, a, s)) { + if (handler.writeEmissions(*out, "", defaultClass, &energyParams, t, v, a, s)) { l += v; totalA += a; totalS += s; @@ -231,6 +265,7 @@ handler.writeSums(std::cout, ""); } delete sumOut; + } catch (InvalidArgument& e) { MsgHandler::getErrorInstance()->inform(e.what()); MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); diff -Nru sumo-1.11.0/src/tools/emissionsMap_main.cpp sumo-1.12.0/src/tools/emissionsMap_main.cpp --- sumo-1.11.0/src/tools/emissionsMap_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/tools/emissionsMap_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/tools/TrajectoriesHandler.cpp sumo-1.12.0/src/tools/TrajectoriesHandler.cpp --- sumo-1.11.0/src/tools/TrajectoriesHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/tools/TrajectoriesHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -37,10 +38,15 @@ // method definitions // =========================================================================== TrajectoriesHandler::TrajectoriesHandler(const bool computeA, const bool computeAForward, - const bool accelZeroCorrection, const SUMOEmissionClass defaultClass, - const double defaultSlope, std::ostream* stdOut, OutputDevice* xmlOut) - : SUMOSAXHandler(""), myComputeA(computeA), myComputeAForward(computeAForward), myAccelZeroCorrection(accelZeroCorrection), myDefaultClass(defaultClass), - myDefaultSlope(defaultSlope), myStdOut(stdOut), myXMLOut(xmlOut), myCurrentTime(-1), myStepSize(TS) {} + const bool accelZeroCorrection, const SUMOEmissionClass defaultClass, EnergyParams* params, + const double defaultSlope, std::ostream* stdOut, OutputDevice* xmlOut) : + SUMOSAXHandler(""), + myComputeA(computeA), + myComputeAForward(computeAForward), + myAccelZeroCorrection(accelZeroCorrection), + myDefaultClass(defaultClass), + myParams(params), + myDefaultSlope(defaultSlope), myStdOut(stdOut), myXMLOut(xmlOut), myCurrentTime(-1), myStepSize(TS) {} TrajectoriesHandler::~TrajectoriesHandler() {} @@ -62,7 +68,7 @@ double v = attrs.getFloat(SUMO_ATTR_SPEED); double a = INVALID_VALUE; double s = INVALID_VALUE; - writeEmissions(std::cout, attrs.getString(SUMO_ATTR_ID), myDefaultClass, STEPS2TIME(myCurrentTime), v, a, s); + writeEmissions(std::cout, attrs.getString(SUMO_ATTR_ID), myDefaultClass, myParams, STEPS2TIME(myCurrentTime), v, a, s); } else { const std::string acId = attrs.getString(SUMO_ATTR_ACTORCONFIG); const std::string id = attrs.getString(SUMO_ATTR_ID); @@ -94,10 +100,10 @@ double s = attrs.hasAttribute(SUMO_ATTR_SLOPE) ? RAD2DEG(asin(attrs.get(SUMO_ATTR_SLOPE, id.c_str(), ok) / 10000.)) : INVALID_VALUE; const SUMOTime time = attrs.getOpt(SUMO_ATTR_TIME, id.c_str(), ok, INVALID_VALUE); if (myXMLOut != nullptr) { - writeXMLEmissions(id, c, time, v, a, s); + writeXMLEmissions(id, c, nullptr, time, v, a, s); } if (myStdOut != nullptr) { - writeEmissions(*myStdOut, id, c, STEPS2TIME(time), v, a, s); + writeEmissions(*myStdOut, id, c, nullptr, STEPS2TIME(time), v, a, s); } break; } @@ -109,6 +115,7 @@ const PollutantsInterface::Emissions TrajectoriesHandler::computeEmissions(const std::string id, const SUMOEmissionClass c, + EnergyParams* params, double& v, double& a, double& s) { if (myComputeA) { @@ -131,7 +138,7 @@ if (s == INVALID_VALUE) { s = myDefaultSlope; } - const PollutantsInterface::Emissions result = PollutantsInterface::computeAll(c, v, a, s); + const PollutantsInterface::Emissions result = PollutantsInterface::computeAll(c, v, a, s, params); mySums[id].addScaled(result, myStepSize); if (id != "") { mySums[""].addScaled(result, myStepSize); @@ -143,6 +150,7 @@ bool TrajectoriesHandler::writeEmissions(std::ostream& o, const std::string id, const SUMOEmissionClass c, + EnergyParams* params, double t, double& v, double& a, double& s) { if (myComputeA && myLastV.count(id) == 0) { @@ -156,7 +164,7 @@ s = myLastSlope[id]; myLastSlope[id] = nextS; } - const PollutantsInterface::Emissions e = computeEmissions(id, c, v, a, s); + const PollutantsInterface::Emissions e = computeEmissions(id, c, params, v, a, s); o << t << ";" << v << ";" << a << ";" << s << ";" << e.CO << ";" << e.CO2 << ";" << e.HC << ";" << e.PMx << ";" << e.NOx << ";" << e.fuel << ";" << e.electricity << std::endl; @@ -167,6 +175,7 @@ bool TrajectoriesHandler::writeXMLEmissions(const std::string id, const SUMOEmissionClass c, + EnergyParams* params, SUMOTime t, double& v, double a, double s) { if (myComputeA && myLastV.count(id) == 0) { @@ -180,7 +189,7 @@ myCurrentTime = t; myXMLOut->openTag(SUMO_TAG_TIMESTEP).writeAttr(SUMO_ATTR_TIME, time2string(t)); } - const PollutantsInterface::Emissions e = computeEmissions(id, c, v, a, s); + const PollutantsInterface::Emissions e = computeEmissions(id, c, params, v, a, s); myXMLOut->openTag("vehicle").writeAttr("id", id).writeAttr("eclass", PollutantsInterface::getName(c)); myXMLOut->writeAttr("CO2", e.CO2).writeAttr("CO", e.CO).writeAttr("HC", e.HC).writeAttr("NOx", e.NOx); myXMLOut->writeAttr("PMx", e.PMx).writeAttr("fuel", e.fuel).writeAttr("electricity", e.electricity); diff -Nru sumo-1.11.0/src/tools/TrajectoriesHandler.h sumo-1.12.0/src/tools/TrajectoriesHandler.h --- sumo-1.11.0/src/tools/TrajectoriesHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/tools/TrajectoriesHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ @@ -24,6 +24,7 @@ #include #include +class EnergyParams; // =========================================================================== // class definitions @@ -45,6 +46,7 @@ */ TrajectoriesHandler(const bool computeA, const bool computeAForward, const bool accelZeroCorrection, const SUMOEmissionClass defaultClass, + EnergyParams* params, const double defaultSlope, std::ostream* stdOut, OutputDevice* xmlOut); @@ -52,16 +54,18 @@ ~TrajectoriesHandler(); const PollutantsInterface::Emissions computeEmissions(const std::string id, - const SUMOEmissionClass c, double& v, + const SUMOEmissionClass c, EnergyParams* params, double& v, double& a, double& s); bool writeEmissions(std::ostream& o, const std::string id, const SUMOEmissionClass c, + EnergyParams* params, double t, double& v, double& a, double& s); bool writeXMLEmissions(const std::string id, const SUMOEmissionClass c, + EnergyParams* params, SUMOTime t, double& v, double a = INVALID_VALUE, double s = INVALID_VALUE); @@ -93,6 +97,7 @@ const bool myComputeAForward; const bool myAccelZeroCorrection; const SUMOEmissionClass myDefaultClass; + EnergyParams* myParams; const double myDefaultSlope; std::ostream* myStdOut; OutputDevice* myXMLOut; diff -Nru sumo-1.11.0/src/tools/VTypesHandler.cpp sumo-1.12.0/src/tools/VTypesHandler.cpp --- sumo-1.11.0/src/tools/VTypesHandler.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/tools/VTypesHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,46 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2014-2022 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 VTypesHandler.cpp +/// @author Jakob Erdmann +/// @date 12.01.2022 +/// +// An XML-Handler for reading vTypes +/****************************************************************************/ +#include + +#include +#include +#include +#include "VTypesHandler.h" + + +// =========================================================================== +// method definitions +// =========================================================================== +VTypesHandler::VTypesHandler(const std::string& file, std::map& vTypes) : + SUMORouteHandler(file, "", true), + myVTypes(vTypes) +{} + +void +VTypesHandler::closeVType() { + myVTypes[myCurrentVType->id] = myCurrentVType; + myCurrentVType = nullptr; +} + +VTypesHandler::~VTypesHandler() {} + + + +/****************************************************************************/ diff -Nru sumo-1.11.0/src/tools/VTypesHandler.h sumo-1.12.0/src/tools/VTypesHandler.h --- sumo-1.11.0/src/tools/VTypesHandler.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/tools/VTypesHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,124 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2014-2022 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 VTypesHandler.h +/// @author Jakob Erdmann +/// @date 12.01.2022 +/// +// An XML-Handler for reading vTypes +/****************************************************************************/ +#pragma once +#include + +#include +#include +#include + +class EnergyParams; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class VTypesHandler + * @brief An XML-Handler for amitran and netstate trajectories + * + * This SUMOSAXHandler parses vehicles and their speeds. + */ +class VTypesHandler : public SUMORouteHandler { +public: + static const int INVALID_VALUE = -999999; + +public: + /** @brief Constructor + * + * @param[in] file The file that will be processed + */ + VTypesHandler(const std::string& file, std::map& vTypes); + + + /// @brief Destructor + ~VTypesHandler(); + + void closeVType(); + void openVehicleTypeDistribution(const SUMOSAXAttributes& attrs) { + UNUSED_PARAMETER(attrs); + } + void closeVehicleTypeDistribution() {} + void openRoute(const SUMOSAXAttributes& attrs) { + UNUSED_PARAMETER(attrs); + } + void openFlow(const SUMOSAXAttributes& attrs) { + UNUSED_PARAMETER(attrs); + } + void openRouteFlow(const SUMOSAXAttributes& attrs) { + UNUSED_PARAMETER(attrs); + } + void openTrip(const SUMOSAXAttributes& attrs) { + UNUSED_PARAMETER(attrs); + } + void closeRoute(const bool mayBeDisconnected = false) { + UNUSED_PARAMETER(mayBeDisconnected); + } + void openRouteDistribution(const SUMOSAXAttributes& attrs) { + UNUSED_PARAMETER(attrs); + } + void closeRouteDistribution() {} + void closeVehicle() {} + void closePerson() {} + void closePersonFlow() {} + void closeContainer() {} + void closeContainerFlow() {} + void closeFlow() {} + void closeTrip() {} + void addStop(const SUMOSAXAttributes& attrs) { + UNUSED_PARAMETER(attrs); + } + void addPersonTrip(const SUMOSAXAttributes& attrs) { + UNUSED_PARAMETER(attrs); + } + void addWalk(const SUMOSAXAttributes& attrs) { + UNUSED_PARAMETER(attrs); + } + void addPerson(const SUMOSAXAttributes& attrs) { + UNUSED_PARAMETER(attrs); + } + void addRide(const SUMOSAXAttributes& attrs) { + UNUSED_PARAMETER(attrs); + } + void addContainer(const SUMOSAXAttributes& attrs) { + UNUSED_PARAMETER(attrs); + } + void addTransport(const SUMOSAXAttributes& attrs) { + UNUSED_PARAMETER(attrs); + } + void addTranship(const SUMOSAXAttributes& attrs) { + UNUSED_PARAMETER(attrs); + } + +protected: + + +private: + std::map& myVTypes; + + +private: + /// @brief invalidated copy constructor + VTypesHandler(const VTypesHandler& s); + + /// @brief invalidated assignment operator + VTypesHandler& operator=(const VTypesHandler& s); + + +}; diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_BusStop.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_BusStop.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_BusStop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_BusStop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_BusStop.h sumo-1.12.0/src/traci-server/TraCIServerAPI_BusStop.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_BusStop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_BusStop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Calibrator.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_Calibrator.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Calibrator.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Calibrator.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Calibrator.h sumo-1.12.0/src/traci-server/TraCIServerAPI_Calibrator.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Calibrator.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Calibrator.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_ChargingStation.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_ChargingStation.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_ChargingStation.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_ChargingStation.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -15,7 +15,7 @@ /// @author Jakob Erdmann /// @date 16.03.2020 /// -// APIs for getting/setting busstop values via TraCI +// APIs for getting/setting charging station values via TraCI /****************************************************************************/ #include diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_ChargingStation.h sumo-1.12.0/src/traci-server/TraCIServerAPI_ChargingStation.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_ChargingStation.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_ChargingStation.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Edge.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_Edge.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Edge.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Edge.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Edge.h sumo-1.12.0/src/traci-server/TraCIServerAPI_Edge.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Edge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Edge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_InductionLoop.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_InductionLoop.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_InductionLoop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_InductionLoop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2009-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_InductionLoop.h sumo-1.12.0/src/traci-server/TraCIServerAPI_InductionLoop.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_InductionLoop.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_InductionLoop.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Junction.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_Junction.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Junction.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Junction.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2009-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Junction.h sumo-1.12.0/src/traci-server/TraCIServerAPI_Junction.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Junction.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Junction.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_LaneArea.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_LaneArea.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_LaneArea.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_LaneArea.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_LaneArea.h sumo-1.12.0/src/traci-server/TraCIServerAPI_LaneArea.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_LaneArea.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_LaneArea.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Lane.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_Lane.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Lane.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Lane.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2009-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Lane.h sumo-1.12.0/src/traci-server/TraCIServerAPI_Lane.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Lane.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Lane.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2009-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_MeanData.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_MeanData.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_MeanData.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_MeanData.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -15,7 +15,7 @@ /// @author Jakob Erdmann /// @date 16.03.2020 /// -// APIs for getting/setting busstop values via TraCI +// APIs for getting/setting mean data values via TraCI /****************************************************************************/ #include diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_MeanData.h sumo-1.12.0/src/traci-server/TraCIServerAPI_MeanData.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_MeanData.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_MeanData.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_MultiEntryExit.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_MultiEntryExit.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_MultiEntryExit.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_MultiEntryExit.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_MultiEntryExit.h sumo-1.12.0/src/traci-server/TraCIServerAPI_MultiEntryExit.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_MultiEntryExit.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_MultiEntryExit.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_OverheadWire.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_OverheadWire.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_OverheadWire.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_OverheadWire.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -15,7 +15,7 @@ /// @author Jakob Erdmann /// @date 16.03.2020 /// -// APIs for getting/setting busstop values via TraCI +// APIs for getting/setting overhead wire values via TraCI /****************************************************************************/ #include diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_OverheadWire.h sumo-1.12.0/src/traci-server/TraCIServerAPI_OverheadWire.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_OverheadWire.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_OverheadWire.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_ParkingArea.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_ParkingArea.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_ParkingArea.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_ParkingArea.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -15,7 +15,7 @@ /// @author Jakob Erdmann /// @date 16.03.2020 /// -// APIs for getting/setting busstop values via TraCI +// APIs for getting/setting parking area values via TraCI /****************************************************************************/ #include diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_ParkingArea.h sumo-1.12.0/src/traci-server/TraCIServerAPI_ParkingArea.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_ParkingArea.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_ParkingArea.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Person.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_Person.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Person.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Person.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Person.h sumo-1.12.0/src/traci-server/TraCIServerAPI_Person.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Person.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Person.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_POI.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_POI.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_POI.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_POI.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2017-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_POI.h sumo-1.12.0/src/traci-server/TraCIServerAPI_POI.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_POI.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_POI.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Polygon.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_Polygon.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Polygon.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Polygon.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Polygon.h sumo-1.12.0/src/traci-server/TraCIServerAPI_Polygon.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Polygon.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Polygon.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Rerouter.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_Rerouter.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Rerouter.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Rerouter.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -15,7 +15,7 @@ /// @author Jakob Erdmann /// @date 16.03.2020 /// -// APIs for getting/setting busstop values via TraCI +// APIs for getting/setting rerouter values via TraCI /****************************************************************************/ #include diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Rerouter.h sumo-1.12.0/src/traci-server/TraCIServerAPI_Rerouter.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Rerouter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Rerouter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Route.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_Route.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Route.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Route.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Route.h sumo-1.12.0/src/traci-server/TraCIServerAPI_Route.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Route.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Route.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_RouteProbe.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_RouteProbe.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_RouteProbe.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_RouteProbe.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -15,7 +15,7 @@ /// @author Jakob Erdmann /// @date 16.03.2020 /// -// APIs for getting/setting busstop values via TraCI +// APIs for getting/setting RouteProbe values via TraCI /****************************************************************************/ #include diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_RouteProbe.h sumo-1.12.0/src/traci-server/TraCIServerAPI_RouteProbe.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_RouteProbe.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_RouteProbe.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Simulation.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_Simulation.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Simulation.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Simulation.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -18,7 +18,7 @@ /// @author Laura Bieker /// @date Sept 2002 /// -// APIs for getting/setting edge values via TraCI +// APIs for getting/setting simulation values via TraCI /****************************************************************************/ #include diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Simulation.h sumo-1.12.0/src/traci-server/TraCIServerAPI_Simulation.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Simulation.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Simulation.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_TrafficLight.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_TrafficLight.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_TrafficLight.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_TrafficLight.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2009-2022 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/ @@ -45,52 +45,30 @@ if (!libsumo::TrafficLight::handleVariable(id, variable, &server, &inputStorage)) { switch (variable) { case libsumo::TL_COMPLETE_DEFINITION_RYG: { - std::vector logics = libsumo::TrafficLight::getCompleteRedYellowGreenDefinition(id); + std::vector logics = libsumo::TrafficLight::getAllProgramLogics(id); tcpip::Storage& storage = server.getWrapperStorage(); - storage.writeUnsignedByte(libsumo::TYPE_COMPOUND); - storage.writeInt((int)logics.size()); + StoHelp::writeCompound(storage, (int)logics.size()); for (const libsumo::TraCILogic& logic : logics) { - storage.writeUnsignedByte(libsumo::TYPE_COMPOUND); - storage.writeInt(5); - storage.writeUnsignedByte(libsumo::TYPE_STRING); - storage.writeString(logic.programID); - // type - storage.writeUnsignedByte(libsumo::TYPE_INTEGER); - storage.writeInt(logic.type); - // (current) phase index - storage.writeUnsignedByte(libsumo::TYPE_INTEGER); - storage.writeInt(logic.currentPhaseIndex); - // phase number - storage.writeUnsignedByte(libsumo::TYPE_COMPOUND); - storage.writeInt((int)logic.phases.size()); - for (const libsumo::TraCIPhase* phase : logic.phases) { - storage.writeUnsignedByte(libsumo::TYPE_COMPOUND); - storage.writeInt(6); - storage.writeUnsignedByte(libsumo::TYPE_DOUBLE); - storage.writeDouble(phase->duration); - storage.writeUnsignedByte(libsumo::TYPE_STRING); - storage.writeString(phase->state); - storage.writeUnsignedByte(libsumo::TYPE_DOUBLE); - storage.writeDouble(phase->minDur); - storage.writeUnsignedByte(libsumo::TYPE_DOUBLE); - storage.writeDouble(phase->maxDur); - storage.writeUnsignedByte(libsumo::TYPE_COMPOUND); - storage.writeInt((int)phase->next.size()); + StoHelp::writeCompound(storage, 5); + StoHelp::writeTypedString(storage, logic.programID); + StoHelp::writeTypedInt(storage, logic.type); + StoHelp::writeTypedInt(storage, logic.currentPhaseIndex); + StoHelp::writeCompound(storage, (int)logic.phases.size()); + for (const std::shared_ptr& phase : logic.phases) { + StoHelp::writeCompound(storage, 6); + StoHelp::writeTypedDouble(storage, phase->duration); + StoHelp::writeTypedString(storage, phase->state); + StoHelp::writeTypedDouble(storage, phase->minDur); + StoHelp::writeTypedDouble(storage, phase->maxDur); + StoHelp::writeCompound(storage, (int)phase->next.size()); for (int n : phase->next) { - storage.writeUnsignedByte(libsumo::TYPE_INTEGER); - storage.writeInt(n); + StoHelp::writeTypedInt(storage, n); } - storage.writeUnsignedByte(libsumo::TYPE_STRING); - storage.writeString(phase->name); + StoHelp::writeTypedString(storage, phase->name); } - // subparameter - storage.writeUnsignedByte(libsumo::TYPE_COMPOUND); - storage.writeInt((int)logic.subParameter.size()); + StoHelp::writeCompound(storage, (int)logic.subParameter.size()); for (const auto& item : logic.subParameter) { - storage.writeUnsignedByte(libsumo::TYPE_STRINGLIST); - storage.writeInt(2); - storage.writeString(item.first); - storage.writeString(item.second); + StoHelp::writeTypedStringList(storage, std::vector {item.first, item.second}); } } break; diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_TrafficLight.h sumo-1.12.0/src/traci-server/TraCIServerAPI_TrafficLight.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_TrafficLight.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_TrafficLight.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_VariableSpeedSign.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_VariableSpeedSign.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_VariableSpeedSign.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_VariableSpeedSign.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -15,7 +15,7 @@ /// @author Jakob Erdmann /// @date 16.03.2020 /// -// APIs for getting/setting busstop values via TraCI +// APIs for getting/setting variable speed sign values via TraCI /****************************************************************************/ #include diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_VariableSpeedSign.h sumo-1.12.0/src/traci-server/TraCIServerAPI_VariableSpeedSign.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_VariableSpeedSign.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_VariableSpeedSign.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Vehicle.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_Vehicle.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Vehicle.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Vehicle.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2009-2022 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/ @@ -956,6 +956,10 @@ departSpeed = "desired"; } else if (-departSpeedCode == (int)DepartSpeedDefinition::LIMIT) { departSpeed = "speedLimit"; + } else if (-departSpeedCode == (int)DepartSpeedDefinition::LAST) { + departSpeed = "last"; + } else if (-departSpeedCode == (int)DepartSpeedDefinition::AVG) { + departSpeed = "avg"; } int departLaneCode; @@ -1213,6 +1217,17 @@ libsumo::Vehicle::updateBestLanes(id); } break; + case libsumo::VAR_MINGAP_LAT: { + double value = 0; + if (!server.readTypeCheckingDouble(inputStorage, value)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Setting minimum lateral gap requires a double.", outputStorage); + } + if (value < 0.0 || fabs(value) == std::numeric_limits::infinity()) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Invalid minimum lateral gap.", outputStorage); + } + libsumo::Vehicle::setMinGapLat(id, value); + } + break; default: { try { if (!TraCIServerAPI_VehicleType::setVariable(libsumo::CMD_SET_VEHICLE_VARIABLE, variable, v->getSingularType().getID(), server, inputStorage, outputStorage)) { diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_Vehicle.h sumo-1.12.0/src/traci-server/TraCIServerAPI_Vehicle.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_Vehicle.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_Vehicle.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_VehicleType.cpp sumo-1.12.0/src/traci-server/TraCIServerAPI_VehicleType.cpp --- sumo-1.11.0/src/traci-server/TraCIServerAPI_VehicleType.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_VehicleType.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServerAPI_VehicleType.h sumo-1.12.0/src/traci-server/TraCIServerAPI_VehicleType.h --- sumo-1.11.0/src/traci-server/TraCIServerAPI_VehicleType.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServerAPI_VehicleType.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci-server/TraCIServer.cpp sumo-1.12.0/src/traci-server/TraCIServer.cpp --- sumo-1.11.0/src/traci-server/TraCIServer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServer.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ @@ -620,7 +620,7 @@ while (myCurrentSocket != mySockets.end()) { #ifdef DEBUG_MULTI_CLIENTS std::cout << " current socket: " << myCurrentSocket->second->socket - << " with target time " << myCurrentSocket->second->targetTime + << " with target time=" << myCurrentSocket->second->targetTime << std::endl; #endif @@ -628,7 +628,7 @@ // this client must wait #ifdef DEBUG_MULTI_CLIENTS std::cout << " skipping client " << myCurrentSocket->second->socket - << " with target time " << myCurrentSocket->second->targetTime << std::endl; + << " with target time=" << myCurrentSocket->second->targetTime << std::endl; #endif myCurrentSocket++; continue; @@ -979,7 +979,7 @@ TraCIServer::postProcessSimulationStep() { SUMOTime t = MSNet::getInstance()->getCurrentTimeStep(); #ifdef DEBUG_MULTI_CLIENTS - std::cout << " postProcessSimulationStep() at time " << t << std::endl; + std::cout << " postProcessSimulationStep() at time=" << t << std::endl; #endif writeStatusCmd(libsumo::CMD_SIMSTEP, libsumo::RTYPE_OK, ""); int noActive = 0; @@ -1299,13 +1299,14 @@ bool TraCIServer::addSubscriptionFilter() { bool success = true; - if (myLastContextSubscription == nullptr) { - WRITE_WARNING("addSubscriptionFilter: No previous vehicle context subscription exists to apply the context filter."); - return true; - } // Read filter type int filterType = myInputStorage.readUnsignedByte(); + if (myLastContextSubscription == nullptr) { + writeStatusCmd(filterType, libsumo::RTYPE_ERR, "No previous vehicle context subscription exists to apply filter type " + toHex(filterType, 2)); + return false; + } + // dispatch according to filter type switch (filterType) { case libsumo::FILTER_TYPE_NONE: diff -Nru sumo-1.11.0/src/traci-server/TraCIServer.h sumo-1.12.0/src/traci-server/TraCIServer.h --- sumo-1.11.0/src/traci-server/TraCIServer.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci-server/TraCIServer.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci_testclient/testlibsumo_main.cpp sumo-1.12.0/src/traci_testclient/testlibsumo_main.cpp --- sumo-1.11.0/src/traci_testclient/testlibsumo_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci_testclient/testlibsumo_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci_testclient/testlibtraci_main.cpp sumo-1.12.0/src/traci_testclient/testlibtraci_main.cpp --- sumo-1.11.0/src/traci_testclient/testlibtraci_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci_testclient/testlibtraci_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci_testclient/TraCITestClient.cpp sumo-1.12.0/src/traci_testclient/TraCITestClient.cpp --- sumo-1.11.0/src/traci_testclient/TraCITestClient.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci_testclient/TraCITestClient.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2008-2022 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/ @@ -1014,11 +1014,10 @@ } } libsumo::TraCILogic logic("custom", 0, 3); - logic.phases = std::vector({ new libsumo::TraCIPhase(5, "rrrrrrr", 5, 5), - new libsumo::TraCIPhase(10, "ggggggg", 5, 15), - new libsumo::TraCIPhase(3, "GGGGGGG", 3, 3), - new libsumo::TraCIPhase(3, "yyyyyyy", 3, 3) - }); + logic.phases.push_back(std::make_shared(5, "rrrrrrr", 5, 5)); + logic.phases.push_back(std::make_shared(10, "ggggggg", 5, 15)); + logic.phases.push_back(std::make_shared(3, "GGGGGGG", 3, 3)); + logic.phases.push_back(std::make_shared(3, "yyyyyyy", 3, 3)); trafficlights.setProgramLogic("n_m4", logic); std::vector logics = trafficlights.getAllProgramLogics("n_m4"); diff -Nru sumo-1.11.0/src/traci_testclient/TraCITestClient.h sumo-1.12.0/src/traci_testclient/TraCITestClient.h --- sumo-1.11.0/src/traci_testclient/TraCITestClient.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci_testclient/TraCITestClient.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/traci_testclient/tracitestclient_main.cpp sumo-1.12.0/src/traci_testclient/tracitestclient_main.cpp --- sumo-1.11.0/src/traci_testclient/tracitestclient_main.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/traci_testclient/tracitestclient_main.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/CMakeLists.txt sumo-1.12.0/src/utils/common/CMakeLists.txt --- sumo-1.11.0/src/utils/common/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -18,6 +18,7 @@ RandHelper.cpp RGBColor.cpp RGBColor.h + ScopedLocker.h StaticCommand.h StdDefs.h StdDefs.cpp diff -Nru sumo-1.11.0/src/utils/common/Command.h sumo-1.12.0/src/utils/common/Command.h --- sumo-1.11.0/src/utils/common/Command.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/Command.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/FileHelpers.cpp sumo-1.12.0/src/utils/common/FileHelpers.cpp --- sumo-1.11.0/src/utils/common/FileHelpers.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/FileHelpers.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/FileHelpers.h sumo-1.12.0/src/utils/common/FileHelpers.h --- sumo-1.11.0/src/utils/common/FileHelpers.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/FileHelpers.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/IDSupplier.cpp sumo-1.12.0/src/utils/common/IDSupplier.cpp --- sumo-1.11.0/src/utils/common/IDSupplier.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/IDSupplier.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/IDSupplier.h sumo-1.12.0/src/utils/common/IDSupplier.h --- sumo-1.11.0/src/utils/common/IDSupplier.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/IDSupplier.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/InstancePool.h sumo-1.12.0/src/utils/common/InstancePool.h --- sumo-1.11.0/src/utils/common/InstancePool.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/InstancePool.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/MsgHandler.cpp sumo-1.12.0/src/utils/common/MsgHandler.cpp --- sumo-1.11.0/src/utils/common/MsgHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/MsgHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/MsgHandler.h sumo-1.12.0/src/utils/common/MsgHandler.h --- sumo-1.11.0/src/utils/common/MsgHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/MsgHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2003-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2003-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/MsgRetrievingFunction.h sumo-1.12.0/src/utils/common/MsgRetrievingFunction.h --- sumo-1.11.0/src/utils/common/MsgRetrievingFunction.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/MsgRetrievingFunction.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/Named.h sumo-1.12.0/src/utils/common/Named.h --- sumo-1.11.0/src/utils/common/Named.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/Named.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/NamedObjectCont.h sumo-1.12.0/src/utils/common/NamedObjectCont.h --- sumo-1.11.0/src/utils/common/NamedObjectCont.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/NamedObjectCont.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/NamedRTree.h sumo-1.12.0/src/utils/common/NamedRTree.h --- sumo-1.11.0/src/utils/common/NamedRTree.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/NamedRTree.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/Parameterised.cpp sumo-1.12.0/src/utils/common/Parameterised.cpp --- sumo-1.11.0/src/utils/common/Parameterised.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/Parameterised.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/Parameterised.h sumo-1.12.0/src/utils/common/Parameterised.h --- sumo-1.11.0/src/utils/common/Parameterised.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/Parameterised.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -79,7 +79,7 @@ * @param[in] defaultValue The default value to return if no value is stored under the key * @return The value stored under the key */ - const std::string getParameter(const std::string& key, const std::string defaultValue = "") const; + virtual const std::string getParameter(const std::string& key, const std::string defaultValue = "") const; /**@brief Returns the value for a given key converted to a double * @param[in] key The key to ask for diff -Nru sumo-1.11.0/src/utils/common/ParametrisedWrappingCommand.h sumo-1.12.0/src/utils/common/ParametrisedWrappingCommand.h --- sumo-1.11.0/src/utils/common/ParametrisedWrappingCommand.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/ParametrisedWrappingCommand.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/PolySolver.cpp sumo-1.12.0/src/utils/common/PolySolver.cpp --- sumo-1.11.0/src/utils/common/PolySolver.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/PolySolver.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/PolySolver.h sumo-1.12.0/src/utils/common/PolySolver.h --- sumo-1.11.0/src/utils/common/PolySolver.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/PolySolver.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/RandHelper.cpp sumo-1.12.0/src/utils/common/RandHelper.cpp --- sumo-1.11.0/src/utils/common/RandHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/RandHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -87,7 +87,8 @@ const double v = rand(2.0, rng) - 1; q = u * u + v * v; } while (q == 0.0 || q >= 1.0); - return mean + variance * u * sqrt(-2 * log(q) / q); + const double logRounded = ceil(log(q) * 1e14) / 1e14; + return mean + variance * u * sqrt(-2 * logRounded / q); } diff -Nru sumo-1.11.0/src/utils/common/RandHelper.h sumo-1.12.0/src/utils/common/RandHelper.h --- sumo-1.11.0/src/utils/common/RandHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/RandHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/RGBColor.cpp sumo-1.12.0/src/utils/common/RGBColor.cpp --- sumo-1.11.0/src/utils/common/RGBColor.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/RGBColor.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -215,6 +215,14 @@ } } + +RGBColor +RGBColor::changedAlpha(int change) const { + int alpha = MIN2(MAX2((int)myAlpha + change, 0), 255); + return RGBColor(myRed, myGreen, myBlue, (unsigned char)alpha); +} + + RGBColor RGBColor::multiply(double factor) const { const unsigned char red = (unsigned char)floor(MIN2(MAX2(myRed * factor, 0.0), 255.0) + 0.5); @@ -307,7 +315,7 @@ } } } else { - throw EmptyData(); + throw InvalidArgument("Invalid color definition '" + coldef + "'"); } } return RGBColor(r, g, b, a); diff -Nru sumo-1.11.0/src/utils/common/RGBColor.h sumo-1.12.0/src/utils/common/RGBColor.h --- sumo-1.11.0/src/utils/common/RGBColor.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/RGBColor.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -94,6 +94,9 @@ */ RGBColor changedBrightness(int change, int toChange = 3) const; + /// @brief Returns a new color with altered opacity + RGBColor changedAlpha(int change) const; + /** @brief Returns a new color with altered brightness * @param[in] factor The multiplicative change applied to all color channels (within bounds) * @return The new color diff -Nru sumo-1.11.0/src/utils/common/ScopedLocker.h sumo-1.12.0/src/utils/common/ScopedLocker.h --- sumo-1.11.0/src/utils/common/ScopedLocker.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/utils/common/ScopedLocker.h 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,72 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2018-2022 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 ScopedLocker.h +/// @author Michael Behrisch +/// @date 2018-11-14 +/// +// A scoped lock which only triggers on condition +/****************************************************************************/ +#pragma once +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +namespace FX { +class FXMutex; +} + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class ScopedLocker + * @brief A scoped lock which only triggers on condition + */ +template +class ScopedLocker { +public: + +#ifdef _MSC_VER +#pragma warning(push) +// ignore constant conditional expression (C4127) warnings +#pragma warning(disable: 4127) +#endif + /// Construct & lock associated mutex if the condition is true + ScopedLocker(T& m, const bool condition = true) + : myMutex(m), myCondition(condition) { + if (IGNORE_COND || condition) { + m.lock(); + } + } + + /// Destroy and unlock associated mutex + ~ScopedLocker() { + if (IGNORE_COND || myCondition) { + myMutex.unlock(); + } + } +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +private: + T& myMutex; + const bool myCondition; + +private: + ScopedLocker& operator=(const ScopedLocker&) = delete; +}; diff -Nru sumo-1.11.0/src/utils/common/StaticCommand.h sumo-1.12.0/src/utils/common/StaticCommand.h --- sumo-1.11.0/src/utils/common/StaticCommand.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/StaticCommand.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/StdDefs.cpp sumo-1.12.0/src/utils/common/StdDefs.cpp --- sumo-1.11.0/src/utils/common/StdDefs.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/StdDefs.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/StdDefs.h sumo-1.12.0/src/utils/common/StdDefs.h --- sumo-1.11.0/src/utils/common/StdDefs.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/StdDefs.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/StopWatch.h sumo-1.12.0/src/utils/common/StopWatch.h --- sumo-1.11.0/src/utils/common/StopWatch.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/StopWatch.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2020-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2020-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/StringBijection.h sumo-1.12.0/src/utils/common/StringBijection.h --- sumo-1.11.0/src/utils/common/StringBijection.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/StringBijection.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2011-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/StringTokenizer.cpp sumo-1.12.0/src/utils/common/StringTokenizer.cpp --- sumo-1.11.0/src/utils/common/StringTokenizer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/StringTokenizer.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/StringTokenizer.h sumo-1.12.0/src/utils/common/StringTokenizer.h --- sumo-1.11.0/src/utils/common/StringTokenizer.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/StringTokenizer.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/StringUtils.cpp sumo-1.12.0/src/utils/common/StringUtils.cpp --- sumo-1.11.0/src/utils/common/StringUtils.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/StringUtils.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -186,6 +186,12 @@ } +std::string +StringUtils::padFront(const std::string& str, int length, char padding) { + return std::string(MAX2(0, length - (int)str.size()), padding) + str; +} + + std::string StringUtils::escapeXML(const std::string& orig, const bool maskDoubleHyphen) { std::string result = replace(orig, "&", "&"); diff -Nru sumo-1.11.0/src/utils/common/StringUtils.h sumo-1.12.0/src/utils/common/StringUtils.h --- sumo-1.11.0/src/utils/common/StringUtils.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/StringUtils.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -66,6 +66,9 @@ /// Checks whether a given string ends with the suffix static bool endsWith(const std::string& str, const std::string suffix); + //// @brief pads the given string with padding character up to the given total length + static std::string padFront(const std::string& str, int length, char padding); + /** * @brief Replaces the standard escapes by their XML entities. * diff -Nru sumo-1.11.0/src/utils/common/SUMOTime.cpp sumo-1.12.0/src/utils/common/SUMOTime.cpp --- sumo-1.11.0/src/utils/common/SUMOTime.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/SUMOTime.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -71,7 +71,7 @@ oss << "-"; } // needed for signed zero errors, see #5926 - t = abs(t); + t = llabs(t); const SUMOTime scale = (SUMOTime)pow(10, MAX2(0, 3 - gPrecision)); if (scale > 1 && t != SUMOTime_MAX) { t = (t + scale / 2) / scale; diff -Nru sumo-1.11.0/src/utils/common/SUMOTime.h sumo-1.12.0/src/utils/common/SUMOTime.h --- sumo-1.11.0/src/utils/common/SUMOTime.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/SUMOTime.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/SUMOVehicleClass.cpp sumo-1.12.0/src/utils/common/SUMOVehicleClass.cpp --- sumo-1.11.0/src/utils/common/SUMOVehicleClass.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/SUMOVehicleClass.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -85,49 +85,49 @@ static StringBijection::Entry sumoVehicleShapeStringInitializer[] = { - {"pedestrian", SVS_PEDESTRIAN}, - {"bicycle", SVS_BICYCLE}, - {"moped", SVS_MOPED}, - {"motorcycle", SVS_MOTORCYCLE}, - {"passenger", SVS_PASSENGER}, - {"passenger/sedan", SVS_PASSENGER_SEDAN}, - {"passenger/hatchback", SVS_PASSENGER_HATCHBACK}, - {"passenger/wagon", SVS_PASSENGER_WAGON}, - {"passenger/van", SVS_PASSENGER_VAN}, - {"delivery", SVS_DELIVERY}, - {"transport", SVS_TRUCK}, // !!! deprecated - {"truck", SVS_TRUCK}, - {"transport/semitrailer", SVS_TRUCK_SEMITRAILER}, // !!! deprecated - {"truck/semitrailer", SVS_TRUCK_SEMITRAILER}, - {"transport/trailer", SVS_TRUCK_1TRAILER}, // !!! deprecated - {"truck/trailer", SVS_TRUCK_1TRAILER}, - {"bus/city", SVS_BUS}, // !!! deprecated - {"bus", SVS_BUS}, - {"bus/overland", SVS_BUS_COACH}, // !!! deprecated - {"bus/coach", SVS_BUS_COACH}, - {"bus/flexible", SVS_BUS_FLEXIBLE}, - {"bus/trolley", SVS_BUS_TROLLEY}, - {"rail/slow", SVS_RAIL}, // !!! deprecated - {"rail/fast", SVS_RAIL}, // !!! deprecated - {"rail", SVS_RAIL}, - {"rail/light", SVS_RAIL_CAR}, // !!! deprecated - {"rail/city", SVS_RAIL_CAR}, // !!! deprecated - {"rail/railcar", SVS_RAIL_CAR}, - {"rail/cargo", SVS_RAIL_CARGO}, - {"evehicle", SVS_E_VEHICLE}, - {"ant", SVS_ANT}, - {"ship", SVS_SHIP}, - {"emergency", SVS_EMERGENCY}, - {"firebrigade", SVS_FIREBRIGADE}, - {"police", SVS_POLICE}, - {"rickshaw", SVS_RICKSHAW }, - {"scooter", SVS_SCOOTER}, - {"", SVS_UNKNOWN} + {"pedestrian", SUMOVehicleShape::PEDESTRIAN}, + {"bicycle", SUMOVehicleShape::BICYCLE}, + {"moped", SUMOVehicleShape::MOPED}, + {"motorcycle", SUMOVehicleShape::MOTORCYCLE}, + {"passenger", SUMOVehicleShape::PASSENGER}, + {"passenger/sedan", SUMOVehicleShape::PASSENGER_SEDAN}, + {"passenger/hatchback", SUMOVehicleShape::PASSENGER_HATCHBACK}, + {"passenger/wagon", SUMOVehicleShape::PASSENGER_WAGON}, + {"passenger/van", SUMOVehicleShape::PASSENGER_VAN}, + {"delivery", SUMOVehicleShape::DELIVERY}, + {"transport", SUMOVehicleShape::TRUCK}, // !!! deprecated + {"truck", SUMOVehicleShape::TRUCK}, + {"transport/semitrailer", SUMOVehicleShape::TRUCK_SEMITRAILER}, // !!! deprecated + {"truck/semitrailer", SUMOVehicleShape::TRUCK_SEMITRAILER}, + {"transport/trailer", SUMOVehicleShape::TRUCK_1TRAILER}, // !!! deprecated + {"truck/trailer", SUMOVehicleShape::TRUCK_1TRAILER}, + {"bus/city", SUMOVehicleShape::BUS}, // !!! deprecated + {"bus", SUMOVehicleShape::BUS}, + {"bus/overland", SUMOVehicleShape::BUS_COACH}, // !!! deprecated + {"bus/coach", SUMOVehicleShape::BUS_COACH}, + {"bus/flexible", SUMOVehicleShape::BUS_FLEXIBLE}, + {"bus/trolley", SUMOVehicleShape::BUS_TROLLEY}, + {"rail/slow", SUMOVehicleShape::RAIL}, // !!! deprecated + {"rail/fast", SUMOVehicleShape::RAIL}, // !!! deprecated + {"rail", SUMOVehicleShape::RAIL}, + {"rail/light", SUMOVehicleShape::RAIL_CAR}, // !!! deprecated + {"rail/city", SUMOVehicleShape::RAIL_CAR}, // !!! deprecated + {"rail/railcar", SUMOVehicleShape::RAIL_CAR}, + {"rail/cargo", SUMOVehicleShape::RAIL_CARGO}, + {"evehicle", SUMOVehicleShape::E_VEHICLE}, + {"ant", SUMOVehicleShape::ANT}, + {"ship", SUMOVehicleShape::SHIP}, + {"emergency", SUMOVehicleShape::EMERGENCY}, + {"firebrigade", SUMOVehicleShape::FIREBRIGADE}, + {"police", SUMOVehicleShape::POLICE}, + {"rickshaw", SUMOVehicleShape::RICKSHAW }, + {"scooter", SUMOVehicleShape::SCOOTER}, + {"", SUMOVehicleShape::UNKNOWN} }; StringBijection SumoVehicleShapeStrings( - sumoVehicleShapeStringInitializer, SVS_UNKNOWN, false); + sumoVehicleShapeStringInitializer, SUMOVehicleShape::UNKNOWN, false); // =========================================================================== // static values used for cached @@ -158,6 +158,8 @@ const std::string DEFAULT_TAXITYPE_ID("DEFAULT_TAXITYPE"); +const std::set DEFAULT_VTYPES({DEFAULT_VTYPE_ID, DEFAULT_PEDTYPE_ID, DEFAULT_BIKETYPE_ID, DEFAULT_CONTAINERTYPE_ID, DEFAULT_TAXITYPE_ID}); + const double DEFAULT_VEH_PROB(1.); const double DEFAULT_PEDESTRIAN_SPEED(5. / 3.6); diff -Nru sumo-1.11.0/src/utils/common/SUMOVehicleClass.h sumo-1.12.0/src/utils/common/SUMOVehicleClass.h --- sumo-1.11.0/src/utils/common/SUMOVehicleClass.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/SUMOVehicleClass.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -45,67 +45,67 @@ * @enum SUMOVehicleShape * @brief Definition of vehicle classes to differ between different appearences */ -enum SUMOVehicleShape { +enum class SUMOVehicleShape { /// @brief not defined - SVS_UNKNOWN, + UNKNOWN, /// @brief render as a pedestrian - SVS_PEDESTRIAN, + PEDESTRIAN, /// @brief render as a bicycle - SVS_BICYCLE, + BICYCLE, /// @brief render as a moped - SVS_MOPED, + MOPED, /// @brief render as a motorcycle - SVS_MOTORCYCLE, + MOTORCYCLE, /// @brief render as a passenger vehicle - SVS_PASSENGER, + PASSENGER, /// @brief render as a sedan passenger vehicle ("Stufenheck") - SVS_PASSENGER_SEDAN, + PASSENGER_SEDAN, /// @brief render as a hatchback passenger vehicle ("Fliessheck") - SVS_PASSENGER_HATCHBACK, + PASSENGER_HATCHBACK, /// @brief render as a wagon passenger vehicle ("Combi") - SVS_PASSENGER_WAGON, + PASSENGER_WAGON, /// @brief render as a van - SVS_PASSENGER_VAN, + PASSENGER_VAN, /// @brief automated car (with cruise controllers) - //SVS_PASSENGER_AUTOMATED, + //PASSENGER_AUTOMATED, /// @brief render as a delivery vehicle - SVS_DELIVERY, + DELIVERY, /// @brief render as a transport vehicle - SVS_TRUCK, + TRUCK, /// @brief render as a semi-trailer transport vehicle ("Sattelschlepper") - SVS_TRUCK_SEMITRAILER, + TRUCK_SEMITRAILER, /// @brief render as a transport vehicle with one trailer - SVS_TRUCK_1TRAILER, + TRUCK_1TRAILER, /// @brief render as a bus - SVS_BUS, + BUS, /// @brief render as a coach - SVS_BUS_COACH, + BUS_COACH, /// @brief render as a flexible city bus - SVS_BUS_FLEXIBLE, + BUS_FLEXIBLE, /// @brief render as a trolley bus - SVS_BUS_TROLLEY, + BUS_TROLLEY, /// @brief render as a rail - SVS_RAIL, + RAIL, /// @brief render as a (city) rail without locomotive - SVS_RAIL_CAR, + RAIL_CAR, /// @brief render as a cargo train - SVS_RAIL_CARGO, + RAIL_CARGO, /// @brief render as a (futuristic) e-vehicle - SVS_E_VEHICLE, + E_VEHICLE, /// @brief render as a giant ant - SVS_ANT, + ANT, /// @brief render as a arbitrary ship - SVS_SHIP, + SHIP, /// @brief render as an emergency vehicle - SVS_EMERGENCY, + EMERGENCY, /// @brief render as a fire brigade - SVS_FIREBRIGADE, + FIREBRIGADE, /// @brief render as a police car - SVS_POLICE, + POLICE, /// @brief render as a rickshaw - SVS_RICKSHAW, + RICKSHAW, /// @brief render as a scooter - SVS_SCOOTER + SCOOTER }; @@ -427,6 +427,7 @@ extern const std::string DEFAULT_BIKETYPE_ID; extern const std::string DEFAULT_CONTAINERTYPE_ID; extern const std::string DEFAULT_TAXITYPE_ID; +extern const std::set DEFAULT_VTYPES; extern const double DEFAULT_VEH_PROB; // !!! does this belong here? diff -Nru sumo-1.11.0/src/utils/common/SystemFrame.cpp sumo-1.12.0/src/utils/common/SystemFrame.cpp --- sumo-1.11.0/src/utils/common/SystemFrame.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/SystemFrame.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/SystemFrame.h sumo-1.12.0/src/utils/common/SystemFrame.h --- sumo-1.11.0/src/utils/common/SystemFrame.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/SystemFrame.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/SysUtils.cpp sumo-1.12.0/src/utils/common/SysUtils.cpp --- sumo-1.11.0/src/utils/common/SysUtils.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/SysUtils.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/SysUtils.h sumo-1.12.0/src/utils/common/SysUtils.h --- sumo-1.11.0/src/utils/common/SysUtils.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/SysUtils.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/ToString.h sumo-1.12.0/src/utils/common/ToString.h --- sumo-1.11.0/src/utils/common/ToString.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/ToString.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/UtilExceptions.h sumo-1.12.0/src/utils/common/UtilExceptions.h --- sumo-1.11.0/src/utils/common/UtilExceptions.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/UtilExceptions.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/ValueRetriever.h sumo-1.12.0/src/utils/common/ValueRetriever.h --- sumo-1.11.0/src/utils/common/ValueRetriever.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/ValueRetriever.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/ValueSource.h sumo-1.12.0/src/utils/common/ValueSource.h --- sumo-1.11.0/src/utils/common/ValueSource.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/ValueSource.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/ValueTimeLine.h sumo-1.12.0/src/utils/common/ValueTimeLine.h --- sumo-1.11.0/src/utils/common/ValueTimeLine.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/ValueTimeLine.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/VectorHelper.h sumo-1.12.0/src/utils/common/VectorHelper.h --- sumo-1.11.0/src/utils/common/VectorHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/VectorHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/common/WrappingCommand.h sumo-1.12.0/src/utils/common/WrappingCommand.h --- sumo-1.11.0/src/utils/common/WrappingCommand.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/common/WrappingCommand.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/distribution/DistributionCont.cpp sumo-1.12.0/src/utils/distribution/DistributionCont.cpp --- sumo-1.11.0/src/utils/distribution/DistributionCont.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/distribution/DistributionCont.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/distribution/DistributionCont.h sumo-1.12.0/src/utils/distribution/DistributionCont.h --- sumo-1.11.0/src/utils/distribution/DistributionCont.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/distribution/DistributionCont.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/distribution/Distribution.h sumo-1.12.0/src/utils/distribution/Distribution.h --- sumo-1.11.0/src/utils/distribution/Distribution.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/distribution/Distribution.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/distribution/Distribution_Parameterized.cpp sumo-1.12.0/src/utils/distribution/Distribution_Parameterized.cpp --- sumo-1.11.0/src/utils/distribution/Distribution_Parameterized.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/distribution/Distribution_Parameterized.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -98,7 +98,7 @@ double Distribution_Parameterized::sample(SumoRNG* which) const { - if (myParameter[1] == 0.) { + if (myParameter[1] <= 0.) { return myParameter[0]; } double val = RandHelper::randNorm(myParameter[0], myParameter[1], which); @@ -115,7 +115,7 @@ double Distribution_Parameterized::getMax() const { - if (myParameter[1] == 0.) { + if (myParameter[1] <= 0.) { return myParameter[0]; } return myParameter.size() > 3 ? myParameter[3] : std::numeric_limits::infinity(); diff -Nru sumo-1.11.0/src/utils/distribution/Distribution_Parameterized.h sumo-1.12.0/src/utils/distribution/Distribution_Parameterized.h --- sumo-1.11.0/src/utils/distribution/Distribution_Parameterized.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/distribution/Distribution_Parameterized.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/distribution/Distribution_Points.cpp sumo-1.12.0/src/utils/distribution/Distribution_Points.cpp --- sumo-1.11.0/src/utils/distribution/Distribution_Points.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/distribution/Distribution_Points.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/distribution/Distribution_Points.h sumo-1.12.0/src/utils/distribution/Distribution_Points.h --- sumo-1.11.0/src/utils/distribution/Distribution_Points.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/distribution/Distribution_Points.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/distribution/RandomDistributor.h sumo-1.12.0/src/utils/distribution/RandomDistributor.h --- sumo-1.11.0/src/utils/distribution/RandomDistributor.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/distribution/RandomDistributor.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/CharacteristicMap.cpp sumo-1.12.0/src/utils/emissions/CharacteristicMap.cpp --- sumo-1.11.0/src/utils/emissions/CharacteristicMap.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/CharacteristicMap.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/CharacteristicMap.h sumo-1.12.0/src/utils/emissions/CharacteristicMap.h --- sumo-1.11.0/src/utils/emissions/CharacteristicMap.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/CharacteristicMap.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/EnergyParams.cpp sumo-1.12.0/src/utils/emissions/EnergyParams.cpp --- sumo-1.11.0/src/utils/emissions/EnergyParams.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/EnergyParams.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/EnergyParams.h sumo-1.12.0/src/utils/emissions/EnergyParams.h --- sumo-1.11.0/src/utils/emissions/EnergyParams.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/EnergyParams.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/HelpersEnergy.cpp sumo-1.12.0/src/utils/emissions/HelpersEnergy.cpp --- sumo-1.11.0/src/utils/emissions/HelpersEnergy.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/HelpersEnergy.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/HelpersEnergy.h sumo-1.12.0/src/utils/emissions/HelpersEnergy.h --- sumo-1.11.0/src/utils/emissions/HelpersEnergy.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/HelpersEnergy.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/HelpersHarmonoise.cpp sumo-1.12.0/src/utils/emissions/HelpersHarmonoise.cpp --- sumo-1.11.0/src/utils/emissions/HelpersHarmonoise.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/HelpersHarmonoise.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/HelpersHarmonoise.h sumo-1.12.0/src/utils/emissions/HelpersHarmonoise.h --- sumo-1.11.0/src/utils/emissions/HelpersHarmonoise.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/HelpersHarmonoise.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/HelpersHBEFA3.cpp sumo-1.12.0/src/utils/emissions/HelpersHBEFA3.cpp --- sumo-1.11.0/src/utils/emissions/HelpersHBEFA3.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/HelpersHBEFA3.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/HelpersHBEFA3.h sumo-1.12.0/src/utils/emissions/HelpersHBEFA3.h --- sumo-1.11.0/src/utils/emissions/HelpersHBEFA3.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/HelpersHBEFA3.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/HelpersHBEFA.cpp sumo-1.12.0/src/utils/emissions/HelpersHBEFA.cpp --- sumo-1.11.0/src/utils/emissions/HelpersHBEFA.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/HelpersHBEFA.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/HelpersHBEFA.h sumo-1.12.0/src/utils/emissions/HelpersHBEFA.h --- sumo-1.11.0/src/utils/emissions/HelpersHBEFA.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/HelpersHBEFA.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/HelpersMMPEVEM.cpp sumo-1.12.0/src/utils/emissions/HelpersMMPEVEM.cpp --- sumo-1.11.0/src/utils/emissions/HelpersMMPEVEM.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/HelpersMMPEVEM.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/HelpersMMPEVEM.h sumo-1.12.0/src/utils/emissions/HelpersMMPEVEM.h --- sumo-1.11.0/src/utils/emissions/HelpersMMPEVEM.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/HelpersMMPEVEM.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/HelpersPHEMlight.cpp sumo-1.12.0/src/utils/emissions/HelpersPHEMlight.cpp --- sumo-1.11.0/src/utils/emissions/HelpersPHEMlight.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/HelpersPHEMlight.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/HelpersPHEMlight.h sumo-1.12.0/src/utils/emissions/HelpersPHEMlight.h --- sumo-1.11.0/src/utils/emissions/HelpersPHEMlight.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/HelpersPHEMlight.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/PHEMCEP.cpp sumo-1.12.0/src/utils/emissions/PHEMCEP.cpp --- sumo-1.11.0/src/utils/emissions/PHEMCEP.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/PHEMCEP.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/PHEMCEP.h sumo-1.12.0/src/utils/emissions/PHEMCEP.h --- sumo-1.11.0/src/utils/emissions/PHEMCEP.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/PHEMCEP.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/PHEMCEPHandler.cpp sumo-1.12.0/src/utils/emissions/PHEMCEPHandler.cpp --- sumo-1.11.0/src/utils/emissions/PHEMCEPHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/PHEMCEPHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/PHEMCEPHandler.h sumo-1.12.0/src/utils/emissions/PHEMCEPHandler.h --- sumo-1.11.0/src/utils/emissions/PHEMCEPHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/PHEMCEPHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/PHEMConstants.h sumo-1.12.0/src/utils/emissions/PHEMConstants.h --- sumo-1.11.0/src/utils/emissions/PHEMConstants.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/PHEMConstants.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/PollutantsInterface.cpp sumo-1.12.0/src/utils/emissions/PollutantsInterface.cpp --- sumo-1.11.0/src/utils/emissions/PollutantsInterface.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/PollutantsInterface.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/utils/emissions/PollutantsInterface.h sumo-1.12.0/src/utils/emissions/PollutantsInterface.h --- sumo-1.11.0/src/utils/emissions/PollutantsInterface.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/emissions/PollutantsInterface.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2013-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2013-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/CMakeLists.txt sumo-1.12.0/src/utils/foxtools/CMakeLists.txt --- sumo-1.11.0/src/utils/foxtools/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -3,11 +3,12 @@ fxexdefs.h FXBaseObject.cpp FXBaseObject.h - FXConditionalLock.h FXLCDLabel.cpp FXLCDLabel.h FXLinkLabel.cpp FXLinkLabel.h + FXGroupBoxModule.h + FXGroupBoxModule.cpp FXMenuCheckIcon.cpp FXMenuCheckIcon.h FXRecentNetworks.cpp diff -Nru sumo-1.11.0/src/utils/foxtools/FXBaseObject.cpp sumo-1.12.0/src/utils/foxtools/FXBaseObject.cpp --- sumo-1.11.0/src/utils/foxtools/FXBaseObject.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXBaseObject.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2003-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2003-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXBaseObject.h sumo-1.12.0/src/utils/foxtools/FXBaseObject.h --- sumo-1.11.0/src/utils/foxtools/FXBaseObject.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXBaseObject.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXConditionalLock.h sumo-1.12.0/src/utils/foxtools/FXConditionalLock.h --- sumo-1.11.0/src/utils/foxtools/FXConditionalLock.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXConditionalLock.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2018-2021 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 FXConditionalLock.h -/// @author Michael Behrisch -/// @date 2018-11-14 -/// -// A scoped lock which only triggers on condition -/****************************************************************************/ - -#ifndef FXConditionalLock_h -#define FXConditionalLock_h -#include - -#include "fxheader.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class FXConditionalLock - * @brief A scoped lock which only triggers on condition - */ -class FXConditionalLock { -public: - /// Construct & lock associated mutex if the condition is true - FXConditionalLock(FXMutex& m, const bool condition) - : myMutex(m), myCondition(condition) { - if (condition) { - m.lock(); - } - } - - /// Destroy and unlock associated mutex - ~FXConditionalLock() { - if (myCondition) { - myMutex.unlock(); - } - } - -private: - FXMutex& myMutex; - const bool myCondition; - -private: - FXConditionalLock& operator=(const FXConditionalLock&) = delete; -}; - - -#endif diff -Nru sumo-1.11.0/src/utils/foxtools/fxexdefs.h sumo-1.12.0/src/utils/foxtools/fxexdefs.h --- sumo-1.11.0/src/utils/foxtools/fxexdefs.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/fxexdefs.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXGroupBoxModule.cpp sumo-1.12.0/src/utils/foxtools/FXGroupBoxModule.cpp --- sumo-1.11.0/src/utils/foxtools/FXGroupBoxModule.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXGroupBoxModule.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,157 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2006-2022 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 FXGroupBoxModule.cpp +/// @author Pablo Alvarez Lopez +/// @date Dec 2021 +/// +// +/****************************************************************************/ + +/* ========================================================================= + * included modules + * ======================================================================= */ +#include + +#include +#include +#include + +#include "FXGroupBoxModule.h" + + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +FXDEFMAP(FXGroupBoxModule) FXGroupBoxModuleMap[] = { + FXMAPFUNC(SEL_PAINT, 0, FXGroupBoxModule::onPaint), + FXMAPFUNC(SEL_COMMAND, MID_GROUPBOXMODULE_COLLAPSE, FXGroupBoxModule::onCmdCollapseButton), + FXMAPFUNC(SEL_COMMAND, MID_GROUPBOXMODULE_SAVE, FXGroupBoxModule::onCmdSaveButton), + FXMAPFUNC(SEL_COMMAND, MID_GROUPBOXMODULE_LOAD, FXGroupBoxModule::onCmdLoadButton), +}; + +// Object implementation +FXIMPLEMENT(FXGroupBoxModule, FXVerticalFrame, FXGroupBoxModuleMap, ARRAYNUMBER(FXGroupBoxModuleMap)) + +// =========================================================================== +// method definitions +// =========================================================================== + +FXGroupBoxModule::FXGroupBoxModule(FXVerticalFrame* contentFrame, const std::string& text, const int options) : + FXVerticalFrame(contentFrame, GUIDesignHorizontalFrame), + myOptions(options), + myCollapsed(false) { + // build button and labels + FXHorizontalFrame* headerFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + if (myOptions & Options::COLLAPSIBLE) { + myCollapseButton = new FXButton(headerFrame, "", GUIIconSubSys::getIcon(GUIIcon::COLLAPSE), this, MID_GROUPBOXMODULE_COLLAPSE, GUIDesignButtonFXGroupBoxModule); + } + if (myOptions & Options::SAVE) { + mySaveButton = new FXButton(headerFrame, "", GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_GROUPBOXMODULE_SAVE, GUIDesignButtonFXGroupBoxModule); + } + if (myOptions & Options::LOAD) { + myLoadButton = new FXButton(headerFrame, "", GUIIconSubSys::getIcon(GUIIcon::OPEN_NET), this, MID_GROUPBOXMODULE_LOAD, GUIDesignButtonFXGroupBoxModule); + } + myLabel = new FXLabel(headerFrame, text.c_str(), nullptr, GUIDesignLabelFXGroupBoxModule); + // build collapsable frame + myCollapsableFrame = new FXVerticalFrame(this, GUIDesignCollapsableFrame); +} + + +FXGroupBoxModule::~FXGroupBoxModule() {} + + +void +FXGroupBoxModule::setText(const std::string& text) { + myLabel->setText(text.c_str()); +} + + +FXVerticalFrame* +FXGroupBoxModule::getCollapsableFrame() { + return myCollapsableFrame; +} + + +long +FXGroupBoxModule::onPaint(FXObject*, FXSelector, void* ptr) { + FXEvent* event = (FXEvent*)ptr; + FXDCWindow dc(this, event); + // Paint background + dc.setForeground(backColor); + dc.fillRectangle(event->rect.x, event->rect.y, event->rect.w, event->rect.h); + // draw groove rectangle + drawGrooveRectangle(dc, 0, 15, width, height - 15); + return 1; +} + + +long +FXGroupBoxModule::onCmdCollapseButton(FXObject*, FXSelector, void*) { + if (myCollapsed) { + myCollapsed = false; + myCollapseButton->setIcon(GUIIconSubSys::getIcon(GUIIcon::COLLAPSE)); + myCollapsableFrame->show(); + } else { + myCollapsed = true; + myCollapseButton->setIcon(GUIIconSubSys::getIcon(GUIIcon::UNCOLLAPSE)); + myCollapsableFrame->hide(); + } + recalc(); + return 1; +} + + +long +FXGroupBoxModule::onCmdSaveButton(FXObject*, FXSelector, void*) { + return saveContents(); +} + + +long +FXGroupBoxModule::onCmdLoadButton(FXObject*, FXSelector, void*) { + return loadContents(); +} + + +FXGroupBoxModule::FXGroupBoxModule() : + myOptions(Options::NOTHING), + myCollapsed(false) { +} + + +bool +FXGroupBoxModule::saveContents() const { + // nothing to do + return false; +} + + +bool +FXGroupBoxModule::loadContents() const { + // nothing to do + return false; +} + + +void +FXGroupBoxModule::toogleSaveButton(const bool value) { + if (mySaveButton) { + if (value) { + mySaveButton->enable(); + } else { + mySaveButton->disable(); + } + } +} diff -Nru sumo-1.11.0/src/utils/foxtools/FXGroupBoxModule.h sumo-1.12.0/src/utils/foxtools/FXGroupBoxModule.h --- sumo-1.11.0/src/utils/foxtools/FXGroupBoxModule.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXGroupBoxModule.h 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,97 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2006-2022 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 FXGroupBoxModule.h +/// @author Pablo Alvarez Lopez +/// @date Dec 2021 +/// +// +/****************************************************************************/ + +#pragma once +#include + +#include "fxheader.h" + +/// @brief FXGroupBoxModule (based on FXGroupBox) +class FXGroupBoxModule : protected FXVerticalFrame { + FXDECLARE(FXGroupBoxModule) + +public: + /// @brief GroupBoxModule options + enum Options { + NOTHING = 1 << 0, // Collapsible groupBox + COLLAPSIBLE = 1 << 1, // Collapsible groupBox + SAVE = 1 << 2, // Save contents + LOAD = 1 << 3, // Load contents + }; + + /// @brief constructor + FXGroupBoxModule(FXVerticalFrame* contentFrame, const std::string& text, const int options = Options::COLLAPSIBLE); + + /// @brief destructor + ~FXGroupBoxModule(); + + /// @brief set text + void setText(const std::string& text); + + /// @brief get collapsable frame (used by all elements that will be collapsed if button is toogled) + FXVerticalFrame* getCollapsableFrame(); + + /// @brief draw FXGroupBoxModule + long onPaint(FXObject*, FXSelector, void*); + + /// @brief collapse GroupBoxModule + long onCmdCollapseButton(FXObject*, FXSelector, void*); + + /// @brief save contents + long onCmdSaveButton(FXObject*, FXSelector, void*); + + /// @brief load contents + long onCmdLoadButton(FXObject*, FXSelector, void*); + +protected: + /// @brief FOX need this + FXGroupBoxModule(); + + /// @brief save contents (can be reimplemented in children) + virtual bool saveContents() const; + + /// @brief load contents (can be reimplemented in children) + virtual bool loadContents() const; + + /// @brief enable or disable save buttons + void toogleSaveButton(const bool value); + +private: + /// @brief GroupBoxModule options + const int myOptions; + + /// @brief vertical collapsable frame + FXVerticalFrame* myCollapsableFrame = nullptr; + + /// @brief label used in non collapsable FXGroupBoxModule + FXLabel* myLabel = nullptr; + + /// @brief button for collapse elements + FXButton* myCollapseButton = nullptr; + + /// @brief button for save elements + FXButton* mySaveButton = nullptr; + + /// @brief button for load elements + FXButton* myLoadButton = nullptr; + + /// @brief flag to check if this groupbox is collapsed + bool myCollapsed; +}; diff -Nru sumo-1.11.0/src/utils/foxtools/fxheader.h sumo-1.12.0/src/utils/foxtools/fxheader.h --- sumo-1.11.0/src/utils/foxtools/fxheader.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/fxheader.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXLCDLabel.cpp sumo-1.12.0/src/utils/foxtools/FXLCDLabel.cpp --- sumo-1.11.0/src/utils/foxtools/FXLCDLabel.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXLCDLabel.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXLCDLabel.h sumo-1.12.0/src/utils/foxtools/FXLCDLabel.h --- sumo-1.11.0/src/utils/foxtools/FXLCDLabel.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXLCDLabel.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXLinkLabel.cpp sumo-1.12.0/src/utils/foxtools/FXLinkLabel.cpp --- sumo-1.11.0/src/utils/foxtools/FXLinkLabel.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXLinkLabel.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXLinkLabel.h sumo-1.12.0/src/utils/foxtools/FXLinkLabel.h --- sumo-1.11.0/src/utils/foxtools/FXLinkLabel.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXLinkLabel.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXMenuCheckIcon.cpp sumo-1.12.0/src/utils/foxtools/FXMenuCheckIcon.cpp --- sumo-1.11.0/src/utils/foxtools/FXMenuCheckIcon.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXMenuCheckIcon.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXMenuCheckIcon.h sumo-1.12.0/src/utils/foxtools/FXMenuCheckIcon.h --- sumo-1.11.0/src/utils/foxtools/FXMenuCheckIcon.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXMenuCheckIcon.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXRecentNetworks.cpp sumo-1.12.0/src/utils/foxtools/FXRecentNetworks.cpp --- sumo-1.11.0/src/utils/foxtools/FXRecentNetworks.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXRecentNetworks.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXRecentNetworks.h sumo-1.12.0/src/utils/foxtools/FXRecentNetworks.h --- sumo-1.11.0/src/utils/foxtools/FXRecentNetworks.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXRecentNetworks.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXSevenSegment.cpp sumo-1.12.0/src/utils/foxtools/FXSevenSegment.cpp --- sumo-1.11.0/src/utils/foxtools/FXSevenSegment.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXSevenSegment.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXSevenSegment.h sumo-1.12.0/src/utils/foxtools/FXSevenSegment.h --- sumo-1.11.0/src/utils/foxtools/FXSevenSegment.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXSevenSegment.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXSingleEventThread.cpp sumo-1.12.0/src/utils/foxtools/FXSingleEventThread.cpp --- sumo-1.11.0/src/utils/foxtools/FXSingleEventThread.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXSingleEventThread.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXSingleEventThread.h sumo-1.12.0/src/utils/foxtools/FXSingleEventThread.h --- sumo-1.11.0/src/utils/foxtools/FXSingleEventThread.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXSingleEventThread.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXSynchQue.h sumo-1.12.0/src/utils/foxtools/FXSynchQue.h --- sumo-1.11.0/src/utils/foxtools/FXSynchQue.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXSynchQue.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXSynchSet.h sumo-1.12.0/src/utils/foxtools/FXSynchSet.h --- sumo-1.11.0/src/utils/foxtools/FXSynchSet.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXSynchSet.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXThreadEvent.cpp sumo-1.12.0/src/utils/foxtools/FXThreadEvent.cpp --- sumo-1.11.0/src/utils/foxtools/FXThreadEvent.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXThreadEvent.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXThreadEvent.h sumo-1.12.0/src/utils/foxtools/FXThreadEvent.h --- sumo-1.11.0/src/utils/foxtools/FXThreadEvent.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXThreadEvent.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXThreadMessageRetriever.h sumo-1.12.0/src/utils/foxtools/FXThreadMessageRetriever.h --- sumo-1.11.0/src/utils/foxtools/FXThreadMessageRetriever.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXThreadMessageRetriever.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXTreeListDinamic.cpp sumo-1.12.0/src/utils/foxtools/FXTreeListDinamic.cpp --- sumo-1.11.0/src/utils/foxtools/FXTreeListDinamic.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXTreeListDinamic.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXTreeListDinamic.h sumo-1.12.0/src/utils/foxtools/FXTreeListDinamic.h --- sumo-1.11.0/src/utils/foxtools/FXTreeListDinamic.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXTreeListDinamic.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/FXWorkerThread.h sumo-1.12.0/src/utils/foxtools/FXWorkerThread.h --- sumo-1.11.0/src/utils/foxtools/FXWorkerThread.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/FXWorkerThread.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/MFXAddEditTypedTable.cpp sumo-1.12.0/src/utils/foxtools/MFXAddEditTypedTable.cpp --- sumo-1.11.0/src/utils/foxtools/MFXAddEditTypedTable.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXAddEditTypedTable.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/MFXAddEditTypedTable.h sumo-1.12.0/src/utils/foxtools/MFXAddEditTypedTable.h --- sumo-1.11.0/src/utils/foxtools/MFXAddEditTypedTable.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXAddEditTypedTable.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/MFXCheckableButton.cpp sumo-1.12.0/src/utils/foxtools/MFXCheckableButton.cpp --- sumo-1.11.0/src/utils/foxtools/MFXCheckableButton.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXCheckableButton.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/MFXCheckableButton.h sumo-1.12.0/src/utils/foxtools/MFXCheckableButton.h --- sumo-1.11.0/src/utils/foxtools/MFXCheckableButton.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXCheckableButton.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/MFXEditableTable.cpp sumo-1.12.0/src/utils/foxtools/MFXEditableTable.cpp --- sumo-1.11.0/src/utils/foxtools/MFXEditableTable.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXEditableTable.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/MFXEditableTable.h sumo-1.12.0/src/utils/foxtools/MFXEditableTable.h --- sumo-1.11.0/src/utils/foxtools/MFXEditableTable.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXEditableTable.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ @@ -131,7 +131,7 @@ FXString myPreviousText; protected: - MFXEditableTable() { } + FOX_CONSTRUCTOR(MFXEditableTable) }; diff -Nru sumo-1.11.0/src/utils/foxtools/MFXIconComboBox.cpp sumo-1.12.0/src/utils/foxtools/MFXIconComboBox.cpp --- sumo-1.11.0/src/utils/foxtools/MFXIconComboBox.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXIconComboBox.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ @@ -37,6 +37,7 @@ #define ICON_SPACING 4 // Spacing between icon and label #define COMBOBOX_INS_MASK (COMBOBOX_REPLACE | COMBOBOX_INSERT_BEFORE | COMBOBOX_INSERT_AFTER | COMBOBOX_INSERT_FIRST | COMBOBOX_INSERT_LAST) #define COMBOBOX_MASK (COMBOBOX_STATIC | COMBOBOX_INS_MASK) +#define ICON_HEIGHT 20 // Map FXDEFMAP(MFXIconComboBox) MFXIconComboBoxMap[] = { @@ -126,12 +127,13 @@ flags |= FLAG_ENABLED; target = tgt; message = sel; + myIconLabel = new FXLabel(this, "", nullptr, 0, 0, 0, 0, 0, pl, pr, pt, pb); myTextFieldIcon = new MFXTextFieldIcon(this, cols, this, MFXIconComboBox::ID_TEXT, 0, 0, 0, 0, 0, pl, pr, pt, pb); if (options & COMBOBOX_STATIC) { myTextFieldIcon->setEditable(FALSE); } myPane = new FXPopup(this, FRAME_LINE); - myList = new FXList(myPane, this, MFXIconComboBox::ID_LIST, LIST_BROWSESELECT | LIST_AUTOSELECT | LAYOUT_FILL_X | LAYOUT_FILL_Y | SCROLLERS_TRACK | HSCROLLER_NEVER); + myList = new FXList(myPane, this, MFXIconComboBox::ID_LIST, LIST_BROWSESELECT | LIST_AUTOSELECT | LAYOUT_FILL_X | LAYOUT_FIX_HEIGHT | SCROLLERS_TRACK | HSCROLLER_NEVER); if (options & COMBOBOX_STATIC) { myList->setScrollStyle(SCROLLERS_TRACK | HSCROLLING_OFF); } @@ -145,6 +147,7 @@ MFXIconComboBox::~MFXIconComboBox() { delete myPane; myPane = (FXPopup*) - 1L; + myIconLabel = (FXLabel*) - 1L; myTextFieldIcon = (MFXTextFieldIcon*) - 1L; myButton = (FXMenuButton*) - 1L; myList = (FXList*) - 1L; @@ -176,6 +179,7 @@ MFXIconComboBox::enable() { if (!isEnabled()) { FXPacker::enable(); + myIconLabel->enable(); myTextFieldIcon->enable(); myButton->enable(); } @@ -186,6 +190,7 @@ MFXIconComboBox::disable() { if (isEnabled()) { FXPacker::disable(); + myIconLabel->disable(); myTextFieldIcon->disable(); myButton->disable(); } @@ -195,7 +200,7 @@ FXint MFXIconComboBox::getDefaultWidth() { FXint ww, pw; - ww = myTextFieldIcon->getDefaultWidth() + myButton->getDefaultWidth() + (border << 1); + ww = myIconLabel->getDefaultWidth() + myTextFieldIcon->getDefaultWidth() + myButton->getDefaultWidth() + (border << 1); pw = myPane->getDefaultWidth(); return FXMAX(ww, pw); } @@ -212,12 +217,14 @@ void MFXIconComboBox::layout() { - FXint buttonWidth, textWidth, itemHeight; + FXint buttonWidth, textWidth, itemHeight, iconSize; itemHeight = height - (border << 1); + iconSize = itemHeight; buttonWidth = myButton->getDefaultWidth(); - textWidth = width - buttonWidth - (border << 1); - myTextFieldIcon->position(border, border, textWidth, itemHeight); - myButton->position(border + textWidth, border, buttonWidth, itemHeight); + textWidth = width - buttonWidth - iconSize - (border << 1); + myIconLabel->position(border, border, iconSize, iconSize); + myTextFieldIcon->position(border + iconSize, border, textWidth, itemHeight); + myButton->position(border + textWidth + iconSize, border, buttonWidth, itemHeight); myPane->resize(width, myPane->getDefaultHeight()); flags &= ~FLAG_DIRTY; } @@ -268,6 +275,8 @@ void MFXIconComboBox::setNumVisible(FXint nvis) { myList->setNumVisible(nvis); + // set height manually (due icons) + myList->setHeight(nvis * ICON_HEIGHT); } @@ -290,9 +299,13 @@ if (item) { myTextFieldIcon->setText(item->getText()); myTextFieldIcon->setBackColor(item->getBackGroundColor()); - myTextFieldIcon->setIcon(item->getIcon()); + myIconLabel->setIcon(item->getIcon()); + myIconLabel->setBackColor(item->getBackGroundColor()); } else { myTextFieldIcon->resetTextField(); + myTextFieldIcon->setBackColor(FXRGB(255, 255, 255)); + myIconLabel->setIcon(nullptr); + myIconLabel->setBackColor(FXRGB(255, 255, 255)); } } else { myTextFieldIcon->resetTextField(); @@ -324,8 +337,9 @@ myList->setItem(index, text, NULL, ptr); if (isItemCurrent(index)) { myTextFieldIcon->setText(text); - myTextFieldIcon->setIcon(icon); myTextFieldIcon->setBackColor(bgColor); + myIconLabel->setIcon(icon); + myIconLabel->setBackColor(bgColor); } recalc(); return index; @@ -340,8 +354,9 @@ myList->insertItem(index, text, NULL, ptr); if (isItemCurrent(index)) { myTextFieldIcon->setText(text); - myTextFieldIcon->setIcon(icon); myTextFieldIcon->setBackColor(bgColor); + myIconLabel->setIcon(icon); + myIconLabel->setBackColor(bgColor); } recalc(); return index; @@ -353,8 +368,9 @@ FXint index = myList->appendItem(new MFXListItem(text, icon, bgColor, ptr)); if (isItemCurrent(getNumItems() - 1)) { myTextFieldIcon->setText(text); - myTextFieldIcon->setIcon(icon); myTextFieldIcon->setBackColor(bgColor); + myIconLabel->setIcon(icon); + myIconLabel->setBackColor(bgColor); } recalc(); return index; @@ -381,6 +397,9 @@ FXint index = myList->prependItem(text, NULL, ptr); if (isItemCurrent(0)) { myTextFieldIcon->setText(text); + myTextFieldIcon->setBackColor(FXRGB(255, 255, 255)); + myIconLabel->setIcon(nullptr); + myIconLabel->setBackColor(FXRGB(255, 255, 255)); } recalc(); return index; @@ -401,6 +420,8 @@ } else { myTextFieldIcon->setText(" "); } + myIconLabel->setIcon(nullptr); + myIconLabel->setBackColor(FXRGB(255, 255, 255)); } recalc(); return newindex; @@ -418,6 +439,8 @@ } else { myTextFieldIcon->setText(FXString::null); } + myIconLabel->setIcon(nullptr); + myIconLabel->setBackColor(FXRGB(255, 255, 255)); } recalc(); } @@ -522,6 +545,7 @@ void MFXIconComboBox::setBackColor(FXColor clr) { myTextFieldIcon->setBackColor(clr); + myIconLabel->setBackColor(clr); myList->setBackColor(clr); } @@ -635,7 +659,8 @@ if (item) { myTextFieldIcon->setText(item->getText()); myTextFieldIcon->setBackColor(item->getBackGroundColor()); - myTextFieldIcon->setIcon(item->getIcon()); + myIconLabel->setIcon(item->getIcon()); + myIconLabel->setBackColor(item->getBackGroundColor()); } if (!(options & COMBOBOX_STATIC)) { // Select if editable @@ -694,6 +719,10 @@ break; } } + // reset icon and color + myTextFieldIcon->setBackColor(FXRGB(255, 255, 255)); + myIconLabel->setIcon(nullptr); + myIconLabel->setBackColor(FXRGB(255, 255, 255)); return target && target->tryHandle(this, FXSEL(SEL_COMMAND, message), ptr); } diff -Nru sumo-1.11.0/src/utils/foxtools/MFXIconComboBox.h sumo-1.12.0/src/utils/foxtools/MFXIconComboBox.h --- sumo-1.11.0/src/utils/foxtools/MFXIconComboBox.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXIconComboBox.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ @@ -266,6 +266,9 @@ /// @brief FOX need this MFXIconComboBox(); + /// @brief label for icon + FXLabel* myIconLabel = nullptr; + /// @brief textField with icon MFXTextFieldIcon* myTextFieldIcon = nullptr; diff -Nru sumo-1.11.0/src/utils/foxtools/MFXImageHelper.cpp sumo-1.12.0/src/utils/foxtools/MFXImageHelper.cpp --- sumo-1.11.0/src/utils/foxtools/MFXImageHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXImageHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/MFXImageHelper.h sumo-1.12.0/src/utils/foxtools/MFXImageHelper.h --- sumo-1.11.0/src/utils/foxtools/MFXImageHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXImageHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/MFXInterThreadEventClient.h sumo-1.12.0/src/utils/foxtools/MFXInterThreadEventClient.h --- sumo-1.11.0/src/utils/foxtools/MFXInterThreadEventClient.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXInterThreadEventClient.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/MFXMenuHeader.cpp sumo-1.12.0/src/utils/foxtools/MFXMenuHeader.cpp --- sumo-1.11.0/src/utils/foxtools/MFXMenuHeader.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXMenuHeader.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/MFXMenuHeader.h sumo-1.12.0/src/utils/foxtools/MFXMenuHeader.h --- sumo-1.11.0/src/utils/foxtools/MFXMenuHeader.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXMenuHeader.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/MFXTextFieldIcon.cpp sumo-1.12.0/src/utils/foxtools/MFXTextFieldIcon.cpp --- sumo-1.11.0/src/utils/foxtools/MFXTextFieldIcon.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXTextFieldIcon.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ @@ -20,16 +20,6 @@ #include "MFXTextFieldIcon.h" -// Map -FXDEFMAP(MFXTextFieldIcon) MFXTextFieldIconMap[] = { - FXMAPFUNC(SEL_PAINT, 0, MFXTextFieldIcon::onPaint), - -}; - - -// Object implementation -FXIMPLEMENT(MFXTextFieldIcon, FXTextField, MFXTextFieldIconMap, ARRAYNUMBER(MFXTextFieldIconMap)) - MFXTextFieldIcon::MFXTextFieldIcon(FXComposite* p, FXint ncols, FXObject* tgt, FXSelector sel, FXuint opt, FXint x, FXint y, FXint w, FXint h, FXint pl, FXint pr, FXint pt, FXint pb) : FXTextField(p, ncols, tgt, sel, opt, x, y, w, h, pl, pr, pt, pb), @@ -51,42 +41,6 @@ } -long -MFXTextFieldIcon::onPaint(FXObject*, FXSelector, void* ptr) { - FXEvent* ev = (FXEvent*)ptr; - FXDCWindow dc(this, ev); - const FXint iconWidth = myIcon ? myIcon->getWidth() + 4 : 0; - // Draw frame - drawFrame(dc, 0, 0, width, height); - // Gray background if disabled - if (isEnabled()) { - dc.setForeground(backColor); - } else { - dc.setForeground(baseColor); - } - // Draw background - dc.fillRectangle(border, border, width - (border << 1), height - (border << 1)); - // Draw text, clipped against frame interior - dc.setClipRectangle(border, border, width - (border << 1), height - (border << 1)); - // draw text depending of icon - drawIconTextRange(dc, iconWidth, 0, contents.length()); - // Draw caret - if (flags & FLAG_CARET) { - const int xx = coord(cursor) - 1; - dc.setForeground(cursorColor); - dc.fillRectangle(xx, padtop + border, 1, height - padbottom - padtop - (border << 1)); - dc.fillRectangle(xx - 2, padtop + border, 5, 1); - dc.fillRectangle(xx - 2, height - border - padbottom - 1, 5, 1); - } - return 1; -} - - -MFXTextFieldIcon::MFXTextFieldIcon() : - myIcon(nullptr) { -} - - void MFXTextFieldIcon::drawIconTextRange(FXDCWindow& dc, const FXint iconWidth, FXint fm, FXint to) { FXint sx, ex, xx, yy, cw, hh, ww, si, ei, lx, rx, t; diff -Nru sumo-1.11.0/src/utils/foxtools/MFXTextFieldIcon.h sumo-1.12.0/src/utils/foxtools/MFXTextFieldIcon.h --- sumo-1.11.0/src/utils/foxtools/MFXTextFieldIcon.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXTextFieldIcon.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ @@ -26,7 +26,6 @@ /// @brief FXTextFieldIcon (based on FXTextFieldIcon) class MFXTextFieldIcon : public FXTextField { - FXDECLARE(MFXTextFieldIcon) public: /// @brief constructor @@ -38,13 +37,7 @@ /// @brief reset textField void resetTextField(); - /// @brief paint - long onPaint(FXObject*, FXSelector, void* ptr); - protected: - /// @brief FOX need this - MFXTextFieldIcon(); - /// @brief draw icon text range void drawIconTextRange(FXDCWindow& dc, const FXint iconWidth, FXint fm, FXint to); diff -Nru sumo-1.11.0/src/utils/foxtools/MFXUtils.cpp sumo-1.12.0/src/utils/foxtools/MFXUtils.cpp --- sumo-1.11.0/src/utils/foxtools/MFXUtils.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXUtils.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/MFXUtils.h sumo-1.12.0/src/utils/foxtools/MFXUtils.h --- sumo-1.11.0/src/utils/foxtools/MFXUtils.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MFXUtils.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/utils/foxtools/MsgHandlerSynchronized.h sumo-1.12.0/src/utils/foxtools/MsgHandlerSynchronized.h --- sumo-1.11.0/src/utils/foxtools/MsgHandlerSynchronized.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/foxtools/MsgHandlerSynchronized.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2003-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2003-2022 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/ diff -Nru sumo-1.11.0/src/utils/geom/AbstractPoly.h sumo-1.12.0/src/utils/geom/AbstractPoly.h --- sumo-1.11.0/src/utils/geom/AbstractPoly.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/geom/AbstractPoly.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/geom/Boundary.cpp sumo-1.12.0/src/utils/geom/Boundary.cpp --- sumo-1.11.0/src/utils/geom/Boundary.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/geom/Boundary.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/geom/Boundary.h sumo-1.12.0/src/utils/geom/Boundary.h --- sumo-1.11.0/src/utils/geom/Boundary.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/geom/Boundary.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/geom/Bresenham.cpp sumo-1.12.0/src/utils/geom/Bresenham.cpp --- sumo-1.11.0/src/utils/geom/Bresenham.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/geom/Bresenham.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/geom/Bresenham.h sumo-1.12.0/src/utils/geom/Bresenham.h --- sumo-1.11.0/src/utils/geom/Bresenham.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/geom/Bresenham.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/geom/GeoConvHelper.cpp sumo-1.12.0/src/utils/geom/GeoConvHelper.cpp --- sumo-1.11.0/src/utils/geom/GeoConvHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/geom/GeoConvHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -76,11 +77,11 @@ #ifdef PROJ_API_FILE } else { myProjectionMethod = PROJ; -#ifdef PROJ_VERSION_MAJOR - myProjection = proj_create(PJ_DEFAULT_CTX, proj.c_str()); -#else - myProjection = pj_init_plus(proj.c_str()); -#endif + initProj(proj); + if (myProjection == nullptr) { + // avoid error about missing datum shift file + initProj(std::regex_replace(proj, std::regex("\\+geoidgrids[^ ]*"), std::string(""))); + } if (myProjection == nullptr) { // !!! check pj_errno throw ProcessError("Could not build projection!"); @@ -90,6 +91,18 @@ } +#ifdef PROJ_API_FILE +void +GeoConvHelper::initProj(const std::string& proj) { +#ifdef PROJ_VERSION_MAJOR + myProjection = proj_create(PJ_DEFAULT_CTX, proj.c_str()); +#else + myProjection = pj_init_plus(proj.c_str()); +#endif +} +#endif + + GeoConvHelper::~GeoConvHelper() { #ifdef PROJ_API_FILE if (myProjection != nullptr) { @@ -453,6 +466,7 @@ } #endif if (myProjectionMethod == SIMPLE) { + // Sinusoidal projection (https://en.wikipedia.org/wiki/Sinusoidal_projection) x *= 111320. * cos(DEG2RAD(y)); y *= 111136.; //!!! recheck whether the axes are mirrored diff -Nru sumo-1.11.0/src/utils/geom/GeoConvHelper.h sumo-1.12.0/src/utils/geom/GeoConvHelper.h --- sumo-1.11.0/src/utils/geom/GeoConvHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/geom/GeoConvHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -174,6 +174,8 @@ std::string myProjString; #ifdef PROJ_API_FILE + void initProj(const std::string& proj); + /// @brief The proj.4-projection to use projPJ myProjection; diff -Nru sumo-1.11.0/src/utils/geom/GeomConvHelper.cpp sumo-1.12.0/src/utils/geom/GeomConvHelper.cpp --- sumo-1.11.0/src/utils/geom/GeomConvHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/geom/GeomConvHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/geom/GeomConvHelper.h sumo-1.12.0/src/utils/geom/GeomConvHelper.h --- sumo-1.11.0/src/utils/geom/GeomConvHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/geom/GeomConvHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/geom/GeomHelper.cpp sumo-1.12.0/src/utils/geom/GeomHelper.cpp --- sumo-1.11.0/src/utils/geom/GeomHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/geom/GeomHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/geom/GeomHelper.h sumo-1.12.0/src/utils/geom/GeomHelper.h --- sumo-1.11.0/src/utils/geom/GeomHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/geom/GeomHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/geom/Position.cpp sumo-1.12.0/src/utils/geom/Position.cpp --- sumo-1.11.0/src/utils/geom/Position.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/geom/Position.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/geom/Position.h sumo-1.12.0/src/utils/geom/Position.h --- sumo-1.11.0/src/utils/geom/Position.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/geom/Position.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/geom/PositionVector.cpp sumo-1.12.0/src/utils/geom/PositionVector.cpp --- sumo-1.11.0/src/utils/geom/PositionVector.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/geom/PositionVector.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -38,6 +38,8 @@ #include "GeomHelper.h" #include "Boundary.h" +//#define DEBUG_MOVE2SIDE + // =========================================================================== // static members // =========================================================================== @@ -631,15 +633,7 @@ void PositionVector::sub(const Position& offset) { - sub(offset.x(), offset.y(), offset.z()); -} - - -void -PositionVector::sub(double xoff, double yoff, double zoff) { - for (int i = 0; i < (int)size(); i++) { - (*this)[i].add(-xoff, -yoff, -zoff); - } + add(-offset.x(), -offset.y(), -offset.z()); } @@ -1124,22 +1118,29 @@ return; } removeDoublePoints(POSITION_EPS, true); - if (length2D() == 0) { + if (length2D() == 0 || amount == 0) { return; } PositionVector shape; + std::vector recheck; for (int i = 0; i < static_cast(size()); i++) { if (i == 0) { const Position& from = (*this)[i]; const Position& to = (*this)[i + 1]; if (from != to) { shape.push_back(from - sideOffset(from, to, amount)); +#ifdef DEBUG_MOVE2SIDE + if (gDebugFlag1) std::cout << " " << i << "a=" << shape.back() << "\n"; +#endif } } else if (i == static_cast(size()) - 1) { const Position& from = (*this)[i - 1]; const Position& to = (*this)[i]; if (from != to) { shape.push_back(to - sideOffset(from, to, amount)); +#ifdef DEBUG_MOVE2SIDE + if (gDebugFlag1) std::cout << " " << i << "b=" << shape.back() << "\n"; +#endif } } else { const Position& from = (*this)[i - 1]; @@ -1151,11 +1152,17 @@ if (fabs(extrapolateDev) < POSITION_EPS) { // parallel case, just shift the middle point shape.push_back(me - sideOffset(from, to, amount)); +#ifdef DEBUG_MOVE2SIDE + if (gDebugFlag1) std::cout << " " << i << "c=" << shape.back() << "\n"; +#endif } else if (fabs(extrapolateDev - 2 * me.distanceTo2D(to)) < POSITION_EPS) { // counterparallel case, just shift the middle point PositionVector fromMe2(from, me); fromMe2.extrapolate2D(amount); shape.push_back(fromMe2[1]); +#ifdef DEBUG_MOVE2SIDE + if (gDebugFlag1) std::cout << " " << i << "d=" << shape.back() << " " << i << "_from=" << from << " " << i << "_me=" << me << " " << i << "_to=" << to << "\n"; +#endif } else { Position offsets = sideOffset(from, me, amount); Position offsets2 = sideOffset(me, to, amount); @@ -1163,21 +1170,46 @@ PositionVector l2(me - offsets2, to - offsets2); Position meNew = l1.intersectionPosition2D(l2[0], l2[1], maxExtension); if (meNew == Position::INVALID) { - throw InvalidArgument("no line intersection"); + recheck.push_back(i); + continue; } meNew = meNew + Position(0, 0, me.z()); shape.push_back(meNew); +#ifdef DEBUG_MOVE2SIDE + if (gDebugFlag1) std::cout << " " << i << "e=" << shape.back() << "\n"; +#endif } // copy original z value shape.back().set(shape.back().x(), shape.back().y(), me.z()); + const double angle = localAngle(from, me, to); + if (fabs(angle) > NUMERICAL_EPS) { + const double length = (i == 1 || i + 2 == (int)size() + ? MIN2(from.distanceTo2D(me), me.distanceTo2D(to)) * 2 + : (from.distanceTo2D(me) + me.distanceTo2D(to))); + const double radius = length / angle; +#ifdef DEBUG_MOVE2SIDE + if (gDebugFlag1) std::cout << " i=" << i << " a=" << RAD2DEG(angle) << " l=" << length << " r=" << radius << " t=" << amount * 1.8 << "\n"; +#endif + if ((radius < 0 && -radius < amount * 1.8) || fabs(RAD2DEG(angle)) > 170) { + recheck.push_back(i); + } + } + } + } + if (!recheck.empty()) { + // try to adjust positions to avoid clipping + shape = *this; + for (int i = (int)recheck.size() - 1; i >= 0; i--) { + shape.erase(shape.begin() + recheck[i]); } + shape.move2side(amount, maxExtension); } *this = shape; } void -PositionVector::move2side(std::vector amount, double maxExtension) { +PositionVector::move2sideCustom(std::vector amount, double maxExtension) { if (size() < 2) { return; } @@ -1224,7 +1256,7 @@ PositionVector l2(me - offsets2, to - offsets2); Position meNew = l1.intersectionPosition2D(l2[0], l2[1], maxExtension); if (meNew == Position::INVALID) { - throw InvalidArgument("no line intersection"); + continue; } meNew = meNew + Position(0, 0, me.z()); shape.push_back(meNew); @@ -1237,6 +1269,11 @@ } double +PositionVector::localAngle(const Position& from, const Position& pos, const Position& to) { + return GeomHelper::angleDiff(from.angleTo2D(pos), pos.angleTo2D(to)); +} + +double PositionVector::angleAt2D(int pos) const { if ((pos + 1) < (int)size()) { return (*this)[pos].angleTo2D((*this)[pos + 1]); @@ -1360,7 +1397,7 @@ void -PositionVector::removeDoublePoints(double minDist, bool assertLength, int beginOffset, int endOffset) { +PositionVector::removeDoublePoints(double minDist, bool assertLength, int beginOffset, int endOffset, bool resample) { int curSize = (int)size() - beginOffset - endOffset; if (curSize > 1) { iterator last = begin() + beginOffset; @@ -1368,10 +1405,30 @@ if (last->almostSame(*i, minDist)) { if (i + 1 == end() - endOffset) { // special case: keep the last point and remove the next-to-last - erase(last); - i = end() - endOffset; + if (resample && last > begin() && (last - 1)->distanceTo(*i) >= 2 * minDist) { + // resample rather than remove point after a long segment + const double shiftBack = minDist - last->distanceTo(*i); + //if (gDebugFlag1) std::cout << " resample endOffset beforeLast=" << *(last - 1) << " last=" << *last << " i=" << *i; + (*last) = positionAtOffset(*(last - 1), *last, (last - 1)->distanceTo(*last) - shiftBack); + //if (gDebugFlag1) std::cout << " lastNew=" << *last; + last = i; + ++i; + } else { + erase(last); + i = end() - endOffset; + } } else { - i = erase(i); + if (resample && i + 1 != end() && last->distanceTo(*(i + 1)) >= 2 * minDist) { + // resample rather than remove points before a long segment + const double shiftForward = minDist - last->distanceTo(*i); + //if (gDebugFlag1) std::cout << " resample last=" << *last << " i=" << *i << " next=" << *(i + 1); + (*i) = positionAtOffset(*i, *(i + 1), shiftForward); + //if (gDebugFlag1) std::cout << " iNew=" << *i << "\n"; + last = i; + ++i; + } else { + i = erase(i); + } } curSize--; } else { diff -Nru sumo-1.11.0/src/utils/geom/PositionVector.h sumo-1.12.0/src/utils/geom/PositionVector.h --- sumo-1.11.0/src/utils/geom/PositionVector.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/geom/PositionVector.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -217,16 +217,13 @@ //// @brief check if two positions crosses bool crosses(const Position& p1, const Position& p2) const; - //// @brief add a position + //// @brief add an offset to all positions void add(double xoff, double yoff, double zoff); - //// @brief substract a position + //// @brief add an offset to all positions void add(const Position& offset); - //// @brief add a position - void sub(double xoff, double yoff, double zoff); - - //// @brief substract a position + //// @brief subtract an offset from all positions void sub(const Position& offset); //// @brief adds a position without modifying the vector itself but returning the result @@ -275,7 +272,7 @@ void move2side(double amount, double maxExtension = 100); /// @brief move position vector to side using a custom offset for each geometry point - void move2side(std::vector amount, double maxExtension = 100); + void move2sideCustom(std::vector amount, double maxExtension = 100); /// @brief get angle in certain position of position vector double angleAt2D(int pos) const; @@ -382,7 +379,7 @@ * @param[in] minDist The minimum accepted distance; default: POSITION_EPS * @param[in] assertLength Whether the result must at least contain two points (be a line); default: false, to ensure original behaviour */ - void removeDoublePoints(double minDist = POSITION_EPS, bool assertLength = false, int beginOffset = 0, int endOffset = 0); + void removeDoublePoints(double minDist = POSITION_EPS, bool assertLength = false, int beginOffset = 0, int endOffset = 0, bool resample = false); /// @brief return whether two positions differ in z-coordinate bool hasElevation() const; @@ -422,6 +419,8 @@ /// @brief return a bezier interpolation PositionVector bezier(int numPoints); + static double localAngle(const Position& from, const Position& pos, const Position& to); + private: /// @brief return whether the line segments defined by Line p11,p12 and Line p21,p22 intersect static bool intersects(const Position& p11, const Position& p12, const Position& p21, const Position& p22, const double withinDist = 0., double* x = 0, double* y = 0, double* mu = 0); diff -Nru sumo-1.11.0/src/utils/gui/cursors/Delete_cursor.cpp sumo-1.12.0/src/utils/gui/cursors/Delete_cursor.cpp --- sumo-1.11.0/src/utils/gui/cursors/Delete_cursor.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/cursors/Delete_cursor.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/cursors/GUICursors.h sumo-1.12.0/src/utils/gui/cursors/GUICursors.h --- sumo-1.11.0/src/utils/gui/cursors/GUICursors.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/cursors/GUICursors.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/cursors/GUICursorSubSys.cpp sumo-1.12.0/src/utils/gui/cursors/GUICursorSubSys.cpp --- sumo-1.11.0/src/utils/gui/cursors/GUICursorSubSys.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/cursors/GUICursorSubSys.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/cursors/GUICursorSubSys.h sumo-1.12.0/src/utils/gui/cursors/GUICursorSubSys.h --- sumo-1.11.0/src/utils/gui/cursors/GUICursorSubSys.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/cursors/GUICursorSubSys.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/cursors/Inspect_cursor.cpp sumo-1.12.0/src/utils/gui/cursors/Inspect_cursor.cpp --- sumo-1.11.0/src/utils/gui/cursors/Inspect_cursor.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/cursors/Inspect_cursor.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/cursors/InspectLane_cursor.cpp sumo-1.12.0/src/utils/gui/cursors/InspectLane_cursor.cpp --- sumo-1.11.0/src/utils/gui/cursors/InspectLane_cursor.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/cursors/InspectLane_cursor.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/cursors/MoveElement_cursor.cpp sumo-1.12.0/src/utils/gui/cursors/MoveElement_cursor.cpp --- sumo-1.11.0/src/utils/gui/cursors/MoveElement_cursor.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/cursors/MoveElement_cursor.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/cursors/Select_cursor.cpp sumo-1.12.0/src/utils/gui/cursors/Select_cursor.cpp --- sumo-1.11.0/src/utils/gui/cursors/Select_cursor.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/cursors/Select_cursor.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/cursors/SelectLane_cursor.cpp sumo-1.12.0/src/utils/gui/cursors/SelectLane_cursor.cpp --- sumo-1.11.0/src/utils/gui/cursors/SelectLane_cursor.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/cursors/SelectLane_cursor.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GLHelper.cpp sumo-1.12.0/src/utils/gui/div/GLHelper.cpp --- sumo-1.11.0/src/utils/gui/div/GLHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GLHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -599,6 +599,12 @@ } +double +GLHelper::getTextWidth(const std::string& text, double size) { + return size / myFontSize * fonsTextBounds(myFont, 0, 0, text.c_str(), nullptr, nullptr); +} + + void GLHelper::drawText(const std::string& text, const Position& pos, const double layer, const double size, const RGBColor& col, const double angle, const int align, double width) { @@ -738,6 +744,49 @@ GLHelper::popMatrix(); } +void +GLHelper::drawInverseMarkings(const PositionVector& geom, + const std::vector& rots, + const std::vector& lengths, + double maxLength, double spacing, + double halfWidth, bool cl, bool cr, bool lefthand, double scale) { + + double mw = (halfWidth + SUMO_const_laneMarkWidth * (cl ? 0.6 : 0.2)) * scale; + double mw2 = (halfWidth - SUMO_const_laneMarkWidth * (cr ? 0.6 : 0.2)) * scale; + if (cl || cr) { + if (lefthand) { + mw *= -1; + mw2 *= -1; + } + int e = (int) geom.size() - 1; + for (int i = 0; i < e; ++i) { + GLHelper::pushMatrix(); + glTranslated(geom[i].x(), geom[i].y(), 2.1); + glRotated(rots[i], 0, 0, 1); + for (double t = 0; t < lengths[i]; t += spacing) { + const double length = MIN2((double)maxLength, lengths[i] - t); + glBegin(GL_QUADS); + glVertex2d(-mw, -t); + glVertex2d(-mw, -t - length); + glVertex2d(-mw2, -t - length); + glVertex2d(-mw2, -t); + glEnd(); + if (!cl || !cr) { + // draw inverse marking between asymmetrical lane markings + const double length2 = MIN2((double)6, lengths[i] - t); + glBegin(GL_QUADS); + glVertex2d(-halfWidth + 0.02, -t - length2); + glVertex2d(-halfWidth + 0.02, -t - length); + glVertex2d(-halfWidth - 0.02, -t - length); + glVertex2d(-halfWidth - 0.02, -t - length2); + glEnd(); + } + } + GLHelper::popMatrix(); + } + } +} + void GLHelper::debugVertices(const PositionVector& shape, double size, double layer) { diff -Nru sumo-1.11.0/src/utils/gui/div/GLHelper.h sumo-1.12.0/src/utils/gui/div/GLHelper.h --- sumo-1.11.0/src/utils/gui/div/GLHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GLHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -303,6 +303,9 @@ /// @brief gets the gl-color static RGBColor getColor(); + /// @brief get required width of text + static double getTextWidth(const std::string& text, double size); + /* @brief draw Text with given parameters * when width is not given (negative) the font is scaled proportionally in * height and width according to size. @@ -345,6 +348,13 @@ const std::vector& lengths, double length, double spacing, double halfWidth, bool drawForSelection); + /// @bried draw the space between markings (in road color) + static void drawInverseMarkings(const PositionVector& geom, + const std::vector& rots, + const std::vector& lengths, + double maxLength, double spacing, + double halfWidth, bool cl, bool cr, bool lefthand, double scale); + /// @brief draw vertex numbers for the given shape (in a random color) static void debugVertices(const PositionVector& shape, double size, double layer = 256); diff -Nru sumo-1.11.0/src/utils/gui/div/GLObjectValuePassConnector.h sumo-1.12.0/src/utils/gui/div/GLObjectValuePassConnector.h --- sumo-1.11.0/src/utils/gui/div/GLObjectValuePassConnector.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GLObjectValuePassConnector.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIBasePersonHelper.cpp sumo-1.12.0/src/utils/gui/div/GUIBasePersonHelper.cpp --- sumo-1.11.0/src/utils/gui/div/GUIBasePersonHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIBasePersonHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -94,7 +94,7 @@ const SUMOVehicleShape guiShape, const double exaggeration) { // first check if filename isn't empty if (file != "") { - if (guiShape == SVS_PEDESTRIAN) { + if (guiShape == SUMOVehicleShape::PEDESTRIAN) { glRotated(RAD2DEG(angle + M_PI / 2.), 0, 0, 1); } int textureID = GUITexturesHelper::getTextureID(file); diff -Nru sumo-1.11.0/src/utils/gui/div/GUIBasePersonHelper.h sumo-1.12.0/src/utils/gui/div/GUIBasePersonHelper.h --- sumo-1.11.0/src/utils/gui/div/GUIBasePersonHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIBasePersonHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIBaseVehicleHelper.cpp sumo-1.12.0/src/utils/gui/div/GUIBaseVehicleHelper.cpp --- sumo-1.11.0/src/utils/gui/div/GUIBaseVehicleHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIBaseVehicleHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -162,14 +162,14 @@ // draw main body switch (shape) { - case SVS_UNKNOWN: + case SUMOVehicleShape::UNKNOWN: drawPoly(vehiclePoly_PassengerCarBody, 4); GLHelper::setColor(lighter); drawPoly(vehiclePoly_PassengerCarBodyFront, 4.5); glColor3d(0, 0, 0); drawPoly(vehiclePoly_PassengerFrontGlass, 4.5); break; - case SVS_PEDESTRIAN: + case SUMOVehicleShape::PEDESTRIAN: glTranslated(0, 0, .045); GLHelper::drawFilledCircle(0.25); glTranslated(0, 0, -.045); @@ -179,9 +179,9 @@ GLHelper::drawFilledCircle(0.25); glTranslated(0, 0, -.04); break; - case SVS_BICYCLE: - case SVS_MOPED: - case SVS_MOTORCYCLE: { + case SUMOVehicleShape::BICYCLE: + case SUMOVehicleShape::MOPED: + case SUMOVehicleShape::MOTORCYCLE: { darker = current.changedBrightness(-50); // body drawPoly(vehiclePoly_Cyclist, 4); @@ -207,17 +207,17 @@ GLHelper::popMatrix(); } break; - case SVS_PASSENGER: - case SVS_PASSENGER_SEDAN: - case SVS_PASSENGER_HATCHBACK: - case SVS_PASSENGER_WAGON: + case SUMOVehicleShape::PASSENGER: + case SUMOVehicleShape::PASSENGER_SEDAN: + case SUMOVehicleShape::PASSENGER_HATCHBACK: + case SUMOVehicleShape::PASSENGER_WAGON: drawPoly(vehiclePoly_PassengerCarBody, 4); GLHelper::setColor(lighter); drawPoly(vehiclePoly_PassengerCarBodyFront, 4.5); glColor3d(0, 0, 0); drawPoly(vehiclePoly_PassengerFrontGlass, 4.5); break; - case SVS_PASSENGER_VAN: + case SUMOVehicleShape::PASSENGER_VAN: drawPoly(vehiclePoly_PassengerVanBody, 4); GLHelper::setColor(lighter); drawPoly(vehiclePoly_PassengerVanBodyFront, 4.5); @@ -227,7 +227,7 @@ drawPoly(vehiclePoly_PassengerVanLeftGlass, 4.5); drawPoly(vehiclePoly_PassengerVanBackGlass, 4.5); break; - case SVS_DELIVERY: + case SUMOVehicleShape::DELIVERY: drawPoly(vehiclePoly_PassengerVanBody, 4); GLHelper::setColor(lighter); drawPoly(vehiclePoly_PassengerVanBodyFront, 4.5); @@ -236,9 +236,9 @@ drawPoly(vehiclePoly_DeliveryMediumRightGlass, 4.5); drawPoly(vehiclePoly_DeliveryMediumLeftGlass, 4.5); break; - case SVS_TRUCK: - case SVS_TRUCK_SEMITRAILER: - case SVS_TRUCK_1TRAILER: + case SUMOVehicleShape::TRUCK: + case SUMOVehicleShape::TRUCK_SEMITRAILER: + case SUMOVehicleShape::TRUCK_1TRAILER: if (carriageIndex < 1) { glScaled(1. / (length), 1, 1.); drawPoly(vehiclePoly_TransportBody, 4); @@ -248,9 +248,9 @@ drawPoly(vehiclePoly_TransportLeftGlass, 4.5); } break; - case SVS_BUS: - case SVS_BUS_COACH: - case SVS_BUS_TROLLEY: { + case SUMOVehicleShape::BUS: + case SUMOVehicleShape::BUS_COACH: + case SUMOVehicleShape::BUS_TROLLEY: { double ml = length; glScaled(1. / (length), 1, 1.); glTranslated(0, 0, .04); @@ -296,11 +296,11 @@ glTranslated(0, 0, -.045); } break; - case SVS_BUS_FLEXIBLE: - case SVS_RAIL: - case SVS_RAIL_CAR: - case SVS_RAIL_CARGO: - case SVS_E_VEHICLE: + case SUMOVehicleShape::BUS_FLEXIBLE: + case SUMOVehicleShape::RAIL: + case SUMOVehicleShape::RAIL_CAR: + case SUMOVehicleShape::RAIL_CARGO: + case SUMOVehicleShape::E_VEHICLE: drawPoly(vehiclePoly_EVehicleBody, 4); glColor3d(0, 0, 0); drawPoly(vehiclePoly_EVehicleFrontGlass, 4.5); @@ -325,7 +325,7 @@ glTranslated(0, 0, -.048); //drawPoly(vehiclePoly_EVehicleBackGlass, 4.5); break; - case SVS_ANT: + case SUMOVehicleShape::ANT: GLHelper::pushMatrix(); // ant is stretched via vehicle length GLHelper::setColor(darker); @@ -357,7 +357,7 @@ GLHelper::drawFilledCircle(.3, 16); GLHelper::popMatrix(); break; - case SVS_SHIP: { + case SUMOVehicleShape::SHIP: { drawPoly(vehiclePoly_Ship, 4); GLHelper::setColor(current.changedBrightness(-30)); drawPoly(vehiclePoly_ShipDeck, 5); @@ -365,7 +365,7 @@ drawPoly(vehiclePoly_ShipSuperStructure, 6); break; } - case SVS_EMERGENCY: // similar to delivery + case SUMOVehicleShape::EMERGENCY: // similar to delivery drawPoly(vehiclePoly_PassengerVanBody, 4); GLHelper::setColor(darker); drawPoly(vehiclePoly_PassengerVanBodyFront, 4.5); @@ -381,7 +381,7 @@ drawPoly(vehiclePoly_Emergency, 5); drawPoly(vehiclePoly_Emergency2, 5); break; - case SVS_FIREBRIGADE: // similar to delivery in red orange + case SUMOVehicleShape::FIREBRIGADE: // similar to delivery in red orange drawPoly(vehiclePoly_PassengerVanBody, 4); GLHelper::setColor(lighter); drawPoly(vehiclePoly_PassengerVanBodyFront, 4.5); @@ -402,7 +402,7 @@ drawPoly(vehiclePoly_EmergencyLadder6, 5); drawPoly(vehiclePoly_EmergencyLadder7, 5); break; - case SVS_POLICE: // similar to passenger grey with blue + case SUMOVehicleShape::POLICE: // similar to passenger grey with blue drawPoly(vehiclePoly_PassengerCarBody, 4); GLHelper::setColor(lighter); drawPoly(vehiclePoly_PassengerCarBodyFront, 4.5); @@ -416,7 +416,7 @@ drawPoly(vehiclePoly_Emergency, 5); drawPoly(vehiclePoly_Emergency2, 5); break; - case SVS_RICKSHAW: // Rickshaw + case SUMOVehicleShape::RICKSHAW: // Rickshaw drawPoly(vehiclePoly_PassengerCarBody, 4); // wheels GLHelper::setColor(darker); @@ -430,7 +430,7 @@ GLHelper::drawFilledCircle(.3, 6); GLHelper::popMatrix(); break; - case SVS_SCOOTER: { + case SUMOVehicleShape::SCOOTER: { RGBColor darker2 = current.changedBrightness(-25); GLHelper::pushMatrix(); // front small oval @@ -485,9 +485,9 @@ // draw decorations switch (shape) { - case SVS_PEDESTRIAN: + case SUMOVehicleShape::PEDESTRIAN: break; - case SVS_BICYCLE: + case SUMOVehicleShape::BICYCLE: //glScaled(length, 1, 1.); glBegin(GL_TRIANGLE_FAN); glVertex2d(1 / 2., 0); @@ -503,8 +503,8 @@ glVertex2d(0, 0); glEnd(); break; - case SVS_MOPED: - case SVS_MOTORCYCLE: + case SUMOVehicleShape::MOPED: + case SUMOVehicleShape::MOTORCYCLE: //glScaled(length, 1, 1.); glBegin(GL_TRIANGLE_FAN); glVertex2d(1 / 2., 0); @@ -520,36 +520,36 @@ glVertex2d(0, 0); glEnd(); break; - case SVS_PASSENGER: - case SVS_PASSENGER_SEDAN: + case SUMOVehicleShape::PASSENGER: + case SUMOVehicleShape::PASSENGER_SEDAN: drawPoly(vehiclePoly_PassengerSedanRightGlass, 4.5); drawPoly(vehiclePoly_PassengerSedanLeftGlass, 4.5); drawPoly(vehiclePoly_PassengerSedanBackGlass, 4.5); break; - case SVS_PASSENGER_HATCHBACK: + case SUMOVehicleShape::PASSENGER_HATCHBACK: drawPoly(vehiclePoly_PassengerHatchbackRightGlass, 4.5); drawPoly(vehiclePoly_PassengerHatchbackLeftGlass, 4.5); drawPoly(vehiclePoly_PassengerHatchbackBackGlass, 4.5); break; - case SVS_PASSENGER_WAGON: + case SUMOVehicleShape::PASSENGER_WAGON: drawPoly(vehiclePoly_PassengerWagonRightGlass, 4.5); drawPoly(vehiclePoly_PassengerWagonLeftGlass, 4.5); drawPoly(vehiclePoly_PassengerWagonBackGlass, 4.5); break; - case SVS_PASSENGER_VAN: - case SVS_DELIVERY: + case SUMOVehicleShape::PASSENGER_VAN: + case SUMOVehicleShape::DELIVERY: break; - case SVS_TRUCK: + case SUMOVehicleShape::TRUCK: GLHelper::setColor(current); GLHelper::drawBoxLine(Position(2.3, 0), 90., length - 2.3, .5); break; - case SVS_TRUCK_SEMITRAILER: + case SUMOVehicleShape::TRUCK_SEMITRAILER: if (carriageIndex < 0) { GLHelper::setColor(current); GLHelper::drawBoxLine(Position(2.8, 0), 90., length - 2.8, .5); } break; - case SVS_TRUCK_1TRAILER: { + case SUMOVehicleShape::TRUCK_1TRAILER: { GLHelper::setColor(current); double l = length - 2.3; if (carriageIndex != 0) { @@ -561,7 +561,7 @@ } break; } - case SVS_BUS_TROLLEY: + case SUMOVehicleShape::BUS_TROLLEY: GLHelper::pushMatrix(); glTranslated(0, 0, .1); GLHelper::setColor(darker); @@ -574,20 +574,20 @@ GLHelper::drawBoxLine(Position(5.3, -.2), 90., 3, .03); GLHelper::popMatrix(); break; - case SVS_BUS: - case SVS_BUS_COACH: - case SVS_BUS_FLEXIBLE: - case SVS_RAIL: - case SVS_RAIL_CAR: - case SVS_RAIL_CARGO: - case SVS_E_VEHICLE: - case SVS_ANT: - case SVS_SHIP: - case SVS_EMERGENCY: - case SVS_FIREBRIGADE: - case SVS_POLICE: - case SVS_RICKSHAW: - case SVS_SCOOTER: + case SUMOVehicleShape::BUS: + case SUMOVehicleShape::BUS_COACH: + case SUMOVehicleShape::BUS_FLEXIBLE: + case SUMOVehicleShape::RAIL: + case SUMOVehicleShape::RAIL_CAR: + case SUMOVehicleShape::RAIL_CARGO: + case SUMOVehicleShape::E_VEHICLE: + case SUMOVehicleShape::ANT: + case SUMOVehicleShape::SHIP: + case SUMOVehicleShape::EMERGENCY: + case SUMOVehicleShape::FIREBRIGADE: + case SUMOVehicleShape::POLICE: + case SUMOVehicleShape::RICKSHAW: + case SUMOVehicleShape::SCOOTER: break; default: // same as passenger/sedan drawPoly(vehiclePoly_PassengerSedanRightGlass, 4.5); diff -Nru sumo-1.11.0/src/utils/gui/div/GUIBaseVehicleHelper.h sumo-1.12.0/src/utils/gui/div/GUIBaseVehicleHelper.h --- sumo-1.11.0/src/utils/gui/div/GUIBaseVehicleHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIBaseVehicleHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIDesigns.cpp sumo-1.12.0/src/utils/gui/div/GUIDesigns.cpp --- sumo-1.11.0/src/utils/gui/div/GUIDesigns.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIDesigns.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIDesigns.h sumo-1.12.0/src/utils/gui/div/GUIDesigns.h --- sumo-1.11.0/src/utils/gui/div/GUIDesigns.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIDesigns.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -53,7 +53,7 @@ /// @brief text field with thick frame and width 50 and limited to doubles #define GUIDesignTextFielWidth50Real (FRAME_THICK | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT | TEXTFIELD_REAL), 0, 0, 50, GUIDesignHeight, 2, 2, 2, 2 -/// @brief text field with thick frame, width of 180 (Used in GNEVehicleType) +/// @brief text field with thick frame, width of 180 (Used in type frame) #define GUIDesignTextFielWidth180 (FRAME_THICK | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT), 0, 0, 180, GUIDesignHeight, 2, 2, 2, 2 /// @brief Num of column of text field @@ -85,6 +85,9 @@ /// @brief button rectangular with thick and raise frame with a width of 150 #define GUIDesignButtonRectangular150 (FRAME_THICK | FRAME_RAISED | ICON_BEFORE_TEXT | JUSTIFY_CENTER_X | JUSTIFY_CENTER_Y | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT), 0, 0, 150, GUIDesignHeight, 2, 2, 2, 2 +/// @brief button used in GroupBoxModule +#define GUIDesignButtonFXGroupBoxModule (FRAME_LINE | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT), 0, 0, GUIDesignHeight - 1, GUIDesignHeight - 1, 2, 2, 2, 2 + /// @} @@ -153,6 +156,9 @@ /// @brief CheckButton for Frames without thick extended over the frame #define GUIDesignCheckButtonViewSettings (CHECKBUTTON_NORMAL | LAYOUT_CENTER_Y) +/// @brief design for check button with fixed height (used in fix elements dialogs) +#define GUIDesignCheckButtonFix (CHECKBUTTON_NORMAL | JUSTIFY_CENTER_Y | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT | JUSTIFY_LEFT | ICON_BEFORE_TEXT), 0, 0, 200, GUIDesignHeight - 2, 2, 2, 2, 2 + /// @} @@ -175,6 +181,9 @@ /// @brief design for radio button with fixed height #define GUIDesignRadioButtonAttribute (RADIOBUTTON_NORMAL | JUSTIFY_CENTER_Y | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT | JUSTIFY_LEFT | ICON_BEFORE_TEXT | FRAME_THICK), 0, 0, 100, GUIDesignHeight, 2, 2, 2, 2 +/// @brief design for radio button with fixed height (used in fix elements dialogs) +#define GUIDesignRadioButtonFix (RADIOBUTTON_NORMAL | JUSTIFY_CENTER_Y | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT | JUSTIFY_LEFT | ICON_BEFORE_TEXT), 0, 0, 200, GUIDesignHeight - 2, 2, 2, 2, 2 + /// @} @@ -223,7 +232,10 @@ #define GUIDesignLabelIcon64x32Thicked (FRAME_THICK | ICON_BEFORE_TEXT | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT), 0, 0, 94, 46, 2, 2, 2, 2 /// @brief design for label with icon -#define GUIDesignLabelIcon (LAYOUT_CENTER_Y | LAYOUT_CENTER_X ), 0, 0, 0, 0, 2, 2, 0, 0 +#define GUIDesignLabelIcon (LAYOUT_CENTER_Y | LAYOUT_CENTER_X), 0, 0, 0, 0, 2, 2, 0, 0 + +/// @brief label with thick, text justify to left and extended with (used in selector frame) +#define GUIDesignLabelThickCenter (FRAME_THICK | ICON_BEFORE_TEXT | LAYOUT_FILL_X | LAYOUT_FIX_HEIGHT | LAYOUT_CENTER_Y | LAYOUT_CENTER_X), 0, 0, 0, GUIDesignHeight, 2, 2, 2, 2 /// @brief label ticked filled extended over frame used for VClasses/VShapes. (can be used by icons of 64x32 pixels) #define GUIDesignLabelTickedIcon180x46 (FRAME_THICK | ICON_BEFORE_TEXT | LAYOUT_FILL_X | LAYOUT_FIX_HEIGHT | LAYOUT_FIX_WIDTH), 0, 0, 180, 46, 2, 2, 2, 2 @@ -243,6 +255,9 @@ /// @brief label with thick, text justify to left and width of 50 #define GUIDesignLabelThick50 (FRAME_THICK | ICON_BEFORE_TEXT | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT), 0, 0, 50, GUIDesignHeight, 2, 2, 2, 2 +/// @brief label used in GroupBoxModule +#define GUIDesignLabelFXGroupBoxModule (FRAME_GROOVE | LAYOUT_FILL_X | LAYOUT_FIX_HEIGHT), 0, 0, 0, GUIDesignHeight, 2, 2, 2, 2 + /// @} @@ -260,7 +275,7 @@ /// @brief Combo box static (cannot be edited) extended over the matrix column #define GUIDesignComboBoxAttribute (COMBOBOX_NORMAL | FRAME_THICK | LAYOUT_FILL_X | LAYOUT_FIX_HEIGHT), 0, 0, 0, GUIDesignHeight, 2, 2, 2, 2 -/// @brief comboBox with thick frame, width 180 (Used in GNEVehicleType) +/// @brief comboBox with thick frame, width 180 (Used in GNEVType) #define GUIDesignComboBoxWidth180 (COMBOBOX_NORMAL | FRAME_THICK | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT), 0, 0, 180, GUIDesignHeight, 2, 2, 2, 2 /// @brief comboBox with thick frame, width 120 @@ -336,6 +351,9 @@ /// @brief design for the main content frame of every frame/dialog #define GUIDesignContentsFrame (LAYOUT_FILL_X | LAYOUT_FILL_Y) +/// @brief design for CollapsableFrame (Used in FXGroupBoxModule) +#define GUIDesignCollapsableFrame (LAYOUT_FILL_X | LAYOUT_FILL_Y), 0, 0, 0, 0, 2, 2, 2, 2, 2, 2 + /// @} @@ -540,6 +558,9 @@ /// @brief design for tables used in additional dialogs #define GUIDesignTableAdditionals (LAYOUT_FILL_X | LAYOUT_FILL_Y | VSCROLLER_ALWAYS | HSCROLLER_NEVER | TABLE_NO_ROWSELECT | TABLE_NO_COLSELECT), 0, 0, 0, 0, 2, 2, 2, 2 +/// @brief design for tables used in GNEFixDemandElements dialogs +#define GUIDesignTableFixElements (LAYOUT_FILL_X | LAYOUT_FIX_HEIGHT | VSCROLLER_ALWAYS | HSCROLLER_NEVER | TABLE_NO_ROWSELECT | TABLE_NO_COLSELECT), 0, 0, 0, 200, 2, 2, 2, 2 + /// @} diff -Nru sumo-1.11.0/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp sumo-1.12.0/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp --- sumo-1.11.0/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIDialog_GLChosenEditor.h sumo-1.12.0/src/utils/gui/div/GUIDialog_GLChosenEditor.h --- sumo-1.11.0/src/utils/gui/div/GUIDialog_GLChosenEditor.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIDialog_GLChosenEditor.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIDottedGeometry.cpp sumo-1.12.0/src/utils/gui/div/GUIDottedGeometry.cpp --- sumo-1.11.0/src/utils/gui/div/GUIDottedGeometry.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIDottedGeometry.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIDottedGeometry.h sumo-1.12.0/src/utils/gui/div/GUIDottedGeometry.h --- sumo-1.11.0/src/utils/gui/div/GUIDottedGeometry.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIDottedGeometry.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIGeometry.cpp sumo-1.12.0/src/utils/gui/div/GUIGeometry.cpp --- sumo-1.11.0/src/utils/gui/div/GUIGeometry.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIGeometry.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -259,7 +259,7 @@ void GUIGeometry::drawGeometry(const GUIVisualizationSettings& s, const Position& mousePos, - const GUIGeometry& geometry, const double width) { + const GUIGeometry& geometry, const double width, double offset) { // continue depending of draw for position selection if (s.drawForPositionSelection) { // obtain position over lane relative to mouse position @@ -279,7 +279,7 @@ // draw line (needed for zoom out) GLHelper::drawLine(geometry.getShape()); } else { - GLHelper::drawBoxLines(geometry.getShape(), geometry.getShapeRotations(), geometry.getShapeLengths(), width); + GLHelper::drawBoxLines(geometry.getShape(), geometry.getShapeRotations(), geometry.getShapeLengths(), width, 0, offset); } } diff -Nru sumo-1.11.0/src/utils/gui/div/GUIGeometry.h sumo-1.12.0/src/utils/gui/div/GUIGeometry.h --- sumo-1.11.0/src/utils/gui/div/GUIGeometry.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIGeometry.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -90,7 +90,7 @@ const std::vector& lengths, const std::vector& colors, double width, const bool onlyContour = false); /// @brief draw geometry - static void drawGeometry(const GUIVisualizationSettings& s, const Position& mousePos, const GUIGeometry& geometry, const double width); + static void drawGeometry(const GUIVisualizationSettings& s, const Position& mousePos, const GUIGeometry& geometry, const double width, double offset = 0); /// @brief draw contour geometry static void drawContourGeometry(const GUIGeometry& geometry, const double width, const bool drawExtremes = false); diff -Nru sumo-1.11.0/src/utils/gui/div/GUIGlobalSelection.cpp sumo-1.12.0/src/utils/gui/div/GUIGlobalSelection.cpp --- sumo-1.11.0/src/utils/gui/div/GUIGlobalSelection.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIGlobalSelection.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIGlobalSelection.h sumo-1.12.0/src/utils/gui/div/GUIGlobalSelection.h --- sumo-1.11.0/src/utils/gui/div/GUIGlobalSelection.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIGlobalSelection.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIIOGlobals.cpp sumo-1.12.0/src/utils/gui/div/GUIIOGlobals.cpp --- sumo-1.11.0/src/utils/gui/div/GUIIOGlobals.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIIOGlobals.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIIOGlobals.h sumo-1.12.0/src/utils/gui/div/GUIIOGlobals.h --- sumo-1.11.0/src/utils/gui/div/GUIIOGlobals.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIIOGlobals.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIMessageWindow.cpp sumo-1.12.0/src/utils/gui/div/GUIMessageWindow.cpp --- sumo-1.11.0/src/utils/gui/div/GUIMessageWindow.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIMessageWindow.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2003-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2003-2022 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/ @@ -221,23 +221,23 @@ // build the styled message FXint style = 1; switch (eType) { - case EVENT_DEBUG_OCCURRED: + case GUIEventType::DEBUG_OCCURRED: // color: blue style = 0; break; - case EVENT_GLDEBUG_OCCURRED: + case GUIEventType::GLDEBUG_OCCURRED: // color: fuchsia style = 7; break; - case EVENT_ERROR_OCCURRED: + case GUIEventType::ERROR_OCCURRED: // color: red style = 2; break; - case EVENT_WARNING_OCCURRED: + case GUIEventType::WARNING_OCCURRED: // color: yellow style = 3; break; - case EVENT_MESSAGE_OCCURRED: + case GUIEventType::MESSAGE_OCCURRED: // color: green style = 1; break; @@ -321,11 +321,11 @@ GUIMessageWindow::registerMsgHandlers() { if (myMessageRetriever == nullptr) { // initialize only if registration is requested - myMessageRetriever = new MsgOutputDevice(this, EVENT_MESSAGE_OCCURRED); - myErrorRetriever = new MsgOutputDevice(this, EVENT_ERROR_OCCURRED); - myDebugRetriever = new MsgOutputDevice(this, EVENT_DEBUG_OCCURRED); - myGLDebugRetriever = new MsgOutputDevice(this, EVENT_GLDEBUG_OCCURRED); - myWarningRetriever = new MsgOutputDevice(this, EVENT_WARNING_OCCURRED); + myMessageRetriever = new MsgOutputDevice(this, GUIEventType::MESSAGE_OCCURRED); + myErrorRetriever = new MsgOutputDevice(this, GUIEventType::ERROR_OCCURRED); + myDebugRetriever = new MsgOutputDevice(this, GUIEventType::DEBUG_OCCURRED); + myGLDebugRetriever = new MsgOutputDevice(this, GUIEventType::GLDEBUG_OCCURRED); + myWarningRetriever = new MsgOutputDevice(this, GUIEventType::WARNING_OCCURRED); } MsgHandler::getMessageInstance()->addRetriever(myMessageRetriever); MsgHandler::getDebugInstance()->addRetriever(myDebugRetriever); diff -Nru sumo-1.11.0/src/utils/gui/div/GUIMessageWindow.h sumo-1.12.0/src/utils/gui/div/GUIMessageWindow.h --- sumo-1.11.0/src/utils/gui/div/GUIMessageWindow.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIMessageWindow.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2003-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2003-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIParameterTableItem.h sumo-1.12.0/src/utils/gui/div/GUIParameterTableItem.h --- sumo-1.11.0/src/utils/gui/div/GUIParameterTableItem.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIParameterTableItem.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIParameterTableWindow.cpp sumo-1.12.0/src/utils/gui/div/GUIParameterTableWindow.cpp --- sumo-1.11.0/src/utils/gui/div/GUIParameterTableWindow.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIParameterTableWindow.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -146,14 +146,16 @@ if (i->dynamic() && i->getdoubleSourceCopy() != nullptr) { // open tracker directly const std::string trackerName = i->getName() + " from " + myObject->getFullName(); - GUIParameterTracker* tr = new GUIParameterTracker(*myApplication, trackerName); TrackerValueDesc* newTracked = new TrackerValueDesc(i->getName(), RGBColor::BLACK, myApplication->getCurrentSimTime(), myApplication->getTrackerInterval()); - tr->addTracked(*myObject, i->getdoubleSourceCopy(), newTracked); - tr->setX(getX() + getWidth() + 10); - tr->setY(myTrackerY); - tr->create(); - tr->show(); - myTrackerY = (myTrackerY + tr->getHeight() + 20) % getApp()->getRootWindow()->getHeight(); + if (!GUIParameterTracker::addTrackedMultiplot(*myObject, i->getdoubleSourceCopy(), newTracked)) { + GUIParameterTracker* tr = new GUIParameterTracker(*myApplication, trackerName); + tr->addTracked(*myObject, i->getdoubleSourceCopy(), newTracked); + tr->setX(getX() + getWidth() + 10); + tr->setY(myTrackerY); + tr->create(); + tr->show(); + myTrackerY = (myTrackerY + tr->getHeight() + 20) % getApp()->getRootWindow()->getHeight(); + } } } return FXMainWindow::onLeftBtnPress(sender, sel, eventData); diff -Nru sumo-1.11.0/src/utils/gui/div/GUIParameterTableWindow.h sumo-1.12.0/src/utils/gui/div/GUIParameterTableWindow.h --- sumo-1.11.0/src/utils/gui/div/GUIParameterTableWindow.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIParameterTableWindow.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIParam_PopupMenu.cpp sumo-1.12.0/src/utils/gui/div/GUIParam_PopupMenu.cpp --- sumo-1.11.0/src/utils/gui/div/GUIParam_PopupMenu.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIParam_PopupMenu.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -61,11 +61,13 @@ long GUIParam_PopupMenuInterface::onCmdOpenTracker(FXObject*, FXSelector, void*) { std::string trackerName = myVarName + " from " + myObject->getFullName(); - GUIParameterTracker* tr = new GUIParameterTracker(*myApplication, trackerName); TrackerValueDesc* newTracked = new TrackerValueDesc(myVarName, RGBColor::BLACK, myApplication->getCurrentSimTime(), myApplication->getTrackerInterval()); - tr->addTracked(*myObject, mySource->copy(), newTracked); - tr->create(); - tr->show(); + if (!GUIParameterTracker::addTrackedMultiplot(*myObject, mySource->copy(), newTracked)) { + GUIParameterTracker* tr = new GUIParameterTracker(*myApplication, trackerName); + tr->addTracked(*myObject, mySource->copy(), newTracked); + tr->create(); + tr->show(); + } return 1; } diff -Nru sumo-1.11.0/src/utils/gui/div/GUIParam_PopupMenu.h sumo-1.12.0/src/utils/gui/div/GUIParam_PopupMenu.h --- sumo-1.11.0/src/utils/gui/div/GUIParam_PopupMenu.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIParam_PopupMenu.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUISelectedStorage.cpp sumo-1.12.0/src/utils/gui/div/GUISelectedStorage.cpp --- sumo-1.11.0/src/utils/gui/div/GUISelectedStorage.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUISelectedStorage.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUISelectedStorage.h sumo-1.12.0/src/utils/gui/div/GUISelectedStorage.h --- sumo-1.11.0/src/utils/gui/div/GUISelectedStorage.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUISelectedStorage.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIUserIO.cpp sumo-1.12.0/src/utils/gui/div/GUIUserIO.cpp --- sumo-1.11.0/src/utils/gui/div/GUIUserIO.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIUserIO.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIUserIO.h sumo-1.12.0/src/utils/gui/div/GUIUserIO.h --- sumo-1.11.0/src/utils/gui/div/GUIUserIO.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIUserIO.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/GUIVideoEncoder.h sumo-1.12.0/src/utils/gui/div/GUIVideoEncoder.h --- sumo-1.11.0/src/utils/gui/div/GUIVideoEncoder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/GUIVideoEncoder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/div/Roboto.h sumo-1.12.0/src/utils/gui/div/Roboto.h --- sumo-1.11.0/src/utils/gui/div/Roboto.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/div/Roboto.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/events/GUIEvent.h sumo-1.12.0/src/utils/gui/events/GUIEvent.h --- sumo-1.11.0/src/utils/gui/events/GUIEvent.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/events/GUIEvent.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -29,38 +29,38 @@ * As events are distinguished by their number, here is the enumeration * of our custom events */ -enum GUIEventType { +enum class GUIEventType { /// @brief send when a simulation has been loaded - EVENT_SIMULATION_LOADED, + SIMULATION_LOADED, /// @brief send when a simulation step has been performed - EVENT_SIMULATION_STEP, + SIMULATION_STEP, /// @brief send when a message occured - EVENT_MESSAGE_OCCURRED, + MESSAGE_OCCURRED, /// @brief send when a warning occured - EVENT_WARNING_OCCURRED, + WARNING_OCCURRED, /// @brief send when a error occured - EVENT_ERROR_OCCURRED, + ERROR_OCCURRED, /// @brief send when a debug occured - EVENT_DEBUG_OCCURRED, + DEBUG_OCCURRED, /// @brief send when a gldebug occured - EVENT_GLDEBUG_OCCURRED, + GLDEBUG_OCCURRED, /// @brief send when a status change occured - EVENT_STATUS_OCCURRED, + STATUS_OCCURRED, /**@brief Send when the simulation is over; * @note The reason and the time step are stored within the event */ - EVENT_SIMULATION_ENDED, + SIMULATION_ENDED, /// @brief End of events list; use this to define new - EVENT_END + END }; diff -Nru sumo-1.11.0/src/utils/gui/events/GUIEvent_Message.h sumo-1.12.0/src/utils/gui/events/GUIEvent_Message.h --- sumo-1.11.0/src/utils/gui/events/GUIEvent_Message.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/events/GUIEvent_Message.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -37,27 +37,27 @@ public: /// constructor GUIEvent_Message(const std::string& msg) - : GUIEvent(EVENT_STATUS_OCCURRED), myMsg(msg) { + : GUIEvent(GUIEventType::STATUS_OCCURRED), myMsg(msg) { } /// constructor GUIEvent_Message(MsgHandler::MsgType type, const std::string& msg) - : GUIEvent(EVENT_MESSAGE_OCCURRED), myMsg(msg) { + : GUIEvent(GUIEventType::MESSAGE_OCCURRED), myMsg(msg) { switch (type) { case MsgHandler::MsgType::MT_MESSAGE: - myType = EVENT_MESSAGE_OCCURRED; + myType = GUIEventType::MESSAGE_OCCURRED; break; case MsgHandler::MsgType::MT_WARNING: - myType = EVENT_WARNING_OCCURRED; + myType = GUIEventType::WARNING_OCCURRED; break; case MsgHandler::MsgType::MT_ERROR: - myType = EVENT_ERROR_OCCURRED; + myType = GUIEventType::ERROR_OCCURRED; break; case MsgHandler::MsgType::MT_DEBUG: - myType = EVENT_DEBUG_OCCURRED; + myType = GUIEventType::DEBUG_OCCURRED; break; case MsgHandler::MsgType::MT_GLDEBUG: - myType = EVENT_GLDEBUG_OCCURRED; + myType = GUIEventType::GLDEBUG_OCCURRED; break; default: throw 1; diff -Nru sumo-1.11.0/src/utils/gui/events/GUIEvent_SimulationStep.h sumo-1.12.0/src/utils/gui/events/GUIEvent_SimulationStep.h --- sumo-1.11.0/src/utils/gui/events/GUIEvent_SimulationStep.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/events/GUIEvent_SimulationStep.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -35,7 +35,7 @@ public: /// constructor GUIEvent_SimulationStep() - : GUIEvent(EVENT_SIMULATION_STEP) { } + : GUIEvent(GUIEventType::SIMULATION_STEP) { } /// destructor ~GUIEvent_SimulationStep() { } diff -Nru sumo-1.11.0/src/utils/gui/globjects/GLIncludes.h sumo-1.12.0/src/utils/gui/globjects/GLIncludes.h --- sumo-1.11.0/src/utils/gui/globjects/GLIncludes.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GLIncludes.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp sumo-1.12.0/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp --- sumo-1.11.0/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h sumo-1.12.0/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h --- sumo-1.11.0/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/globjects/GUIGlObject.cpp sumo-1.12.0/src/utils/gui/globjects/GUIGlObject.cpp --- sumo-1.11.0/src/utils/gui/globjects/GUIGlObject.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GUIGlObject.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -303,6 +303,7 @@ GUIDesigns::buildFXMenuCommand(ret, "Copy cursor position to clipboard", nullptr, ret, MID_COPY_CURSOR_POSITION); if (GeoConvHelper::getFinal().usingGeoProjection()) { GUIDesigns::buildFXMenuCommand(ret, "Copy cursor geo-position to clipboard", nullptr, ret, MID_COPY_CURSOR_GEOPOSITION); + GUIDesigns::buildFXMenuCommand(ret, "Show cursor geo-position in GeoHack", nullptr, ret, MID_SHOW_GEOPOSITION_ONLINE); } if (addSeparator) { new FXMenuSeparator(ret); @@ -387,8 +388,8 @@ void -GUIGlObject::drawName(const Position& pos, const double scale, const GUIVisualizationTextSettings& settings, const double angle) const { - if (settings.show) { +GUIGlObject::drawName(const Position& pos, const double scale, const GUIVisualizationTextSettings& settings, const double angle, bool forceShow) const { + if (settings.show(this) || forceShow) { GLHelper::drawTextSettings(settings, getMicrosimID(), pos, scale, angle); } } diff -Nru sumo-1.11.0/src/utils/gui/globjects/GUIGlObject.h sumo-1.12.0/src/utils/gui/globjects/GUIGlObject.h --- sumo-1.11.0/src/utils/gui/globjects/GUIGlObject.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GUIGlObject.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -186,7 +186,7 @@ /// @} /// @brief draw name of item - void drawName(const Position& pos, const double scale, const GUIVisualizationTextSettings& settings, const double angle = 0) const; + void drawName(const Position& pos, const double scale, const GUIVisualizationTextSettings& settings, const double angle = 0, bool forceShow = false) const; protected: /// @name helper methods for building popup-menus diff -Nru sumo-1.11.0/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp sumo-1.12.0/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp --- sumo-1.11.0/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -32,6 +32,7 @@ #include #include #include "GUIGLObjectPopupMenu.h" +#include // =========================================================================== // FOX callback mapping @@ -43,6 +44,7 @@ FXMAPFUNC(SEL_COMMAND, MID_COPY_EDGE_NAME, GUIGLObjectPopupMenu::onCmdCopyEdgeName), FXMAPFUNC(SEL_COMMAND, MID_COPY_CURSOR_POSITION, GUIGLObjectPopupMenu::onCmdCopyCursorPosition), FXMAPFUNC(SEL_COMMAND, MID_COPY_CURSOR_GEOPOSITION, GUIGLObjectPopupMenu::onCmdCopyCursorGeoPosition), + FXMAPFUNC(SEL_COMMAND, MID_SHOW_GEOPOSITION_ONLINE, GUIGLObjectPopupMenu::onCmdShowCursorGeoPositionOnline), FXMAPFUNC(SEL_COMMAND, MID_SHOWPARS, GUIGLObjectPopupMenu::onCmdShowPars), FXMAPFUNC(SEL_COMMAND, MID_SHOWTYPEPARS, GUIGLObjectPopupMenu::onCmdShowTypePars), FXMAPFUNC(SEL_COMMAND, MID_ADDSELECT, GUIGLObjectPopupMenu::onCmdAddSelected), @@ -139,6 +141,17 @@ return 1; } + +long +GUIGLObjectPopupMenu::onCmdShowCursorGeoPositionOnline(FXObject*, FXSelector, void*) { + Position pos = myNetworkPosition; + GeoConvHelper::getFinal().cartesian2geo(pos); + std::string paramsString = toString(pos.y(), gPrecisionGeo) + ";" + toString(pos.x(), gPrecisionGeo); + std::string geohackUrl = "https://geohack.toolforge.org/geohack.php?params=" + paramsString; + FXLinkLabel::fxexecute(geohackUrl.c_str()); + return 1; +} + long GUIGLObjectPopupMenu::onCmdShowPars(FXObject*, FXSelector, void*) { diff -Nru sumo-1.11.0/src/utils/gui/globjects/GUIGLObjectPopupMenu.h sumo-1.12.0/src/utils/gui/globjects/GUIGLObjectPopupMenu.h --- sumo-1.11.0/src/utils/gui/globjects/GUIGLObjectPopupMenu.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GUIGLObjectPopupMenu.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -85,6 +85,9 @@ /// @brief Called if the cursor geo-position shall be copied to clipboard long onCmdCopyCursorGeoPosition(FXObject*, FXSelector, void*); + /// @brief Called if the cursor geo-position shall be shown online + long onCmdShowCursorGeoPositionOnline(FXObject*, FXSelector, void*); + /// @brief Called if the parameter of this object shall be shown long onCmdShowPars(FXObject*, FXSelector, void*); diff -Nru sumo-1.11.0/src/utils/gui/globjects/GUIGlObjectStorage.cpp sumo-1.12.0/src/utils/gui/globjects/GUIGlObjectStorage.cpp --- sumo-1.11.0/src/utils/gui/globjects/GUIGlObjectStorage.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GUIGlObjectStorage.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/globjects/GUIGlObjectStorage.h sumo-1.12.0/src/utils/gui/globjects/GUIGlObjectStorage.h --- sumo-1.11.0/src/utils/gui/globjects/GUIGlObjectStorage.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GUIGlObjectStorage.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/globjects/GUIGlObjectTypes.h sumo-1.12.0/src/utils/gui/globjects/GUIGlObjectTypes.h --- sumo-1.11.0/src/utils/gui/globjects/GUIGlObjectTypes.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GUIGlObjectTypes.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/globjects/GUIPointOfInterest.cpp sumo-1.12.0/src/utils/gui/globjects/GUIPointOfInterest.cpp --- sumo-1.11.0/src/utils/gui/globjects/GUIPointOfInterest.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GUIPointOfInterest.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -161,11 +161,11 @@ if (!s.drawForRectangleSelection) { const Position namePos = *POI; o->drawName(namePos, s.scale, s.poiName, s.angle); - if (s.poiType.show) { + if (s.poiType.show(o)) { const Position p = namePos + Position(0, -0.6 * s.poiType.size / s.scale); GLHelper::drawTextSettings(s.poiType, POI->getShapeType(), p, s.scale, s.angle); } - if (s.poiText.show) { + if (s.poiText.show(o)) { GLHelper::pushMatrix(); glTranslated(POI->x(), POI->y(), 0); std::string value = POI->getParameter(s.poiTextParam, ""); diff -Nru sumo-1.11.0/src/utils/gui/globjects/GUIPointOfInterest.h sumo-1.12.0/src/utils/gui/globjects/GUIPointOfInterest.h --- sumo-1.11.0/src/utils/gui/globjects/GUIPointOfInterest.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GUIPointOfInterest.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/globjects/GUIPolygon.cpp sumo-1.12.0/src/utils/gui/globjects/GUIPolygon.cpp --- sumo-1.11.0/src/utils/gui/globjects/GUIPolygon.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GUIPolygon.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -351,7 +351,7 @@ GLHelper::popMatrix(); const Position& namePos = shape.getPolygonCenter(); o->drawName(namePos, s.scale, s.polyName, s.angle); - if (s.polyType.show) { + if (s.polyType.show(o)) { const Position p = namePos + Position(0, -0.6 * s.polyType.size / s.scale); GLHelper::drawTextSettings(s.polyType, polygon->getShapeType(), p, s.scale, s.angle); } diff -Nru sumo-1.11.0/src/utils/gui/globjects/GUIPolygon.h sumo-1.12.0/src/utils/gui/globjects/GUIPolygon.h --- sumo-1.11.0/src/utils/gui/globjects/GUIPolygon.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GUIPolygon.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/globjects/GUIShapeContainer.cpp sumo-1.12.0/src/utils/gui/globjects/GUIShapeContainer.cpp --- sumo-1.11.0/src/utils/gui/globjects/GUIShapeContainer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GUIShapeContainer.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/globjects/GUIShapeContainer.h sumo-1.12.0/src/utils/gui/globjects/GUIShapeContainer.h --- sumo-1.11.0/src/utils/gui/globjects/GUIShapeContainer.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/globjects/GUIShapeContainer.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2009-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/access.xpm sumo-1.12.0/src/utils/gui/images/access.xpm --- sumo-1.11.0/src/utils/gui/images/access.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/access.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,23 +1,25 @@ /* XPM */ static const char *access_xpm[] = { /* columns rows colors chars-per-pixel */ -"16 16 1 1", -"U c None", +"16 16 3 1", +" c None", +". c #4CAA32", +"o c #FFEB00", /* pixels */ -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU" +" ", +" ", +" ..... ", +" ......... ", +" ........... ", +" ........... ", +" ......o......", +".........oo.....", +".....ooooooo....", +".........oo.....", +" ......o......", +" ........... ", +" ........... ", +" ......... ", +" ..... ", +" " }; diff -Nru sumo-1.11.0/src/utils/gui/images/collapse.xpm sumo-1.12.0/src/utils/gui/images/collapse.xpm --- sumo-1.11.0/src/utils/gui/images/collapse.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/collapse.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,24 @@ +/* XPM */ +static const char *collapse_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 2 1", +"o c #000", +" c None", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" oo ", +" oooo ", +" oooooo ", +" oooooooo ", +" ", +" ", +" ", +" ", +" ", +" " +}; diff -Nru sumo-1.11.0/src/utils/gui/images/copy.xpm sumo-1.12.0/src/utils/gui/images/copy.xpm --- sumo-1.11.0/src/utils/gui/images/copy.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/copy.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,29 @@ +/* XPM */ +static const char *copy_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 7 1", +". c #396BBD", +"1 c #6A92D2", +"2 c #73B5EF", +"3 c white", +"e c #C6DEF7", +"i c #DEE7F7", +" c None", +/* pixels */ +"........ ", +".3333331. ", +".32222311. ", +".3eeeei33. ", +".3222e........ ", +".3eeee.3333331. ", +".3222e.32222311.", +".3eeee.3eeeei33.", +".3222e.32222223.", +".3eeee.3eeeeee3.", +".33333.32222223.", +".......3eeeeee3.", +" .32222223.", +" .3eeeeee3.", +" .33333333.", +" .........." +}; diff -Nru sumo-1.11.0/src/utils/gui/images/cut.xpm sumo-1.12.0/src/utils/gui/images/cut.xpm --- sumo-1.11.0/src/utils/gui/images/cut.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/cut.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,25 +1,31 @@ /* XPM */ static const char *cut_xpm[] = { /* columns rows colors chars-per-pixel */ -"16 15 4 1", -" c None", -". c Black", -"X c Red", -"o c #00ff4e", +"16 16 9 1 ", +" c #396BBD", +". c #7F8C9D", +"X c #6A92D2", +"o c #ABB2BF", +"O c #B4BBC5", +"+ c #B4BBC7", +"@ c #C2C8D1", +"# c #DEE1E6", +"$ c None", /* pixels */ -" ", -" . ", -" . ", -" .X. ", -" .X. ", -" .XX. ", -" .XX. ", -" .XXX. ", -".. .. .. ..... .", -" .oooo. ", -" .. .ooooo. .", -". .o...ooooo.. .", -". .oo.ooooooo.. ", -"o.oooooooooooooo", -"o.oooooooooooooo" +"$$$$$$$$$$OO$$$$", +"$$$$$$$$$O..$$$$", +"$$$$$$$$O..$$$$$", +"$$$$$$$$...$$$$$", +"$$$$$$$$..$$$$o@", +"$$$$$$$...$$ooo@", +"$ X$$$..$$+oo@$", +" $$$X$$..+ooo@$$", +" $$$Xo..+oo$$$$$", +" $$$X+.#$$$$$$$$", +"$ X$$.#$$$$$$$$", +"$$$$$XXX$$$$$$$$", +"$$$$X$$$X$$$$$$$", +"$$$$ $$$ $$$$$$$", +"$$$$ $$$ $$$$$$$", +"$$$$$ $$$$$$$$" }; diff -Nru sumo-1.11.0/src/utils/gui/images/e1instant.xpm sumo-1.12.0/src/utils/gui/images/e1instant.xpm --- sumo-1.11.0/src/utils/gui/images/e1instant.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/e1instant.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,23 +1,25 @@ /* XPM */ static const char *e1instant_xpm[] = { /* columns rows colors chars-per-pixel */ -"16 16 1 1", -"U c None", +"16 16 3 1", +" c magenta", +"x c black", +". c None", /* pixels */ -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU", -"UUUUUUUUUUUUUUUU" +"................", +"................", +"................", +" ", +" ", +" xxxx x ", +" x xx ", +" x x x ", +" xxxx x ", +" x x ", +" x x ", +" xxxx xxxxx ", +" ", +"................", +"................", +"................" }; diff -Nru sumo-1.11.0/src/utils/gui/images/edgetype.xpm sumo-1.12.0/src/utils/gui/images/edgetype.xpm --- sumo-1.11.0/src/utils/gui/images/edgetype.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/edgetype.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,278 @@ +/* XPM */ +static const char *edgetype_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 256 2 ", +" c black", +". c #010101", +"X c gray1", +"o c gray2", +"O c #070707", +"+ c #131313", +"@ c #161616", +"# c #191919", +"$ c #1D1D1D", +"% c #222222", +"& c gray14", +"* c #252525", +"= c #2A2A2A", +"- c gray17", +"; c #2D2D2D", +": c #434343", +"> c #484848", +", c #4B4B4B", +"< c #4E4E4E", +"1 c gray33", +"2 c #585858", +"3 c #5B5B5B", +"4 c gray38", +"5 c #646464", +"6 c #686868", +"7 c #6A6A6A", +"8 c black", +"9 c black", +"0 c black", +"q c black", +"w c black", +"e c black", +"r c black", +"t c black", +"y c black", +"u c black", +"i c black", +"p c black", +"a c black", +"s c black", +"d c black", +"f c black", +"g c black", +"h c black", +"j c black", +"k c black", +"l c black", +"z c black", +"x c black", +"c c black", +"v c black", +"b c black", +"n c black", +"m c black", +"M c black", +"N c black", +"B c black", +"V c black", +"C c black", +"Z c black", +"A c black", +"S c black", +"D c black", +"F c black", +"G c black", +"H c black", +"J c black", +"K c black", +"L c black", +"P c black", +"I c black", +"U c black", +"Y c black", +"T c black", +"R c black", +"E c black", +"W c black", +"Q c black", +"! c black", +"~ c black", +"^ c black", +"/ c black", +"( c black", +") c black", +"_ c black", +"` c black", +"' c black", +"] c black", +"[ c black", +"{ c black", +"} c black", +"| c black", +" . c black", +".. c black", +"X. c black", +"o. c black", +"O. c black", +"+. c black", +"@. c black", +"#. c black", +"$. c black", +"%. c black", +"&. c black", +"*. c black", +"=. c black", +"-. c black", +";. c black", +":. c black", +">. c black", +",. c black", +"<. c black", +"1. c black", +"2. c black", +"3. c black", +"4. c black", +"5. c black", +"6. c black", +"7. c black", +"8. c black", +"9. c black", +"0. c black", +"q. c black", +"w. c black", +"e. c black", +"r. c black", +"t. c black", +"y. c black", +"u. c black", +"i. c black", +"p. c black", +"a. c black", +"s. c black", +"d. c black", +"f. c black", +"g. c black", +"h. c black", +"j. c black", +"k. c black", +"l. c black", +"z. c black", +"x. c black", +"c. c black", +"v. c black", +"b. c black", +"n. c black", +"m. c black", +"M. c black", +"N. c black", +"B. c black", +"V. c black", +"C. c black", +"Z. c black", +"A. c black", +"S. c black", +"D. c black", +"F. c black", +"G. c black", +"H. c black", +"J. c black", +"K. c black", +"L. c black", +"P. c black", +"I. c black", +"U. c black", +"Y. c black", +"T. c black", +"R. c black", +"E. c black", +"W. c black", +"Q. c black", +"!. c black", +"~. c black", +"^. c black", +"/. c black", +"(. c black", +"). c black", +"_. c black", +"`. c black", +"'. c black", +"]. c black", +"[. c black", +"{. c black", +"}. c black", +"|. c black", +" X c black", +".X c black", +"XX c black", +"oX c black", +"OX c black", +"+X c black", +"@X c black", +"#X c black", +"$X c black", +"%X c black", +"&X c black", +"*X c black", +"=X c black", +"-X c black", +";X c black", +":X c black", +">X c black", +",X c black", +" 5 2 ; ; 2 5 > UXUX", +"UXUXo UX# - - # UXo UXUX", +"UXUX UX UXUX UX UXUX", +"UX: % UX , , UX% : UX", +"UXX 4 3 . & & . 3 4 X UX", +"UX UX$ + UXUX+ $ UX UX", +"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX", +"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX", +"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX" +}; diff -Nru sumo-1.11.0/src/utils/gui/images/flag.cpp sumo-1.12.0/src/utils/gui/images/flag.cpp --- sumo-1.11.0/src/utils/gui/images/flag.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/flag.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/flag_minus.cpp sumo-1.12.0/src/utils/gui/images/flag_minus.cpp --- sumo-1.11.0/src/utils/gui/images/flag_minus.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/flag_minus.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/flag_plus.cpp sumo-1.12.0/src/utils/gui/images/flag_plus.cpp --- sumo-1.11.0/src/utils/gui/images/flag_plus.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/flag_plus.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/flowjunctions.xpm sumo-1.12.0/src/utils/gui/images/flowjunctions.xpm --- sumo-1.11.0/src/utils/gui/images/flowjunctions.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/flowjunctions.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,28 @@ +/* XPM */ +static const char *flowjunctions_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 6 1", +" c black", +". c #7092BE", +"X c #FFD800", +"o c cyan", +"O c #808080", +"+ c None", +/* pixels */ +"++++++++++++++++", +"+++..........+++", +"++.oooooooooo.++", +"++.oo oooo oo.++", +"+..o oo o..+", +"+..............+", +"................", +".XX..........XX.", +".XX.OOOOOOOO.XX.", +"................", +"....OOOOOOOO....", +"................", +"+ ++++++++++ +", +"+ ++++++++++ +", +"++++++++++++++++", +"++++++++++++++++" +}; diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_E3.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_E3.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_E3.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_E3.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_E3Selected.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_E3Selected.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_E3Selected.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_E3Selected.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_LaneBike.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_LaneBike.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_LaneBike.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_LaneBike.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_LaneBus.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_LaneBus.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_LaneBus.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_LaneBus.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_LanePedestrian.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_LanePedestrian.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_LanePedestrian.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_LanePedestrian.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_Lock.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_Lock.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_Lock.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_Lock.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_NotMoving.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_NotMoving.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_NotMoving.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_NotMoving.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_NotMovingSelected.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_NotMovingSelected.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_NotMovingSelected.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_NotMovingSelected.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_Rerouter_ClosingLaneReroute.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_Rerouter_ClosingLaneReroute.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_Rerouter_ClosingLaneReroute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_Rerouter_ClosingLaneReroute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_Rerouter_ClosingReroute.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_Rerouter_ClosingReroute.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_Rerouter_ClosingReroute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_Rerouter_ClosingReroute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_Rerouter.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_Rerouter.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_Rerouter.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_Rerouter.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_Rerouter_DestProbReroute.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_Rerouter_DestProbReroute.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_Rerouter_DestProbReroute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_Rerouter_DestProbReroute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_Rerouter_Interval.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_Rerouter_Interval.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_Rerouter_Interval.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_Rerouter_Interval.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_Rerouter_ParkingAreaReroute.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_Rerouter_ParkingAreaReroute.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_Rerouter_ParkingAreaReroute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_Rerouter_ParkingAreaReroute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_Rerouter_RouteProbReroute.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_Rerouter_RouteProbReroute.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_Rerouter_RouteProbReroute.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_Rerouter_RouteProbReroute.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_RerouterSelected.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_RerouterSelected.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_RerouterSelected.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_RerouterSelected.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_RouteProbe.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_RouteProbe.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_RouteProbe.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_RouteProbe.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_RouteProbeSelected.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_RouteProbeSelected.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_RouteProbeSelected.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_RouteProbeSelected.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_StopContainer.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_StopContainer.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_StopContainer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_StopContainer.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_StopContainerSelected.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_StopContainerSelected.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_StopContainerSelected.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_StopContainerSelected.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_Stop.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_Stop.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_Stop.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_Stop.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_StopPerson.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_StopPerson.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_StopPerson.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_StopPerson.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_StopPersonSelected.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_StopPersonSelected.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_StopPersonSelected.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_StopPersonSelected.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_StopSelected.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_StopSelected.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_StopSelected.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_StopSelected.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_TLS.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_TLS.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_TLS.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_TLS.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_Vaporizer.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_Vaporizer.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_Vaporizer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_Vaporizer.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_VaporizerSelected.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_VaporizerSelected.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_VaporizerSelected.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_VaporizerSelected.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_VariableSpeedSign.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_VariableSpeedSign.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_VariableSpeedSign.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_VariableSpeedSign.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_VariableSpeedSignSelected.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_VariableSpeedSignSelected.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_VariableSpeedSignSelected.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_VariableSpeedSignSelected.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GNETexture_VariableSpeedSign_Step.cpp sumo-1.12.0/src/utils/gui/images/GNETexture_VariableSpeedSign_Step.cpp --- sumo-1.11.0/src/utils/gui/images/GNETexture_VariableSpeedSign_Step.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GNETexture_VariableSpeedSign_Step.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GUIIcons.h sumo-1.12.0/src/utils/gui/images/GUIIcons.h --- sumo-1.11.0/src/utils/gui/images/GUIIcons.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GUIIcons.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -51,6 +51,16 @@ CLEARMESSAGEWINDOW, /// @} + /// @brief basic operations + /// @{ + + CUT, + COPY, + PASTE, + + /// @} + + /// @name simulation control icons /// @{ START, @@ -58,6 +68,12 @@ STEP, /// @} + /// @name select icons + /// @{ + SELECT, + UNSELECT, + /// @} + /// @name simulation view icons /// @{ MICROVIEW, @@ -201,6 +217,8 @@ BIGARROWRIGHT, FRONTELEMENT, COMPUTEPATHMANAGER, + COLLAPSE, + UNCOLLAPSE, /// @} /// @name NETEDIT common mode specific icons @@ -299,9 +317,8 @@ /// @{ MODEROUTE, MODEVEHICLE, - MODEVEHICLETYPE, + MODETYPE, MODESTOP, - MODEPERSONTYPE, MODEPERSON, MODEPERSONPLAN, MODECONTAINER, @@ -330,7 +347,7 @@ /// @name NETEDIT network elements icons /// @{ JUNCTION, - TYPE, + EDGETYPE, LANETYPE, EDGE, LANE, @@ -378,20 +395,24 @@ /// @{ ROUTE, VTYPE, - PTYPE, + VTYPEDISTRIBUTION, VEHICLE, TRIP, + TRIP_JUNCTIONS, FLOW, + FLOW_JUNCTIONS, ROUTEFLOW, STOPELEMENT, PERSON, PERSONFLOW, PERSONTRIP_FROMTO, PERSONTRIP_BUSSTOP, + PERSONTRIP_JUNCTIONS, WALK_EDGES, WALK_FROMTO, WALK_BUSSTOP, WALK_ROUTE, + WALK_JUNCTIONS, RIDE_FROMTO, RIDE_BUSSTOP, CONTAINER, @@ -471,6 +492,7 @@ VSHAPE_FIREBRIGADE, VSHAPE_POLICE, VSHAPE_RICKSHAW, + VSHAPE_SCOOTER, VSHAPE_UNKNOWN, /// @} diff -Nru sumo-1.11.0/src/utils/gui/images/GUIIconSubSys.cpp sumo-1.12.0/src/utils/gui/images/GUIIconSubSys.cpp --- sumo-1.11.0/src/utils/gui/images/GUIIconSubSys.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GUIIconSubSys.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -130,6 +130,8 @@ #include "unlock_selected.xpm" #include "add.xpm" #include "remove.xpm" +#include "collapse.xpm" +#include "uncollapse.xpm" #include "arrowup.xpm" #include "arrowdown.xpm" @@ -177,6 +179,12 @@ #include "lanegreenverge.xpm" #include "cut.xpm" +#include "copy.xpm" +#include "paste.xpm" + +#include "select.xpm" +#include "unselect.xpm" + #include "ext.xpm" #include "tracker.xpm" #include "hall_of_fame.xpm" @@ -209,11 +217,10 @@ #include "modecontainerplan.xpm" #include "modeperson.xpm" #include "modepersonplan.xpm" -#include "modepersontype.xpm" #include "moderoute.xpm" #include "modestop.xpm" #include "modevehicle.xpm" -#include "modevehicletype.xpm" +#include "modetype.xpm" #include "modeedgedata.xpm" #include "modeedgereldata.xpm" @@ -229,7 +236,7 @@ #include "options.xpm" #include "junction.xpm" -#include "type.xpm" +#include "edgetype.xpm" #include "lanetype.xpm" #include "edge.xpm" #include "lane.xpm" @@ -271,20 +278,24 @@ #include "route.xpm" #include "vtype.xpm" -#include "ptype.xpm" +#include "vtypedistribution.xpm" #include "vehicle.xpm" #include "trip.xpm" +#include "tripjunctions.xpm" #include "flow.xpm" +#include "flowjunctions.xpm" #include "routeflow.xpm" #include "stopelement.xpm" #include "person.xpm" #include "personflow.xpm" #include "persontripfromto.xpm" #include "persontripbusstop.xpm" +#include "persontripjunctions.xpm" #include "walkedges.xpm" #include "walkfromto.xpm" #include "walkbusstop.xpm" #include "walkroute.xpm" +#include "walkjunctions.xpm" #include "ridefromto.xpm" #include "ridebusstop.xpm" #include "container.xpm" @@ -356,6 +367,7 @@ #include "vshape_firebrigade.xpm" #include "vshape_police.xpm" #include "vshape_rickshaw.xpm" +#include "vshape_scooter.xpm" #include "vshape_unknown.xpm" #include "accept.xpm" @@ -410,6 +422,13 @@ myIcons[GUIIcon::HALL_OF_FAME] = new FXXPMIcon(a, hall_of_fame_xpm); /** temporal? **/ myIcons[GUIIcon::CLEARMESSAGEWINDOW] = new FXXPMIcon(a, clear_message_window_xpm); + myIcons[GUIIcon::CUT] = new FXXPMIcon(a, cut_xpm); + myIcons[GUIIcon::COPY] = new FXXPMIcon(a, copy_xpm); + myIcons[GUIIcon::PASTE] = new FXXPMIcon(a, paste_xpm); + + myIcons[GUIIcon::SELECT] = new FXXPMIcon(a, select_xpm); + myIcons[GUIIcon::UNSELECT] = new FXXPMIcon(a, unselect_xpm); + myIcons[GUIIcon::APP_TRACKER] = new FXXPMIcon(a, app_tracker_xpm); myIcons[GUIIcon::APP_FINDER] = new FXXPMIcon(a, app_finder_xpm); myIcons[GUIIcon::APP_BREAKPOINTS] = new FXXPMIcon(a, app_breakpoints_xpm); @@ -496,6 +515,8 @@ myIcons[GUIIcon::BIGARROWRIGHT] = new FXXPMIcon(a, bigarrowright_xpm); myIcons[GUIIcon::FRONTELEMENT] = new FXXPMIcon(a, frontelement_xpm); myIcons[GUIIcon::COMPUTEPATHMANAGER] = new FXXPMIcon(a, computepathmanager_xpm); + myIcons[GUIIcon::COLLAPSE] = new FXXPMIcon(a, collapse_xpm); + myIcons[GUIIcon::UNCOLLAPSE] = new FXXPMIcon(a, uncollapse_xpm); myIcons[GUIIcon::COMMONMODE_CHECKBOX_TOGGLEGRID] = new FXXPMIcon(a, checkbox_grid_xpm); myIcons[GUIIcon::COMMONMODE_CHECKBOX_SPREADVEHICLE] = new FXXPMIcon(a, checkbox_spreadvehicle_xpm); @@ -568,9 +589,8 @@ myIcons[GUIIcon::MODEROUTE] = new FXXPMIcon(a, moderoute_xpm); myIcons[GUIIcon::MODEVEHICLE] = new FXXPMIcon(a, modevehicle_xpm); - myIcons[GUIIcon::MODEVEHICLETYPE] = new FXXPMIcon(a, modevehicletype_xpm); + myIcons[GUIIcon::MODETYPE] = new FXXPMIcon(a, modetype_xpm); myIcons[GUIIcon::MODESTOP] = new FXXPMIcon(a, modestop_xpm); - myIcons[GUIIcon::MODEPERSONTYPE] = new FXXPMIcon(a, modepersontype_xpm); myIcons[GUIIcon::MODEPERSON] = new FXXPMIcon(a, modeperson_xpm); myIcons[GUIIcon::MODEPERSONPLAN] = new FXXPMIcon(a, modepersonplan_xpm); myIcons[GUIIcon::MODECONTAINER] = new FXXPMIcon(a, modecontainer_xpm); @@ -591,7 +611,7 @@ myIcons[GUIIcon::OPTIONS] = new FXXPMIcon(a, options_xpm); myIcons[GUIIcon::JUNCTION] = new FXXPMIcon(a, junction_xpm); - myIcons[GUIIcon::TYPE] = new FXXPMIcon(a, type_xpm); + myIcons[GUIIcon::EDGETYPE] = new FXXPMIcon(a, edgetype_xpm); myIcons[GUIIcon::LANETYPE] = new FXXPMIcon(a, lanetype_xpm); myIcons[GUIIcon::EDGE] = new FXXPMIcon(a, edge_xpm); myIcons[GUIIcon::LANE] = new FXXPMIcon(a, lane_xpm); @@ -633,20 +653,24 @@ myIcons[GUIIcon::ROUTE] = new FXXPMIcon(a, route_xpm); myIcons[GUIIcon::VTYPE] = new FXXPMIcon(a, vtype_xpm); - myIcons[GUIIcon::PTYPE] = new FXXPMIcon(a, ptype_xpm); + myIcons[GUIIcon::VTYPEDISTRIBUTION] = new FXXPMIcon(a, vtypedistribution_xpm); myIcons[GUIIcon::VEHICLE] = new FXXPMIcon(a, vehicle_xpm); myIcons[GUIIcon::TRIP] = new FXXPMIcon(a, trip_xpm); + myIcons[GUIIcon::TRIP_JUNCTIONS] = new FXXPMIcon(a, tripjunctions_xpm); myIcons[GUIIcon::FLOW] = new FXXPMIcon(a, flow_xpm); + myIcons[GUIIcon::FLOW_JUNCTIONS] = new FXXPMIcon(a, flowjunctions_xpm); myIcons[GUIIcon::ROUTEFLOW] = new FXXPMIcon(a, routeflow_xpm); myIcons[GUIIcon::STOPELEMENT] = new FXXPMIcon(a, stopelement_xpm); myIcons[GUIIcon::PERSON] = new FXXPMIcon(a, person_xpm); myIcons[GUIIcon::PERSONFLOW] = new FXXPMIcon(a, personflow_xpm); myIcons[GUIIcon::PERSONTRIP_FROMTO] = new FXXPMIcon(a, persontripfromto_xpm); myIcons[GUIIcon::PERSONTRIP_BUSSTOP] = new FXXPMIcon(a, persontripbusstop_xpm); + myIcons[GUIIcon::PERSONTRIP_JUNCTIONS] = new FXXPMIcon(a, persontripjunctions_xpm); myIcons[GUIIcon::WALK_EDGES] = new FXXPMIcon(a, walkedges_xpm); myIcons[GUIIcon::WALK_FROMTO] = new FXXPMIcon(a, walkfromto_xpm); myIcons[GUIIcon::WALK_BUSSTOP] = new FXXPMIcon(a, walkbusstop_xpm); myIcons[GUIIcon::WALK_ROUTE] = new FXXPMIcon(a, walkroute_xpm); + myIcons[GUIIcon::WALK_JUNCTIONS] = new FXXPMIcon(a, walkjunctions_xpm); myIcons[GUIIcon::RIDE_FROMTO] = new FXXPMIcon(a, ridefromto_xpm); myIcons[GUIIcon::RIDE_BUSSTOP] = new FXXPMIcon(a, ridebusstop_xpm); @@ -718,6 +742,7 @@ myIcons[GUIIcon::VSHAPE_FIREBRIGADE] = new FXXPMIcon(a, vshape_firebrigade_xpm); myIcons[GUIIcon::VSHAPE_POLICE] = new FXXPMIcon(a, vshape_police_xpm); myIcons[GUIIcon::VSHAPE_RICKSHAW] = new FXXPMIcon(a, vshape_rickshaw_xpm); + myIcons[GUIIcon::VSHAPE_SCOOTER] = new FXXPMIcon(a, vshape_scooter_xpm); myIcons[GUIIcon::VSHAPE_UNKNOWN] = new FXXPMIcon(a, vshape_unknown_xpm); myIcons[GUIIcon::OK] = new FXXPMIcon(a, accept_xpm); diff -Nru sumo-1.11.0/src/utils/gui/images/GUIIconSubSys.h sumo-1.12.0/src/utils/gui/images/GUIIconSubSys.h --- sumo-1.11.0/src/utils/gui/images/GUIIconSubSys.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GUIIconSubSys.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GUITextures.h sumo-1.12.0/src/utils/gui/images/GUITextures.h --- sumo-1.11.0/src/utils/gui/images/GUITextures.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GUITextures.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GUITexturesHelper.cpp sumo-1.12.0/src/utils/gui/images/GUITexturesHelper.cpp --- sumo-1.11.0/src/utils/gui/images/GUITexturesHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GUITexturesHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GUITexturesHelper.h sumo-1.12.0/src/utils/gui/images/GUITexturesHelper.h --- sumo-1.11.0/src/utils/gui/images/GUITexturesHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GUITexturesHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GUITextureSubSys.cpp sumo-1.12.0/src/utils/gui/images/GUITextureSubSys.cpp --- sumo-1.11.0/src/utils/gui/images/GUITextureSubSys.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GUITextureSubSys.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/GUITextureSubSys.h sumo-1.12.0/src/utils/gui/images/GUITextureSubSys.h --- sumo-1.11.0/src/utils/gui/images/GUITextureSubSys.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/GUITextureSubSys.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/manip.cpp sumo-1.12.0/src/utils/gui/images/manip.cpp --- sumo-1.11.0/src/utils/gui/images/manip.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/manip.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/images/modepersontype.xpm sumo-1.12.0/src/utils/gui/images/modepersontype.xpm --- sumo-1.11.0/src/utils/gui/images/modepersontype.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/modepersontype.xpm 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -/* XPM */ -static const char *modepersontype_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 16 6 1", -" c None", -". c black", -"X c red", -"o c #338033", -"O c #FFCB99", -"+ c white", -/* pixels */ -" ...... ", -" .OOOOOO. ", -" .OOOOOOOO. ", -" .O++O++OO. ", -" .O+.O+.OO. ", -" .OOOOOOOO. ", -" .OOOOOOOO. ", -" .OOXXXXOO. ", -" .OOOOOO. ", -" ...... ", -" ", -" .......... ", -" .oooooooooo. ", -" .oooooooooooo. ", -".oooooooooooooo.", -".oooooooooooooo." -}; diff -Nru sumo-1.11.0/src/utils/gui/images/modetype.xpm sumo-1.12.0/src/utils/gui/images/modetype.xpm --- sumo-1.11.0/src/utils/gui/images/modetype.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/modetype.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,27 @@ +/* XPM */ +static const char *modetype_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 5 1", +" c black", +"X c gray25", +"o c red", +"O c #808080", +"+ c None", +/* pixels */ +"+++XXXXXXXX+++++", +"++++ ++++++", +"+++XXXXXXX++++++", +"X+XOOOOOOXXX++X+", +"X+XOXXXOOOOXXXX ", +"X XOX XOOOOOOOX ", +"X XOXXXXXXOOOOX ", +"X+XOOOOX XOOOOX ", +"X+XXOOOXXXOXXXX ", +"+++XXOOOOOXX++X+", +"++++XXXXXXX+++++", +"++++++++++++++++", +"+ooo+o+o+oo+oo++", +"++o++ooo+oo+o+++", +"++o+++o++o++oo++", +"++++++++++++++++" +}; diff -Nru sumo-1.11.0/src/utils/gui/images/modevehicletype.xpm sumo-1.12.0/src/utils/gui/images/modevehicletype.xpm --- sumo-1.11.0/src/utils/gui/images/modevehicletype.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/modevehicletype.xpm 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -/* XPM */ -static const char *modevehicletype_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 16 5 1", -" c black", -"X c gray25", -"o c red", -"O c #808080", -"+ c None", -/* pixels */ -"+++XXXXXXXX+++++", -"++++ ++++++", -"+++XXXXXXX++++++", -"X+XOOOOOOXXX++X+", -"X+XOXXXOOOOXXXX ", -"X XOX XOOOOOOOX ", -"X XOXXXXXXOOOOX ", -"X+XOOOOX XOOOOX ", -"X+XXOOOXXXOXXXX ", -"+++XXOOOOOXX++X+", -"++++XXXXXXX+++++", -"++++++++++++++++", -"+ooo+o+o+oo+oo++", -"++o++ooo+oo+o+++", -"++o+++o++o++oo++", -"++++++++++++++++" -}; diff -Nru sumo-1.11.0/src/utils/gui/images/paste.xpm sumo-1.12.0/src/utils/gui/images/paste.xpm --- sumo-1.11.0/src/utils/gui/images/paste.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/paste.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,34 @@ +/* XPM */ +static const char *paste_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 12 1", +". c #396BBD", +"1 c #6A92D2", +"2 c #73B5EF", +"3 c white", +"e c #C6DEF7", +"i c #DEE7F7", +" c None", +"k c #9C6321", +"h c #A57B42", +"g c #DEAD7B", +"= c #D59D66", +"4 c #FFC90E", +/* pixels */ +" kkkkkk ", +"ghkk4444kkhg ", +"hggk4444kggh ", +"kg=kkkkkk=gk ", +"kg====........ ", +"kg====.3333331. ", +"kg====.32222311.", +"kg====.3eeeei33.", +"kg====.32222223.", +"kg====.3eeeeee3.", +"kg====.32222223.", +"kg====.3eeeeee3.", +"kg====.32222223.", +"hggggg.3eeeeee3.", +"ghkkkk.33333333.", +" .........." +}; diff -Nru sumo-1.11.0/src/utils/gui/images/personflow.xpm sumo-1.12.0/src/utils/gui/images/personflow.xpm --- sumo-1.11.0/src/utils/gui/images/personflow.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/personflow.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,25 +1,27 @@ /* XPM */ static const char *personflow_xpm[] = { /* columns rows colors chars-per-pixel */ -"16 16 3 1", +"16 16 5 1", " c None", ". c red", "X c #FF6A00", +"o c #FF7777", +"E c #FFC093", /* pixels */ -" .... ", -" .... ", -" .... ", -" .... ", +" ooo .... ", +" ooo .... ", +" ooo .... ", +" ooo .... ", " ", -" ........ ", -" ........ ", -" ........ ", -" ........ ", -" X......X ", -" ........ ", -" ...... ", -" ...... ", -" .. .. ", -" .. .. ", -" .. .. " +" ooo ........ ", +" ooo ........ ", +" ooo ........ ", +" ooo ........ ", +" Eoo X......X ", +" ooo ........ ", +" oo ...... ", +" oo ...... ", +" oo .. .. ", +" oo .. .. ", +" oo .. .. " }; diff -Nru sumo-1.11.0/src/utils/gui/images/persontripjunctions.xpm sumo-1.12.0/src/utils/gui/images/persontripjunctions.xpm --- sumo-1.11.0/src/utils/gui/images/persontripjunctions.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/persontripjunctions.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,27 @@ +/* XPM */ +static const char *persontripjunctions_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 5 1 ", +" c black", +". c red", +"X c #0026FF", +"o c #C800FF", +"O c white", +/* pixels */ +"ooXooooooooooooo", +"ooXooooooooooooo", +"ooXoooo oo", +"XXXXXoo O O O oo", +"oXXXooo oo", +"ooXoooo O o O oo", +"o... o oo", +"o... O O o O oo", +"o... o oo", +"ooooooooooo O oo", +"ooooooooooo oo", +"ooooooooooo O oo", +"o... oo", +"o... O O O O oo", +"o... oo", +"oooooooooooooooo" +}; diff -Nru sumo-1.11.0/src/utils/gui/images/ptype.xpm sumo-1.12.0/src/utils/gui/images/ptype.xpm --- sumo-1.11.0/src/utils/gui/images/ptype.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/ptype.xpm 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -/* XPM */ -static const char *ptype_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 16 6 1", -" c None", -". c black", -"X c red", -"o c #338033", -"O c #FFCB99", -"+ c white", -/* pixels */ -" ...... ", -" .OOOOOO. ", -" .OOOOOOOO. ", -" .O++O++OO. ", -" .O+.O+.OO. ", -" .OOOOOOOO. ", -" .OOOOOOOO. ", -" .OOXXXXOO. ", -" .OOOOOO. ", -" ...... ", -" ", -" .......... ", -" .oooooooooo. ", -" .oooooooooooo. ", -".oooooooooooooo.", -".oooooooooooooo." -}; diff -Nru sumo-1.11.0/src/utils/gui/images/select.xpm sumo-1.12.0/src/utils/gui/images/select.xpm --- sumo-1.11.0/src/utils/gui/images/select.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/select.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,25 @@ +/* XPM */ +static const char *select_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 3 1", +"X c #457C20", +"+ c #66FF00", +"@ c None", +/* pixels */ +"@@@@@XXXXXX@@@@@", +"@@@@@X++++X@@@@@", +"@@@@@X++++X@@@@@", +"@@@@@X++++X@@@@@", +"@@@@@X++++X@@@@@", +"XXXXXX++++XXXXXX", +"X++++++++++++++X", +"X++++++++++++++X", +"X++++++++++++++X", +"X++++++++++++++X", +"XXXXXX++++XXXXXX", +"@@@@@X++++X@@@@@", +"@@@@@X++++X@@@@@", +"@@@@@X++++X@@@@@", +"@@@@@X++++X@@@@@", +"@@@@@XXXXXX@@@@@" +}; diff -Nru sumo-1.11.0/src/utils/gui/images/tripjunctions.xpm sumo-1.12.0/src/utils/gui/images/tripjunctions.xpm --- sumo-1.11.0/src/utils/gui/images/tripjunctions.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/tripjunctions.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,28 @@ +/* XPM */ +static const char *tripjunctions_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 6 1", +" c black", +". c #D8496D", +"X c #FFD800", +"o c cyan", +"O c #808080", +"+ c None", +/* pixels */ +"++++++++++++++++", +"+++..........+++", +"++.oooooooooo.++", +"++.oo oooo oo.++", +"+..o oo o..+", +"+..............+", +"................", +".XX..........XX.", +".XX.OOOOOOOO.XX.", +"................", +"....OOOOOOOO....", +"................", +"+ ++++++++++ +", +"+ ++++++++++ +", +"++++++++++++++++", +"++++++++++++++++" +}; diff -Nru sumo-1.11.0/src/utils/gui/images/type.xpm sumo-1.12.0/src/utils/gui/images/type.xpm --- sumo-1.11.0/src/utils/gui/images/type.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/type.xpm 1970-01-01 00:00:00.000000000 +0000 @@ -1,278 +0,0 @@ -/* XPM */ -static const char *type_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 16 256 2 ", -" c black", -". c #010101", -"X c gray1", -"o c gray2", -"O c #070707", -"+ c #131313", -"@ c #161616", -"# c #191919", -"$ c #1D1D1D", -"% c #222222", -"& c gray14", -"* c #252525", -"= c #2A2A2A", -"- c gray17", -"; c #2D2D2D", -": c #434343", -"> c #484848", -", c #4B4B4B", -"< c #4E4E4E", -"1 c gray33", -"2 c #585858", -"3 c #5B5B5B", -"4 c gray38", -"5 c #646464", -"6 c #686868", -"7 c #6A6A6A", -"8 c black", -"9 c black", -"0 c black", -"q c black", -"w c black", -"e c black", -"r c black", -"t c black", -"y c black", -"u c black", -"i c black", -"p c black", -"a c black", -"s c black", -"d c black", -"f c black", -"g c black", -"h c black", -"j c black", -"k c black", -"l c black", -"z c black", -"x c black", -"c c black", -"v c black", -"b c black", -"n c black", -"m c black", -"M c black", -"N c black", -"B c black", -"V c black", -"C c black", -"Z c black", -"A c black", -"S c black", -"D c black", -"F c black", -"G c black", -"H c black", -"J c black", -"K c black", -"L c black", -"P c black", -"I c black", -"U c black", -"Y c black", -"T c black", -"R c black", -"E c black", -"W c black", -"Q c black", -"! c black", -"~ c black", -"^ c black", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" 5 2 ; ; 2 5 > UXUX", -"UXUXo UX# - - # UXo UXUX", -"UXUX UX UXUX UX UXUX", -"UX: % UX , , UX% : UX", -"UXX 4 3 . & & . 3 4 X UX", -"UX UX$ + UXUX+ $ UX UX", -"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX", -"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX", -"UXUXUXUXUXUXUXUXUXUXUXUXUXUXUXUX" -}; diff -Nru sumo-1.11.0/src/utils/gui/images/uncollapse.xpm sumo-1.12.0/src/utils/gui/images/uncollapse.xpm --- sumo-1.11.0/src/utils/gui/images/uncollapse.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/uncollapse.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,24 @@ +/* XPM */ +static const char *uncollapse_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 2 1", +"o c #000", +" c None", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" oooooooo ", +" oooooo ", +" oooo ", +" oo ", +" ", +" ", +" ", +" ", +" ", +" " +}; diff -Nru sumo-1.11.0/src/utils/gui/images/unselect.xpm sumo-1.12.0/src/utils/gui/images/unselect.xpm --- sumo-1.11.0/src/utils/gui/images/unselect.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/unselect.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,25 @@ +/* XPM */ +static const char *unselect_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 3 1", +" c #860000", +"$ c red", +"% c None", +/* pixels */ +"%%%%%%%%%%%%%%%%", +"%%% %%%%%% %%%", +"%% $$ %%%% $$ %%", +"% $$$$ %% $$$$ %", +"% $$$$$ $$$$$ %", +"%% $$$$$$$$$$ %%", +"%%% $$$$$$$$ %%%", +"%%%% $$$$$$ %%%%", +"%%%% $$$$$$ %%%%", +"%%% $$$$$$$$ %%%", +"%% $$$$$$$$$$ %%", +"% $$$$$ $$$$$ %", +"% $$$$ %% $$$$ %", +"%% $$ %%%% $$ %%", +"%%% %%%%%% %%%", +"%%%%%%%%%%%%%%%%" +}; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_ant.xpm sumo-1.12.0/src/utils/gui/images/vshape_ant.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_ant.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_ant.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,65 @@ /* XPM */ static const char *vshape_ant_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" c #F3F300", +", c #F4F400", +"< c #F5F500", +"1 c #F6F600", +"2 c #F7F700", +"3 c #F8F800", +"4 c #FCFC00", +"5 c #FDFD00", +"6 c #FEFE00", +"7 c yellow", +"8 c None", /* pixels */ -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 t M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ - q j m m j q = @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e < V ~ ^ ^ ^ ^ ^ ^ ~ V < e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . p W ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ W p . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . z ^ ^ ^ ^ L x s d b Y ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ p ^ ^ ^ ^ y . $ A ^ ^ ^ ^ i @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r 1 W ^ ^ ^ ^ k % R ^ ^ ^ W < r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + V ^ ^ ^ ^ ^ P w C G 7 S ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ H D ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r q ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ a # R ^ ^ ^ ^ ^ 0 r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ ^ F O v ^ ^ ^ ^ ^ ^ h 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ U ; r ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ f 2 W ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ 4 c ^ ^ ^ ^ ^ ^ ^ ^ g 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ t q ^ ^ ^ ^ ^ ^ ^ ^ 6 & & F ^ ^ ^ ^ ^ ^ ^ ^ 9 t ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ! ^ ^ ^ ^ ^ ^ ^ ^ E ^ ^ ^ ^ ^ ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + B ^ ^ ^ ^ ^ ^ Q 7 X : J ^ ^ ^ ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r < W ^ ^ ^ ^ ^ Z 0 ^ ^ ^ ^ ^ ^ W , r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ i ^ ^ ^ ^ ^ A q ^ ^ ^ ^ ^ ^ u @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . l ^ ^ ^ ^ ~ 8 o > K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"8888888888888888888888888888888888888888888888888888888888888888", +"8888888888888888888888888888888888888888888888888888888888888888", +"8888888888888888888888888888888888888888888888888888888888888888", +"8888888888888888888888888888888888888888888888888888888888888888", +"8888888888888888888888888888888888888888888888888888888888888888", +"8888888888888888888888888888888888888888888888888888888888888888", +"8888888888888oXX8888888888888888888888888888888888888XX.X.X.8888", +"8888888888888888XXXoo.X. 88888888888888888888XXXXoXX.88888888888", +"8888888888888888888888888XX.X888888888888888XO888888888888888888", +"88888888888888888888888888888.8888888888888X88888888888888888888", +"Xoo.XoXo.XoXXXX.X8888888888888Xo8888888888X8888888888oX888888888", +"88888888888888888X...8888888888Xo88888888X88888888888.8.XX888888", +"888888888888888888888.XX88888888XX888888X88888888888X88888XXXX88", +"888888888888888888887775>3-*$8888.o8888o888888888888X88888888888", +"8888888888888888887777777775331$-22,71+887777777777#888888888888", +"8888888888888888877777777777777767667767777777777777788888888888", +"8888888888888888877777777777777767477747777777777777788888888888", +"8888888888888888887777777775<22&:23<7<@887777777777+888888888888", +"888888888888888888887765>2;=%8888.o8888X888888888888X88888888888", +"888888888888888888888.XX88888888X8888888X88888888888.88888XX.X88", +"88888888888888888oX..8888888888Xo88888888.88888888888o8XXX888888", +"XXXXXX.o.XOXX.o.X8888888888888.X8888888888o8888888888XX888888888", +"88888888888888888888888888888o.888888888888o88888888888888888888", +"8888888888888888888888888XXoX.88888888888888 X888888888888888888", +"8888888888888888XXXoo.X. 88888888888888888888oXXXooo.88888888888", +"8888888888888oXX8888888888888888888888888888888888888XXooXXX8888", +"8888888888888888888888888888888888888888888888888888888888888888", +"8888888888888888888888888888888888888888888888888888888888888888", +"8888888888888888888888888888888888888888888888888888888888888888", +"8888888888888888888888888888888888888888888888888888888888888888", +"8888888888888888888888888888888888888888888888888888888888888888", +"8888888888888888888888888888888888888888888888888888888888888888" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_bicycle.xpm sumo-1.12.0/src/utils/gui/images/vshape_bicycle.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_bicycle.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_bicycle.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,81 @@ /* XPM */ static const char *vshape_bicycle_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " -}; +"64 32 45 1", +" c None", +". c #FFFF00", +"+ c #FBFB04", +"@ c #90906F", +"# c #808080", +"$ c #818181", +"% c #FBFB00", +"& c #E5E500", +"* c #D5D500", +"= c #FAFA00", +"- c #DFDF00", +"; c #C7C700", +"> c #B5B500", +", c #B4B400", +"' c #C0C000", +") c #BABA00", +"! c #FDFD01", +"~ c #FEFE01", +"{ c #FFFF01", +"] c #FDFD02", +"^ c #F3F300", +"/ c #B4B401", +"( c #B1B107", +"_ c #B3B301", +": c #B3B300", +"< c #B1B105", +"[ c #B3B302", +"} c #9A9A65", +"| c #FDFD03", +"1 c #FAFA05", +"2 c #BCBC0C", +"3 c #9A9A3B", +"4 c #7F7F7F", +"5 c #9A9A64", +"6 c #FAFA06", +"7 c #BDBD0C", +"8 c #B1B109", +"9 c #9B9B3C", +"0 c #FEFE02", +"a c #B2B201", +"b c #B2B207", +"c c #B2B206", +"d c #B2B204", +"e c #BBBB00", +"f c #DEDE00", +" ", +" ", +" ", +" ", +" ", +" ...+ ", +" ........@# ", +" .......... ## ", +" ............. ## ", +" ................ #$ ", +" ................... $# ", +" ...................%&* ## ", +" ....................=-;>,,,,, ## ", +" ....................*'),,,,,,> #$ ", +" ........!~{].{.....^>,/(,_:<,,[ ## ", +"###$###$####}..............|..{12,,,,,,,,,,,3#######$###$###$###", +"###$###$4###5...............|..67,,,,8/[,,,,9#####$##4######$###", +" ........0|~0~......^>,ab,c:d,,[ ## ", +" ....................*'e,,,,,,: ## ", +" ....................=f;>,,,,, $$ ", +" ...................%&* ## ", +" ................... ## ", +" ................ ## ", +" ............. $# ", +" .......... ## ", +" ........@# ", +" ...+ ", +" ", +" ", +" ", +" ", +" "}; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_bus_coach.xpm sumo-1.12.0/src/utils/gui/images/vshape_bus_coach.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_bus_coach.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_bus_coach.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,52 @@ /* XPM */ static const char *vshape_bus_coach_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"----------------------------------------------------------------", +"----------------------------------------------------------------", +"----------------------------------------------------------------", +"----------------------------------------------------------------", +"-=#XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#&-", +"$%@..........................................................+ o", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"$%@..........................................................+ o", +"-=#XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#*-", +"----------------------------------------------------------------", +"----------------------------------------------------------------", +"----------------------------------------------------------------", +"----------------------------------------------------------------" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_bus_flexible.xpm sumo-1.12.0/src/utils/gui/images/vshape_bus_flexible.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_bus_flexible.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_bus_flexible.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,42 @@ /* XPM */ static const char *vshape_bus_flexible_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo", +"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo", +"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo", +"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo", +"ooooo. .ooooo", +"oooo........................................................oooo", +"oo............................................................oo", +"oX............................................................ o", +"................................................................", +"................................................................", +"................................................................", +"................................................................", +"................................................................", +"................................................................", +"................................................................", +"................................................................", +"................................................................", +"................................................................", +"................................................................", +"................................................................", +"................................................................", +"................................................................", +"................................................................", +"................................................................", +"oX............................................................ o", +"oo............................................................oo", +"oooo........................................................oooo", +"ooooo. .ooooo", +"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo", +"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo", +"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo", +"oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_bus_trolley.xpm sumo-1.12.0/src/utils/gui/images/vshape_bus_trolley.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_bus_trolley.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_bus_trolley.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,62 @@ /* XPM */ static const char *vshape_bus_trolley_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" c #C7C700", +", c #CACA00", +"< c #D7D700", +"1 c #F0F000", +"2 c #F3F300", +"3 c #F7F700", +"4 c yellow", +"5 c None", /* pixels */ -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 t M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ - q j m m j q = @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e < V ~ ^ ^ ^ ^ ^ ^ ~ V < e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . p W ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ W p . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . z ^ ^ ^ ^ L x s d b Y ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ p ^ ^ ^ ^ y . $ A ^ ^ ^ ^ i @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r 1 W ^ ^ ^ ^ k % R ^ ^ ^ W < r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + V ^ ^ ^ ^ ^ P w C G 7 S ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ H D ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r q ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ a # R ^ ^ ^ ^ ^ 0 r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ ^ F O v ^ ^ ^ ^ ^ ^ h 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ U ; r ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ f 2 W ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ 4 c ^ ^ ^ ^ ^ ^ ^ ^ g 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ t q ^ ^ ^ ^ ^ ^ ^ ^ 6 & & F ^ ^ ^ ^ ^ ^ ^ ^ 9 t ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ! ^ ^ ^ ^ ^ ^ ^ ^ E ^ ^ ^ ^ ^ ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + B ^ ^ ^ ^ ^ ^ Q 7 X : J ^ ^ ^ ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r < W ^ ^ ^ ^ ^ Z 0 ^ ^ ^ ^ ^ ^ W , r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ i ^ ^ ^ ^ ^ A q ^ ^ ^ ^ ^ ^ u @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . l ^ ^ ^ ^ ~ 8 o > K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555", +"555555555555555555555555551###################################%$", +"5555555555555555555555555;>44444444444444444444444444444444444<@", +"5555555555555555555555555;>22222223444444444444444444444444444<@", +"55555555555555555555555 XOooo+---,444444444444444444444444444<@", +" .---,444444444444444444444444444<@", +"5555555555555555555555555*:&&&=---,444444444444444444444444444<@", +"5555555555555555555555555;>-------,444444444444444444444444444<@", +"5555555555555555555555555;>-------,444444444444444444444444444<@", +"5555555555555555555555555*:&&&=---,444444444444444444444444444<@", +" .---,444444444444444444444444444<@", +"55555555555555555555555 XOooo+---,444444444444444444444444444<@", +"5555555555555555555555555;>22222223444444444444444444444444444<@", +"5555555555555555555555555;>44444444444444444444444444444444444<@", +"555555555555555555555555551###################################%$", +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555", +"5555555555555555555555555555555555555555555555555555555555555555" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_bus.xpm sumo-1.12.0/src/utils/gui/images/vshape_bus.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_bus.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_bus.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,52 @@ /* XPM */ static const char *vshape_bus_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"----------------------------------------------------------------", +"----------------------------------------------------------------", +"----------------------------------------------------------------", +"----------------------------------------------------------------", +"-=#XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#&-", +"$%@..........................................................+ o", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"O+============================================================ O", +"$%@..........................................................+ o", +"-=#XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX#*-", +"----------------------------------------------------------------", +"----------------------------------------------------------------", +"----------------------------------------------------------------", +"----------------------------------------------------------------" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_delivery.xpm sumo-1.12.0/src/utils/gui/images/vshape_delivery.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_delivery.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_delivery.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,82 @@ /* XPM */ static const char *vshape_delivery_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" c #ADAD00", +", c #BBBB00", +"< c #BEBE00", +"1 c #CFCF00", +"2 c #D4D400", +"3 c #D9D900", +"4 c #E7E700", +"5 c #EBEB00", +"6 c #F5F500", +"7 c #F8F800", +"8 c #F9F900", +"9 c #FBFB00", +"0 c yellow", +"q c #FFFF06", +"w c #FFFF25", +"e c #FFFF26", +"r c #FFFF28", +"t c #FFFF2E", +"y c #FFFF31", +"u c #FFFF33", +"i c #FFFF35", +"p c #FFFF3E", +"a c #FFFF76", +"s c #FFFF77", +"d c #FFFF78", +"f c #FFFF7D", +"g c #FFFF99", +"h c None", /* pixels */ -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 t M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ - q j m m j q = @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e < V ~ ^ ^ ^ ^ ^ ^ ~ V < e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . p W ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ W p . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . z ^ ^ ^ ^ L x s d b Y ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ p ^ ^ ^ ^ y . $ A ^ ^ ^ ^ i @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r 1 W ^ ^ ^ ^ k % R ^ ^ ^ W < r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + V ^ ^ ^ ^ ^ P w C G 7 S ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ H D ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r q ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ a # R ^ ^ ^ ^ ^ 0 r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ ^ F O v ^ ^ ^ ^ ^ ^ h 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ U ; r ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ f 2 W ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ 4 c ^ ^ ^ ^ ^ ^ ^ ^ g 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ t q ^ ^ ^ ^ ^ ^ ^ ^ 6 & & F ^ ^ ^ ^ ^ ^ ^ ^ 9 t ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ! ^ ^ ^ ^ ^ ^ ^ ^ E ^ ^ ^ ^ ^ ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + B ^ ^ ^ ^ ^ ^ Q 7 X : J ^ ^ ^ ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r < W ^ ^ ^ ^ ^ Z 0 ^ ^ ^ ^ ^ ^ W , r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ i ^ ^ ^ ^ ^ A q ^ ^ ^ ^ ^ ^ u @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . l ^ ^ ^ ^ ~ 8 o > K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh", +"hh0000000000000000000000000000000000000000000000000000000hhhhhhh", +"000000000000000000000000000000000000000 X+%;40050q0000000h", +"0000000000000000000000000000000000000003====-19006,*o+0yfu000000", +"00000000000000000000000000000000000000000000002=@. +0yggsr0000", +"000000000000000000000000000000000000000000000& +0yggggae00", +"000000000000000000000000000000000000000000000$ +0yggggggi0", +"000000000000000000000000000000000000000000000$ +0yggggggp0", +"000000000000000000000000000000000000000000000$ +0yggggggp0", +"000000000000000000000000000000000000000000000$ +0yggggggp0", +"000000000000000000000000000000000000000000000$ +0yggggggp0", +"000000000000000000000000000000000000000000000$ +0yggggggp0", +"000000000000000000000000000000000000000000000$ +0yggggggp0", +"000000000000000000000000000000000000000000000$ +0yggggggp0", +"000000000000000000000000000000000000000000000$ +0yggggggp0", +"000000000000000000000000000000000000000000000$ +0yggggggp0", +"000000000000000000000000000000000000000000000$ +0yggggggp0", +"000000000000000000000000000000000000000000000$ +0yggggggi0", +"000000000000000000000000000000000000000000000& +0yggggaw00", +"00000000000000000000000000000000000000000000002=@. +0yggar0000", +"0000000000000000000000000000000000000003====-19006,*O+0ydt000000", +"000000000000000000000000000000000000000> X+&:40050q0000000h", +"000000000000000000000000000000000000000 c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"64 32 120 2", +" c None", +". c #FFFFFF", +"+ c #9BC9B0", +"@ c #6FB18C", +"# c #7AB593", +"$ c #81BA9A", +"% c #2D8C56", +"& c #2E8C56", +"* c #2F8D58", +"= c #808080", +"- c #3C3C3C", +"; c #4A4A4A", +"> c #535353", +", c #595959", +"' c #5C5C5C", +") c #5A5A5A", +"! c #565656", +"~ c #4D4D4D", +"{ c #414141", +"] c #252525", +"^ c #262626", +"/ c #F3F3F3", +"( c #79B593", +"_ c #2E8D57", +": c #ADADAD", +"< c #000000", +"[ c #050505", +"} c #1D1D1D", +"| c #303030", +"1 c #3D3D3D", +"2 c #474747", +"3 c #787878", +"4 c #D1D1D1", +"5 c #E7E7E7", +"6 c #FDFDFD", +"7 c #74B390", +"8 c #2F8D57", +"9 c #2E8D56", +"0 c #D9D9D9", +"a c #919191", +"b c #969696", +"c c #939393", +"d c #898989", +"e c #B5B5B5", +"f c #F7F7F7", +"g c #F5F5F5", +"h c #AFAFAF", +"i c #6A6A6A", +"j c #2A2A2A", +"k c #5E5E5E", +"l c #EFEFEF", +"m c #D5D5D5", +"n c #EEEEEE", +"o c #D4D4D4", +"p c #868686", +"q c #373737", +"r c #060606", +"s c #CFCFCF", +"t c #CCCCCC", +"u c #F1F1F1", +"v c #74B38F", +"w c #FCFDFD", +"x c #F9FCFB", +"y c #F8FBFA", +"z c #B0D4C0", +"A c #838383", +"B c #010101", +"C c #383838", +"D c #EDEDED", +"E c #D6D6D6", +"F c #D8D8D8", +"G c #F2F2F2", +"H c #B3D5C1", +"I c #6F6F6F", +"J c #CECECE", +"K c #CCE3D6", +"L c #717171", +"M c #030303", +"N c #D7D7D7", +"O c #EAEAEA", +"P c #CDE3D7", +"Q c #2E8C57", +"R c #D2D2D2", +"S c #3B9461", +"T c #73B28E", +"U c #A6CEB7", +"V c #FEFFFF", +"W c #FCFDFC", +"X c #E1EFE7", +"Y c #84BC9C", +"Z c #72B28E", +"` c #55A277", +" . c #57A378", +".. c #FEFEFE", +"+. c #FBFDFB", +"@. c #ABD1BB", +"#. c #CDCDCD", +"$. c #FBFDFC", +"%. c #FDFEFE", +"&. c #FDFEFD", +"*. c #F8FBF9", +"=. c #F6FAF8", +"-. c #FBFDFD", +";. c #020202", +">. c #3B9462", +",. c #6FB08B", +"'. c #74B28F", +"). c #BCDAC9", +"!. c #DEECE4", +"~. c #308D58", +"{. c #FBFCFB", +"]. c #6EAF8A", +"^. c #F1F7F4", +"/. c #C2DECE", +"(. c #333333", +"_. c #5D5D5D", +":. c #F0F0F0", +"<. c #E6E6E6", +"[. c #318D59", +"}. c #A4CCB4", +" ", +" ", +" ", +" ", +" . . . + @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ # . . . . . . . . . . . . . . . . . . . . . . . . . ", +". . . . . . $ % % % % % % % % % % % % % % % % % % % % % % % & * . . . . . . . = - ; > , ' ) ! ~ { ] ^ / . . . . . . . . . ", +". . . . . . ( % % % % % % % % % % % % % % % % % % % % % % _ * % . . . . . . . : < < < [ } | | 1 2 3 4 . . 5 . 6 . . . . . . . ", +". . . . . . 7 % % % % % % % % % % % % % % % % % % % % % 8 9 % % . . . . . . . 0 a b c d a e f . . g h i j k . l m n . . . . . . ", +". . . . . . $ % % % % % % % % % % % % % % % % % % % % % % % % % . . . . . . . . . . . . . . o p q r < < < ! . l s t m u . . . . ", +". . . . . . $ % % % % % % % % % v w x y . z % % % % % % % % % % . . . . . . . . . . . . . A B < < < < < < C . D E t t t F G . . ", +". . . . . . $ % % % % % % % % % ( . . . . H % % % % % % % % % % . . . . . . . . . . . . . I < < < < < < < 1 . l 0 t t t t J n . ", +". . . . . . $ % % % % % % % % % ( . . . . K % % % % % % % % % % . . . . . . . . . . . . . L M < < < < B < 1 . l N t t t t t O . ", +". . . . . . $ % % % % % % % % % ( . . . . P % Q % % % % % % % % . . . . . . . . . . . . . i < M < < < < < 1 . l R t t t t t O . ", +". . . . . . $ % % % % % S T T T U . . V W X Y T Z ` % % % % % % . . . . . . . . . . . . . L < < < B < < < 1 . l t t t t t t O . ", +". . . . . . $ % % % % % .. . . . . . . . . . ..+.@.% % % % % % . . . . . . . . . . . . . L < < < < B < < 1 . l t t t #.t t O . ", +". . . . . . $ % % % % % .. . . . . . $.. . . . . @.% % % % % % . . . . . . . . . . . . . L < < < < < < < 1 . l t #.#.t t t O . ", +". . . . . . $ % % % % % .. . . %.. ... . . . . . @.% % % % % % . . . . . . . . . . . . . L < < < B < < < 1 . l t #.t t t t O . ", +". . . . . . $ % % % % % .&.*.=.-.. . . . . . . . @.% % % % % % . . . . . . . . . . . . . L < < < < ;.< < 1 . l t t t #.t t O . ", +". . . . . . $ % % % % % >.,.T '.).. . . . !.T T T .% % % % % % . . . . . . . . . . . . . L < < < B < < < 1 . l t t t #.t t O . ", +". . . . . . $ % % % % % % % % ~.( $.&.. . P % % % % % % % % % % . . . . . . . . . . . . . i < < < < < < < 1 . l 4 t t t t t O . ", +". . . . . . $ % % % % % % % % % ( $.. . . P % % % % % % % % % % . . . . . . . . . . . . . L M < < < < < < 1 . l N t t t t t O . ", +". . . . . . $ % % % % % % % % % ( {.. . . P % % % % % % % % % % . . . . . . . . . . . . . I < < < < < < < 1 . l 0 t t t t J l . ", +". . . . . . $ % % % % % 8 % % % ].^.^.^.^./.% % % % % % % % % % . . . . . . . . . . . . . A ;.< < < < < < C . D E t t t F G . . ", +". . . . . . $ % % % % % % % % % % % % % % % % % % % % % % % % % . . . . . . . . . . . . . . o p q r < < < ! . n J t m u . . . . ", +". . . . . . 7 % % % % % % % % % % % % % % % % % % % % % % % % % . . . . . . . 0 a b c d a e f . . g h i (._.. :.N :.. . . . . . ", +". . . . . . ( % % % % % % % % % % % % % % % % % % % % % % % % % . . . . . . . : < < < [ } | | 1 2 3 4 . . <.. 6 . . . . . . . ", +". . . . . . $ [.Q % % % % % % % % % % % % % % % % % % % % % % % . . . . . . . = - ; > , ' ) ! ~ { ] ^ / . . . . . . . . . ", +" . . . }.@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ . . . . . . . . . . . . . . . . . . . . . . . . . ", +" ", +" ", +" ", +" " }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_e_vehicle.xpm sumo-1.12.0/src/utils/gui/images/vshape_e_vehicle.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_e_vehicle.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_e_vehicle.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,74 @@ /* XPM */ static const char *vshape_e_vehicle_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" c #7F7F00", +", c #888800", +"< c #909000", +"1 c #999900", +"2 c #AAAA00", +"3 c #BABA00", +"4 c #BBBB00", +"5 c #C7C700", +"6 c #CCCC00", +"7 c #CDCD00", +"8 c #CECE00", +"9 c #DADA00", +"0 c #DDDD00", +"q c #EEEE00", +"w c #F1F100", +"e c #F4F400", +"r c #F9F900", +"t c #FBFB00", +"y c yellow", +"u c None", /* pixels */ -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 t M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ - q j m m j q = @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e < V ~ ^ ^ ^ ^ ^ ^ ~ V < e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . p W ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ W p . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . z ^ ^ ^ ^ L x s d b Y ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ p ^ ^ ^ ^ y . $ A ^ ^ ^ ^ i @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r 1 W ^ ^ ^ ^ k % R ^ ^ ^ W < r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + V ^ ^ ^ ^ ^ P w C G 7 S ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ H D ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r q ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ a # R ^ ^ ^ ^ ^ 0 r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ ^ F O v ^ ^ ^ ^ ^ ^ h 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ U ; r ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ f 2 W ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ 4 c ^ ^ ^ ^ ^ ^ ^ ^ g 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ t q ^ ^ ^ ^ ^ ^ ^ ^ 6 & & F ^ ^ ^ ^ ^ ^ ^ ^ 9 t ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ! ^ ^ ^ ^ ^ ^ ^ ^ E ^ ^ ^ ^ ^ ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + B ^ ^ ^ ^ ^ ^ Q 7 X : J ^ ^ ^ ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r < W ^ ^ ^ ^ ^ Z 0 ^ ^ ^ ^ ^ ^ W , r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ i ^ ^ ^ ^ ^ A q ^ ^ ^ ^ ^ ^ u @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . l ^ ^ ^ ^ ~ 8 o > K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", +"uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", +"uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", +"uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", +"uuuuuuuuuuuuuuuuyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyuuuuuuuuuuuuuuuu", +"uuuuuuuuyyyyyyyyr932222222222222222222222222239ryyyyyyyyuuuuuuuu", +"uuuuyyyyyq62,;=@X +%-:140tyyyyuuuu", +"uuuyyytryyyyuu", +"uyyyy7& #5yyyyu", +"yyye:X .;wyyy", +"yyy* *yyy", +"yyy% %yyy", +"yyy% %yyy", +"yyy% %yyy", +"yyy% %yyy", +"yyy% %yyy", +"yyy% %yyy", +"yyy% %yyy", +"yyy% %yyy", +"yyy% %yyy", +"yyy% %yyy", +"yyy* *yyy", +"yyye:X .;wyyy", +"uyyyy8& $5yyyyu", +"uuuyyytryyyyuu", +"uuuuyyyyyq62,;=@X +%-:140tyyyyuuuu", +"uuuuuuuuyyyyyyyyr932222222222222222222222222239ryyyyyyyyuuuuuuuu", +"uuuuuuuuuuuuuuuuyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyuuuuuuuuuuuuuuuu", +"uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", +"uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", +"uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", +"uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_firebrigade.xpm sumo-1.12.0/src/utils/gui/images/vshape_firebrigade.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_firebrigade.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_firebrigade.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,102 @@ /* XPM */ static const char *vshape_firebrigade_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" c #555555", +", c gray36", +"< c #606060", +"1 c #616060", +"2 c gray50", +"3 c #870000", +"4 c #890000", +"5 c #8A0000", +"6 c #980000", +"7 c #B60000", +"8 c #BB0000", +"9 c #C00000", +"0 c #C10000", +"q c #C40000", +"w c #DE0000", +"e c #EC0000", +"r c #F40000", +"t c #F50000", +"y c red", +"u c #FF0202", +"i c #FF0303", +"p c #EA1414", +"a c #FF1F1F", +"s c #FF2500", +"d c #FF2A00", +"f c #FF2121", +"g c #FF2323", +"h c #FF3030", +"j c #FF3333", +"k c #FF5B00", +"l c #FF7F00", +"z c #EA7F14", +"x c #A95555", +"c c #A35C5C", +"v c #A96355", +"b c #A3685C", +"n c #A97F55", +"m c #A37F5C", +"M c #866060", +"N c #9E6060", +"B c #9E6A60", +"V c #9E7F60", +"C c #8B7272", +"Z c #FF4343", +"A c #FF4646", +"S c #FF4747", +"D c #FF4C4C", +"F c None", /* pixels */ -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 t M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ - q j m m j q = @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e < V ~ ^ ^ ^ ^ ^ ^ ~ V < e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . p W ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ W p . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . z ^ ^ ^ ^ L x s d b Y ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ p ^ ^ ^ ^ y . $ A ^ ^ ^ ^ i @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r 1 W ^ ^ ^ ^ k % R ^ ^ ^ W < r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + V ^ ^ ^ ^ ^ P w C G 7 S ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ H D ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r q ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ a # R ^ ^ ^ ^ ^ 0 r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ ^ F O v ^ ^ ^ ^ ^ ^ h 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ U ; r ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ f 2 W ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ 4 c ^ ^ ^ ^ ^ ^ ^ ^ g 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ t q ^ ^ ^ ^ ^ ^ ^ ^ 6 & & F ^ ^ ^ ^ ^ ^ ^ ^ 9 t ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ! ^ ^ ^ ^ ^ ^ ^ ^ E ^ ^ ^ ^ ^ ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + B ^ ^ ^ ^ ^ ^ Q 7 X : J ^ ^ ^ ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r < W ^ ^ ^ ^ ^ Z 0 ^ ^ ^ ^ ^ ^ W , r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ i ^ ^ ^ ^ ^ A q ^ ^ ^ ^ ^ ^ u @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . l ^ ^ ^ ^ ~ 8 o > K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", +"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", +"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", +"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", +"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", +"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", +"FFFFFFFFFFFFyyyykkkkkkkkkkkkkkkkkkkkksyyyyyyyyyyyyyyyyyyyyyFFFFF", +"FFFFFFFFFFFyyyyyllllllllllllllllllllldyyyyy8 X&eyyyyyyyyFF", +"FFFFFFFFFFFyyyyyllllllllllllllllllllldyyyyyq###$;50ryw67yaiyyyyy", +"FFFFFFFFFFFyyyyyllllllllllllllllllllldyyyyyyyyyyyt8:% 3ySAguyyy", +"2222222222CNNNNNVVVVVVVVVVVVVVVVVVVVVBNNNNNNNNNNM1<<<* 3ySDDZfuy", +"22222222222222222222222222222222222222222222222222222= 3ySDDDDhy", +"FFF22FFFFFFppc22zzzzzzzz22mzzzzzzzzzzb22pppppppp22,@@o 3ySDDDDjy", +"FFF22FFFFFFyyx22llllllll22nllllllllllv22yyyyyyyy22> 3ySDDDDjy", +"FFF22FFFFFFyyx22llllllll22nllllllllllv22yyyyyyyy22> 3ySDDDDjy", +"FFF22FFFFFFyyx22llllllll22nllllllllllv22yyyyyyyy22> 3ySDDDDjy", +"FFF22FFFFFFyyx22llllllll22nllllllllllv22yyyyyyyy22> 3ySDDDDjy", +"FFF22FFFFFFyyx22llllllll22nllllllllllv22yyyyyyyy22> 3ySDDDDjy", +"FFF22FFFFFFyyx22llllllll22nllllllllllv22yyyyyyyy22> 3ySDDDDjy", +"FFF22FFFFFFppc22zzzzzzzz22mzzzzzzzzzzb22pppppppp22,@@o 3ySDDDDjy", +"22222222222222222222222222222222222222222222222222222= 3ySDDDDhy", +"2222222222CNNNNNVVVVVVVVVVVVVVVVVVVVVBNNNNNNNNNNM1<<<* 3ySDDZfuy", +"FFFFFFFFFFFyyyyyllllllllllllllllllllldyyyyyyyyyyyt8:% 3ySAguyyy", +"FFFFFFFFFFFyyyyyllllllllllllllllllllldyyyyy9OOO+-49ryw67yaiyyyyy", +"FFFFFFFFFFFyyyyyllllllllllllllllllllldyyyyy8 .&eyyyyyyyyFF", +"FFFFFFFFFFFFyyyykkkkkkkkkkkkkkkkkkkkksyyyyyyyyyyyyyyyyyyyyyFFFFF", +"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", +"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", +"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", +"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", +"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", +"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_moped.xpm sumo-1.12.0/src/utils/gui/images/vshape_moped.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_moped.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_moped.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,78 @@ /* XPM */ static const char *vshape_moped_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" c #F3F300", +", c #F4F400", +"< c #FBFB00", +"1 c #FBFB03", +"2 c #FEFE00", +"3 c yellow", +"4 c #FDFD03", +"5 c #EBEB15", +"6 c #E9E917", +"7 c #CECE31", +"8 c #D0D030", +"9 c #929252", +"0 c #939352", +"q c #949450", +"w c #B0B04F", +"e c #999966", +"r c #90906F", +"t c #8C8C74", +"y c #8C8C75", +"u c #82827A", +"i c #83837B", +"p c #80807F", +"a c #808080", +"s c None", /* pixels */ -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 t M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ - q j m m j q = @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e < V ~ ^ ^ ^ ^ ^ ^ ~ V < e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . p W ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ W p . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . z ^ ^ ^ ^ L x s d b Y ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ p ^ ^ ^ ^ y . $ A ^ ^ ^ ^ i @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r 1 W ^ ^ ^ ^ k % R ^ ^ ^ W < r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + V ^ ^ ^ ^ ^ P w C G 7 S ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ H D ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r q ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ a # R ^ ^ ^ ^ ^ 0 r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ ^ F O v ^ ^ ^ ^ ^ ^ h 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ U ; r ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ f 2 W ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ 4 c ^ ^ ^ ^ ^ ^ ^ ^ g 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ t q ^ ^ ^ ^ ^ ^ ^ ^ 6 & & F ^ ^ ^ ^ ^ ^ ^ ^ 9 t ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ! ^ ^ ^ ^ ^ ^ ^ ^ E ^ ^ ^ ^ ^ ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + B ^ ^ ^ ^ ^ ^ Q 7 X : J ^ ^ ^ ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r < W ^ ^ ^ ^ ^ Z 0 ^ ^ ^ ^ ^ ^ W , r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ i ^ ^ ^ ^ ^ A q ^ ^ ^ ^ ^ ^ u @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . l ^ ^ ^ ^ ~ 8 o > K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssss3331ssssssssssssssss", +"sssssssssssssssssssssssssssssssssssssss33333333rasssssssssssssss", +"sssssssssssssssssssssssssssssssssss3333333333ssaasssssssssssssss", +"sssssssssssssssssssssssssssssss3333333333333sssaasssssssssssssss", +"ssssssssssssssssssssssssss3333333333333333sssssaasssssssssssssss", +"ssssssssssssssssssssss3333333333333333333ssssssaasssssssssssssss", +"sssaaaaaaaaaaaayw8643333333333333333<:=&iaaaaaaaaaaaaaaaaaaaasss", +"ssaaaaaaaaaat75233333333333333333<;*X...O%qpaaaaaaaaaaaaaaaaaass", +"saaaaaaaaaaae33333333333333333333-.........0aaaaaaaaaaaaaaaaaaas", +"saaaaaaaaaaae3333333333333333333>X......... uaaaaaaaaaaaaaaaaaas", +"aaaaaaaaaaaae3333333333333333333+...........$aaaaaaaaaaaaaaaaaaa", +"aaaaaaaaaaaae3333333333333333333@...........#aaaaaaaaaaaaaaaaaaa", +"saaaaaaaaaaae3333333333333333333,o......... uaaaaaaaaaaaaaaaaaas", +"saaaaaaaaaaae33333333333333333333-.........9aaaaaaaaaaaaaaaaaaas", +"ssaaaaaaaaaat75233333333333333333<;*X...O%qpaaaaaaaaaaaaaaaaaass", +"sssaaaaaaaaaaaayw8643333333333333333<:=&iaaaaaaaaaaaaaaaaaaaasss", +"ssssssssssssssssssssss3333333333333333333ssssssaasssssssssssssss", +"ssssssssssssssssssssssssss3333333333333333sssssaasssssssssssssss", +"sssssssssssssssssssssssssssssss3333333333333sssaasssssssssssssss", +"sssssssssssssssssssssssssssssssssss3333333333ssaasssssssssssssss", +"sssssssssssssssssssssssssssssssssssssss33333333rasssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssss3331ssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_motorcycle.xpm sumo-1.12.0/src/utils/gui/images/vshape_motorcycle.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_motorcycle.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_motorcycle.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,78 @@ /* XPM */ static const char *vshape_motorcycle_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" c #F3F300", +", c #F4F400", +"< c #FBFB00", +"1 c #FBFB03", +"2 c #FEFE00", +"3 c yellow", +"4 c #FDFD03", +"5 c #EBEB15", +"6 c #E9E917", +"7 c #CECE31", +"8 c #D0D030", +"9 c #929252", +"0 c #939352", +"q c #949450", +"w c #B0B04F", +"e c #999966", +"r c #90906F", +"t c #8C8C74", +"y c #8C8C75", +"u c #82827A", +"i c #83837B", +"p c #80807F", +"a c #808080", +"s c None", /* pixels */ -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 t M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ - q j m m j q = @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e < V ~ ^ ^ ^ ^ ^ ^ ~ V < e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . p W ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ W p . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . z ^ ^ ^ ^ L x s d b Y ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ p ^ ^ ^ ^ y . $ A ^ ^ ^ ^ i @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r 1 W ^ ^ ^ ^ k % R ^ ^ ^ W < r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + V ^ ^ ^ ^ ^ P w C G 7 S ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ H D ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r q ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ a # R ^ ^ ^ ^ ^ 0 r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ ^ F O v ^ ^ ^ ^ ^ ^ h 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ U ; r ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ f 2 W ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ 4 c ^ ^ ^ ^ ^ ^ ^ ^ g 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ t q ^ ^ ^ ^ ^ ^ ^ ^ 6 & & F ^ ^ ^ ^ ^ ^ ^ ^ 9 t ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ! ^ ^ ^ ^ ^ ^ ^ ^ E ^ ^ ^ ^ ^ ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + B ^ ^ ^ ^ ^ ^ Q 7 X : J ^ ^ ^ ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r < W ^ ^ ^ ^ ^ Z 0 ^ ^ ^ ^ ^ ^ W , r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ i ^ ^ ^ ^ ^ A q ^ ^ ^ ^ ^ ^ u @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . l ^ ^ ^ ^ ~ 8 o > K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssss3331ssssssssssssssss", +"sssssssssssssssssssssssssssssssssssssss33333333rasssssssssssssss", +"sssssssssssssssssssssssssssssssssss3333333333ssaasssssssssssssss", +"sssssssssssssssssssssssssssssss3333333333333sssaasssssssssssssss", +"ssssssssssssssssssssssssss3333333333333333sssssaasssssssssssssss", +"ssssssssssssssssssssss3333333333333333333ssssssaasssssssssssssss", +"sssaaaaaaaaaaaayw8643333333333333333<:=&iaaaaaaaaaaaaaaaaaaaasss", +"ssaaaaaaaaaat75233333333333333333<;*X...O%qpaaaaaaaaaaaaaaaaaass", +"saaaaaaaaaaae33333333333333333333-.........0aaaaaaaaaaaaaaaaaaas", +"saaaaaaaaaaae3333333333333333333>X......... uaaaaaaaaaaaaaaaaaas", +"aaaaaaaaaaaae3333333333333333333+...........$aaaaaaaaaaaaaaaaaaa", +"aaaaaaaaaaaae3333333333333333333@...........#aaaaaaaaaaaaaaaaaaa", +"saaaaaaaaaaae3333333333333333333,o......... uaaaaaaaaaaaaaaaaaas", +"saaaaaaaaaaae33333333333333333333-.........9aaaaaaaaaaaaaaaaaaas", +"ssaaaaaaaaaat75233333333333333333<;*X...O%qpaaaaaaaaaaaaaaaaaass", +"sssaaaaaaaaaaaayw8643333333333333333<:=&iaaaaaaaaaaaaaaaaaaaasss", +"ssssssssssssssssssssss3333333333333333333ssssssaasssssssssssssss", +"ssssssssssssssssssssssssss3333333333333333sssssaasssssssssssssss", +"sssssssssssssssssssssssssssssss3333333333333sssaasssssssssssssss", +"sssssssssssssssssssssssssssssssssss3333333333ssaasssssssssssssss", +"sssssssssssssssssssssssssssssssssssssss33333333rasssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssss3331ssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss", +"ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_passenger_hatchback.xpm sumo-1.12.0/src/utils/gui/images/vshape_passenger_hatchback.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_passenger_hatchback.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_passenger_hatchback.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,107 @@ /* XPM */ static const char *vshape_passenger_hatchback_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" c #7B7B00", +", c #7D7D00", +"< c #7E7E00", +"1 c #7F7F00", +"2 c #888800", +"3 c #8C8C00", +"4 c #8D8D00", +"5 c #909000", +"6 c #979700", +"7 c #989800", +"8 c #999900", +"9 c #9A9A00", +"0 c #9F9F00", +"q c #A0A000", +"w c #BBBB00", +"e c #C9C900", +"r c #CACA00", +"t c #CCCC00", +"y c #D4D400", +"u c #D9D900", +"i c #DADA00", +"p c #DDDD00", +"a c #E1E100", +"s c #E7E700", +"d c #E8E800", +"f c #EBEB00", +"g c #F5F500", +"h c #F8F800", +"j c #FBFB00", +"k c #FDFD00", +"l c #FEFE00", +"z c yellow", +"x c #FFFF01", +"c c #FFFF07", +"v c #FFFF08", +"b c #FFFF0B", +"n c #FFFF1A", +"m c #FFFF1F", +"M c #FFFF2B", +"N c #FFFF2E", +"B c #FFFF31", +"V c #FFFF3D", +"C c #FFFF3E", +"Z c #FFFF43", +"A c #FFFF52", +"S c #FFFF61", +"D c #FFFF76", +"F c #FFFF80", +"G c #FFFF85", +"H c #FFFF91", +"J c #FFFF97", +"K c #FFFF99", +"L c None", /* pixels */ -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 t M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ - q j m m j q = @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e < V ~ ^ ^ ^ ^ ^ ^ ~ V < e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . p W ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ W p . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . z ^ ^ ^ ^ L x s d b Y ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ p ^ ^ ^ ^ y . $ A ^ ^ ^ ^ i @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r 1 W ^ ^ ^ ^ k % R ^ ^ ^ W < r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + V ^ ^ ^ ^ ^ P w C G 7 S ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ H D ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r q ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ a # R ^ ^ ^ ^ ^ 0 r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ ^ F O v ^ ^ ^ ^ ^ ^ h 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ U ; r ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ f 2 W ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ 4 c ^ ^ ^ ^ ^ ^ ^ ^ g 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ t q ^ ^ ^ ^ ^ ^ ^ ^ 6 & & F ^ ^ ^ ^ ^ ^ ^ ^ 9 t ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ! ^ ^ ^ ^ ^ ^ ^ ^ E ^ ^ ^ ^ ^ ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + B ^ ^ ^ ^ ^ ^ Q 7 X : J ^ ^ ^ ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r < W ^ ^ ^ ^ ^ Z 0 ^ ^ ^ ^ ^ ^ W , r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ i ^ ^ ^ ^ ^ A q ^ ^ ^ ^ ^ ^ u @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . l ^ ^ ^ ^ ~ 8 o > K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", +"LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", +"LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", +"LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", +"LLLzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzLLLLLLLLLLLLLLLL", +"LLzzu6=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@,jzzzzzzzzzzzzzLLLLLLLL", +"zzzszzza0;+ o&3elzzfzvvzzzzzzzzzzzzLLLL", +"zzz@O%2tkzzi922222222222222222222227ylzzgw:@@zMJFSZmxzzzzzzzzzLL", +"zzz@ X$1whzzzzzzzzzzzzzzzzzzzzzzzzp5$. @zMKKKKKHDANbzzzzzzL", +"zzz@ #zzzzzzzzzzzzzzzzzzzzzzz< @zMKKKKKKKKKKGSZmxzz", +"zzz@ @zzzzzzzzzzzzzzzzzzzzzzz> @zMKKKKKKKKKKKKKKHBz", +"zzz@ @zzzzzzzzzzzzzzzzzzzzzzz> @zMKKKKKKKKKKKKKKKCz", +"zzz@ @zzzzzzzzzzzzzzzzzzzzzzz> @zMKKKKKKKKKKKKKKKCz", +"zzz@ @zzzzzzzzzzzzzzzzzzzzzzz> @zMKKKKKKKKKKKKKKKCz", +"zzz@ @zzzzzzzzzzzzzzzzzzzzzzz> @zMKKKKKKKKKKKKKKKCz", +"zzz@ @zzzzzzzzzzzzzzzzzzzzzzz> @zMKKKKKKKKKKKKKKKCz", +"zzz@ @zzzzzzzzzzzzzzzzzzzzzzz> @zMKKKKKKKKKKKKKKKCz", +"zzz@ @zzzzzzzzzzzzzzzzzzzzzzz> @zMKKKKKKKKKKKKKKKCz", +"zzz@ @zzzzzzzzzzzzzzzzzzzzzzz> @zMKKKKKKKKKKKKKKKCz", +"zzz@ @zzzzzzzzzzzzzzzzzzzzzzz> @zMKKKKKKKKKKKKKKKCz", +"zzz@ @zzzzzzzzzzzzzzzzzzzzzzz> @zMKKKKKKKKKKKKKKKCz", +"zzz@ @zzzzzzzzzzzzzzzzzzzzzzz> @zMKKKKKKKKKKKKKKHBz", +"zzz@ #zzzzzzzzzzzzzzzzzzzzzzz< @zMKKKKKKKKKKGSZmxzz", +"zzz@ X$1whzzzzzzzzzzzzzzzzzzzzzzzzp5$. @zMKKKKKHDANbzzzzzzL", +"zzz@O%2tkzzi922222222222222222222228ylzzgw:@@zMJFSVnxzzzzzzzzzLL", +"zzzdzzzaq;+ o*4rlzzfzvczzzzzzzzzzzzLLLL", +"LLzzi7-@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" c #888800", +", c #8C8C00", +"< c #8D8D00", +"1 c #909000", +"2 c #989800", +"3 c #999900", +"4 c #BBBB00", +"5 c #BDBD00", +"6 c #BEBE00", +"7 c #C9C900", +"8 c #CACA00", +"9 c #CBCB00", +"0 c #CFCF00", +"q c #D2D200", +"w c #D4D400", +"e c #DDDD00", +"r c #E0E000", +"t c #E2E200", +"y c #EBEB00", +"u c #F1F100", +"i c #F5F500", +"p c #F9F900", +"a c #FBFB00", +"s c #FDFD00", +"d c #FEFE00", +"f c yellow", +"g c #FFFF01", +"h c #FFFF07", +"j c #FFFF08", +"k c #FFFF0B", +"l c #FFFF1A", +"z c #FFFF1F", +"x c #FFFF2B", +"c c #FFFF2E", +"v c #FFFF31", +"b c #FFFF3D", +"n c #FFFF3E", +"m c #FFFF43", +"M c #FFFF52", +"N c #FFFF61", +"B c #FFFF76", +"V c #FFFF80", +"C c #FFFF85", +"Z c #FFFF91", +"A c #FFFF97", +"S c #FFFF99", +"D c None", /* pixels */ -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 t M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ - q j m m j q = @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e < V ~ ^ ^ ^ ^ ^ ^ ~ V < e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . p W ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ W p . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . z ^ ^ ^ ^ L x s d b Y ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ p ^ ^ ^ ^ y . $ A ^ ^ ^ ^ i @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r 1 W ^ ^ ^ ^ k % R ^ ^ ^ W < r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + V ^ ^ ^ ^ ^ P w C G 7 S ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ H D ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r q ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ a # R ^ ^ ^ ^ ^ 0 r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ ^ F O v ^ ^ ^ ^ ^ ^ h 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ U ; r ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ f 2 W ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ 4 c ^ ^ ^ ^ ^ ^ ^ ^ g 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ t q ^ ^ ^ ^ ^ ^ ^ ^ 6 & & F ^ ^ ^ ^ ^ ^ ^ ^ 9 t ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ! ^ ^ ^ ^ ^ ^ ^ ^ E ^ ^ ^ ^ ^ ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + B ^ ^ ^ ^ ^ ^ Q 7 X : J ^ ^ ^ ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r < W ^ ^ ^ ^ ^ Z 0 ^ ^ ^ ^ ^ ^ W , r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ i ^ ^ ^ ^ ^ A q ^ ^ ^ ^ ^ ^ u @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . l ^ ^ ^ ^ ~ 8 o > K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", +"DDDfffffffffffffffffffffffffffffffffffffffffffffDDDDDDDDDDDDDDDD", +"DDffffffffffffs5&++++++++++++++++++++++++;afffffffffffffDDDDDDDD", +"ffffffffffpufffffq*O o#,7dffyfjjffffffffffffDDDD", +"ffffffffffr.+=4afffs6>>>>>>>>>>>>>>2wdffi4=++fxAVNmzgfffffffffDD", +"ffffffffffr o%3tffffffffffffffffffe1@X +fxSSSSSZBMckffffffD", +"ffffffffffr 0ffffffffffffffff: +fxSSSSSSSSSSCNmzgff", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSZvf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSZvf", +"ffffffffffr 0ffffffffffffffff: +fxSSSSSSSSSSCNmzgff", +"ffffffffffr o%3tffffffffffffffffffe1@X +fxSSSSSZBMckffffffD", +"ffffffffffr.+=4afffs6>>>>>>>>>>>>>>3wdffi4=++fxAVNblgfffffffffDD", +"ffffffffffpufffffq*O o$<8dffyfjhffffffffffffDDDD", +"DDffffffffffffs6&++++++++++++++++++++++++:afffffffffffffDDDDDDDD", +"DDDfffffffffffffffffffffffffffffffffffffffffffffDDDDDDDDDDDDDDDD", +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_passenger_van.xpm sumo-1.12.0/src/utils/gui/images/vshape_passenger_van.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_passenger_van.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_passenger_van.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,95 @@ /* XPM */ static const char *vshape_passenger_van_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" c #717100", +", c #747400", +"< c #767600", +"1 c #777700", +"2 c #888800", +"3 c #909000", +"4 c #A2A200", +"5 c #A3A300", +"6 c #ABAB00", +"7 c #BBBB00", +"8 c #C1C100", +"9 c #CACA00", +"0 c #CBCB00", +"q c #CFCF00", +"w c #D4D400", +"e c #E1E100", +"r c #E7E700", +"t c #E8E800", +"y c #EBEB00", +"u c #EEEE00", +"i c #EFEF00", +"p c #F5F500", +"a c #F9F900", +"s c #FDFD00", +"d c #FEFE00", +"f c yellow", +"g c #FFFF06", +"h c #FFFF25", +"j c #FFFF26", +"k c #FFFF28", +"l c #FFFF2E", +"z c #FFFF31", +"x c #FFFF33", +"c c #FFFF35", +"v c #FFFF3E", +"b c #FFFF76", +"n c #FFFF77", +"m c #FFFF78", +"M c #FFFF7D", +"N c #FFFF99", +"B c None", /* pixels */ -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 t M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ - q j m m j q = @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e < V ~ ^ ^ ^ ^ ^ ^ ~ V < e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . p W ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ W p . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . z ^ ^ ^ ^ L x s d b Y ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ p ^ ^ ^ ^ y . $ A ^ ^ ^ ^ i @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r 1 W ^ ^ ^ ^ k % R ^ ^ ^ W < r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + V ^ ^ ^ ^ ^ P w C G 7 S ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ H D ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r q ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ a # R ^ ^ ^ ^ ^ 0 r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ ^ F O v ^ ^ ^ ^ ^ ^ h 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ U ; r ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ f 2 W ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ 4 c ^ ^ ^ ^ ^ ^ ^ ^ g 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ t q ^ ^ ^ ^ ^ ^ ^ ^ 6 & & F ^ ^ ^ ^ ^ ^ ^ ^ 9 t ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ! ^ ^ ^ ^ ^ ^ ^ ^ E ^ ^ ^ ^ ^ ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + B ^ ^ ^ ^ ^ ^ Q 7 X : J ^ ^ ^ ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r < W ^ ^ ^ ^ ^ Z 0 ^ ^ ^ ^ ^ ^ W , r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ i ^ ^ ^ ^ ^ A q ^ ^ ^ ^ ^ ^ u @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . l ^ ^ ^ ^ ~ 8 o > K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", +"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", +"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", +"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", +"BBfffffffffffffffffffffffffffffffffffffffffffffffffffffffBBBBBBB", +"fe;#############################################$<9dffffffffBBBB", +"faf7@ .%3rffffyfgfffffffB", +"f-qfs6222222222222222222222222222222222222224ufffp71+&fzMxffffff", +"f=o8ffffffffffffffffffffffffffffffffffffffffffw2*X &fzNNnkffff", +"f= +fffffffffffffffffffffffffffffffffffffffff, &fzNNNNbjff", +"f= Offfffffffffffffffffffffffffffffffffffffff> &fzNNNNNNcf", +"f= Offfffffffffffffffffffffffffffffffffffffff> &fzNNNNNNvf", +"f= Offfffffffffffffffffffffffffffffffffffffff> &fzNNNNNNvf", +"f= Offfffffffffffffffffffffffffffffffffffffff> &fzNNNNNNvf", +"f= Offfffffffffffffffffffffffffffffffffffffff> &fzNNNNNNvf", +"f= Offfffffffffffffffffffffffffffffffffffffff> &fzNNNNNNvf", +"f= Offfffffffffffffffffffffffffffffffffffffff> &fzNNNNNNvf", +"f= Offfffffffffffffffffffffffffffffffffffffff> &fzNNNNNNvf", +"f= Offfffffffffffffffffffffffffffffffffffffff> &fzNNNNNNvf", +"f= Offfffffffffffffffffffffffffffffffffffffff> &fzNNNNNNvf", +"f= Offfffffffffffffffffffffffffffffffffffffff> &fzNNNNNNvf", +"f= Offfffffffffffffffffffffffffffffffffffffff> &fzNNNNNNcf", +"f= +fffffffffffffffffffffffffffffffffffffffff, &fzNNNNbhff", +"f=o8ffffffffffffffffffffffffffffffffffffffffffw2*X &fzNNbkffff", +"f-qfs6222222222222222222222222222222222222225ifffp71#&fzmlffffff", +"faf7@ .%3tffffyfgfffffffB", +"fe:#############################################$10fffffffffBBBB", +"BBfffffffffffffffffffffffffffffffffffffffffffffffffffffffBBBBBBB", +"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", +"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", +"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", +"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_passenger_wagon.xpm sumo-1.12.0/src/utils/gui/images/vshape_passenger_wagon.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_passenger_wagon.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_passenger_wagon.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,104 @@ /* XPM */ static const char *vshape_passenger_wagon_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" c #7B7B00", +", c #7D7D00", +"< c #7E7E00", +"1 c #888800", +"2 c #8C8C00", +"3 c #8D8D00", +"4 c #8E8E00", +"5 c #909000", +"6 c #989800", +"7 c #999900", +"8 c #9B9B00", +"9 c #AEAE00", +"0 c #AFAF00", +"q c #B4B400", +"w c #B5B500", +"e c #BBBB00", +"r c #C9C900", +"t c #CACA00", +"y c #D4D400", +"u c #DDDD00", +"i c #E6E600", +"p c #EAEA00", +"a c #EBEB00", +"s c #F5F500", +"d c #F7F700", +"f c #F8F800", +"g c #FBFB00", +"h c #FEFE00", +"j c yellow", +"k c #FFFF01", +"l c #FFFF07", +"z c #FFFF08", +"x c #FFFF0B", +"c c #FFFF1A", +"v c #FFFF1F", +"b c #FFFF2B", +"n c #FFFF2E", +"m c #FFFF31", +"M c #FFFF3D", +"N c #FFFF3E", +"B c #FFFF43", +"V c #FFFF52", +"C c #FFFF61", +"Z c #FFFF76", +"A c #FFFF80", +"S c #FFFF85", +"D c #FFFF91", +"F c #FFFF97", +"G c #FFFF99", +"H c None", /* pixels */ -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 t M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ - q j m m j q = @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e < V ~ ^ ^ ^ ^ ^ ^ ~ V < e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . p W ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ W p . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . z ^ ^ ^ ^ L x s d b Y ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ p ^ ^ ^ ^ y . $ A ^ ^ ^ ^ i @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r 1 W ^ ^ ^ ^ k % R ^ ^ ^ W < r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + V ^ ^ ^ ^ ^ P w C G 7 S ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ H D ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r q ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ a # R ^ ^ ^ ^ ^ 0 r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ ^ F O v ^ ^ ^ ^ ^ ^ h 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ U ; r ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ f 2 W ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ 4 c ^ ^ ^ ^ ^ ^ ^ ^ g 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ t q ^ ^ ^ ^ ^ ^ ^ ^ 6 & & F ^ ^ ^ ^ ^ ^ ^ ^ 9 t ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ! ^ ^ ^ ^ ^ ^ ^ ^ E ^ ^ ^ ^ ^ ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + B ^ ^ ^ ^ ^ ^ Q 7 X : J ^ ^ ^ ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r < W ^ ^ ^ ^ ^ Z 0 ^ ^ ^ ^ ^ ^ W , r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ i ^ ^ ^ ^ ^ A q ^ ^ ^ ^ ^ ^ u @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . l ^ ^ ^ ^ ~ 8 o > K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH", +"HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH", +"HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH", +"HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH", +"HHHjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjHHHHHHHHHHHHHHHH", +"HHjh9@+++++++++++++++++++++++++++++++++++,gjjjjjjjjjjjjjHHHHHHHH", +"jjjdjp;o O*2rhjjajzzjjjjjjjjjjjjHHHH", +"jjj%qjji4111111111111111111111111116yhjjse:++jbFACBvkjjjjjjjjjHH", +"jjj+.-fjjjjjjjjjjjjjjjjjjjjjjjjjjjjjju5$X +jbGGGGGDZVnxjjjjjjH", +"jjj+ 8jjjjjjjjjjjjjjjjjjjjjjjjjjjjj< +jbGGGGGGGGGGSCBvkjj", +"jjj+ 7jjjjjjjjjjjjjjjjjjjjjjjjjjjjj> +jbGGGGGGGGGGGGGGDmj", +"jjj+ 7jjjjjjjjjjjjjjjjjjjjjjjjjjjjj> +jbGGGGGGGGGGGGGGGNj", +"jjj+ 7jjjjjjjjjjjjjjjjjjjjjjjjjjjjj> +jbGGGGGGGGGGGGGGGNj", +"jjj+ 7jjjjjjjjjjjjjjjjjjjjjjjjjjjjj> +jbGGGGGGGGGGGGGGGNj", +"jjj+ 7jjjjjjjjjjjjjjjjjjjjjjjjjjjjj> +jbGGGGGGGGGGGGGGGNj", +"jjj+ 7jjjjjjjjjjjjjjjjjjjjjjjjjjjjj> +jbGGGGGGGGGGGGGGGNj", +"jjj+ 7jjjjjjjjjjjjjjjjjjjjjjjjjjjjj> +jbGGGGGGGGGGGGGGGNj", +"jjj+ 7jjjjjjjjjjjjjjjjjjjjjjjjjjjjj> +jbGGGGGGGGGGGGGGGNj", +"jjj+ 7jjjjjjjjjjjjjjjjjjjjjjjjjjjjj> +jbGGGGGGGGGGGGGGGNj", +"jjj+ 7jjjjjjjjjjjjjjjjjjjjjjjjjjjjj> +jbGGGGGGGGGGGGGGGNj", +"jjj+ 7jjjjjjjjjjjjjjjjjjjjjjjjjjjjj> +jbGGGGGGGGGGGGGGGNj", +"jjj+ 7jjjjjjjjjjjjjjjjjjjjjjjjjjjjj> +jbGGGGGGGGGGGGGGDmj", +"jjj+ 8jjjjjjjjjjjjjjjjjjjjjjjjjjjjj< +jbGGGGGGGGGGSCBvkjj", +"jjj+.-fjjjjjjjjjjjjjjjjjjjjjjjjjjjjjju5$X +jbGGGGGDZVnxjjjjjjH", +"jjj&wjji4111111111111111111111111117yhjjse:++jbFACMckjjjjjjjjjHH", +"jjjdja;o O=3thjjajzljjjjjjjjjjjjHHHH", +"HHjh0#+++++++++++++++++++++++++++++++++++ c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" c #888800", +", c #8C8C00", +"< c #8D8D00", +"1 c #909000", +"2 c #989800", +"3 c #999900", +"4 c #BBBB00", +"5 c #BDBD00", +"6 c #BEBE00", +"7 c #C9C900", +"8 c #CACA00", +"9 c #CBCB00", +"0 c #CFCF00", +"q c #D2D200", +"w c #D4D400", +"e c #DDDD00", +"r c #E0E000", +"t c #E2E200", +"y c #EBEB00", +"u c #F1F100", +"i c #F5F500", +"p c #F9F900", +"a c #FBFB00", +"s c #FDFD00", +"d c #FEFE00", +"f c yellow", +"g c #FFFF01", +"h c #FFFF07", +"j c #FFFF08", +"k c #FFFF0B", +"l c #FFFF1A", +"z c #FFFF1F", +"x c #FFFF2B", +"c c #FFFF2E", +"v c #FFFF31", +"b c #FFFF3D", +"n c #FFFF3E", +"m c #FFFF43", +"M c #FFFF52", +"N c #FFFF61", +"B c #FFFF76", +"V c #FFFF80", +"C c #FFFF85", +"Z c #FFFF91", +"A c #FFFF97", +"S c #FFFF99", +"D c None", /* pixels */ -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 t M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ - q j m m j q = @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e < V ~ ^ ^ ^ ^ ^ ^ ~ V < e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . p W ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ W p . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . z ^ ^ ^ ^ L x s d b Y ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ p ^ ^ ^ ^ y . $ A ^ ^ ^ ^ i @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r 1 W ^ ^ ^ ^ k % R ^ ^ ^ W < r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + V ^ ^ ^ ^ ^ P w C G 7 S ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ H D ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r q ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ a # R ^ ^ ^ ^ ^ 0 r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ ^ F O v ^ ^ ^ ^ ^ ^ h 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ U ; r ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ f 2 W ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ 4 c ^ ^ ^ ^ ^ ^ ^ ^ g 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ t q ^ ^ ^ ^ ^ ^ ^ ^ 6 & & F ^ ^ ^ ^ ^ ^ ^ ^ 9 t ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ! ^ ^ ^ ^ ^ ^ ^ ^ E ^ ^ ^ ^ ^ ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + B ^ ^ ^ ^ ^ ^ Q 7 X : J ^ ^ ^ ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r < W ^ ^ ^ ^ ^ Z 0 ^ ^ ^ ^ ^ ^ W , r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ i ^ ^ ^ ^ ^ A q ^ ^ ^ ^ ^ ^ u @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . l ^ ^ ^ ^ ~ 8 o > K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", +"DDDfffffffffffffffffffffffffffffffffffffffffffffDDDDDDDDDDDDDDDD", +"DDffffffffffffs5&++++++++++++++++++++++++;afffffffffffffDDDDDDDD", +"ffffffffffpufffffq*O o#,7dffyfjjffffffffffffDDDD", +"ffffffffffr.+=4afffs6>>>>>>>>>>>>>>2wdffi4=++fxAVNmzgfffffffffDD", +"ffffffffffr o%3tffffffffffffffffffe1@X +fxSSSSSZBMckffffffD", +"ffffffffffr 0ffffffffffffffff: +fxSSSSSSSSSSCNmzgff", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSZvf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSSnf", +"ffffffffffr 9ffffffffffffffff- +fxSSSSSSSSSSSSSSZvf", +"ffffffffffr 0ffffffffffffffff: +fxSSSSSSSSSSCNmzgff", +"ffffffffffr o%3tffffffffffffffffffe1@X +fxSSSSSZBMckffffffD", +"ffffffffffr.+=4afffs6>>>>>>>>>>>>>>3wdffi4=++fxAVNblgfffffffffDD", +"ffffffffffpufffffq*O o$<8dffyfjhffffffffffffDDDD", +"DDffffffffffffs6&++++++++++++++++++++++++:afffffffffffffDDDDDDDD", +"DDDfffffffffffffffffffffffffffffffffffffffffffffDDDDDDDDDDDDDDDD", +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD", +"DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_pedestrian.xpm sumo-1.12.0/src/utils/gui/images/vshape_pedestrian.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_pedestrian.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_pedestrian.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,64 @@ /* XPM */ static const char *vshape_pedestrian_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" c #2C2CFF", +", c #2E2EFF", +"< c #3A3AFF", +"1 c #3E3EFF", +"2 c #4444FF", +"3 c #4848FF", +"4 c #4B4BFF", +"5 c #4C4CFF", +"6 c #4D4DFF", +"7 c None", /* pixels */ -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 t M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ - q j m m j q = @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e < V ~ ^ ^ ^ ^ ^ ^ ~ V < e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . p W ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ W p . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . z ^ ^ ^ ^ L x s d b Y ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ p ^ ^ ^ ^ y . $ A ^ ^ ^ ^ i @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r 1 W ^ ^ ^ ^ k % R ^ ^ ^ W < r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + V ^ ^ ^ ^ ^ P w C G 7 S ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ H D ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r q ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ a # R ^ ^ ^ ^ ^ 0 r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ ^ F O v ^ ^ ^ ^ ^ ^ h 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ U ; r ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ f 2 W ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ 4 c ^ ^ ^ ^ ^ ^ ^ ^ g 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ t q ^ ^ ^ ^ ^ ^ ^ ^ 6 & & F ^ ^ ^ ^ ^ ^ ^ ^ 9 t ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ! ^ ^ ^ ^ ^ ^ ^ ^ E ^ ^ ^ ^ ^ ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + B ^ ^ ^ ^ ^ ^ Q 7 X : J ^ ^ ^ ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r < W ^ ^ ^ ^ ^ Z 0 ^ ^ ^ ^ ^ ^ W , r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ i ^ ^ ^ ^ ^ A q ^ ^ ^ ^ ^ ^ u @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . l ^ ^ ^ ^ ~ 8 o > K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"7777777777777777777777777777777477777777777777777777777777777777", +"7777777777777777777777777777775547777777777777777777777777777777", +"7777777777777777777777777777755556777777777777777777777777777777", +"7777777777777777777777777777555555577777777777777777777777777777", +"7777777777777777777777777775555555567777777777777777777777777777", +"7777777777777777777777777775555555567777777777777777777777777777", +"7777777777777777777777777755555555557777777777777777777777777777", +"7777777777777777777777777755555555557777777777777777777777777777", +"777777777777777777777777775551=O;3555777777777777777777777777777", +"777777777777777777777777775<& o-25777777777777777777777777777", +"77777777777777777777777777$ .,777777777777777777777777777", +"7777777777777777777777777> @777777777777777777777777777", +"7777777777777777777777777% 777777777777777777777777777", +"7777777777777777777777777X #77777777777777777777777777", +"7777777777777777777777777 o77777777777777777777777777", +"777777777777777777777777X 7777777777777777777777777", +"777777777777777777777777X 7777777777777777777777777", +"7777777777777777777777777 o77777777777777777777777777", +"7777777777777777777777777X #77777777777777777777777777", +"7777777777777777777777777% 777777777777777777777777777", +"7777777777777777777777777> @777777777777777777777777777", +"77777777777777777777777777$ .,777777777777777777777777777", +"777777777777777777777777775<& o-25777777777777777777777777777", +"777777777777777777777777775551*+:3555777777777777777777777777777", +"7777777777777777777777777755555555557777777777777777777777777777", +"7777777777777777777777777755555555557777777777777777777777777777", +"7777777777777777777777777775555555567777777777777777777777777777", +"7777777777777777777777777775555555567777777777777777777777777777", +"7777777777777777777777777777555555577777777777777777777777777777", +"7777777777777777777777777777755556777777777777777777777777777777", +"7777777777777777777777777777775547777777777777777777777777777777", +"7777777777777777777777777777777577777777777777777777777777777777" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_police.xpm sumo-1.12.0/src/utils/gui/images/vshape_police.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_police.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_police.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,85 @@ /* XPM */ static const char *vshape_police_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" c #0000DD", +", c #3A3AC5", +"< c #3333CB", +"1 c #3636C8", +"2 c #2525DA", +"3 c #0000EB", +"4 c #1E1EE0", +"5 c #1414EA", +"6 c #0000F5", +"7 c #0808F6", +"8 c blue", +"9 c #0101FF", +"0 c #0404FF", +"q c #0606FF", +"w c #0D0DFF", +"e c #0F0FFF", +"r c #1515FF", +"t c #1717FF", +"y c #1818FF", +"u c #1E1EFF", +"i c #1F1FFF", +"p c #2121FF", +"a c #2929FF", +"s c #3030FF", +"d c #3A3AFF", +"f c #3F3FFF", +"g c #4242FF", +"h c #4848FF", +"j c #4B4BFF", +"k c #4C4CFF", +"l c None", /* pixels */ -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 t M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ - q j m m j q = @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e < V ~ ^ ^ ^ ^ ^ ^ ~ V < e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . p W ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ W p . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . z ^ ^ ^ ^ L x s d b Y ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ p ^ ^ ^ ^ y . $ A ^ ^ ^ ^ i @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r 1 W ^ ^ ^ ^ k % R ^ ^ ^ W < r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + V ^ ^ ^ ^ ^ P w C G 7 S ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ H D ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r q ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ a # R ^ ^ ^ ^ ^ 0 r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ ^ F O v ^ ^ ^ ^ ^ ^ h 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ U ; r ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ f 2 W ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ 4 c ^ ^ ^ ^ ^ ^ ^ ^ g 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ t q ^ ^ ^ ^ ^ ^ ^ ^ 6 & & F ^ ^ ^ ^ ^ ^ ^ ^ 9 t ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ! ^ ^ ^ ^ ^ ^ ^ ^ E ^ ^ ^ ^ ^ ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + B ^ ^ ^ ^ ^ ^ Q 7 X : J ^ ^ ^ ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r < W ^ ^ ^ ^ ^ Z 0 ^ ^ ^ ^ ^ ^ W , r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ i ^ ^ ^ ^ ^ A q ^ ^ ^ ^ ^ ^ u @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . l ^ ^ ^ ^ ~ 8 o > K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll", +"llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll", +"llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll", +"llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll", +"lll888,=========================8888888888888888llllllllllllllll", +"ll8888:#########################888888888888888888888888llllllll", +"888888:#########################8888888888883800888888888888llll", +"888888:#########################888888886%OXX8rjfspe9888888888ll", +"888888:#########################88888>$o. X8rkkkkkhdatq888888l", +"888888:#########=77772##########8888@ X8rkkkkkkkkkkgspe988", +"888888:#########;88884##########8888+ X8rkkkkkkkkkkkkkkhy8", +"888888:#########;88884##########8888+ X8rkkkkkkkkkkkkkkki8", +"888888:#########;88884##########8888+ X8rkkkkkkkkkkkkkkki8", +"888888:#####&---188885---*######8888+ X8rkkkkkkkkkkkkkkki8", +"888888:#####*888888888888<######8888+ X8rkkkkkkkkkkkkkkki8", +"888888:#####*888888888888<######8888+ X8rkkkkkkkkkkkkkkki8", +"888888:#####*888888888888<######8888+ X8rkkkkkkkkkkkkkkki8", +"888888:#####*888888888888<######8888+ X8rkkkkkkkkkkkkkkki8", +"888888:#####&---188885---*######8888+ X8rkkkkkkkkkkkkkkki8", +"888888:#########;88884##########8888+ X8rkkkkkkkkkkkkkkki8", +"888888:#########;88884##########8888+ X8rkkkkkkkkkkkkkkki8", +"888888:#########;88884##########8888+ X8rkkkkkkkkkkkkkkhy8", +"888888:#########=77772##########8888@ X8rkkkkkkkkkkgspe988", +"888888:#########################88888>$o. X8rkkkkkhdatq888888l", +"888888:#########################888888886%OXX8rjfsuw9888888888ll", +"888888:#########################8888888888883800888888888888llll", +"ll8888:#########################888888888888888888888888llllllll", +"lll888,=========================8888888888888888llllllllllllllll", +"llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll", +"llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll", +"llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll", +"llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_rail_cargo.xpm sumo-1.12.0/src/utils/gui/images/vshape_rail_cargo.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_rail_cargo.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_rail_cargo.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,41 @@ /* XPM */ static const char *vshape_rail_cargo_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", +"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", +"XXXXX XXXXX", +"XXXX. XXXX", +"XXX XX", +"X X", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +"X X", +"XXX XX", +"XXXX. XXXX", +"XXXXX XXXXX", +"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", +"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_rail_car.xpm sumo-1.12.0/src/utils/gui/images/vshape_rail_car.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_rail_car.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_rail_car.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,41 @@ /* XPM */ static const char *vshape_rail_car_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", +"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", +"XXXXX XXXXX", +"XXXX. XXXX", +"XXX XX", +"X X", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +"X X", +"XXX XX", +"XXXX. XXXX", +"XXXXX XXXXX", +"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", +"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_rail.xpm sumo-1.12.0/src/utils/gui/images/vshape_rail.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_rail.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_rail.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,41 @@ /* XPM */ static const char *vshape_rail_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", +"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", +"XXXXX XXXXX", +"XXXX. XXXX", +"XXX XX", +"X X", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +"X X", +"XXX XX", +"XXXX. XXXX", +"XXXXX XXXXX", +"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", +"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_rickshaw.xpm sumo-1.12.0/src/utils/gui/images/vshape_rickshaw.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_rickshaw.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_rickshaw.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,43 @@ /* XPM */ static const char *vshape_rickshaw_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOO", +"OOOOOOOOOOOOOOOOOOOOOOOOO . OOOOOOOOOOOOOOOOOOOOOOOO", +"OOOOOOOOOOOOOOOOOOOO . . OOOOOOOOOOOOOOOOOOOO", +"OOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOO", +"OOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOO", +"OOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOO", +"OOOOOOooooooooooooooooooooooooooooooooooooooooXoooOOOOOOOOOOOOOO", +"OOOOOoooooooooooooooooooooooooooooooooooooooooooooooooooOOOOOOOO", +"OOOOoooooooooooooooooooooooooooooooooooooooooooooooooooooOOOOOOO", +"OOOOoooooooooooooooooooooooooooooooooooooooooooooooooooooooOOOOO", +"OOOOooooooooooooooooooooooooooooooooooooooooooooooooooooooooOOOO", +"OOOOooooooooooooooooooooooooooooooooooooooooooooooooooooooooOOOO", +"OOOOooooooooooooooooooooooooooooooooooooooooooooooooooooooooOOOO", +"OOOOooooooooooooooooooooooooooooooooooooooooooooooooooooooooOOOO", +"OOOOooooooooooooooooooooooooooooooooooooooooooooooooooooooooOOOO", +"OOOOooooooooooooooooooooooooooooooooooooooooooooooooooooooooOOOO", +"OOOOooooooooooooooooooooooooooooooooooooooooooooooooooooooooOOOO", +"OOOOooooooooooooooooooooooooooooooooooooooooooooooooooooooooOOOO", +"OOOOooooooooooooooooooooooooooooooooooooooooooooooooooooooooOOOO", +"OOOOooooooooooooooooooooooooooooooooooooooooooooooooooooooooOOOO", +"OOOOooooooooooooooooooooooooooooooooooooooooooooooooooooooooOOOO", +"OOOOooooooooooooooooooooooooooooooooooooooooooooooooooooooooOOOO", +"OOOOoooooooooooooooooooooooooooooooooooooooooooooooooooooooOOOOO", +"OOOOoooooooooooooooooooooooooooooooooooooooooooooooooooooOOOOOOO", +"OOOOOoooooooooooooooooooooooooooooooooooooooooooooooooooOOOOOOOO", +"OOOOOOooooooooooooooooooooooooooooooooooooooooXoooOOOOOOOOOOOOOO", +"OOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOO", +"OOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOO", +"OOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOO", +"OOOOOOOOOOOOOOOOOOOO . . OOOOOOOOOOOOOOOOOOOO", +"OOOOOOOOOOOOOOOOOOOOOOOOO . OOOOOOOOOOOOOOOOOOOOOOOO", +"OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO. .OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_scooter.xpm sumo-1.12.0/src/utils/gui/images/vshape_scooter.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_scooter.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_scooter.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,81 @@ +/* XPM */ +static const char *vshape_scooter_xpm[] = { +/* columns rows colors chars-per-pixel */ +"64 32 43 1 ", +" c #78782C", +". c #7E7E2C", +"X c #4C4C4C", +"o c #4D4D4C", +"O c #5A5A41", +"+ c #5D5D41", +"@ c #646453", +"# c #7F7F62", +"$ c #B3B300", +"% c #B5B500", +"& c #C4C400", +"* c #C9C900", +"= c #CACA00", +"- c #CFCF00", +"; c #C6C60B", +": c #D0D000", +"> c #D8D800", +", c #DADA00", +"< c #DDDD0C", +"1 c #DDDD0D", +"2 c #D9D912", +"3 c #DEDE11", +"4 c #DFDF17", +"5 c yellow", +"6 c #E0E017", +"7 c #E1E11D", +"8 c #E1E11E", +"9 c #E5E52F", +"0 c #8D8D40", +"q c #98986D", +"w c #FFFF53", +"e c #F2F263", +"r c #F2F264", +"t c #F3F366", +"y c #F4F46F", +"u c #F8F87C", +"i c #F9F980", +"p c #FBFB89", +"a c #FEFE96", +"s c #FFFF98", +"d c #FFFF99", +"f c #FFFF9A", +"g c None", +/* pixels */ +"gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggXXXXggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggXXXXggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggXXXXggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggXXXXggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggXXXXggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggXXXXggggggggg", +"gggggggggggggggggggggggsddddddddddddddddsggggggggggXXXXggggggggg", +"ggggggggggggdffddddddddddddddddddddddddddddddddddff#XXoggggggggg", +"ggggggeryupdddddwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwdddqXX@yregggggg", +"ggg8<,,,,,,19tad55555555555555555555555555555555dat0XX+*->,<8ggg", +"g2,,,,,,,,,,,,6i55555555555555555555555555555555i6>.XXO$$%*,,,3g", +"X;,,,,,,,,,,,,,7555555555555555555555555555555557,& XXO$$$$:,,,4", +"X;,,,,,,,,,,,,,7555555555555555555555555555555557,& XXO$$$$:,,,4", +"g2,,,,,,,,,,,,6i55555555555555555555555555555555i6>.XXO$$%=,,,3g", +"ggg8<,,,,,,19tad55555555555555555555555555555555dat0XX+*->,<8ggg", +"ggggggeryupdddddwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwdddqXX@yregggggg", +"ggggggggggggdffddddddddddddddddddddddddddddddddddff#XXoggggggggg", +"gggggggggggggggggggggggsddddddddddddddddsggggggggggXXXXggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggXXXXggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggXXXXggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggXXXXggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggXXXXggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggXXXXggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggXXXXggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg", +"gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg" +}; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_ship.xpm sumo-1.12.0/src/utils/gui/images/vshape_ship.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_ship.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_ship.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,50 @@ /* XPM */ static const char *vshape_ship_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"****************************************************************", +"****************************************************************", +"****************************************************************", +"****************************************************************", +"***&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&****************", +"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*************", +"&&&$@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&************", +"&&&+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO&&&&&&**********", +"&&&+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO&&&&&&&*********", +"&&&+OOOOOo......................OOOOOOOOOOOOOOOO&&&&&&&&&*******", +"&&&+OOOOOX OOOOOOOOOOOOOOOO&&&&&&&&&&******", +"&&&+OOOOOX OOOOOOOOOOOOOOOO&&&&&&&&&&&*****", +"&&&+OOOOOX OOOOOOOOOOOOOOOO&&&&&&&&&&&&****", +"&&&+OOOOOX OOOOOOOOOOOOOOOO&&&&&&&&&&&&&***", +"&&&+OOOOOX OOOOOOOOOOOOOOOO&&&&&&&&&&&&&&**", +"&&&+OOOOOX OOOOOOOOOOOOOOOO&&&&&&&&&&&&&&&*", +"&&&+OOOOOX OOOOOOOOOOOOOOOO&&&&&&&&&&&&&&&*", +"&&&+OOOOOX OOOOOOOOOOOOOOOO&&&&&&&&&&&&&&**", +"&&&+OOOOOX OOOOOOOOOOOOOOOO&&&&&&&&&&&&&***", +"&&&+OOOOOX OOOOOOOOOOOOOOOO&&&&&&&&&&&&****", +"&&&+OOOOOX OOOOOOOOOOOOOOOO&&&&&&&&&&&*****", +"&&&+OOOOOX OOOOOOOOOOOOOOOO&&&&&&&&&&******", +"&&&+OOOOOo......................OOOOOOOOOOOOOOOO&&&&&&&&&*******", +"&&&+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO&&&&&&&*********", +"&&&+OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO&&&&&&**********", +"&&&%############################################&&&&************", +"&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*************", +"***&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&****************", +"****************************************************************", +"****************************************************************", +"****************************************************************", +"****************************************************************" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_truck_1trailer.xpm sumo-1.12.0/src/utils/gui/images/vshape_truck_1trailer.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_truck_1trailer.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_truck_1trailer.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,51 @@ /* XPM */ static const char *vshape_truck_1trailer_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"*****************=====*********************=********$XXXXXXXXX+&", +"*****************=====*********************=********%OOOOOOOO@.o", +"*****************=====*********************=*****************# o", +"*****************=====*********************=*****************# o", +"*****************=====*********************=*****************# o", +"*****************=====*********************=*****************# o", +"*****************=====*********************=*****************# o", +"*****************=====*********************=*****************# o", +"*****************=====*********************=*****************# o", +"*****************=====*********************=*****************# o", +"*****************=====*********************=*****************# o", +"*****************=====*********************=*****************# o", +"*****************=====*********************=*****************# o", +"*****************=====*********************=*****************# o", +"*****************=====*********************=********%OOOOOOOO@.o", +"*****************=====*********************=********$XXXXXXXXX+&", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_truck_semitrailer.xpm sumo-1.12.0/src/utils/gui/images/vshape_truck_semitrailer.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_truck_semitrailer.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_truck_semitrailer.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,51 @@ /* XPM */ static const char *vshape_truck_semitrailer_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"***************************************=====********$XXXXXXXXX+&", +"***************************************=====********%OOOOOOOO@.o", +"***************************************=====*****************# o", +"***************************************=====*****************# o", +"***************************************=====*****************# o", +"***************************************=====*****************# o", +"***************************************=====*****************# o", +"***************************************=====*****************# o", +"***************************************=====*****************# o", +"***************************************=====*****************# o", +"***************************************=====*****************# o", +"***************************************=====*****************# o", +"***************************************=====*****************# o", +"***************************************=====*****************# o", +"***************************************=====********%OOOOOOOO@.o", +"***************************************=====********$XXXXXXXXX+&", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================", +"================================================================" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vshape_truck.xpm sumo-1.12.0/src/utils/gui/images/vshape_truck.xpm --- sumo-1.11.0/src/utils/gui/images/vshape_truck.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vshape_truck.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,294 +1,55 @@ /* XPM */ static const char *vshape_truck_xpm[] = { /* columns rows colors chars-per-pixel */ -"64 32 256 2 ", -" c #D80027", -". c #D80128", -"X c #D80229", -"o c #D9052B", -"O c #D9072D", -"+ c #DA1034", -"@ c #DB1236", -"# c #DB1639", -"$ c #DC183B", -"% c #DC193C", -"& c #DC1C3E", -"* c #DD1E40", -"= c #DD1E41", -"- c #DD2042", -"; c #DD2143", -": c #DE2647", -"> c #DF2C4D", -", c #DF3150", -"< c #DF3151", -"1 c #E03251", -"2 c #E03655", -"3 c #E13958", -"4 c #E34B67", -"5 c #E44C68", -"6 c #E5556F", -"7 c #E65B74", -"8 c #E7637B", -"9 c #E8677E", -"0 c #E8677F", -"q c #E8687F", -"w c #E96D83", -"e c #E97288", -"r c #EA7489", -"t c #EA748A", -"y c #EA798D", -"u c #EB7E92", -"i c #EB7F93", -"p c #EB8093", -"a c #EC8295", -"s c #EC8396", -"d c #EC8497", -"f c #EE8E9F", -"g c #EF97A7", -"h c #EF98A7", -"j c #EF98A8", -"k c #EF9AA9", -"l c #F09EAD", -"z c #F09FAE", -"x c #F0A0AF", -"c c #F1A2B0", -"v c #F1A4B2", -"b c #F2ABB8", -"n c #F3AFBB", -"m c #F3B0BC", -"M c #F3B2BE", -"N c #F4B5C0", -"B c #F4B5C1", -"V c #F4B6C1", -"C c #F5C0CA", -"Z c #F6C2CB", -"A c #F6C4CD", -"S c #F6C5CE", -"D c #F6C7CF", -"F c #F7CAD2", -"G c #F7CED5", -"H c #F8CFD6", -"J c #F9DAE0", -"K c #FADCE2", -"L c #FADFE4", -"P c #FBE7EB", -"I c #FCEAED", -"U c #FDF3F5", -"Y c #FDF5F6", -"T c #FEF7F8", -"R c #FEF8F9", -"E c #FEFAFB", -"W c #FEFCFC", -"Q c #FFFDFD", -"! c #FFFDFE", -"~ c #FFFEFE", -"^ c gray100", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -" c None", /* pixels */ -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 t M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ - q j m m j q = @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e < V ~ ^ ^ ^ ^ ^ ^ ~ V < e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . p W ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ W p . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . z ^ ^ ^ ^ L x s d b Y ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ p ^ ^ ^ ^ y . $ A ^ ^ ^ ^ i @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r 1 W ^ ^ ^ ^ k % R ^ ^ ^ W < r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + V ^ ^ ^ ^ ^ P w C G 7 S ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ H D ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r q ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ a # R ^ ^ ^ ^ ^ 0 r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ ^ F O v ^ ^ ^ ^ ^ ^ h 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ U ; r ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 3 m ^ ^ ^ ^ ^ ^ ^ ^ f 2 W ^ ^ ^ ^ ^ ^ ^ n 3 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ 5 j ^ ^ ^ ^ ^ ^ ^ ^ 4 c ^ ^ ^ ^ ^ ^ ^ ^ g 5 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ t q ^ ^ ^ ^ ^ ^ ^ ^ 6 & & F ^ ^ ^ ^ ^ ^ ^ ^ 9 t ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ M = ! ^ ^ ^ ^ ^ ^ ^ ^ E ^ ^ ^ ^ ^ ^ ^ ^ ^ ! = M ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T + B ^ ^ ^ ^ ^ ^ Q 7 X : J ^ ^ ^ ^ ^ ^ ^ N + T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ r < W ^ ^ ^ ^ ^ Z 0 ^ ^ ^ ^ ^ ^ W , r ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I @ i ^ ^ ^ ^ ^ A q ^ ^ ^ ^ ^ ^ u @ I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v . l ^ ^ ^ ^ ~ 8 o > K ^ ^ ^ ^ ^ l . v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ e . i W ^ ^ ^ ^ ~ ^ ^ ^ ^ ^ W u . e ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ~ e , N ! ^ ^ ^ ^ ^ ^ ! N , e ~ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ v @ = 9 h n n g 9 * @ v ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ I r + + r I ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ T M r 5 3 3 5 r M T ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ", -"^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ " +">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", +">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", +">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", +">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", +"::::::::::::::::::::::::::::::::::>>::::::::::::==============;>", +"::::::::::::::::::::::::::::::::::>>:::::::::::: o*-", +"::::::::::::::::::::::::::::::::::>>::::::::::::oooooooooooo+@.$", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::::::::::::::& $", +"::::::::::::::::::::::::::::::::::>>::::::::::::ooooooooooooO#.$", +"::::::::::::::::::::::::::::::::::>>:::::::::::: X%-", +"::::::::::::::::::::::::::::::::::>>::::::::::::==============;>", +">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", +">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", +">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", +">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" }; diff -Nru sumo-1.11.0/src/utils/gui/images/vssstep.xpm sumo-1.12.0/src/utils/gui/images/vssstep.xpm --- sumo-1.11.0/src/utils/gui/images/vssstep.xpm 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/images/vssstep.xpm 2022-01-24 20:43:50.000000000 +0000 @@ -1,278 +1,25 @@ /* XPM */ static const char *vssstep_xpm[] = { /* columns rows colors chars-per-pixel */ -"16 16 256 2 ", -" c black", -". c black", -"X c black", -"o c black", -"O c black", -"+ c black", -"@ c black", -"# c black", -"$ c black", -"% c black", -"& c black", -"* c black", -"= c black", -"- c black", -"; c black", -": c black", -"> c black", -", c black", -"< c black", -"1 c black", -"2 c black", -"3 c black", -"4 c black", -"5 c black", -"6 c black", -"7 c black", -"8 c black", -"9 c black", -"0 c black", -"q c black", -"w c black", -"e c black", -"r c black", -"t c black", -"y c black", -"u c black", -"i c black", -"p c black", -"a c black", -"s c black", -"d c black", -"f c black", -"g c black", -"h c black", -"j c black", -"k c black", -"l c black", -"z c black", -"x c black", -"c c black", -"v c black", -"b c black", -"n c black", -"m c black", -"M c black", -"N c black", -"B c black", -"V c black", -"C c black", -"Z c black", -"A c black", -"S c black", -"D c black", -"F c black", -"G c black", -"H c black", -"J c black", -"K c black", -"L c black", -"P c black", -"I c black", -"U c black", -"Y c black", -"T c black", -"R c black", -"E c black", -"W c black", -"Q c black", -"! c black", -"~ c black", -"^ c black", -"/ c black", -"( c black", -") c black", -"_ c black", -"` c black", -"' c black", -"] c black", -"[ c black", -"{ c black", -"} c black", -"| c black", -" . c black", -".. c black", -"X. c black", -"o. c black", -"O. c black", -"+. c black", -"@. c black", -"#. c black", -"$. c black", -"%. c black", -"&. c black", -"*. c black", -"=. c black", -"-. c black", -";. c black", -":. c black", -">. c black", -",. c black", -"<. c black", -"1. c black", -"2. c black", -"3. c black", -"4. c black", -"5. c black", -"6. c black", -"7. c black", -"8. c black", -"9. c black", -"0. c black", -"q. c black", -"w. c black", -"e. c black", -"r. c black", -"t. c black", -"y. c black", -"u. c black", -"i. c black", -"p. c black", -"a. c black", -"s. c black", -"d. c black", -"f. c black", -"g. c black", -"h. c black", -"j. c black", -"k. c black", -"l. c black", -"z. c black", -"x. c black", -"c. c black", -"v. c black", -"b. c black", -"n. c black", -"m. c black", -"M. c black", -"N. c black", -"B. c black", -"V. c black", -"C. c black", -"Z. c black", -"A. c black", -"S. c black", -"D. c black", -"F. c black", -"G. c black", -"H. c black", -"J. c black", -"K. c black", -"L. c black", -"P. c black", -"I. c black", -"U. c black", -"Y. c black", -"T. c black", -"R. c black", -"E. c black", -"W. c black", -"Q. c black", -"!. c black", -"~. c black", -"^. c black", -"/. c black", -"(. c black", -"). c black", -"_. c black", -"`. c black", -"'. c black", -"]. c black", -"[. c black", -"{. c black", -"}. c black", -"|. c black", -" X c black", -".X c black", -"XX c black", -"oX c black", -"OX c black", -"+X c black", -"@X c black", -"#X c black", -"$X c black", -"%X c black", -"&X c black", -"*X c black", -"=X c black", -"-X c black", -";X c black", -":X c black", -">X c black", -",X c black", -"isFixed()) { myCurrentScaleScheme->setInterpolated(attrs.getOpt(SUMO_ATTR_INTERPOLATED, nullptr, ok, false)); myCurrentScaleScheme->clear(); @@ -226,6 +230,7 @@ break; case SUMO_TAG_VIEWSETTINGS_VEHICLES: mySettings.vehicleColorer.setActive(StringUtils::toInt(attrs.getStringSecure("vehicleMode", "0"))); + mySettings.vehicleScaler.setActive(StringUtils::toInt(attrs.getStringSecure("vehicleScaleMode", "0"))); mySettings.vehicleQuality = StringUtils::toInt(attrs.getStringSecure("vehicleQuality", toString(mySettings.vehicleQuality))); mySettings.showBlinker = StringUtils::toBool(attrs.getStringSecure("showBlinker", toString(mySettings.showBlinker))); mySettings.drawMinGap = StringUtils::toBool(attrs.getStringSecure("drawMinGap", toString(mySettings.drawMinGap))); @@ -233,9 +238,11 @@ mySettings.showBTRange = StringUtils::toBool(attrs.getStringSecure("showBTRange", toString(mySettings.showBTRange))); mySettings.showRouteIndex = StringUtils::toBool(attrs.getStringSecure("showRouteIndex", toString(mySettings.showRouteIndex))); mySettings.scaleLength = StringUtils::toBool(attrs.getStringSecure("scaleLength", toString(mySettings.scaleLength))); + mySettings.showParkingInfo = StringUtils::toBool(attrs.getStringSecure("showParkingInfo", toString(mySettings.showParkingInfo))); mySettings.vehicleSize = parseSizeSettings("vehicle", attrs, mySettings.vehicleSize); mySettings.vehicleName = parseTextSettings("vehicleName", attrs, mySettings.vehicleName); mySettings.vehicleValue = parseTextSettings("vehicleValue", attrs, mySettings.vehicleValue); + mySettings.vehicleScaleValue = parseTextSettings("vehicleScaleValue", attrs, mySettings.vehicleScaleValue); mySettings.vehicleText = parseTextSettings("vehicleText", attrs, mySettings.vehicleText); myCurrentColorer = element; break; @@ -425,11 +432,12 @@ GUIVisualizationTextSettings defaults) { bool ok = true; return GUIVisualizationTextSettings( - StringUtils::toBool(attrs.getStringSecure(prefix + "_show", toString(defaults.show))), + StringUtils::toBool(attrs.getStringSecure(prefix + "_show", toString(defaults.showText))), StringUtils::toDouble(attrs.getStringSecure(prefix + "_size", toString(defaults.size))), RGBColor::parseColorReporting(attrs.getStringSecure(prefix + "_color", toString(defaults.color)), "textSettings", nullptr, true, ok), RGBColor::parseColorReporting(attrs.getStringSecure(prefix + "_bgColor", toString(defaults.bgColor)), "textSettings", nullptr, true, ok), - StringUtils::toBool(attrs.getStringSecure(prefix + "_constantSize", toString(defaults.constSize)))); + StringUtils::toBool(attrs.getStringSecure(prefix + "_constantSize", toString(defaults.constSize))), + StringUtils::toBool(attrs.getStringSecure(prefix + "_onlySelected", toString(defaults.onlySelected)))); } diff -Nru sumo-1.11.0/src/utils/gui/settings/GUISettingsHandler.h sumo-1.12.0/src/utils/gui/settings/GUISettingsHandler.h --- sumo-1.11.0/src/utils/gui/settings/GUISettingsHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/settings/GUISettingsHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/settings/GUIVisualizationSettings.cpp sumo-1.12.0/src/utils/gui/settings/GUIVisualizationSettings.cpp --- sumo-1.11.0/src/utils/gui/settings/GUIVisualizationSettings.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/settings/GUIVisualizationSettings.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -83,6 +83,7 @@ const double GUIVisualizationNeteditSizeSettings::junctionBubbleRadius(4); const double GUIVisualizationNeteditSizeSettings::junctionGeometryPointRadius(1); const double GUIVisualizationNeteditSizeSettings::edgeGeometryPointRadius(1.2); +const double GUIVisualizationNeteditSizeSettings::laneGeometryPointRadius(1); const double GUIVisualizationNeteditSizeSettings::connectionGeometryPointRadius(0.8); const double GUIVisualizationNeteditSizeSettings::crossingGeometryPointRadius(1); const double GUIVisualizationNeteditSizeSettings::polygonGeometryPointRadius(1.2); @@ -142,7 +143,7 @@ const double GUIVisualizationStoppingPlaceSettings::stoppingPlaceSignOffset(1.5); const double GUIVisualizationStoppingPlaceSettings::busStopWidth(1); const double GUIVisualizationStoppingPlaceSettings::trainStopWidth(0.5); -const double GUIVisualizationStoppingPlaceSettings::containerStopWidth(1); +const double GUIVisualizationStoppingPlaceSettings::containerStopWidth(3); const double GUIVisualizationStoppingPlaceSettings::chargingStationWidth(1); // ------------------------------------------------------------------------- @@ -217,42 +218,46 @@ // GUIVisualizationTextSettings - methods // --------------------------------------------------------------------------- -GUIVisualizationTextSettings::GUIVisualizationTextSettings(bool _show, double _size, RGBColor _color, RGBColor _bgColor, bool _constSize) : - show(_show), +GUIVisualizationTextSettings::GUIVisualizationTextSettings(bool _showText, double _size, RGBColor _color, RGBColor _bgColor, bool _constSize, bool _onlySelected) : + showText(_showText), size(_size), color(_color), bgColor(_bgColor), - constSize(_constSize) { + constSize(_constSize), + onlySelected(_onlySelected) { } bool GUIVisualizationTextSettings::operator==(const GUIVisualizationTextSettings& other) { - return (show == other.show) && + return (showText == other.showText) && (size == other.size) && (color == other.color) && (bgColor == other.bgColor) && - (constSize == other.constSize); + (constSize == other.constSize) && + (onlySelected == other.onlySelected); } bool GUIVisualizationTextSettings::operator!=(const GUIVisualizationTextSettings& other) { - return (show != other.show) || + return (showText != other.showText) || (size != other.size) || (color != other.color) || (bgColor != other.bgColor) || - (constSize != other.constSize); + (constSize != other.constSize) || + (onlySelected != other.onlySelected); } void GUIVisualizationTextSettings::print(OutputDevice& dev, const std::string& name) const { - dev.writeAttr(name + "_show", show); + dev.writeAttr(name + "_show", showText); dev.writeAttr(name + "_size", size); dev.writeAttr(name + "_color", color); dev.writeAttr(name + "_bgColor", bgColor); dev.writeAttr(name + "_constantSize", constSize); + dev.writeAttr(name + "_onlySelected", onlySelected); } @@ -261,6 +266,12 @@ return constSize ? (size / scale) : (size * constFactor); } + +bool +GUIVisualizationTextSettings::show(const GUIGlObject* o) const { + return showText && (!onlySelected || o == nullptr || gSelected.isSelected(o)); +} + // --------------------------------------------------------------------------- // GUIVisualizationSizeSettings - methods // --------------------------------------------------------------------------- @@ -279,7 +290,7 @@ double exaggerationFinal; /// @note should look normal-sized at zoom 1000 if (constantSize && (!constantSizeSelected || (o == nullptr) || gSelected.isSelected(o))) { - exaggerationFinal = MAX2((double)exaggeration, exaggeration * factor / s.scale); + exaggerationFinal = MAX2(exaggeration, exaggeration * factor / s.scale); } else if (!constantSizeSelected || (o == nullptr) || gSelected.isSelected(o)) { exaggerationFinal = exaggeration; } else { @@ -507,6 +518,7 @@ edgeParam("EDGE_KEY"), laneParam("LANE_KEY"), vehicleParam("PARAM_NUMERICAL"), + vehicleScaleParam("PARAM_NUMERICAL"), vehicleTextParam("PARAM_TEXT"), edgeData("speed"), edgeValueHideCheck(false), @@ -518,9 +530,11 @@ showBTRange(false), showRouteIndex(false), scaleLength(true), + showParkingInfo(false), vehicleSize(1), vehicleName(false, 60, RGBColor(204, 153, 0, 255)), vehicleValue(false, 80, RGBColor::CYAN), + vehicleScaleValue(false, 80, RGBColor::GREY), vehicleText(false, 80, RGBColor::RED), personQuality(0), personSize(1), @@ -612,11 +626,11 @@ laneColorer.addScheme(scheme); // ... traffic states ... scheme = GUIColorScheme("by allowed speed (lanewise)", RGBColor::RED); - scheme.addColor(RGBColor::YELLOW, (double)(30 / 3.6)); - scheme.addColor(RGBColor::GREEN, (double)(55 / 3.6)); - scheme.addColor(RGBColor::CYAN, (double)(80 / 3.6)); - scheme.addColor(RGBColor::BLUE, (double)(120 / 3.6)); - scheme.addColor(RGBColor::MAGENTA, (double)(150 / 3.6)); + scheme.addColor(RGBColor::YELLOW, 30. / 3.6); + scheme.addColor(RGBColor::GREEN, 55. / 3.6); + scheme.addColor(RGBColor::CYAN, 80. / 3.6); + scheme.addColor(RGBColor::BLUE, 120. / 3.6); + scheme.addColor(RGBColor::MAGENTA, 150. / 3.6); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by current occupancy (lanewise, brutto)", RGBColor(235, 235, 235), "", false, 0, COL_SCHEME_DYNAMIC); scheme.addColor(RGBColor::GREEN, 0.25); @@ -631,13 +645,13 @@ scheme.addColor(RGBColor::RED, 1.0); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by first vehicle waiting time (lanewise)", RGBColor(235, 235, 235), "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::CYAN, (double)30); - scheme.addColor(RGBColor::GREEN, (double)100); - scheme.addColor(RGBColor::YELLOW, (double)200); - scheme.addColor(RGBColor::RED, (double)300); + scheme.addColor(RGBColor::CYAN, 30.); + scheme.addColor(RGBColor::GREEN, 100.); + scheme.addColor(RGBColor::YELLOW, 200.); + scheme.addColor(RGBColor::RED, 300.); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by lane number (streetwise)", RGBColor::RED); - scheme.addColor(RGBColor::BLUE, (double)5); + scheme.addColor(RGBColor::BLUE, 5.); laneColorer.addScheme(scheme); // ... emissions ... scheme = GUIColorScheme("by CO2 emissions", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); @@ -698,82 +712,82 @@ laneColorer.addScheme(scheme); // ... weights (experimental) ... scheme = GUIColorScheme("by global travel time", RGBColor::GREEN); - scheme.addColor(RGBColor::RED, (double)100); + scheme.addColor(RGBColor::RED, 100.); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by global speed percentage", RGBColor::RED); - scheme.addColor(RGBColor::YELLOW, (double)50); - scheme.addColor(RGBColor::GREEN, (double)100); + scheme.addColor(RGBColor::YELLOW, 50.); + scheme.addColor(RGBColor::GREEN, 100.); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by given length/geometrical length", RGBColor::RED); scheme.addColor(RGBColor::ORANGE, 0.25); scheme.addColor(RGBColor::YELLOW, 0.5); - scheme.addColor(RGBColor(179, 179, 179, 255), (double)1.0); - scheme.addColor(RGBColor::GREEN, (double)2.0); - scheme.addColor(RGBColor::CYAN, (double)4.0); - scheme.addColor(RGBColor::BLUE, (double)100.0); + scheme.addColor(RGBColor(179, 179, 179, 255), 1.); + scheme.addColor(RGBColor::GREEN, 2.); + scheme.addColor(RGBColor::CYAN, 4.); + scheme.addColor(RGBColor::BLUE, 100.); laneColorer.addScheme(scheme); laneColorer.addScheme(GUIColorScheme("by angle", RGBColor::YELLOW, "", true)); scheme = GUIColorScheme("by loaded weight", RGBColor::GREEN); - scheme.addColor(RGBColor::RED, (double)100); + scheme.addColor(RGBColor::RED, 100.); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by priority", RGBColor::YELLOW); - scheme.addColor(RGBColor::RED, (double) - 20); - scheme.addColor(RGBColor::GREEN, (double)20); + scheme.addColor(RGBColor::RED, -20.); + scheme.addColor(RGBColor::GREEN, 20.); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by height at start", RGBColor::GREY); - scheme.addColor(RGBColor::BLUE, (double) - 10); - scheme.addColor(RGBColor::RED, (double)10); - scheme.addColor(RGBColor::YELLOW, (double)50); - scheme.addColor(RGBColor::GREEN, (double)100); - scheme.addColor(RGBColor::MAGENTA, (double)200); + scheme.addColor(RGBColor::BLUE, -10.); + scheme.addColor(RGBColor::RED, 10.); + scheme.addColor(RGBColor::YELLOW, 50.); + scheme.addColor(RGBColor::GREEN, 100.); + scheme.addColor(RGBColor::MAGENTA, 200.); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by height at geometry-segment start", RGBColor::GREY); - scheme.addColor(RGBColor::BLUE, (double) - 10); - scheme.addColor(RGBColor::RED, (double)10); - scheme.addColor(RGBColor::YELLOW, (double)50); - scheme.addColor(RGBColor::GREEN, (double)100); - scheme.addColor(RGBColor::MAGENTA, (double)200); + scheme.addColor(RGBColor::BLUE, -10.); + scheme.addColor(RGBColor::RED, 10.); + scheme.addColor(RGBColor::YELLOW, 50.); + scheme.addColor(RGBColor::GREEN, 100.); + scheme.addColor(RGBColor::MAGENTA, 200.); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by inclination", RGBColor::GREY); - scheme.addColor(RGBColor::YELLOW, (double) .1); - scheme.addColor(RGBColor::RED, (double) .3); - scheme.addColor(RGBColor::GREEN, (double) - .1); - scheme.addColor(RGBColor::BLUE, (double) - .3); + scheme.addColor(RGBColor::YELLOW, 0.1); + scheme.addColor(RGBColor::RED, 0.3); + scheme.addColor(RGBColor::GREEN, -0.1); + scheme.addColor(RGBColor::BLUE, -0.3); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by geometry-segment inclination", RGBColor::GREY); - scheme.addColor(RGBColor::YELLOW, (double) .1); - scheme.addColor(RGBColor::RED, (double) .3); - scheme.addColor(RGBColor::GREEN, (double) - .1); - scheme.addColor(RGBColor::BLUE, (double) - .3); + scheme.addColor(RGBColor::YELLOW, 0.1); + scheme.addColor(RGBColor::RED, 0.3); + scheme.addColor(RGBColor::GREEN, -0.1); + scheme.addColor(RGBColor::BLUE, -0.3); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by average speed", RGBColor::RED, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::YELLOW, (double)(30 / 3.6)); - scheme.addColor(RGBColor::GREEN, (double)(55 / 3.6)); - scheme.addColor(RGBColor::CYAN, (double)(80 / 3.6)); - scheme.addColor(RGBColor::BLUE, (double)(120 / 3.6)); - scheme.addColor(RGBColor::MAGENTA, (double)(150 / 3.6)); + scheme.addColor(RGBColor::YELLOW, 30. / 3.6); + scheme.addColor(RGBColor::GREEN, 55. / 3.6); + scheme.addColor(RGBColor::CYAN, 80. / 3.6); + scheme.addColor(RGBColor::BLUE, 120. / 3.6); + scheme.addColor(RGBColor::MAGENTA, 150. / 3.6); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by average relative speed ", RGBColor::RED, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::YELLOW, (double)(0.25)); - scheme.addColor(RGBColor::GREEN, (double)(0.5)); - scheme.addColor(RGBColor::CYAN, (double)(0.75)); - scheme.addColor(RGBColor::BLUE, (double)(1)); - scheme.addColor(RGBColor::MAGENTA, (double)(1.25)); + scheme.addColor(RGBColor::YELLOW, 0.25); + scheme.addColor(RGBColor::GREEN, 0.5); + scheme.addColor(RGBColor::CYAN, 0.75); + scheme.addColor(RGBColor::BLUE, 1.); + scheme.addColor(RGBColor::MAGENTA, 1.25); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by routing device assumed speed ", RGBColor::RED, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::YELLOW, (double)(30 / 3.6)); - scheme.addColor(RGBColor::GREEN, (double)(55 / 3.6)); - scheme.addColor(RGBColor::CYAN, (double)(80 / 3.6)); - scheme.addColor(RGBColor::BLUE, (double)(120 / 3.6)); - scheme.addColor(RGBColor::MAGENTA, (double)(150 / 3.6)); + scheme.addColor(RGBColor::YELLOW, 30. / 3.6); + scheme.addColor(RGBColor::GREEN, 55. / 3.6); + scheme.addColor(RGBColor::CYAN, 80. / 3.6); + scheme.addColor(RGBColor::BLUE, 120. / 3.6); + scheme.addColor(RGBColor::MAGENTA, 150. / 3.6); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by electricity consumption", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); scheme.addColor(RGBColor::CYAN, 0.2); @@ -784,9 +798,9 @@ scheme.addColor(RGBColor::MAGENTA, 2.0); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by insertion-backlog (streetwise)", RGBColor(204, 204, 204), "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::GREEN, (double)1); - scheme.addColor(RGBColor::YELLOW, (double)10); - scheme.addColor(RGBColor::RED, (double)100); + scheme.addColor(RGBColor::GREEN, 1.); + scheme.addColor(RGBColor::YELLOW, 10.); + scheme.addColor(RGBColor::RED, 100.); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by TAZ (streetwise)", RGBColor(204, 204, 204), "no TAZ", true); laneColorer.addScheme(scheme); @@ -800,22 +814,28 @@ scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by distance (kilometrage)", RGBColor(204, 204, 204)); - scheme.addColor(RGBColor(255, 204, 204), (double)1); - scheme.addColor(RGBColor::RED, (double)10000); - scheme.addColor(RGBColor(204, 204, 255), (double) -1); - scheme.addColor(RGBColor::BLUE, (double) -10000); + scheme.addColor(RGBColor(255, 204, 204), 1.); + scheme.addColor(RGBColor::RED, 10000.); + scheme.addColor(RGBColor(204, 204, 255), -1.); + scheme.addColor(RGBColor::BLUE, -10000.); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by abs distance (kilometrage)", RGBColor(204, 204, 204)); - scheme.addColor(RGBColor::RED, (double)1); + scheme.addColor(RGBColor::RED, 1.); scheme.setAllowsNegativeValues(false); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by reachability (traveltime)", RGBColor(204, 204, 204)); - scheme.addColor(RGBColor::RED, (double)1); + scheme.addColor(RGBColor::RED, 1.); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by thread index", RGBColor(204, 204, 204)); - scheme.addColor(RGBColor::RED, (double)1); + scheme.addColor(RGBColor::RED, 1.); + laneColorer.addScheme(scheme); + scheme = GUIColorScheme("free parking spaces", RGBColor(204, 204, 204), "", false, 0, COL_SCHEME_DYNAMIC); + scheme.addColor(RGBColor::RED, 1.); + scheme.addColor(RGBColor::YELLOW, 10.); + scheme.addColor(RGBColor::GREEN, 100.); + scheme.addColor(RGBColor::BLUE, 1000.); laneColorer.addScheme(scheme); /// add vehicle coloring schemes @@ -828,11 +848,11 @@ vehicleColorer.addScheme(GUIColorScheme("arrival position as HSV", RGBColor::YELLOW, "", true)); vehicleColorer.addScheme(GUIColorScheme("direction/distance as HSV", RGBColor::YELLOW, "", true)); scheme = GUIColorScheme("by speed", RGBColor::RED, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::YELLOW, (double)(30 / 3.6)); - scheme.addColor(RGBColor::GREEN, (double)(55 / 3.6)); - scheme.addColor(RGBColor::CYAN, (double)(80 / 3.6)); - scheme.addColor(RGBColor::BLUE, (double)(120 / 3.6)); - scheme.addColor(RGBColor::MAGENTA, (double)(150 / 3.6)); + scheme.addColor(RGBColor::YELLOW, 30. / 3.6); + scheme.addColor(RGBColor::GREEN, 55. / 3.6); + scheme.addColor(RGBColor::CYAN, 80. / 3.6); + scheme.addColor(RGBColor::BLUE, 120. / 3.6); + scheme.addColor(RGBColor::MAGENTA, 150. / 3.6); scheme.setAllowsNegativeValues(true); // negative speed indicates stopped scheme.addColor(RGBColor::RED, -1); // stopped on road scheme.addColor(RGBColor::GREY, -2); // stopped off-road (parking) @@ -842,16 +862,16 @@ scheme.addColor(RGBColor(80, 160, 80, 255), 2., "had action step"); vehicleColorer.addScheme(scheme); scheme = GUIColorScheme("by waiting time", RGBColor::BLUE, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::CYAN, (double)30); - scheme.addColor(RGBColor::GREEN, (double)100); - scheme.addColor(RGBColor::YELLOW, (double)200); - scheme.addColor(RGBColor::RED, (double)300); + scheme.addColor(RGBColor::CYAN, 30.); + scheme.addColor(RGBColor::GREEN, 100.); + scheme.addColor(RGBColor::YELLOW, 200.); + scheme.addColor(RGBColor::RED, 300.); vehicleColorer.addScheme(scheme); scheme = GUIColorScheme("by accumulated waiting time", RGBColor::BLUE, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::CYAN, (double)25); - scheme.addColor(RGBColor::GREEN, (double)50); - scheme.addColor(RGBColor::YELLOW, (double)75); - scheme.addColor(RGBColor::RED, (double)100); + scheme.addColor(RGBColor::CYAN, 25.); + scheme.addColor(RGBColor::GREEN, 50.); + scheme.addColor(RGBColor::YELLOW, 75.); + scheme.addColor(RGBColor::RED, 100.); vehicleColorer.addScheme(scheme); scheme = GUIColorScheme("by time since lane change", RGBColor(179, 179, 179, 255), "0", false, 0, COL_SCHEME_DYNAMIC); scheme.addColor(RGBColor(189, 189, 179, 255), -180); @@ -863,11 +883,11 @@ scheme.setAllowsNegativeValues(true); vehicleColorer.addScheme(scheme); scheme = GUIColorScheme("by max speed", RGBColor::RED); - scheme.addColor(RGBColor::YELLOW, (double)(30 / 3.6)); - scheme.addColor(RGBColor::GREEN, (double)(55 / 3.6)); - scheme.addColor(RGBColor::CYAN, (double)(80 / 3.6)); - scheme.addColor(RGBColor::BLUE, (double)(120 / 3.6)); - scheme.addColor(RGBColor::MAGENTA, (double)(150 / 3.6)); + scheme.addColor(RGBColor::YELLOW, 30. / 3.6); + scheme.addColor(RGBColor::GREEN, 55. / 3.6); + scheme.addColor(RGBColor::CYAN, 80. / 3.6); + scheme.addColor(RGBColor::BLUE, 120. / 3.6); + scheme.addColor(RGBColor::MAGENTA, 150. / 3.6); vehicleColorer.addScheme(scheme); // ... emissions ... scheme = GUIColorScheme("by CO2 emissions", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); @@ -927,8 +947,8 @@ scheme.addColor(RGBColor::MAGENTA, 120); vehicleColorer.addScheme(scheme); scheme = GUIColorScheme("by reroute number", RGBColor::GREY, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::YELLOW, (double)1.); - scheme.addColor(RGBColor::RED, (double)10.); + scheme.addColor(RGBColor::YELLOW, 1.); + scheme.addColor(RGBColor::RED, 10.); vehicleColorer.addScheme(scheme); scheme = GUIColorScheme(SCHEME_NAME_SELECTION, RGBColor(179, 179, 179, 255), "unselected", true, 0, COL_SCHEME_MISC); scheme.addColor(RGBColor(0, 102, 204, 255), 1, "selected"); @@ -957,10 +977,10 @@ scheme.setAllowsNegativeValues(true); vehicleColorer.addScheme(scheme); scheme = GUIColorScheme("by depart delay", RGBColor::BLUE); - scheme.addColor(RGBColor::CYAN, (double)30); - scheme.addColor(RGBColor::GREEN, (double)100); - scheme.addColor(RGBColor::YELLOW, (double)200); - scheme.addColor(RGBColor::RED, (double)300); + scheme.addColor(RGBColor::CYAN, 30.); + scheme.addColor(RGBColor::GREEN, 100.); + scheme.addColor(RGBColor::YELLOW, 200.); + scheme.addColor(RGBColor::RED, 300.); vehicleColorer.addScheme(scheme); scheme = GUIColorScheme("by electricity consumption", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); scheme.addColor(RGBColor::CYAN, 10); @@ -971,28 +991,28 @@ scheme.addColor(RGBColor::MAGENTA, 100); vehicleColorer.addScheme(scheme); scheme = GUIColorScheme("by time loss", RGBColor::BLUE, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::CYAN, (double)10); - scheme.addColor(RGBColor::GREEN, (double)60); - scheme.addColor(RGBColor::YELLOW, (double)180); - scheme.addColor(RGBColor::RED, (double)900); + scheme.addColor(RGBColor::CYAN, 10.); + scheme.addColor(RGBColor::GREEN, 60.); + scheme.addColor(RGBColor::YELLOW, 180.); + scheme.addColor(RGBColor::RED, 900.); vehicleColorer.addScheme(scheme); scheme = GUIColorScheme("by stop delay", RGBColor::GREY, "", false, -1, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::BLUE, (double)0); - scheme.addColor(RGBColor::CYAN, (double)10); - scheme.addColor(RGBColor::GREEN, (double)60); - scheme.addColor(RGBColor::YELLOW, (double)120); - scheme.addColor(RGBColor::ORANGE, (double)300); - scheme.addColor(RGBColor::RED, (double)900); + scheme.addColor(RGBColor::BLUE, 0.); + scheme.addColor(RGBColor::CYAN, 10.); + scheme.addColor(RGBColor::GREEN, 60.); + scheme.addColor(RGBColor::YELLOW, 120.); + scheme.addColor(RGBColor::ORANGE, 300.); + scheme.addColor(RGBColor::RED, 900.); scheme.setAllowsNegativeValues(true); vehicleColorer.addScheme(scheme); scheme = GUIColorScheme("by stop arrival delay", RGBColor::GREY, "", false, INVALID_DOUBLE, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::MAGENTA, (double) -10); - scheme.addColor(RGBColor::BLUE, (double)0); - scheme.addColor(RGBColor::CYAN, (double)10); - scheme.addColor(RGBColor::GREEN, (double)60); - scheme.addColor(RGBColor::YELLOW, (double)120); - scheme.addColor(RGBColor::ORANGE, (double)300); - scheme.addColor(RGBColor::RED, (double)900); + scheme.addColor(RGBColor::MAGENTA, -10.); + scheme.addColor(RGBColor::BLUE, 0.); + scheme.addColor(RGBColor::CYAN, 10.); + scheme.addColor(RGBColor::GREEN, 60.); + scheme.addColor(RGBColor::YELLOW, 120.); + scheme.addColor(RGBColor::ORANGE, 300.); + scheme.addColor(RGBColor::RED, 900.); scheme.setAllowsNegativeValues(true); vehicleColorer.addScheme(scheme); scheme = GUIColorScheme("by lateral speed", RGBColor(179, 179, 179, 255), "0", false, 0, COL_SCHEME_DYNAMIC); @@ -1014,28 +1034,28 @@ personColorer.addScheme(GUIColorScheme("given/assigned person color", RGBColor::BLUE, "", true)); personColorer.addScheme(GUIColorScheme("given/assigned type color", RGBColor::BLUE, "", true)); scheme = GUIColorScheme("by speed", RGBColor::RED, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::YELLOW, (double)(2.5 / 3.6)); - scheme.addColor(RGBColor::GREEN, (double)(5 / 3.6)); - scheme.addColor(RGBColor::BLUE, (double)(10 / 3.6)); + scheme.addColor(RGBColor::YELLOW, 2.5 / 3.6); + scheme.addColor(RGBColor::GREEN, 5. / 3.6); + scheme.addColor(RGBColor::BLUE, 10. / 3.6); scheme.setAllowsNegativeValues(true); // negative speed indicates stopped - scheme.addColor(RGBColor::GREY, -1); // stop stage - scheme.addColor(RGBColor::GREY, -2); // stop stage (departure) + scheme.addColor(RGBColor::GREY, -1.); // stop stage + scheme.addColor(RGBColor::GREY, -2.); // stop stage (departure) personColorer.addScheme(scheme); scheme = GUIColorScheme("by mode", RGBColor::GREY, "waiting for insertion", true, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::RED, (double)(1), "stopped"); - scheme.addColor(RGBColor::GREEN, (double)(2), "walking"); - scheme.addColor(RGBColor::BLUE, (double)(3), "riding"); - scheme.addColor(RGBColor::CYAN, (double)(4), "accessing trainStop"); - scheme.addColor(RGBColor::YELLOW, (double)(5), "waiting for ride"); + scheme.addColor(RGBColor::RED, 1., "stopped"); + scheme.addColor(RGBColor::GREEN, 2., "walking"); + scheme.addColor(RGBColor::BLUE, 3., "riding"); + scheme.addColor(RGBColor::CYAN, 4., "accessing trainStop"); + scheme.addColor(RGBColor::YELLOW, 5., "waiting for ride"); personColorer.addScheme(scheme); scheme = GUIColorScheme("by waiting time", RGBColor::BLUE, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::CYAN, (double)30); - scheme.addColor(RGBColor::GREEN, (double)100); - scheme.addColor(RGBColor::YELLOW, (double)200); - scheme.addColor(RGBColor::RED, (double)300); + scheme.addColor(RGBColor::CYAN, 30.); + scheme.addColor(RGBColor::GREEN, 100.); + scheme.addColor(RGBColor::YELLOW, 200.); + scheme.addColor(RGBColor::RED, 300.); personColorer.addScheme(scheme); scheme = GUIColorScheme("by jammed state", RGBColor::BLUE, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::RED, (double)1); + scheme.addColor(RGBColor::RED, 1.); personColorer.addScheme(scheme); scheme = GUIColorScheme(SCHEME_NAME_SELECTION, RGBColor(179, 179, 179, 255), "unselected", true, 0, COL_SCHEME_MISC); scheme.addColor(RGBColor(0, 102, 204, 255), 1, "selected"); @@ -1049,22 +1069,22 @@ containerColorer.addScheme(GUIColorScheme("given/assigned container color", RGBColor::YELLOW, "", true)); containerColorer.addScheme(GUIColorScheme("given/assigned type color", RGBColor::YELLOW, "", true)); scheme = GUIColorScheme("by speed", RGBColor::RED, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::YELLOW, (double)(2.5 / 3.6)); - scheme.addColor(RGBColor::GREEN, (double)(5 / 3.6)); - scheme.addColor(RGBColor::BLUE, (double)(10 / 3.6)); + scheme.addColor(RGBColor::YELLOW, 2.5 / 3.6); + scheme.addColor(RGBColor::GREEN, 5. / 3.6); + scheme.addColor(RGBColor::BLUE, 10. / 3.6); containerColorer.addScheme(scheme); scheme = GUIColorScheme("by mode", RGBColor::GREY, "waiting for insertion", true, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::RED, (double)(1), "stopped"); - scheme.addColor(RGBColor::GREEN, (double)(2), "tranship"); // walking - scheme.addColor(RGBColor::BLUE, (double)(3), "transport"); - scheme.addColor(RGBColor::CYAN, (double)(4), "accessing trainStop"); - scheme.addColor(RGBColor::YELLOW, (double)(5), "waiting for transport"); + scheme.addColor(RGBColor::RED, 1., "stopped"); + scheme.addColor(RGBColor::GREEN, 2., "tranship"); // walking + scheme.addColor(RGBColor::BLUE, 3., "transport"); + scheme.addColor(RGBColor::CYAN, 4., "accessing trainStop"); + scheme.addColor(RGBColor::YELLOW, 5., "waiting for transport"); containerColorer.addScheme(scheme); scheme = GUIColorScheme("by waiting time", RGBColor::BLUE, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::CYAN, (double)30); - scheme.addColor(RGBColor::GREEN, (double)100); - scheme.addColor(RGBColor::YELLOW, (double)200); - scheme.addColor(RGBColor::RED, (double)300); + scheme.addColor(RGBColor::CYAN, 30.); + scheme.addColor(RGBColor::GREEN, 100.); + scheme.addColor(RGBColor::YELLOW, 200.); + scheme.addColor(RGBColor::RED, 300.); containerColorer.addScheme(scheme); scheme = GUIColorScheme(SCHEME_NAME_SELECTION, RGBColor(179, 179, 179, 255), "unselected", true, 0, COL_SCHEME_MISC); scheme.addColor(RGBColor(0, 102, 204, 255), 1, "selected"); @@ -1095,11 +1115,11 @@ scheme.addColor(RGBColor(128, 0, 128), 12, "rail_crossing"); // dark purple junctionColorer.addScheme(scheme); scheme = GUIColorScheme("by height", RGBColor::GREY); - scheme.addColor(RGBColor::BLUE, (double) - 10); - scheme.addColor(RGBColor::RED, (double)10); - scheme.addColor(RGBColor::YELLOW, (double)50); - scheme.addColor(RGBColor::GREEN, (double)100); - scheme.addColor(RGBColor::MAGENTA, (double)200); + scheme.addColor(RGBColor::BLUE, -10.); + scheme.addColor(RGBColor::RED, 10.); + scheme.addColor(RGBColor::YELLOW, 50.); + scheme.addColor(RGBColor::GREEN, 100.); + scheme.addColor(RGBColor::MAGENTA, 200.); scheme.setAllowsNegativeValues(true); junctionColorer.addScheme(scheme); @@ -1126,7 +1146,7 @@ laneScaler.addScheme(laneScheme); // ... traffic states ... laneScheme = GUIScaleScheme("by allowed speed (lanewise)", 0); - laneScheme.addColor(10, (double)(150.0 / 3.6)); + laneScheme.addColor(10, 150. / 3.6); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by current occupancy (lanewise, brutto)", 0, "", false, 0, COL_SCHEME_DYNAMIC); laneScheme.addColor(10, 0.95); @@ -1135,148 +1155,148 @@ laneScheme.addColor(10, 0.95); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by first vehicle waiting time (lanewise)", 0, "", false, 0, COL_SCHEME_DYNAMIC); - laneScheme.addColor(10, (double)300); + laneScheme.addColor(10, 300.); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by lane number (streetwise)", 1); - laneScheme.addColor(10, (double)5); + laneScheme.addColor(10, 5.); laneScaler.addScheme(laneScheme); // ... emissions ... laneScheme = GUIScaleScheme("by CO2 emissions", 0, "", false, 0, COL_SCHEME_EMISSION); - laneScheme.addColor(10, (double)(10. / 7.5 / 5.)); + laneScheme.addColor(10, 10. / 7.5 / 5.); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by CO emissions", 0, "", false, 0, COL_SCHEME_EMISSION); - laneScheme.addColor(10, (double)(0.05 / 7.5 / 2.)); + laneScheme.addColor(10, 0.05 / 7.5 / 2.); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by PMx emissions", 0, "", false, 0, COL_SCHEME_EMISSION); - laneScheme.addColor(10, (double)(.005 / 7.5 / 5.)); + laneScheme.addColor(10, .005 / 7.5 / 5.); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by NOx emissions", 0, "", false, 0, COL_SCHEME_EMISSION); - laneScheme.addColor(10, (double)(.125 / 7.5 / 5.)); + laneScheme.addColor(10, .125 / 7.5 / 5.); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by HC emissions", 0, "", false, 0, COL_SCHEME_EMISSION); - laneScheme.addColor(10, (double)(.02 / 7.5 / 4.)); + laneScheme.addColor(10, .02 / 7.5 / 4.); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by fuel consumption", 0, "", false, 0, COL_SCHEME_EMISSION); - laneScheme.addColor(10, (double)(.005 / 7.5 * 100.)); + laneScheme.addColor(10, .005 / 7.5 * 100.); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by noise emissions (Harmonoise)", 0, "", false, 0, COL_SCHEME_EMISSION); - laneScheme.addColor(10, (double)100); + laneScheme.addColor(10, 100.); laneScaler.addScheme(laneScheme); // ... weights (experimental) ... laneScheme = GUIScaleScheme("by global travel time", 0); - laneScheme.addColor(10, (double)100); + laneScheme.addColor(10, 100.); laneScheme.setAllowsNegativeValues(true); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by global speed percentage", 0); - laneScheme.addColor(10, (double)100); + laneScheme.addColor(10, 100.); laneScheme.setAllowsNegativeValues(true); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by given length/geometrical length", 0); - laneScheme.addColor(10, (double)10.0); + laneScheme.addColor(10, 10.); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by loaded weight", 0); - laneScheme.addColor(-1000, (double) - 1000); - laneScheme.addColor(1000, (double)1000); + laneScheme.addColor(-1000, -1000.); + laneScheme.addColor(1000, 1000.); laneScheme.setAllowsNegativeValues(true); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by priority", 1); - laneScheme.addColor(0.5, (double) - 20); - laneScheme.addColor(5, (double)20); + laneScheme.addColor(0.5, -20.); + laneScheme.addColor(5, 20.); laneScheme.setAllowsNegativeValues(true); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by average speed", 0, "", false, 0, COL_SCHEME_DYNAMIC); - laneScheme.addColor(10, (double)(150.0 / 3.6)); + laneScheme.addColor(10, 150. / 3.6); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by average relative speed", 0, "", false, 0, COL_SCHEME_DYNAMIC); - laneScheme.addColor(0.5, (double)(0.5)); - laneScheme.addColor(2, (double)(1)); - laneScheme.addColor(10, (double)(2)); + laneScheme.addColor(0.5, 0.5); + laneScheme.addColor(2, 1.); + laneScheme.addColor(10, 2.); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by electricity consumption", 0, "", false, 0, COL_SCHEME_EMISSION); - laneScheme.addColor(10, (double)(1 / 7.5 / 5.)); + laneScheme.addColor(10, 1. / 7.5 / 5.); laneScaler.addScheme(laneScheme); laneScheme = GUIScaleScheme("by insertion-backlog (streetwise)", 0, "", false, 0, COL_SCHEME_DYNAMIC); - laneScheme.addColor(1, (double)1); - laneScheme.addColor(10, (double)10); - laneScheme.addColor(50, (double)100); + laneScheme.addColor(1, 1.); + laneScheme.addColor(10, 10.); + laneScheme.addColor(50, 100.); laneScaler.addScheme(laneScheme); } /// add edge coloring schemes edgeColorer.addScheme(GUIColorScheme("uniform", RGBColor(0, 0, 0, 0), "", true)); scheme = GUIColorScheme(SCHEME_NAME_SELECTION, RGBColor(128, 128, 128, 255), "unselected", true, 0, COL_SCHEME_MISC); - scheme.addColor(RGBColor(0, 80, 180, 255), 1, "selected"); + scheme.addColor(RGBColor(0, 80, 180, 255), 1., "selected"); edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by purpose (streetwise)", RGBColor(), "normal", true); - scheme.addColor(RGBColor(128, 0, 128, 255), 1, "connector"); // see MSEdge::EdgeBasicFunction::EDGEFUNCTION_CONNECTOR - scheme.addColor(RGBColor::BLUE, 2, "internal"); // see MSEdge::EdgeBasicFunction::EDGEFUNCTION_INTERNAL + scheme.addColor(RGBColor(128, 0, 128, 255), 1., "connector"); // see MSEdge::EdgeBasicFunction::EDGEFUNCTION_CONNECTOR + scheme.addColor(RGBColor::BLUE, 2., "internal"); // see MSEdge::EdgeBasicFunction::EDGEFUNCTION_INTERNAL edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by allowed speed (streetwise)", RGBColor::RED); - scheme.addColor(RGBColor::YELLOW, (double)(30 / 3.6)); - scheme.addColor(RGBColor::GREEN, (double)(55 / 3.6)); - scheme.addColor(RGBColor::CYAN, (double)(80 / 3.6)); - scheme.addColor(RGBColor::BLUE, (double)(120 / 3.6)); - scheme.addColor(RGBColor::MAGENTA, (double)(150 / 3.6)); + scheme.addColor(RGBColor::YELLOW, 30. / 3.6); + scheme.addColor(RGBColor::GREEN, 55. / 3.6); + scheme.addColor(RGBColor::CYAN, 80. / 3.6); + scheme.addColor(RGBColor::BLUE, 120. / 3.6); + scheme.addColor(RGBColor::MAGENTA, 150. / 3.6); edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by current occupancy (streetwise, brutto)", RGBColor::BLUE, "", false, 0, COL_SCHEME_DYNAMIC); scheme.addColor(RGBColor::RED, 0.95); edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by current speed (streetwise)", RGBColor::RED, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::YELLOW, (double)(30 / 3.6)); - scheme.addColor(RGBColor::GREEN, (double)(55 / 3.6)); - scheme.addColor(RGBColor::CYAN, (double)(80 / 3.6)); - scheme.addColor(RGBColor::BLUE, (double)(120 / 3.6)); - scheme.addColor(RGBColor::MAGENTA, (double)(150 / 3.6)); + scheme.addColor(RGBColor::YELLOW, 30. / 3.6); + scheme.addColor(RGBColor::GREEN, 55. / 3.6); + scheme.addColor(RGBColor::CYAN, 80. / 3.6); + scheme.addColor(RGBColor::BLUE, 120. / 3.6); + scheme.addColor(RGBColor::MAGENTA, 150. / 3.6); edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by current flow (streetwise)", RGBColor::BLUE, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::RED, (double)5000); + scheme.addColor(RGBColor::RED, 5000.); edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by relative speed (streetwise)", RGBColor::RED, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::YELLOW, (double)(0.25)); - scheme.addColor(RGBColor::GREEN, (double)(0.5)); - scheme.addColor(RGBColor::CYAN, (double)(0.75)); - scheme.addColor(RGBColor::BLUE, (double)(1)); - scheme.addColor(RGBColor::MAGENTA, (double)(1.25)); + scheme.addColor(RGBColor::YELLOW, 0.25); + scheme.addColor(RGBColor::GREEN, 0.5); + scheme.addColor(RGBColor::CYAN, 0.75); + scheme.addColor(RGBColor::BLUE, 1.); + scheme.addColor(RGBColor::MAGENTA, 1.25); edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by routing device assumed speed", RGBColor::RED, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::YELLOW, (double)(30 / 3.6)); - scheme.addColor(RGBColor::GREEN, (double)(55 / 3.6)); - scheme.addColor(RGBColor::CYAN, (double)(80 / 3.6)); - scheme.addColor(RGBColor::BLUE, (double)(120 / 3.6)); - scheme.addColor(RGBColor::MAGENTA, (double)(150 / 3.6)); + scheme.addColor(RGBColor::YELLOW, 30. / 3.6); + scheme.addColor(RGBColor::GREEN, 55. / 3.6); + scheme.addColor(RGBColor::CYAN, 80. / 3.6); + scheme.addColor(RGBColor::BLUE, 120. / 3.6); + scheme.addColor(RGBColor::MAGENTA, 150. / 3.6); edgeColorer.addScheme(scheme); edgeColorer.addScheme(GUIColorScheme("by angle", RGBColor::YELLOW, "", true)); scheme = GUIColorScheme("by segments (alternating)", RGBColor::BLUE, "odd", true); - scheme.addColor(RGBColor::RED, 1, "even"); + scheme.addColor(RGBColor::RED, 1., "even"); edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by jammed state (segmentwise)", RGBColor::GREEN, "free", true, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::YELLOW, 1, "limitedControl"); - scheme.addColor(RGBColor::RED, 2, "jammed"); + scheme.addColor(RGBColor::YELLOW, 1., "limitedControl"); + scheme.addColor(RGBColor::RED, 2., "jammed"); edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by current occupancy (segmentwise, brutto)", RGBColor::BLUE, "", false, 0, COL_SCHEME_DYNAMIC); scheme.addColor(RGBColor::RED, 0.95); edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by current speed (segmentwise)", RGBColor::RED, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::YELLOW, (double)(30 / 3.6)); - scheme.addColor(RGBColor::GREEN, (double)(55 / 3.6)); - scheme.addColor(RGBColor::CYAN, (double)(80 / 3.6)); - scheme.addColor(RGBColor::BLUE, (double)(120 / 3.6)); - scheme.addColor(RGBColor::MAGENTA, (double)(150 / 3.6)); + scheme.addColor(RGBColor::YELLOW, 30. / 3.6); + scheme.addColor(RGBColor::GREEN, 55. / 3.6); + scheme.addColor(RGBColor::CYAN, 80. / 3.6); + scheme.addColor(RGBColor::BLUE, 120 / 3.6); + scheme.addColor(RGBColor::MAGENTA, 150. / 3.6); edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by current flow (segmentwise)", RGBColor::BLUE, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::RED, (double)5000); + scheme.addColor(RGBColor::RED, 5000.); edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by relative speed (segmentwise)", RGBColor::RED, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::YELLOW, (double)(0.25)); - scheme.addColor(RGBColor::GREEN, (double)(0.5)); - scheme.addColor(RGBColor::CYAN, (double)(0.75)); - scheme.addColor(RGBColor::BLUE, (double)(1)); - scheme.addColor(RGBColor::MAGENTA, (double)(1.25)); + scheme.addColor(RGBColor::YELLOW, 0.25); + scheme.addColor(RGBColor::GREEN, 0.5); + scheme.addColor(RGBColor::CYAN, 0.75); + scheme.addColor(RGBColor::BLUE, 1.); + scheme.addColor(RGBColor::MAGENTA, 1.25); edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by insertion-backlog (streetwise)", RGBColor::GREY, "", false, 0, COL_SCHEME_DYNAMIC); - scheme.addColor(RGBColor::GREEN, (double)1); - scheme.addColor(RGBColor::YELLOW, (double)10); - scheme.addColor(RGBColor::RED, (double)100); + scheme.addColor(RGBColor::GREEN, 1.); + scheme.addColor(RGBColor::YELLOW, 10.); + scheme.addColor(RGBColor::RED, 100.); edgeColorer.addScheme(scheme); scheme = GUIColorScheme("by TAZ (streetwise)", RGBColor(204, 204, 204), "no TAZ", true); edgeColorer.addScheme(scheme); @@ -1291,30 +1311,120 @@ { edgeScaler.addScheme(GUIScaleScheme("uniform", 1, "", true)); GUIScaleScheme edgeScheme = GUIScaleScheme(SCHEME_NAME_SELECTION, 0.5, "unselected", true, 0, COL_SCHEME_MISC); - edgeScheme.addColor(5, 1, "selected"); + edgeScheme.addColor(5, 1., "selected"); edgeScaler.addScheme(edgeScheme); edgeScheme = GUIScaleScheme("by allowed speed (streetwise)", 0); - edgeScheme.addColor(10, (double)(150.0 / 3.6)); + edgeScheme.addColor(10, 150. / 3.6); edgeScaler.addScheme(edgeScheme); edgeScheme = GUIScaleScheme("by current occupancy (streetwise, brutto)", 0, "", false, 0, COL_SCHEME_DYNAMIC); edgeScheme.addColor(10, 0.95); edgeScaler.addScheme(edgeScheme); edgeScheme = GUIScaleScheme("by current speed (streetwise)", 0, "", false, 0, COL_SCHEME_DYNAMIC); - edgeScheme.addColor(10, (double)(150.0 / 3.6)); + edgeScheme.addColor(10, 150. / 3.6); edgeScaler.addScheme(edgeScheme); edgeScheme = GUIScaleScheme("by current flow (streetwise)", 0, "", false, 0, COL_SCHEME_DYNAMIC); - edgeScheme.addColor(20, (double)5000); + edgeScheme.addColor(20, 5000.); edgeScaler.addScheme(edgeScheme); edgeScheme = GUIScaleScheme("by relative speed (streetwise)", 0, "", false, 0, COL_SCHEME_DYNAMIC); - edgeScheme.addColor(20, (double)1); + edgeScheme.addColor(20, 1.); edgeScaler.addScheme(edgeScheme); edgeScheme = GUIScaleScheme("by insertion-backlog (streetwise)", 0, "", false, 0, COL_SCHEME_DYNAMIC); - edgeScheme.addColor(1, (double)1); - edgeScheme.addColor(10, (double)10); - edgeScheme.addColor(50, (double)100); + edgeScheme.addColor(1, 1.); + edgeScheme.addColor(10, 10.); + edgeScheme.addColor(50, 100.); edgeScaler.addScheme(edgeScheme); } + /// add vehicle scaling schemes + { + vehicleScaler.addScheme(GUIScaleScheme("uniform", 1, "", true)); + GUIScaleScheme vehScheme = GUIScaleScheme(SCHEME_NAME_SELECTION, 1, "unselected", true, 0, COL_SCHEME_MISC); + vehScheme.addColor(5, 1., "selected"); + vehicleScaler.addScheme(vehScheme); + vehScheme = GUIScaleScheme("by speed", 1, "", false, 1, COL_SCHEME_DYNAMIC); + vehScheme.addColor(5, 150. / 3.6); + vehScheme.setAllowsNegativeValues(true); // negative speed indicates stopped + vehScheme.addColor(1, -1.); // stopped on road + vehScheme.addColor(0.5, -2.); // stopped off-road (parking) + vehicleScaler.addScheme(vehScheme); + vehScheme = GUIScaleScheme("by waiting time", 1, "", false, 1, COL_SCHEME_DYNAMIC); + vehScheme.addColor(1, 30.); + vehScheme.addColor(2, 100.); + vehScheme.addColor(4, 200.); + vehScheme.addColor(10, 300.); + vehicleScaler.addScheme(vehScheme); + vehScheme = GUIScaleScheme("by accumulated waiting time", 1, "", false, 1, COL_SCHEME_DYNAMIC); + vehScheme.addColor(5, 100.); + vehicleScaler.addScheme(vehScheme); + vehScheme = GUIScaleScheme("by max speed", 1); + vehScheme.addColor(1, 30. / 3.6); + vehScheme.addColor(1, 55. / 3.6); + vehScheme.addColor(1, 80. / 3.6); + vehScheme.addColor(1, 120. / 3.6); + vehScheme.addColor(1, 150. / 3.6); + vehicleScaler.addScheme(vehScheme); + vehScheme = GUIScaleScheme("by reroute number", 1, "", false, 0, COL_SCHEME_DYNAMIC); + vehScheme.addColor(1, 1.); + vehScheme.addColor(5, 10.); + vehicleScaler.addScheme(vehScheme); + vehScheme = GUIScaleScheme("by offset from best lane", 0.8, "0", false, 0, COL_SCHEME_DYNAMIC); + vehScheme.addColor(5, -100, "opposite lane"); + vehScheme.addColor(3, -3, "-3"); + vehScheme.addColor(1.5, -1, "-1"); + vehScheme.addColor(1.5, 1, "1"); + vehScheme.addColor(3, 3, "3"); + vehScheme.setAllowsNegativeValues(true); + vehicleScaler.addScheme(vehScheme); + vehScheme = GUIScaleScheme("by acceleration", 0.8, "0", false, 0, COL_SCHEME_DYNAMIC); + vehScheme.addColor(4, -9.0); + vehScheme.addColor(2, -4.5 /* -SUMOVTypeParameter::getDefaultDecel() */); + vehScheme.addColor(1, -0.1); + vehScheme.addColor(1, 0.1); + vehScheme.addColor(1, 2.6 /* SUMOVTypeParameter::getDefaultAccel() */); + vehScheme.addColor(3, 5.2); + vehScheme.setAllowsNegativeValues(true); + vehicleScaler.addScheme(vehScheme); + vehScheme = GUIScaleScheme("by time gap on lane", 5, "0", false, 0, COL_SCHEME_DYNAMIC); + vehScheme.addColor(1, -1); + vehScheme.addColor(1, 1); + vehScheme.addColor(0.5, 2); + vehScheme.setAllowsNegativeValues(true); + vehicleScaler.addScheme(vehScheme); + vehScheme = GUIScaleScheme("by depart delay", 0.8); + vehScheme.addColor(1, 10.); + vehScheme.addColor(2, 100.); + vehScheme.addColor(3, 200.); + vehScheme.addColor(5, 300.); + vehicleScaler.addScheme(vehScheme); + vehScheme = GUIScaleScheme("by time loss", 1, "", false, 0, COL_SCHEME_DYNAMIC); + vehScheme.addColor(1, 10.); + vehScheme.addColor(2, 60.); + vehScheme.addColor(3, 180.); + vehScheme.addColor(10, 900.); + vehicleScaler.addScheme(vehScheme); + vehScheme = GUIScaleScheme("by stop delay", 0.1, "", false, -1, COL_SCHEME_DYNAMIC); + vehScheme.addColor(1, 0.); + vehScheme.addColor(2, 10.); + vehScheme.addColor(3, 60.); + vehScheme.addColor(4, 120.); + vehScheme.addColor(5, 300.); + vehScheme.addColor(10, 900.); + vehScheme.setAllowsNegativeValues(true); + vehicleScaler.addScheme(vehScheme); + vehScheme = GUIScaleScheme("by stop arrival delay", 0.1, "", false, INVALID_DOUBLE, COL_SCHEME_DYNAMIC); + vehScheme.addColor(0.5, -10.); + vehScheme.addColor(1, 0.); + vehScheme.addColor(2, 10.); + vehScheme.addColor(3, 60.); + vehScheme.addColor(4, 120.); + vehScheme.addColor(5, 300.); + vehScheme.addColor(10, 900.); + vehScheme.setAllowsNegativeValues(true); + vehicleScaler.addScheme(vehScheme); + vehScheme = GUIScaleScheme(SCHEME_NAME_PARAM_NUMERICAL, 1); + vehScheme.setAllowsNegativeValues(true); + vehicleScaler.addScheme(vehScheme); + } } @@ -1332,10 +1442,10 @@ scheme.addColor(RGBColor::RED, 8, "closed"); // road closing scheme.addColor(RGBColor::GREEN, 9, "connector"); // macro-connector scheme.addColor(RGBColor::ORANGE, 10, "forbidden"); // forbidden road - scheme.addColor(RGBColor(145, 145, 145), 11, "data mode"); + scheme.addColor(RGBColor(145, 145, 145), 11., "data mode"); laneColorer.addScheme(scheme); scheme = GUIColorScheme(SCHEME_NAME_SELECTION, RGBColor(128, 128, 128, 255), "unselected", true, 0, COL_SCHEME_MISC); - scheme.addColor(RGBColor(0, 80, 180, 255), 1, "selected"); + scheme.addColor(RGBColor(0, 80, 180, 255), 1., "selected"); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by permission code", RGBColor(240, 240, 240), "nobody"); scheme.addColor(RGBColor(10, 10, 10), (double)SVC_PASSENGER, "passenger"); @@ -1352,58 +1462,58 @@ laneColorer.addScheme(scheme); scheme = GUIColorScheme("by allowed speed (lanewise)", RGBColor::RED); - scheme.addColor(RGBColor::YELLOW, (double)(30 / 3.6)); - scheme.addColor(RGBColor::GREEN, (double)(55 / 3.6)); - scheme.addColor(RGBColor::CYAN, (double)(80 / 3.6)); - scheme.addColor(RGBColor::BLUE, (double)(120 / 3.6)); - scheme.addColor(RGBColor::MAGENTA, (double)(150 / 3.6)); + scheme.addColor(RGBColor::YELLOW, 30. / 3.6); + scheme.addColor(RGBColor::GREEN, 55. / 3.6); + scheme.addColor(RGBColor::CYAN, 80. / 3.6); + scheme.addColor(RGBColor::BLUE, 120. / 3.6); + scheme.addColor(RGBColor::MAGENTA, 150. / 3.6); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by lane number (streetwise)", RGBColor::RED); - scheme.addColor(RGBColor::BLUE, (double)5); + scheme.addColor(RGBColor::BLUE, 5.); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by given length/geometrical length", RGBColor::RED); scheme.addColor(RGBColor::ORANGE, 0.25); scheme.addColor(RGBColor::YELLOW, 0.5); - scheme.addColor(RGBColor(179, 179, 179, 255), (double)1.0); - scheme.addColor(RGBColor::GREEN, (double)2.0); - scheme.addColor(RGBColor::CYAN, (double)4.0); - scheme.addColor(RGBColor::BLUE, (double)100.0); + scheme.addColor(RGBColor(179, 179, 179, 255), 1.); + scheme.addColor(RGBColor::GREEN, 2.); + scheme.addColor(RGBColor::CYAN, 4.); + scheme.addColor(RGBColor::BLUE, 100.); laneColorer.addScheme(scheme); laneColorer.addScheme(GUIColorScheme("by angle", RGBColor::YELLOW, "", true)); scheme = GUIColorScheme("by priority", RGBColor::YELLOW); - scheme.addColor(RGBColor::RED, (double) - 20); - scheme.addColor(RGBColor::GREEN, (double)20); + scheme.addColor(RGBColor::RED, -20.); + scheme.addColor(RGBColor::GREEN, 20.); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by height at start", RGBColor::RED); - scheme.addColor(RGBColor::BLUE, (double) - 10); - scheme.addColor(RGBColor::YELLOW, (double)50); - scheme.addColor(RGBColor::GREEN, (double)100); - scheme.addColor(RGBColor::MAGENTA, (double)200); + scheme.addColor(RGBColor::BLUE, -10.); + scheme.addColor(RGBColor::YELLOW, 50.); + scheme.addColor(RGBColor::GREEN, 100.); + scheme.addColor(RGBColor::MAGENTA, 200.); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by height at segment start", RGBColor::RED); - scheme.addColor(RGBColor::BLUE, (double) - 10); - scheme.addColor(RGBColor::YELLOW, (double)50); - scheme.addColor(RGBColor::GREEN, (double)100); - scheme.addColor(RGBColor::MAGENTA, (double)200); + scheme.addColor(RGBColor::BLUE, -10.); + scheme.addColor(RGBColor::YELLOW, 50.); + scheme.addColor(RGBColor::GREEN, 100.); + scheme.addColor(RGBColor::MAGENTA, 200.); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by inclination", RGBColor::GREY); - scheme.addColor(RGBColor::YELLOW, (double) .1); - scheme.addColor(RGBColor::RED, (double) .3); - scheme.addColor(RGBColor::GREEN, (double) - .1); - scheme.addColor(RGBColor::BLUE, (double) - .3); + scheme.addColor(RGBColor::YELLOW, 0.1); + scheme.addColor(RGBColor::RED, 0.3); + scheme.addColor(RGBColor::GREEN, -0.1); + scheme.addColor(RGBColor::BLUE, -0.3); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by segment inclination", RGBColor::GREY); - scheme.addColor(RGBColor::YELLOW, (double) .1); - scheme.addColor(RGBColor::RED, (double) .3); - scheme.addColor(RGBColor::GREEN, (double) - .1); - scheme.addColor(RGBColor::BLUE, (double) - .3); + scheme.addColor(RGBColor::YELLOW, 0.1); + scheme.addColor(RGBColor::RED, 0.3); + scheme.addColor(RGBColor::GREEN, -0.1); + scheme.addColor(RGBColor::BLUE, -0.3); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme(SCHEME_NAME_EDGE_PARAM_NUMERICAL, RGBColor(204, 204, 204)); @@ -1413,12 +1523,12 @@ scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by distance (kilometrage)", RGBColor(204, 204, 204)); - scheme.addColor(RGBColor::RED, (double)1); - scheme.addColor(RGBColor::RED, (double) -1); + scheme.addColor(RGBColor::RED, 1.); + scheme.addColor(RGBColor::RED, -1.); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by abs distance (kilometrage)", RGBColor(204, 204, 204)); - scheme.addColor(RGBColor::RED, (double)1); + scheme.addColor(RGBColor::RED, 1.); scheme.setAllowsNegativeValues(false); laneColorer.addScheme(scheme); scheme = GUIColorScheme(SCHEME_NAME_EDGEDATA_NUMERICAL, RGBColor(204, 204, 204), "missing data", false, MISSING_DATA); @@ -1450,11 +1560,11 @@ scheme.addColor(RGBColor(128, 0, 128), 12, "rail_crossing"); // dark purple junctionColorer.addScheme(scheme); scheme = GUIColorScheme("by height", RGBColor::GREY); - scheme.addColor(RGBColor::BLUE, (double) - 10); - scheme.addColor(RGBColor::RED, (double)10); - scheme.addColor(RGBColor::YELLOW, (double)50); - scheme.addColor(RGBColor::GREEN, (double)100); - scheme.addColor(RGBColor::MAGENTA, (double)200); + scheme.addColor(RGBColor::BLUE, -10.); + scheme.addColor(RGBColor::RED, 10.); + scheme.addColor(RGBColor::YELLOW, 50.); + scheme.addColor(RGBColor::GREEN, 100.); + scheme.addColor(RGBColor::MAGENTA, 200.); scheme.setAllowsNegativeValues(true); junctionColorer.addScheme(scheme); @@ -1493,6 +1603,7 @@ vehicleColorer.addScheme(GUIColorScheme("uniform", RGBColor::YELLOW, "", true)); personColorer.addScheme(GUIColorScheme("uniform", RGBColor::YELLOW, "", true)); containerColorer.addScheme(GUIColorScheme("uniform", RGBColor::YELLOW, "", true)); + vehicleScaler.addScheme(GUIScaleScheme("uniform", 1, "", true)); } @@ -1568,6 +1679,7 @@ dev.writeAttr("edgeParam", edgeParam); dev.writeAttr("laneParam", laneParam); dev.writeAttr("vehicleParam", vehicleParam); + dev.writeAttr("vehicleScaleParam", vehicleScaleParam); dev.writeAttr("vehicleTextParam", vehicleTextParam); dev.writeAttr("edgeData", edgeData); dev.writeAttr("edgeValueHideCheck", edgeValueHideCheck); @@ -1595,6 +1707,7 @@ // vehicles dev.openTag(SUMO_TAG_VIEWSETTINGS_VEHICLES); dev.writeAttr("vehicleMode", vehicleColorer.getActive()); + dev.writeAttr("vehicleScaleMode", vehicleScaler.getActive()); dev.writeAttr("vehicleQuality", vehicleQuality); vehicleSize.print(dev, "vehicle"); dev.writeAttr("showBlinker", showBlinker); @@ -1603,6 +1716,7 @@ dev.writeAttr("showBTRange", showBTRange); dev.writeAttr("showRouteIndex", showRouteIndex); dev.writeAttr("scaleLength", scaleLength); + dev.writeAttr("showParkingInfo", showParkingInfo); dev.lf(); dev << " "; vehicleName.print(dev, "vehicleName"); @@ -1611,8 +1725,12 @@ vehicleValue.print(dev, "vehicleValue"); dev.lf(); dev << " "; + vehicleScaleValue.print(dev, "vehicleScaleValue"); + dev.lf(); + dev << " "; vehicleText.print(dev, "vehicleText"); vehicleColorer.save(dev); + vehicleScaler.save(dev); dev.closeTag(); // persons dev.openTag(SUMO_TAG_VIEWSETTINGS_PERSONS); @@ -1850,6 +1968,9 @@ if (vehicleParam != v2.vehicleParam) { return false; } + if (vehicleScaleParam != v2.vehicleScaleParam) { + return false; + } if (vehicleTextParam != v2.vehicleTextParam) { return false; } @@ -1865,6 +1986,9 @@ if (!(vehicleColorer == v2.vehicleColorer)) { return false; } + if (!(vehicleScaler == v2.vehicleScaler)) { + return false; + } if (vehicleQuality != v2.vehicleQuality) { return false; } @@ -1892,12 +2016,18 @@ if (scaleLength != v2.scaleLength) { return false; } + if (showParkingInfo != v2.showParkingInfo) { + return false; + } if (vehicleName != v2.vehicleName) { return false; } if (vehicleValue != v2.vehicleValue) { return false; } + if (vehicleScaleValue != v2.vehicleScaleValue) { + return false; + } if (vehicleText != v2.vehicleText) { return false; } diff -Nru sumo-1.11.0/src/utils/gui/settings/GUIVisualizationSettings.h sumo-1.12.0/src/utils/gui/settings/GUIVisualizationSettings.h --- sumo-1.11.0/src/utils/gui/settings/GUIVisualizationSettings.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/settings/GUIVisualizationSettings.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -48,7 +48,7 @@ struct GUIVisualizationTextSettings { /// @brief constructor - GUIVisualizationTextSettings(bool _show, double _size, RGBColor _color, RGBColor _bgColor = RGBColor(128, 0, 0, 0), bool _constSize = true); + GUIVisualizationTextSettings(bool _show, double _size, RGBColor _color, RGBColor _bgColor = RGBColor(128, 0, 0, 0), bool _constSize = true, bool _onlySelected = false); /// @brief equality comparator bool operator==(const GUIVisualizationTextSettings& other); @@ -62,8 +62,11 @@ /// @brief get scale size double scaledSize(double scale, double constFactor = 0.1) const; + /// @brief whether to show the text + bool show(const GUIGlObject* o) const; + /// @brief flag show - bool show; + bool showText; /// @brief text size double size; @@ -76,6 +79,9 @@ /// @brif flag to avoid size changes bool constSize; + + /// @brief whether only selected objects shall have text drawn + bool onlySelected; }; @@ -283,6 +289,9 @@ /// @brief moving edge geometry point radius static const double edgeGeometryPointRadius; + /// @brief moving lane geometry point radius + static const double laneGeometryPointRadius; + /// @brief moving connection geometry point radius static const double connectionGeometryPointRadius; @@ -707,6 +716,8 @@ std::string edgeParam, laneParam; /// @brief key for coloring by vehicle parameter std::string vehicleParam; + /// @brief key for scaling by vehicle parameter + std::string vehicleScaleParam; /// @brief key for rendering vehicle textual parameter std::string vehicleTextParam; @@ -724,6 +735,9 @@ /// @brief The vehicle colorer GUIColorer vehicleColorer; + /// @brief The size scaling settings for vehicles + GUIScaler vehicleScaler; + /// @brief The quality of vehicle drawing int vehicleQuality; @@ -748,11 +762,14 @@ /// @brief Whether vehicle length shall be scaled with length/geometry factor bool scaleLength; + /// @brief Set whether parking related information should be shown + bool showParkingInfo; + // Setting bundles for controling the size of the drawn vehicles GUIVisualizationSizeSettings vehicleSize; // Setting bundles for optional drawing vehicle names or color value - GUIVisualizationTextSettings vehicleName, vehicleValue, vehicleText; + GUIVisualizationTextSettings vehicleName, vehicleValue, vehicleScaleValue, vehicleText; /// @} diff -Nru sumo-1.11.0/src/utils/gui/shortcuts/GUIShortcuts.h sumo-1.12.0/src/utils/gui/shortcuts/GUIShortcuts.h --- sumo-1.11.0/src/utils/gui/shortcuts/GUIShortcuts.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/shortcuts/GUIShortcuts.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/shortcuts/GUIShortcutsSubSys.cpp sumo-1.12.0/src/utils/gui/shortcuts/GUIShortcutsSubSys.cpp --- sumo-1.11.0/src/utils/gui/shortcuts/GUIShortcutsSubSys.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/shortcuts/GUIShortcutsSubSys.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -156,14 +156,14 @@ GNEApp->getAccelTable()->addAccel(parseKey(KEY_s), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_S_MODES_SELECT)); GNEApp->getAccelTable()->addAccel(parseKey(KEY_S), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_S_MODES_SELECT)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_t), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_T_MODES_TLS_VTYPE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_T), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_T_MODES_TLS_VTYPE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_t), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_T_MODES_TLS_TYPE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_T), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_T_MODES_TLS_TYPE)); GNEApp->getAccelTable()->addAccel(parseKey(KEY_v), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_V_MODES_VEHICLE)); GNEApp->getAccelTable()->addAccel(parseKey(KEY_V), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_V_MODES_VEHICLE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_w), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_W), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_w), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_W_MODES_PROHIBITION)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_W), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_W_MODES_PROHIBITION)); GNEApp->getAccelTable()->addAccel(parseKey(KEY_z), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_Z_MODES_TAZ_TAZREL)); GNEApp->getAccelTable()->addAccel(parseKey(KEY_Z), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_Z_MODES_TAZ_TAZREL)); diff -Nru sumo-1.11.0/src/utils/gui/shortcuts/GUIShortcutsSubSys.h sumo-1.12.0/src/utils/gui/shortcuts/GUIShortcutsSubSys.h --- sumo-1.11.0/src/utils/gui/shortcuts/GUIShortcutsSubSys.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/shortcuts/GUIShortcutsSubSys.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/tracker/GUIParameterTracker.cpp sumo-1.12.0/src/utils/gui/tracker/GUIParameterTracker.cpp --- sumo-1.11.0/src/utils/gui/tracker/GUIParameterTracker.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/tracker/GUIParameterTracker.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -44,17 +44,24 @@ // FOX callback mapping // =========================================================================== FXDEFMAP(GUIParameterTracker) GUIParameterTrackerMap[] = { - FXMAPFUNC(SEL_CONFIGURE, 0, GUIParameterTracker::onConfigure), - FXMAPFUNC(SEL_PAINT, 0, GUIParameterTracker::onPaint), - FXMAPFUNC(SEL_COMMAND, MID_SIMSTEP, GUIParameterTracker::onSimStep), + FXMAPFUNC(SEL_CONFIGURE, 0, GUIParameterTracker::onConfigure), + FXMAPFUNC(SEL_PAINT, 0, GUIParameterTracker::onPaint), + FXMAPFUNC(SEL_COMMAND, MID_SIMSTEP, GUIParameterTracker::onSimStep), + FXMAPFUNC(SEL_COMMAND, GUIParameterTracker::MID_MULTIPLOT, GUIParameterTracker::onMultiPlot), FXMAPFUNC(SEL_COMMAND, GUIParameterTracker::MID_AGGREGATIONINTERVAL, GUIParameterTracker::onCmdChangeAggregation), - FXMAPFUNC(SEL_COMMAND, GUIParameterTracker::MID_SAVE, GUIParameterTracker::onCmdSave), + FXMAPFUNC(SEL_COMMAND, GUIParameterTracker::MID_SAVE, GUIParameterTracker::onCmdSave), }; // Macro for the GLTestApp class hierarchy implementation FXIMPLEMENT(GUIParameterTracker, FXMainWindow, GUIParameterTrackerMap, ARRAYNUMBER(GUIParameterTrackerMap)) +// =========================================================================== +// static value definitions +// =========================================================================== +std::set GUIParameterTracker::myMultiPlots; +std::vector GUIParameterTracker::myColors; + // =========================================================================== // method definitions @@ -69,10 +76,16 @@ myPanel = new GUIParameterTrackerPanel(glcanvasFrame, *myApplication, *this); setTitle(name.c_str()); setIcon(GUIIconSubSys::getIcon(GUIIcon::APP_TRACKER)); + + if (myColors.size() == 0) { + myColors = {RGBColor::BLACK, RGBColor::GREEN, RGBColor::RED, RGBColor::BLUE, RGBColor::ORANGE, RGBColor::CYAN, RGBColor::MAGENTA}; + + } } GUIParameterTracker::~GUIParameterTracker() { + myMultiPlots.erase(this); myApplication->removeChild(this); for (std::vector::iterator i1 = myTracked.begin(); i1 != myTracked.end(); i1++) { delete (*i1); @@ -101,6 +114,7 @@ // save button new FXButton(myToolBar, "\t\tSave the data...", GUIIconSubSys::getIcon(GUIIcon::SAVE), this, GUIParameterTracker::MID_SAVE, GUIDesignButtonToolbar); + // aggregation interval combo myAggregationInterval = new FXComboBox(myToolBar, 8, this, MID_AGGREGATIONINTERVAL, @@ -112,6 +126,27 @@ myAggregationInterval->appendItem("30min"); myAggregationInterval->appendItem("60min"); myAggregationInterval->setNumVisible(6); + + myMultiPlot = new FXCheckButton(myToolBar, "Multiplot", this, MID_MULTIPLOT); + myMultiPlot->setCheck(false); +} + + +bool +GUIParameterTracker::addTrackedMultiplot(GUIGlObject& o, ValueSource* src, TrackerValueDesc* newTracked) { + bool first = true; + for (GUIParameterTracker* tr : myMultiPlots) { + if (first) { + first = false; + } else { + // each Tracker gets its own copy to simplify cleanup + newTracked = new TrackerValueDesc(newTracked->getName(), RGBColor::BLACK, newTracked->getRecordingBegin(), + STEPS2TIME(newTracked->getAggregationSpan())); + src = src->copy(); + } + tr->addTracked(o, src, newTracked); + } + return myMultiPlots.size() > 0; } @@ -121,6 +156,7 @@ myTracked.push_back(newTracked); // build connection (is automatically set into an execution map) myValuePassers.push_back(new GLObjectValuePassConnector(o, src, newTracked)); + update(); } @@ -144,7 +180,6 @@ return 1; } - long GUIParameterTracker::onCmdChangeAggregation(FXObject*, FXSelector, void*) { int index = myAggregationInterval->getCurrentItem(); @@ -171,8 +206,8 @@ default: throw 1; } - for (std::vector::iterator i1 = myTracked.begin(); i1 != myTracked.end(); i1++) { - (*i1)->setAggregationSpan(TIME2STEPS(aggInt)); + for (TrackerValueDesc* const tvd : myTracked) { + tvd->setAggregationSpan(TIME2STEPS(aggInt)); } return 1; } @@ -188,13 +223,10 @@ OutputDevice& dev = OutputDevice::getDevice(file.text()); // write header std::vector::iterator i; - dev << "# "; + dev << "# Time"; for (i = myTracked.begin(); i != myTracked.end(); ++i) { - if (i != myTracked.begin()) { - dev << ';'; - } TrackerValueDesc* tvd = *i; - dev << tvd->getName(); + dev << ';' << tvd->getName(); } dev << '\n'; // count entries @@ -208,16 +240,17 @@ tvd->unlockValues(); } // write entries + SUMOTime t = myTracked.empty() ? 0 : myTracked.front()->getRecordingBegin(); + SUMOTime dt = myTracked.empty() ? DELTA_T : myTracked.front()->getAggregationSpan(); for (int j = 0; j < max; j++) { + dev << time2string(t); for (i = myTracked.begin(); i != myTracked.end(); ++i) { - if (i != myTracked.begin()) { - dev << ';'; - } TrackerValueDesc* tvd = *i; - dev << tvd->getAggregatedValues()[j]; + dev << ';' << tvd->getAggregatedValues()[j]; tvd->unlockValues(); } dev << '\n'; + t += dt; } dev.close(); } catch (IOError& e) { @@ -227,11 +260,22 @@ } +long +GUIParameterTracker::onMultiPlot(FXObject*, FXSelector, void*) { + if (myMultiPlot->getCheck()) { + myMultiPlots.insert(this); + } else { + myMultiPlots.erase(this); + } + return 1; +} + /* ------------------------------------------------------------------------- * GUIParameterTracker::GUIParameterTrackerPanel-methods * ----------------------------------------------------------------------- */ FXDEFMAP(GUIParameterTracker::GUIParameterTrackerPanel) GUIParameterTrackerPanelMap[] = { FXMAPFUNC(SEL_CONFIGURE, 0, GUIParameterTracker::GUIParameterTrackerPanel::onConfigure), + FXMAPFUNC(SEL_MOTION, 0, GUIParameterTracker::GUIParameterTrackerPanel::onMouseMove), FXMAPFUNC(SEL_PAINT, 0, GUIParameterTracker::GUIParameterTrackerPanel::onPaint), }; @@ -245,7 +289,7 @@ FXComposite* c, GUIMainWindow& app, GUIParameterTracker& parent) : FXGLCanvas(c, app.getGLVisual(), app.getBuildGLCanvas(), (FXObject*) nullptr, (FXSelector) 0, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 300, 200), - myParent(&parent), myApplication(&app) {} + myParent(&parent) {} GUIParameterTracker::GUIParameterTrackerPanel::~GUIParameterTrackerPanel() {} @@ -258,21 +302,30 @@ glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glDisable(GL_TEXTURE_2D); - int run = 0; - for (std::vector::iterator i = myParent->myTracked.begin(); i != myParent->myTracked.end(); i++) { - TrackerValueDesc* desc = *i; - drawValue(*desc, - (double) myWidthInPixels / (double) myParent->myTracked.size() * (double) run); - run++; + for (int i = 0; i < (int)myParent->myTracked.size(); i++) { + TrackerValueDesc* desc = myParent->myTracked[i]; + glPushMatrix(); + drawValue(*desc, myColors[i % myColors.size()], i); + glPopMatrix(); } } void GUIParameterTracker::GUIParameterTrackerPanel::drawValue(TrackerValueDesc& desc, - double /*namePos*/) { + const RGBColor& col, + int index) { const double fontWidth = 0.1 * 300. / myWidthInPixels; const double fontHeight = 0.1 * 300. / myHeightInPixels; + const bool isMultiPlot = myParent->myTracked.size() > 1; + const std::vector& values = desc.getAggregatedValues(); + if (values.size() < 2) { + // draw name + glTranslated(-.9, 0.9, 0); + GLHelper::drawText(desc.getName(), Position((double)index / myParent->myTracked.size(), 0), 1, fontHeight, col, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, fontWidth); + desc.unlockValues(); + return; + } // // apply scaling GLHelper::pushMatrix(); @@ -284,10 +337,6 @@ glScaled(1.0, ys, 1.0); glTranslated(-1.0, -desc.getYCenter(), 0); - // set color - const unsigned char red = desc.getColor().red(); - const unsigned char green = desc.getColor().green(); - const unsigned char blue = desc.getColor().blue(); // draw value bounderies // draw minimum boundary glBegin(GL_LINES); @@ -298,7 +347,7 @@ glVertex2d(0, desc.getMax()); glVertex2d(2.0, desc.getMax()); glEnd(); - glColor4ub(red, green, blue, 77); + GLHelper::setColor(col.changedAlpha(-178)); for (int a = 1; a < 6; a++) { const double yp = desc.getRange() / 6.0 * (double) a + desc.getMin(); glBegin(GL_LINES); @@ -306,37 +355,45 @@ glVertex2d(2.0, yp); glEnd(); } - const std::vector& values = desc.getAggregatedValues(); + double latest = 0; - if (values.size() < 2) { - GLHelper::popMatrix(); - desc.unlockValues(); - return; - } else { - latest = values.back(); - // init values - const double xStep = 2.0 / (double) values.size(); - std::vector::const_iterator i = values.begin(); - double yp = (*i); - double xp = 0; - i++; - glColor4ub(red, green, blue, 255); - for (; i != values.end(); i++) { - double yn = (*i); - double xn = xp + xStep; - glBegin(GL_LINES); - glVertex2d(xp, yp); - glVertex2d(xn, yn); - glEnd(); - yp = yn; - xp = xn; + double mx = (2 * myMouseX / myWidthInPixels - 1) / 0.8 + 1; + int mIndex = -1; + double mouseValue = std::numeric_limits::max(); + latest = values.back(); + // init values + const double xStep = 2.0 / (double) values.size(); + std::vector::const_iterator i = values.begin(); + double yp = (*i); + double xp = 0; + i++; + GLHelper::setColor(col); + for (; i != values.end(); i++) { + double yn = (*i); + double xn = xp + xStep; + if (xp < mx && mx < xn) { + mouseValue = yp; + glPushMatrix(); + GLHelper::setColor(isMultiPlot ? col.changedBrightness(-40).changedAlpha(-100) : RGBColor::BLUE); + glTranslated(xn, yn, 0); + glScaled(20.0 / myWidthInPixels, 10.0 * desc.getRange() / myHeightInPixels, 0); + GLHelper::drawFilledCircle(1, 8); + GLHelper::setColor(col); + glPopMatrix(); } - desc.unlockValues(); - GLHelper::popMatrix(); + glBegin(GL_LINES); + glVertex2d(xp, yp); + glVertex2d(xn, yn); + glEnd(); + yp = yn; + xp = xn; + mIndex++; } + desc.unlockValues(); + GLHelper::popMatrix(); // draw value bounderies and descriptions - glColor3b(red, green, blue); + GLHelper::setColor(col); // draw min time SUMOTime beginStep = desc.getRecordingBegin(); @@ -354,26 +411,42 @@ // draw min value glTranslated(-0.98, -0.82, 0); - GLHelper::drawText(toString(desc.getMin()), Position(0, 0), 1, fontHeight, RGBColor::BLACK, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, fontWidth); + GLHelper::drawText(toString(desc.getMin()), Position(0, index * fontHeight), 1, fontHeight, col, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, fontWidth); glTranslated(0.98, 0.82, 0); // draw max value glTranslated(-0.98, 0.78, 0); - GLHelper::drawText(toString(desc.getMax()), Position(0, 0), 1, fontHeight, RGBColor::BLACK, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, fontWidth); + GLHelper::drawText(toString(desc.getMax()), Position(0, -index * fontHeight), 1, fontHeight, col, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, fontWidth); glTranslated(0.98, -0.78, 0); // draw name glTranslated(-0.98, .92, 0); - GLHelper::drawText(desc.getName(), Position(0, 0), 1, fontHeight, RGBColor::BLACK, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, fontWidth); + GLHelper::drawText(desc.getName(), Position((double)index / myParent->myTracked.size(), 0), 1, fontHeight, col, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, fontWidth); glTranslated(0.98, -.92, 0); // draw current value (with contrasting color) double p = (double) 0.8 - ((double) 1.6 / (desc.getMax() - desc.getMin()) * (latest - desc.getMin())); glTranslated(-0.98, -(p + .02), 0); - GLHelper::drawText(toString(latest), Position(0, 0), 1, fontHeight, RGBColor::RED, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, fontWidth); + GLHelper::drawText(toString(latest), Position(isMultiPlot ? 0.1 : 0, 0), 1, fontHeight, isMultiPlot ? col.changedBrightness(50) : RGBColor::RED, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, fontWidth); glTranslated(0.98, p + .02, 0); + // draw moused value + if (mouseValue != std::numeric_limits::max()) { + p = (double) 0.8 - + ((double) 1.6 / (desc.getMax() - desc.getMin()) * (mouseValue - desc.getMin())); + glTranslated(-0.98, -(p + .02), 0); + GLHelper::drawText(toString(mouseValue), Position(isMultiPlot ? 0.1 : 0, 0), 1, fontHeight, isMultiPlot ? col.changedBrightness(-40) : RGBColor::BLUE, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, fontWidth); + glTranslated(0.98, p + .02, 0); + + if (index == 0) { + // time is the same for all plots so we only draw it once + const std::string mouseTime = time2string(beginStep + static_cast(mIndex * desc.getAggregationSpan())); + glTranslated(1.6 * mIndex / values.size() - 0.8, -0.9, 0); + GLHelper::drawText(mouseTime, Position(0, 0), 1, fontHeight, isMultiPlot ? col.changedBrightness(-40) : RGBColor::BLUE, 0, FONS_ALIGN_LEFT | FONS_ALIGN_MIDDLE, fontWidth); + } + } + } @@ -390,6 +463,7 @@ glDisable(GL_LIGHTING); glDisable(GL_LINE_SMOOTH); glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_ALPHA_TEST); glDisable(GL_COLOR_MATERIAL); glLineWidth(1); @@ -417,6 +491,7 @@ glDisable(GL_LIGHTING); glDisable(GL_LINE_SMOOTH); glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_ALPHA_TEST); glDisable(GL_COLOR_MATERIAL); glLineWidth(1); @@ -432,4 +507,14 @@ } +long +GUIParameterTracker::GUIParameterTrackerPanel::onMouseMove(FXObject*, FXSelector, void* ptr) { + FXEvent* event = (FXEvent*) ptr; + myMouseX = event->win_x; + update(); + return 1; +} + + + /****************************************************************************/ diff -Nru sumo-1.11.0/src/utils/gui/tracker/GUIParameterTracker.h sumo-1.12.0/src/utils/gui/tracker/GUIParameterTracker.h --- sumo-1.11.0/src/utils/gui/tracker/GUIParameterTracker.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/tracker/GUIParameterTracker.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -52,6 +52,8 @@ MID_AGGREGATIONINTERVAL = FXMainWindow::ID_LAST, /// @brief Save the current values MID_SAVE, + /// @brief toggle multiplot + MID_MULTIPLOT, /// @brief end-of-enum ID_LAST }; @@ -93,6 +95,9 @@ /// @brief Called on a simulation step long onSimStep(FXObject*, FXSelector, void*); + /// @brief Called on a simulation step + long onMultiPlot(FXObject*, FXSelector, void*); + /// @brief Called when the aggregation interval (combo) has been changed long onCmdChangeAggregation(FXObject*, FXSelector, void*); @@ -101,6 +106,9 @@ /// @} + /// @brief all value source to multiplot trackers + static bool addTrackedMultiplot(GUIGlObject& o, ValueSource* src, TrackerValueDesc* newTracked); + public: /** * @class GUIParameterTrackerPanel @@ -135,8 +143,9 @@ /// Called if the window shall be repainted long onPaint(FXObject*, FXSelector, void*); - /// Called on a simulation step - long onSimStep(FXObject* sender, FXSelector, void*); + /// @brief called on mouse movement (for updating moused value) + long onMouseMove(FXObject*, FXSelector, void*); + /// @} @@ -147,10 +156,9 @@ /** @brief Draws a single value * @param[in] desc The tracked values to draw - * @param[in] namePos Position to display the name at (currently unused) + * @param[in] index Mulitplot index */ - void drawValue(TrackerValueDesc& desc, double namePos); - + void drawValue(TrackerValueDesc& desc, const RGBColor& col, int index); private: /// @brief The parent window @@ -159,8 +167,8 @@ /// @brief the sizes of the window int myWidthInPixels, myHeightInPixels; - /// @brief The main application - GUIMainWindow* myApplication; + /// @brief latest mouse position + double myMouseX; protected: FOX_CONSTRUCTOR(GUIParameterTrackerPanel) @@ -174,7 +182,6 @@ /// @brief Builds the tool bar void buildToolBar(); - protected: /// @brief The main application GUIMainWindow* myApplication; @@ -200,6 +207,13 @@ /// @brief The tracker tool bar FXToolBar* myToolBar; + /// @brief Whether phase names shall be printed instead of indices + FXCheckButton* myMultiPlot; + + /// @brief all trackers that are opened for plotting multiple values + static std::set myMultiPlots; + static std::vector myColors; + protected: FOX_CONSTRUCTOR(GUIParameterTracker) diff -Nru sumo-1.11.0/src/utils/gui/tracker/TrackerValueDesc.cpp sumo-1.12.0/src/utils/gui/tracker/TrackerValueDesc.cpp --- sumo-1.11.0/src/utils/gui/tracker/TrackerValueDesc.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/tracker/TrackerValueDesc.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -165,7 +165,7 @@ SUMOTime TrackerValueDesc::getAggregationSpan() const { - return (SUMOTime)(myAggregationInterval) * DELTA_T; + return myAggregationInterval * DELTA_T; } diff -Nru sumo-1.11.0/src/utils/gui/tracker/TrackerValueDesc.h sumo-1.12.0/src/utils/gui/tracker/TrackerValueDesc.h --- sumo-1.11.0/src/utils/gui/tracker/TrackerValueDesc.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/tracker/TrackerValueDesc.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/windows/CMakeLists.txt sumo-1.12.0/src/utils/gui/windows/CMakeLists.txt --- sumo-1.11.0/src/utils/gui/windows/CMakeLists.txt 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/CMakeLists.txt 2022-01-24 20:43:50.000000000 +0000 @@ -18,8 +18,6 @@ GUISUMOAbstractView.h GUIDialog_ChooserAbstract.cpp GUIDialog_ChooserAbstract.h - GUIDialog_GLObjChooser.cpp - GUIDialog_GLObjChooser.h ) add_library(utils_gui_windows STATIC ${utils_gui_windows_STAT_SRCS}) diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIAppEnum.h sumo-1.12.0/src/utils/gui/windows/GUIAppEnum.h --- sumo-1.11.0/src/utils/gui/windows/GUIAppEnum.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIAppEnum.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -61,12 +61,12 @@ MID_HOTKEY_S_MODES_SELECT, /// @brief hotkey for mode editing crossing, routes and edge rel datas MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA, - /// @brief hotkey for mode editing TLS AND Vehicle Types - MID_HOTKEY_T_MODES_TLS_VTYPE, + /// @brief hotkey for mode editing TLS AND types + MID_HOTKEY_T_MODES_TLS_TYPE, /// @brief hotkey for mode create vehicles MID_HOTKEY_V_MODES_VEHICLE, - /// @brief hotkey for mode editing connection prohibitions AND person types - MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE, + /// @brief hotkey for mode editing connection prohibitions + MID_HOTKEY_W_MODES_PROHIBITION, /// @brief hotkey for mode editing TAZ and TAZRel MID_HOTKEY_Z_MODES_TAZ_TAZREL, @@ -417,6 +417,8 @@ MID_COPY_CURSOR_POSITION, /// @brief Copy cursor geo-coordinate position - popup entry MID_COPY_CURSOR_GEOPOSITION, + /// @brief Show the cursor geo-coordinate position online in GeoHack - popup entry + MID_SHOW_GEOPOSITION_ONLINE, /// @brief open additional dialog (used in netedit) MID_OPEN_ADDITIONAL_DIALOG, /// @brief Show object parameter - popup entry @@ -609,6 +611,16 @@ /// @} + /// @name groupBoxModule messages + /// @{ + /// @brief collapse groupBoxModule + MID_GROUPBOXMODULE_COLLAPSE, + /// @brief save contents + MID_GROUPBOXMODULE_SAVE, + /// @brief load contents + MID_GROUPBOXMODULE_LOAD, + /// @} + /// @name Toolbar file messages /// @{ @@ -883,6 +895,10 @@ MID_GNE_SELECTORFRAME_SETBEGIN, /// @brief end text field MID_GNE_SELECTORFRAME_SETEND, + /// @brief select/unselect parents + MID_GNE_SELECTORFRAME_PARENTS, + /// @brief select/unselect children + MID_GNE_SELECTORFRAME_CHILDREN, /// @} @@ -913,17 +929,13 @@ /// @brief selected radio button MID_GNE_CREATEEDGEFRAME_SELECTRADIOBUTTON, /// @brief add new edge type - MID_GNE_CREATEEDGEFRAME_ADDEDGETYPE, + MID_GNE_CREATEEDGEFRAME_ADD, + /// @brief delete edge type + MID_GNE_CREATEEDGEFRAME_DELETE, /// @brief delete edge type - MID_GNE_CREATEEDGEFRAME_DELETEEDGETYPE, - /// @brief reset edge type - MID_GNE_CREATEEDGEFRAME_RESETEDGETYPE, - /// @brief select edge type - MID_GNE_CREATEEDGEFRAME_SELECTEDGETYPE, - /// @brief delete lane type - MID_GNE_CREATEEDGEFRAME_DELETELANETYPE, - /// @brief reset lane type - MID_GNE_CREATEEDGEFRAME_RESETLANETYPE, + MID_GNE_CREATEEDGEFRAME_SELECT, + /// @brief create edge type from template + MID_GNE_CREATEEDGEFRAME_CREATEFROMTEMPLATE, /// @} @@ -1124,6 +1136,8 @@ /// @brief duplicate a lane MID_GNE_LANE_DUPLICATE, + /// @brief edit lane shape + MID_GNE_LANE_EDIT_SHAPE, /// @brief reset custom shape MID_GNE_LANE_RESET_CUSTOMSHAPE, /// @brief reset opposite lane diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp sumo-1.12.0/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp --- sumo-1.11.0/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIDanielPerspectiveChanger.h sumo-1.12.0/src/utils/gui/windows/GUIDanielPerspectiveChanger.h --- sumo-1.11.0/src/utils/gui/windows/GUIDanielPerspectiveChanger.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIDanielPerspectiveChanger.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIDialog_ChooserAbstract.cpp sumo-1.12.0/src/utils/gui/windows/GUIDialog_ChooserAbstract.cpp --- sumo-1.11.0/src/utils/gui/windows/GUIDialog_ChooserAbstract.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIDialog_ChooserAbstract.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -47,6 +47,8 @@ FXMAPFUNC(SEL_CHANGED, MID_CHOOSER_TEXT, GUIDialog_ChooserAbstract::onChgText), FXMAPFUNC(SEL_COMMAND, MID_CHOOSER_TEXT, GUIDialog_ChooserAbstract::onCmdText), FXMAPFUNC(SEL_KEYPRESS, MID_CHOOSER_LIST, GUIDialog_ChooserAbstract::onListKeyPress), + FXMAPFUNC(SEL_CHANGED, MID_CHOOSER_LIST, GUIDialog_ChooserAbstract::onChgList), + FXMAPFUNC(SEL_DESELECTED, MID_CHOOSER_LIST, GUIDialog_ChooserAbstract::onChgListSel), FXMAPFUNC(SEL_COMMAND, MID_CHOOSER_FILTER, GUIDialog_ChooserAbstract::onCmdFilter), FXMAPFUNC(SEL_COMMAND, MID_CHOOSER_FILTER_SUBSTR, GUIDialog_ChooserAbstract::onCmdFilterSubstr), FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_INVERT, GUIDialog_ChooserAbstract::onCmdToggleSelection), @@ -72,7 +74,7 @@ FXHorizontalFrame* hbox = new FXHorizontalFrame(this, GUIDesignAuxiliarFrame); // build the list FXVerticalFrame* layoutLeft = new FXVerticalFrame(hbox, GUIDesignChooserLayoutLeft); - myTextEntry = new FXTextField(layoutLeft, 0, this, MID_CHOOSER_TEXT, GUIDesignChooserTextField); + myTextEntry = new FXTextField(layoutLeft, 0, this, MID_CHOOSER_TEXT, TEXTFIELD_ENTER_ONLY | GUIDesignChooserTextField); FXVerticalFrame* layoutList = new FXVerticalFrame(layoutLeft, GUIDesignChooserLayoutList); myList = new FXList(layoutList, this, MID_CHOOSER_LIST, GUIDesignChooserListSingle); // build the buttons @@ -95,18 +97,26 @@ new FXHorizontalSeparator(layoutRight, GUIDesignHorizontalSeparator); new FXButton(layoutRight, "&Close\t\t", GUIIconSubSys::getIcon(GUIIcon::NO), this, MID_CANCEL, GUIDesignChooserButtons); myCountLabel = new FXLabel(layoutRight, "placeholder", nullptr, LAYOUT_BOTTOM | LAYOUT_FILL_X | JUSTIFY_LEFT); + myCaseSensitive = new FXCheckButton(layoutRight, "case-sensitive search"); + myCaseSensitive->setCheck(getApp()->reg().readIntEntry("LOCATOR", "caseSensitive", 0) == 1); + myInstantCenter = new FXCheckButton(layoutRight, "auto-center"); + myInstantCenter->setCheck(getApp()->reg().readIntEntry("LOCATOR", "autoCenter", 0) == 1); refreshList(ids); // add child in windowsParent myWindowsParent->getParent()->addChild(this); // create and show dialog create(); show(); + + getApp()->reg().writeIntEntry("TL_TRACKER", "x", getX()); } GUIDialog_ChooserAbstract::~GUIDialog_ChooserAbstract() { // remove child from windowsParent myWindowsParent->getParent()->removeChild(this); + getApp()->reg().writeIntEntry("LOCATOR", "autoCenter", myInstantCenter->getCheck()); + getApp()->reg().writeIntEntry("LOCATOR", "caseSensitive", myCaseSensitive->getCheck()); } @@ -156,22 +166,48 @@ return 1; } +long +GUIDialog_ChooserAbstract::onChgList(FXObject*, FXSelector, void*) { + // mouse-click toggles item selection but changked current item with + // keyboard does not affect select + // Enabling the line blow toggles the behavior (which must be fixed via onChgListSel) + myList->selectItem(myList->getCurrentItem()); + if (myInstantCenter->getCheck()) { + onCmdCenter(nullptr, 0, nullptr); + } + return 1; +} + +long +GUIDialog_ChooserAbstract::onChgListSel(FXObject*, FXSelector, void*) { + myList->selectItem(myList->getCurrentItem()); + return 1; +} long GUIDialog_ChooserAbstract::onChgText(FXObject*, FXSelector, void*) { + const bool caseSensitive = myCaseSensitive->getCheck() == TRUE; int id = -1; if (myLocateByName || myHaveFilteredSubstring) { // findItem does not support substring search const int numItems = myList->getNumItems(); - FXString t = myTextEntry->getText().lower(); + FXString t = myTextEntry->getText(); + if (!caseSensitive) { + t = t.lower(); + } for (int i = 0; i < numItems; i++) { - if (myList->getItemText(i).lower().find(t) >= 0) { + FXString t2 = myList->getItemText(i); + if (!caseSensitive) { + t2 = t2.lower(); + } + if (t2.find(t) >= 0) { id = i; break; } } } else { - id = myList->findItem(myTextEntry->getText(), -1, SEARCH_PREFIX); + const int caseOpt = caseSensitive ? 0 : SEARCH_IGNORECASE; + id = myList->findItem(myTextEntry->getText(), -1, SEARCH_PREFIX | caseOpt); } if (id < 0) { if (myList->getNumItems() > 0) { @@ -205,14 +241,18 @@ long GUIDialog_ChooserAbstract::onListKeyPress(FXObject*, FXSelector, void* ptr) { FXEvent* event = (FXEvent*)ptr; - switch (event->code) { - case KEY_Return: - onCmdText(nullptr, 0, nullptr); - break; - default: - break; + if (event->code == KEY_Return) { + onCmdText(nullptr, 0, nullptr); + if ((event->state & CONTROLMASK) != 0) { + close(true); + } + return 1; + } else if (event->code == KEY_Left || (event->code == KEY_Up && myList->getCurrentItem() == 0)) { + myTextEntry->setFocus(); + return 1; } - return 1; + // let other elements handle the keypress + return 0; } @@ -234,11 +274,19 @@ long GUIDialog_ChooserAbstract::onCmdFilterSubstr(FXObject*, FXSelector, void*) { + const bool caseSensitive = myCaseSensitive->getCheck() == TRUE; std::vector selectedGlIDs; const int numItems = myList->getNumItems(); - FXString t = myTextEntry->getText().lower(); + FXString t = myTextEntry->getText(); + if (!caseSensitive) { + t = t.lower(); + } for (int i = 0; i < numItems; i++) { - if (myList->getItemText(i).lower().find(t) >= 0) { + FXString t2 = myList->getItemText(i); + if (!caseSensitive) { + t2 = t2.lower(); + } + if (t2.find(t) >= 0) { const GUIGlID glID = *static_cast(myList->getItemData(i)); selectedGlIDs.push_back(glID); } diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIDialog_ChooserAbstract.h sumo-1.12.0/src/utils/gui/windows/GUIDialog_ChooserAbstract.h --- sumo-1.11.0/src/utils/gui/windows/GUIDialog_ChooserAbstract.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIDialog_ChooserAbstract.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -92,6 +92,12 @@ /// @brief Callback: Selects to current item if enter is pressed long onListKeyPress(FXObject*, FXSelector, void*); + /// @brief Callback: Current list item has changed + long onChgList(FXObject*, FXSelector, void*); + + /// @brief Callback: Current list item selection has changed + long onChgListSel(FXObject*, FXSelector, void*); + /// @brief Callback: Hides unselected items if pressed long onCmdFilter(FXObject*, FXSelector, void*); @@ -166,4 +172,11 @@ /// @brief label for declaring list size FXLabel* myCountLabel; + + /// @brief Whether search is case sensitive + FXCheckButton* myCaseSensitive; + + /// @brief Whether each change in the list should re-center the view + FXCheckButton* myInstantCenter; + }; diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIDialog_EditViewport.cpp sumo-1.12.0/src/utils/gui/windows/GUIDialog_EditViewport.cpp --- sumo-1.11.0/src/utils/gui/windows/GUIDialog_EditViewport.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIDialog_EditViewport.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIDialog_EditViewport.h sumo-1.12.0/src/utils/gui/windows/GUIDialog_EditViewport.h --- sumo-1.11.0/src/utils/gui/windows/GUIDialog_EditViewport.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIDialog_EditViewport.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp sumo-1.12.0/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp --- sumo-1.11.0/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GUIDialog_GLObjChooser.cpp -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date Sept 2002 -/// -// Class for the window that allows to choose a street, junction or vehicle -/****************************************************************************/ -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GUIDialog_GLObjChooser.h" - - -// =========================================================================== -// method definitions -// =========================================================================== -GUIDialog_GLObjChooser::GUIDialog_GLObjChooser(GUISUMOViewParent* SUMOViewParent, int messageId, - FXIcon* icon, const FXString& title, const std::vector& ids, GUIGlObjectStorage& glStorage) : - GUIDialog_ChooserAbstract(SUMOViewParent, messageId, icon, title, ids, glStorage), - mySUMOViewParent(SUMOViewParent) { -} - - -GUIDialog_GLObjChooser::~GUIDialog_GLObjChooser() { - mySUMOViewParent->eraseGLObjChooser(this); -} - -/****************************************************************************/ diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIDialog_GLObjChooser.h sumo-1.12.0/src/utils/gui/windows/GUIDialog_GLObjChooser.h --- sumo-1.11.0/src/utils/gui/windows/GUIDialog_GLObjChooser.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIDialog_GLObjChooser.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,68 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 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 GUIDialog_GLObjChooser.h -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date Sept 2002 -/// -// Class for the window that allows to choose a street, junction or vehicle -/****************************************************************************/ -#pragma once -#include - -#include "GUIDialog_ChooserAbstract.h" - - -// =========================================================================== -// class declarations -// =========================================================================== -class GUISUMOViewParent; -class GNEViewParent; -class GUIGlChildWindow; -class GUIGlObjectStorage; -class GUIGlObject; - - -// =========================================================================== -// class definition -// =========================================================================== -/** - * @class GUIDialog_GLObjChooser - * Instances of this class are windows that display the list of instances - * from a given artifact like vehicles, edges or junctions and allow - * one of their items - */ -class GUIDialog_GLObjChooser : public GUIDialog_ChooserAbstract { - - -public: - /** @brief Constructor - * @param[in] SUMOViewParent The calling view (SUMO-GUI) - * @param[in] viewParent The calling view (NETEDIT) - * @param[in] icon The icon to use - * @param[in] title The title to use - * @param[in] glStorage The storage to retrieve ids from - */ - GUIDialog_GLObjChooser(GUISUMOViewParent* SUMOViewParent, int messageId, - FXIcon* icon, const FXString& title, const std::vector& ids, - GUIGlObjectStorage& glStorage); - - /// @brief Destructor - virtual ~GUIDialog_GLObjChooser(); - -private: - /// @brief SUMO-GUI View parent - GUISUMOViewParent* mySUMOViewParent; -}; diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIDialog_Options.cpp sumo-1.12.0/src/utils/gui/windows/GUIDialog_Options.cpp --- sumo-1.11.0/src/utils/gui/windows/GUIDialog_Options.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIDialog_Options.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIDialog_Options.h sumo-1.12.0/src/utils/gui/windows/GUIDialog_Options.h --- sumo-1.11.0/src/utils/gui/windows/GUIDialog_Options.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIDialog_Options.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIDialog_ViewSettings.cpp sumo-1.12.0/src/utils/gui/windows/GUIDialog_ViewSettings.cpp --- sumo-1.11.0/src/utils/gui/windows/GUIDialog_ViewSettings.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIDialog_ViewSettings.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -145,6 +145,7 @@ delete myJunctionNamePanel; delete myVehicleNamePanel; delete myVehicleValuePanel; + delete myVehicleScaleValuePanel; delete myVehicleTextPanel; delete myPersonNamePanel; delete myPersonValuePanel; @@ -289,6 +290,7 @@ myLaneMinWidthDialer->setValue(mySettings->laneMinSize); myVehicleColorMode->setCurrentItem((FXint) mySettings->vehicleColorer.getActive()); + myVehicleScaleMode->setCurrentItem((FXint) mySettings->vehicleScaler.getActive()); myVehicleShapeDetail->setCurrentItem(mySettings->vehicleQuality); myShowBlinker->setCheck(mySettings->showBlinker); myShowMinGap->setCheck(mySettings->drawMinGap); @@ -296,11 +298,13 @@ myShowBTRange->setCheck(mySettings->showBTRange); myShowRouteIndex->setCheck(mySettings->showRouteIndex); myScaleLength->setCheck(mySettings->scaleLength); + myShowParkingInfo->setCheck(mySettings->showParkingInfo); /* myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference); */ myVehicleNamePanel->update(mySettings->vehicleName); myVehicleValuePanel->update(mySettings->vehicleValue); + myVehicleScaleValuePanel->update(mySettings->vehicleScaleValue); myVehicleTextPanel->update(mySettings->vehicleText); myVehicleSizePanel->update(mySettings->vehicleSize); @@ -458,6 +462,7 @@ int prevLaneMode = mySettings->getLaneEdgeMode(); int prevLaneScaleMode = mySettings->getLaneEdgeScaleMode(); int prevVehicleMode = mySettings->vehicleColorer.getActive(); + int prevVehicleScaleMode = mySettings->vehicleScaler.getActive(); int prevPersonMode = mySettings->personColorer.getActive(); int prevContainerMode = mySettings->containerColorer.getActive(); int prevJunctionMode = mySettings->junctionColorer.getActive(); @@ -567,6 +572,7 @@ tmpSettings.laneMinSize = myLaneMinWidthDialer->getValue(); tmpSettings.vehicleColorer.setActive(myVehicleColorMode->getCurrentItem()); + tmpSettings.vehicleScaler.setActive(myVehicleScaleMode->getCurrentItem()); tmpSettings.vehicleQuality = myVehicleShapeDetail->getCurrentItem(); tmpSettings.showBlinker = (myShowBlinker->getCheck() != FALSE); tmpSettings.drawMinGap = (myShowMinGap->getCheck() != FALSE); @@ -574,11 +580,13 @@ tmpSettings.showBTRange = (myShowBTRange->getCheck() != FALSE); tmpSettings.showRouteIndex = (myShowRouteIndex->getCheck() != FALSE); tmpSettings.scaleLength = (myScaleLength->getCheck() != FALSE); + tmpSettings.showParkingInfo = (myShowParkingInfo->getCheck() != FALSE); /* tmpSettings.drawLaneChangePreference = (myShowLaneChangePreference->getCheck() != FALSE); */ tmpSettings.vehicleName = myVehicleNamePanel->getSettings(); tmpSettings.vehicleValue = myVehicleValuePanel->getSettings(); + tmpSettings.vehicleScaleValue = myVehicleScaleValuePanel->getSettings(); tmpSettings.vehicleText = myVehicleTextPanel->getSettings(); tmpSettings.vehicleSize = myVehicleSizePanel->getSettings(); @@ -695,6 +703,20 @@ } else { doRebuildColorMatrices = true; } + // vehicles (scaling) + if (tmpSettings.vehicleScaler.getActive() == prevVehicleScaleMode) { + if (updateScaleRanges(sender, myVehicleScales.begin(), myVehicleScales.end(), + myVehicleScaleThresholds.begin(), myVehicleScaleThresholds.end(), myVehicleScaleButtons.begin(), + tmpSettings.vehicleScaler.getScheme())) { + doRebuildColorMatrices = true; + } + if (sender == myVehicleScaleInterpolation) { + tmpSettings.vehicleScaler.getScheme().setInterpolated(myVehicleScaleInterpolation->getCheck() != FALSE); + doRebuildColorMatrices = true; + } + } else { + doRebuildColorMatrices = true; + } // persons if (tmpSettings.personColorer.getActive() == prevPersonMode) { if (updateColorRanges(sender, myPersonColors.begin(), myPersonColors.end(), @@ -915,12 +937,20 @@ } } GUIVisualizationSettings tmpSettings = *mySettings; - gSchemeStorage.remove(mySettings->name); tmpSettings.name = name; + if (name == mySettings->name || StringUtils::startsWith(mySettings->name, "custom_")) { + gSchemeStorage.remove(mySettings->name); + myParent->getColoringSchemesCombo()->setItemText(index, name.c_str()); + } else { + gSchemeStorage.get(mySettings->name) = myBackup; + index = mySchemeName->appendItem(name.c_str()); + myParent->getColoringSchemesCombo()->appendItem(name.c_str()); + myParent->getColoringSchemesCombo()->setCurrentItem( + myParent->getColoringSchemesCombo()->findItem(name.c_str())); + } gSchemeStorage.add(tmpSettings); - mySchemeName->setItemText(index, tmpSettings.name.c_str()); - myParent->getColoringSchemesCombo()->setItemText(index, tmpSettings.name.c_str()); - myParent->setColorScheme(tmpSettings.name); + mySchemeName->setItemText(index, name.c_str()); + myParent->setColorScheme(name); mySettings = &gSchemeStorage.get(name); myBackup = *mySettings; gSchemeStorage.writeSettings(getApp()); @@ -987,7 +1017,7 @@ if (!mySettings->netedit && mySaveBreakpoints->getCheck()) { for (SUMOTime t : myParent->retrieveBreakpoints()) { dev.openTag(SUMO_TAG_BREAKPOINT); - dev.writeAttr(SUMO_ATTR_VALUE, time2string(t)); + dev.writeAttr(SUMO_ATTR_TIME, time2string(t)); dev.closeTag(); } } @@ -1336,6 +1366,12 @@ } myVehicleColorSettingFrame->getParent()->recalc(); + m = rebuildScaleMatrix(myVehicleScaleSettingFrame, myVehicleScales, myVehicleScaleThresholds, myVehicleScaleButtons, myVehicleScaleInterpolation, mySettings->vehicleScaler.getScheme()); + if (doCreate) { + m->create(); + } + myVehicleScaleSettingFrame->getParent()->recalc(); + m = rebuildColorMatrix(myPersonColorSettingFrame, myPersonColors, myPersonThresholds, myPersonButtons, myPersonColorInterpolation, mySettings->personColorer.getScheme()); if (doCreate) { m->create(); @@ -1548,8 +1584,10 @@ const std::string& title, const GUIVisualizationTextSettings& settings) { myCheck = new FXCheckButton(parent, title.c_str(), target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings); - myCheck->setCheck(settings.show); + myCheck->setCheck(settings.showText); myMatrix0 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5); + mySelectedCheck = new FXCheckButton(myMatrix0, "Only for selected", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings); + mySelectedCheck->setCheck(settings.onlySelected); myConstSizeCheck = new FXCheckButton(myMatrix0, "constant text size", target, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings); myConstSizeCheck->setCheck(settings.constSize); FXMatrix* m1 = new FXMatrix(parent, 2, GUIDesignViewSettingsMatrix5); @@ -1571,17 +1609,19 @@ mySizeDial->getValue(), MFXUtils::getRGBColor(myColorWell->getRGBA()), MFXUtils::getRGBColor(myBGColorWell->getRGBA()), - myConstSizeCheck->getCheck() != FALSE); + myConstSizeCheck->getCheck() != FALSE, + mySelectedCheck->getCheck() != FALSE); } void GUIDialog_ViewSettings::NamePanel::update(const GUIVisualizationTextSettings& settings) { - myCheck->setCheck(settings.show); + myCheck->setCheck(settings.showText); mySizeDial->setValue(settings.size); myColorWell->setRGBA(MFXUtils::getFXColor(settings.color)); myBGColorWell->setRGBA(MFXUtils::getFXColor(settings.bgColor)); myConstSizeCheck->setCheck(settings.constSize); + mySelectedCheck->setCheck(settings.onlySelected); } @@ -1835,12 +1875,23 @@ myVehicleParamKey->disable(); myVehicleColorSettingFrame = new FXVerticalFrame(verticalframe, GUIDesignViewSettingsVerticalFrame4); + new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator); + // vehicle scale settings + FXVerticalFrame* verticalFrameScale = new FXVerticalFrame(verticalframe, GUIDesignViewSettingsVerticalFrame6); + FXMatrix* matrixScale = new FXMatrix(verticalFrameScale, 3, GUIDesignViewSettingsMatrix3); + new FXLabel(matrixScale, "Scale size", nullptr, GUIDesignViewSettingsLabel1); + myVehicleScaleMode = new MFXIconComboBox(matrixScale, 30, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic); + myVehicleScaleInterpolation = new FXCheckButton(matrixScale, "Interpolate", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings); + myVehicleScaleSettingFrame = new FXVerticalFrame(verticalFrameScale, GUIDesignViewSettingsVerticalFrame4); + mySettings->vehicleScaler.fill(*myVehicleScaleMode); + myVehicleScaleMode->setNumVisible((int)mySettings->vehicleScaler.size()); new FXHorizontalSeparator(verticalframe, GUIDesignHorizontalSeparator); FXMatrix* matrixVehicle = new FXMatrix(verticalframe, 2, GUIDesignMatrixViewSettings); myVehicleNamePanel = new NamePanel(matrixVehicle, this, "Show vehicle id", mySettings->vehicleName); myVehicleValuePanel = new NamePanel(matrixVehicle, this, "Show vehicle color value", mySettings->vehicleValue); + myVehicleScaleValuePanel = new NamePanel(matrixVehicle, this, "Show vehicle scale value", mySettings->vehicleScaleValue); myVehicleTextPanel = new NamePanel(matrixVehicle, this, "Show vehicle text param", mySettings->vehicleText); myVehicleTextParamKey = new FXComboBox(myVehicleTextPanel->myMatrix0, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic); myVehicleTextParamKey->setEditable(true); @@ -1860,6 +1911,8 @@ myShowRouteIndex->setCheck(mySettings->showRouteIndex); myScaleLength = new FXCheckButton(matrixShow, "Scale length with geometry", this, MID_SIMPLE_VIEW_COLORCHANGE); myScaleLength->setCheck(mySettings->scaleLength); + myShowParkingInfo = new FXCheckButton(matrixShow, "Show parking info", this, MID_SIMPLE_VIEW_COLORCHANGE); + myShowParkingInfo->setCheck(mySettings->showParkingInfo); //new FXLabel(matrixShow, " ", nullptr, GUIDesignViewSettingsLabel1); //myShowLaneChangePreference = new FXCheckButton(matrixShow, "Show lane change preference", this, MID_SIMPLE_VIEW_COLORCHANGE); //myShowLaneChangePreference->setCheck(mySettings->drawLaneChangePreference); diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIDialog_ViewSettings.h sumo-1.12.0/src/utils/gui/windows/GUIDialog_ViewSettings.h --- sumo-1.11.0/src/utils/gui/windows/GUIDialog_ViewSettings.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIDialog_ViewSettings.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -74,6 +74,9 @@ /// @brief BGColor well FXColorWell* myBGColorWell; + /// @brief draw only for selected? + FXCheckButton* mySelectedCheck; + /// @brief const size check FXCheckButton* myConstSizeCheck; @@ -299,7 +302,16 @@ std::vector myVehicleThresholds; std::vector myVehicleButtons; FXCheckButton* myVehicleColorInterpolation; - FXCheckButton* myShowBlinker, *myShowMinGap, *myShowBrakeGap, *myShowBTRange, *myShowRouteIndex, *myScaleLength; /* *myShowLaneChangePreference,*/ + + /// @brief vehicle scaler + MFXIconComboBox* myVehicleScaleMode; + FXVerticalFrame* myVehicleScaleSettingFrame; + std::vector myVehicleScales; + std::vector myVehicleScaleThresholds; + std::vector myVehicleScaleButtons; + FXCheckButton* myVehicleScaleInterpolation; + + FXCheckButton* myShowBlinker, *myShowMinGap, *myShowBrakeGap, *myShowBTRange, *myShowRouteIndex, *myScaleLength, *myShowParkingInfo; /* *myShowLaneChangePreference,*/ FXComboBox* myVehicleParamKey; FXComboBox* myVehicleTextParamKey; @@ -381,7 +393,7 @@ *myJunctionIndexPanel, *myTLIndexPanel, *myJunctionIDPanel, *myJunctionNamePanel, *myInternalJunctionNamePanel, *myTLSPhaseIndexPanel, *myTLSPhaseNamePanel, - *myVehicleNamePanel, *myVehicleValuePanel, *myVehicleTextPanel, + *myVehicleNamePanel, *myVehicleValuePanel, *myVehicleScaleValuePanel, *myVehicleTextPanel, *myPersonNamePanel, *myPersonValuePanel, *myContainerNamePanel, *myAddNamePanel, *myAddFullNamePanel, diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIGlChildWindow.cpp sumo-1.12.0/src/utils/gui/windows/GUIGlChildWindow.cpp --- sumo-1.11.0/src/utils/gui/windows/GUIGlChildWindow.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIGlChildWindow.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIGlChildWindow.h sumo-1.12.0/src/utils/gui/windows/GUIGlChildWindow.h --- sumo-1.11.0/src/utils/gui/windows/GUIGlChildWindow.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIGlChildWindow.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIMainWindow.cpp sumo-1.12.0/src/utils/gui/windows/GUIMainWindow.cpp --- sumo-1.11.0/src/utils/gui/windows/GUIMainWindow.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIMainWindow.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIMainWindow.h sumo-1.12.0/src/utils/gui/windows/GUIMainWindow.h --- sumo-1.11.0/src/utils/gui/windows/GUIMainWindow.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIMainWindow.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIPerspectiveChanger.cpp sumo-1.12.0/src/utils/gui/windows/GUIPerspectiveChanger.cpp --- sumo-1.11.0/src/utils/gui/windows/GUIPerspectiveChanger.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIPerspectiveChanger.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/windows/GUIPerspectiveChanger.h sumo-1.12.0/src/utils/gui/windows/GUIPerspectiveChanger.h --- sumo-1.11.0/src/utils/gui/windows/GUIPerspectiveChanger.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUIPerspectiveChanger.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/gui/windows/GUISUMOAbstractView.cpp sumo-1.12.0/src/utils/gui/windows/GUISUMOAbstractView.cpp --- sumo-1.11.0/src/utils/gui/windows/GUISUMOAbstractView.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUISUMOAbstractView.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -508,7 +508,7 @@ Position pos = getPositionInformation(); pos.add(0, p2m(15)); std::string label = object->getFullName(); - if (myVisualizationSettings->edgeValue.show && + if (myVisualizationSettings->edgeValue.show(object) && (object->getType() == GLO_EDGE || object->getType() == GLO_LANE)) { const int activeScheme = myVisualizationSettings->getLaneEdgeMode(); label += " (" + toString(object->getColorValue(*myVisualizationSettings, activeScheme)) + ")"; diff -Nru sumo-1.11.0/src/utils/gui/windows/GUISUMOAbstractView.h sumo-1.12.0/src/utils/gui/windows/GUISUMOAbstractView.h --- sumo-1.11.0/src/utils/gui/windows/GUISUMOAbstractView.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/gui/windows/GUISUMOAbstractView.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/handlers/AdditionalHandler.cpp sumo-1.12.0/src/utils/handlers/AdditionalHandler.cpp --- sumo-1.11.0/src/utils/handlers/AdditionalHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/handlers/AdditionalHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -38,7 +38,7 @@ AdditionalHandler::~AdditionalHandler() {} -void +bool AdditionalHandler::beginParseAttributes(SumoXMLTag tag, const SUMOSAXAttributes& attrs) { // open SUMOBaseOBject myCommonXMLStructure.openSUMOBaseOBject(); @@ -157,11 +157,14 @@ parseParameters(attrs); break; default: + // tag cannot be parsed in AdditionalHandler + return false; break; } } catch (InvalidArgument& e) { WRITE_ERROR(e.what()); } + return true; } @@ -1354,7 +1357,7 @@ bool parsedOk = true; // needed attributes const std::string edgeID = attrs.get(SUMO_ATTR_ID, "", parsedOk); - const double probability = attrs.get(SUMO_ATTR_PROB, "", parsedOk); + const double probability = attrs.getOpt(SUMO_ATTR_PROB, "", parsedOk, 1); // check parent checkParent(SUMO_TAG_DEST_PROB_REROUTE, {SUMO_TAG_INTERVAL}, parsedOk); // continue if flag is ok @@ -1378,7 +1381,7 @@ bool parsedOk = true; // needed attributes const std::string parkingAreaID = attrs.get(SUMO_ATTR_ID, "", parsedOk); - const double probability = attrs.get(SUMO_ATTR_PROB, "", parsedOk); + const double probability = attrs.getOpt(SUMO_ATTR_PROB, "", parsedOk, 1); // optional attributes const bool visible = attrs.getOpt(SUMO_ATTR_VISIBLE, "", parsedOk, false); // check parent @@ -1405,7 +1408,7 @@ bool parsedOk = true; // needed attributes const std::string routeID = attrs.get(SUMO_ATTR_ID, "", parsedOk); - const double probability = attrs.get(SUMO_ATTR_PROB, "", parsedOk); + const double probability = attrs.getOpt(SUMO_ATTR_PROB, "", parsedOk, 1); // check parent checkParent(SUMO_TAG_ROUTE_PROB_REROUTE, {SUMO_TAG_INTERVAL}, parsedOk); // continue if flag is ok diff -Nru sumo-1.11.0/src/utils/handlers/AdditionalHandler.h sumo-1.12.0/src/utils/handlers/AdditionalHandler.h --- sumo-1.11.0/src/utils/handlers/AdditionalHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/handlers/AdditionalHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -37,7 +37,7 @@ ~AdditionalHandler(); /// @brief begin parse attributes - void beginParseAttributes(SumoXMLTag tag, const SUMOSAXAttributes& attrs); + bool beginParseAttributes(SumoXMLTag tag, const SUMOSAXAttributes& attrs); /// @brief end parse attributes void endParseAttributes(); diff -Nru sumo-1.11.0/src/utils/handlers/DataHandler.cpp sumo-1.12.0/src/utils/handlers/DataHandler.cpp --- sumo-1.11.0/src/utils/handlers/DataHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/handlers/DataHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/handlers/DataHandler.h sumo-1.12.0/src/utils/handlers/DataHandler.h --- sumo-1.11.0/src/utils/handlers/DataHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/handlers/DataHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/handlers/GeneralHandler.cpp sumo-1.12.0/src/utils/handlers/GeneralHandler.cpp --- sumo-1.11.0/src/utils/handlers/GeneralHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/handlers/GeneralHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/handlers/GeneralHandler.h sumo-1.12.0/src/utils/handlers/GeneralHandler.h --- sumo-1.11.0/src/utils/handlers/GeneralHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/handlers/GeneralHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/handlers/RouteHandler.cpp sumo-1.12.0/src/utils/handlers/RouteHandler.cpp --- sumo-1.11.0/src/utils/handlers/RouteHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/handlers/RouteHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -46,7 +46,7 @@ RouteHandler::~RouteHandler() {} -void +bool RouteHandler::beginParseAttributes(SumoXMLTag tag, const SUMOSAXAttributes& attrs) { // open SUMOBaseOBject myCommonXMLStructure.openSUMOBaseOBject(); @@ -124,12 +124,12 @@ } default: // nested CFM attributes - parseNestedCFM(tag, attrs); - break; + return parseNestedCFM(tag, attrs); } } catch (InvalidArgument& e) { WRITE_ERROR(e.what()); } + return true; } @@ -140,33 +140,45 @@ // close SUMOBaseOBject myCommonXMLStructure.closeSUMOBaseOBject(); // check tag - switch (obj->getTag()) { - // specia case for route (because can be embedded) - case SUMO_TAG_ROUTE: - // only parse non-embedded routes - if (!obj->getStringAttribute(SUMO_ATTR_ID).empty()) { + if (obj) { + switch (obj->getTag()) { + // specia case for route (because can be embedded) + case SUMO_TAG_ROUTE: + // only parse non-embedded routes + if (!obj->getStringAttribute(SUMO_ATTR_ID).empty()) { + // 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 (obj->getParentSumoBaseObject() && + (obj->getParentSumoBaseObject()->getTag() != 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_TRIP: + case SUMO_TAG_VEHICLE: + case SUMO_TAG_FLOW: + case SUMO_TAG_PERSON: + case SUMO_TAG_PERSONFLOW: + case SUMO_TAG_CONTAINER: + case SUMO_TAG_CONTAINERFLOW: // parse object and all their childrens parseSumoBaseObject(obj); // delete object (and all of their childrens) delete obj; - } - break; - // demand elements - case SUMO_TAG_VTYPE: - case SUMO_TAG_TRIP: - case SUMO_TAG_VEHICLE: - case SUMO_TAG_FLOW: - case SUMO_TAG_PERSON: - case SUMO_TAG_PERSONFLOW: - case SUMO_TAG_CONTAINER: - case SUMO_TAG_CONTAINERFLOW: - // parse object and all their childrens - parseSumoBaseObject(obj); - // delete object (and all of their childrens) - delete obj; - break; - default: - break; + break; + default: + break; + } } } @@ -182,7 +194,8 @@ break; case SUMO_TAG_VTYPE_DISTRIBUTION: buildVTypeDistribution(obj, - obj->getStringAttribute(SUMO_ATTR_ID)); + obj->getStringAttribute(SUMO_ATTR_ID), + obj->getStringListAttribute(SUMO_ATTR_VTYPES)); break; // route case SUMO_TAG_ROUTE: @@ -210,11 +223,21 @@ break; // vehicles case SUMO_TAG_TRIP: - buildTrip(obj, - obj->getVehicleParameter(), - obj->getStringAttribute(SUMO_ATTR_FROM), - obj->getStringAttribute(SUMO_ATTR_TO), - obj->getStringListAttribute(SUMO_ATTR_VIA)); + if (obj->hasStringAttribute(SUMO_ATTR_FROM) && + obj->hasStringAttribute(SUMO_ATTR_TO)) { + // build trip with from-to edges + buildTrip(obj, + obj->getVehicleParameter(), + obj->getStringAttribute(SUMO_ATTR_FROM), + obj->getStringAttribute(SUMO_ATTR_TO), + obj->getStringListAttribute(SUMO_ATTR_VIA)); + } else { + // build trip with from-to junctions + buildTrip(obj, + obj->getVehicleParameter(), + obj->getStringAttribute(SUMO_ATTR_FROMJUNCTION), + obj->getStringAttribute(SUMO_ATTR_TOJUNCTION)); + } break; case SUMO_TAG_VEHICLE: if (obj->hasStringAttribute(SUMO_ATTR_ROUTE)) { @@ -225,15 +248,24 @@ // flows case SUMO_TAG_FLOW: if (obj->hasStringAttribute(SUMO_ATTR_ROUTE)) { + // build flow over route buildFlowOverRoute(obj, obj->getVehicleParameter()); } else if (obj->hasStringAttribute(SUMO_ATTR_FROM) && obj->hasStringAttribute(SUMO_ATTR_TO)) { + // build flow with from-to edges buildFlow(obj, obj->getVehicleParameter(), obj->getStringAttribute(SUMO_ATTR_FROM), obj->getStringAttribute(SUMO_ATTR_TO), obj->getStringListAttribute(SUMO_ATTR_VIA)); + } else if (obj->hasStringAttribute(SUMO_ATTR_FROMJUNCTION) && + obj->hasStringAttribute(SUMO_ATTR_TOJUNCTION)) { + // build flow with from-to junctions + buildFlow(obj, + obj->getVehicleParameter(), + obj->getStringAttribute(SUMO_ATTR_FROMJUNCTION), + obj->getStringAttribute(SUMO_ATTR_TOJUNCTION)); } break; // persons @@ -250,6 +282,8 @@ buildPersonTrip(obj, obj->getStringAttribute(SUMO_ATTR_FROM), obj->getStringAttribute(SUMO_ATTR_TO), + obj->getStringAttribute(SUMO_ATTR_FROMJUNCTION), + obj->getStringAttribute(SUMO_ATTR_TOJUNCTION), obj->getStringAttribute(SUMO_ATTR_BUS_STOP), obj->getDoubleAttribute(SUMO_ATTR_ARRIVALPOS), obj->getStringListAttribute(SUMO_ATTR_VTYPES), @@ -267,6 +301,8 @@ buildWalk(obj, obj->getStringAttribute(SUMO_ATTR_FROM), obj->getStringAttribute(SUMO_ATTR_TO), + obj->getStringAttribute(SUMO_ATTR_FROMJUNCTION), + obj->getStringAttribute(SUMO_ATTR_TOJUNCTION), obj->getStringAttribute(SUMO_ATTR_BUS_STOP), obj->getStringListAttribute(SUMO_ATTR_EDGES), obj->getStringAttribute(SUMO_ATTR_ROUTE), @@ -337,11 +373,14 @@ bool parsedOk = true; // needed attributes const std::string ID = attrs.get(SUMO_ATTR_ID, "", parsedOk); + // optional attributes + const std::vector vTypes = attrs.getOptStringVector(SUMO_ATTR_VTYPES, ID.c_str(), parsedOk); if (parsedOk) { // set tag myCommonXMLStructure.getCurrentSumoBaseObject()->setTag(SUMO_TAG_VTYPE_DISTRIBUTION); // add all attributes myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_ID, ID); + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringListAttribute(SUMO_ATTR_VTYPES, vTypes); } } @@ -362,7 +401,7 @@ const std::vector edges = attrs.get >(SUMO_ATTR_EDGES, id.c_str(), parsedOk); // optional attributes SUMOVehicleClass vClass = SUMOVehicleParserHelper::parseVehicleClass(attrs, id); - const RGBColor color = attrs.getOpt(SUMO_ATTR_COLOR, id.c_str(), parsedOk, RGBColor::YELLOW); + 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); if (parsedOk) { @@ -397,25 +436,47 @@ void RouteHandler::parseTrip(const SUMOSAXAttributes& attrs) { - // first parse vehicle + // declare Ok Flag + bool parsedOk = true; + // parse vehicle SUMOVehicleParameter* tripParameter = SUMOVehicleParserHelper::parseVehicleAttributes(SUMO_TAG_TRIP, attrs, myHardFail); if (tripParameter) { - // declare Ok Flag - bool parsedOk = true; - // needed attributes - const std::string from = attrs.get(SUMO_ATTR_FROM, tripParameter->id.c_str(), parsedOk); - const std::string to = attrs.get(SUMO_ATTR_TO, tripParameter->id.c_str(), parsedOk); - // optional attributes - const std::vector via = attrs.getOptStringVector(SUMO_ATTR_VIA, tripParameter->id.c_str(), parsedOk); - if (parsedOk) { - // set tag - myCommonXMLStructure.getCurrentSumoBaseObject()->setTag(SUMO_TAG_TRIP); - // set vehicle parameters - myCommonXMLStructure.getCurrentSumoBaseObject()->setVehicleParameter(tripParameter); - // add other attributes - myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_FROM, from); - myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_TO, to); - myCommonXMLStructure.getCurrentSumoBaseObject()->addStringListAttribute(SUMO_ATTR_VIA, via); + // check from/to edge/junction + if (attrs.hasAttribute(SUMO_ATTR_FROM) && attrs.hasAttribute(SUMO_ATTR_FROMJUNCTION)) { + WRITE_ERROR("Attributes 'from' and 'fromJunction' cannot be defined together"); + } else if (attrs.hasAttribute(SUMO_ATTR_TO) && attrs.hasAttribute(SUMO_ATTR_TOJUNCTION)) { + WRITE_ERROR("Attributes 'to' and 'toJunction' cannot be defined together"); + } else if (attrs.hasAttribute(SUMO_ATTR_FROM) && attrs.hasAttribute(SUMO_ATTR_TO)) { + // from-to attributes + const std::string from = attrs.getOpt(SUMO_ATTR_FROM, tripParameter->id.c_str(), parsedOk, ""); + const std::string to = attrs.getOpt(SUMO_ATTR_TO, tripParameter->id.c_str(), parsedOk, ""); + // optional attributes + const std::vector via = attrs.getOptStringVector(SUMO_ATTR_VIA, tripParameter->id.c_str(), parsedOk); + if (parsedOk) { + // set tag + myCommonXMLStructure.getCurrentSumoBaseObject()->setTag(SUMO_TAG_TRIP); + // set vehicle parameters + myCommonXMLStructure.getCurrentSumoBaseObject()->setVehicleParameter(tripParameter); + // add other attributes + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_FROM, from); + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_TO, to); + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringListAttribute(SUMO_ATTR_VIA, via); + } + } else if (attrs.hasAttribute(SUMO_ATTR_FROMJUNCTION) && attrs.hasAttribute(SUMO_ATTR_TOJUNCTION)) { + // from-to attributes + const std::string fromJunction = attrs.getOpt(SUMO_ATTR_FROMJUNCTION, tripParameter->id.c_str(), parsedOk, ""); + const std::string toJunction = attrs.getOpt(SUMO_ATTR_TOJUNCTION, tripParameter->id.c_str(), parsedOk, ""); + if (parsedOk) { + // set tag + myCommonXMLStructure.getCurrentSumoBaseObject()->setTag(SUMO_TAG_TRIP); + // set vehicle parameters + myCommonXMLStructure.getCurrentSumoBaseObject()->setVehicleParameter(tripParameter); + // add other attributes + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_FROMJUNCTION, fromJunction); + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_TOJUNCTION, toJunction); + } + } else { + WRITE_ERROR("trip definition needs either 'from/to' or 'fromJunction/toJunction'"); } // delete trip parameter (because in XMLStructure we have a copy) delete tripParameter; @@ -440,30 +501,55 @@ void RouteHandler::parseFlow(const SUMOSAXAttributes& attrs) { + // declare Ok Flag + bool parsedOk = true; // first parse flow SUMOVehicleParameter* flowParameter = SUMOVehicleParserHelper::parseFlowAttributes(SUMO_TAG_FLOW, attrs, myHardFail, true, myFlowBeginDefault, myFlowEndDefault); if (flowParameter) { - // declare Ok Flag - bool parsedOk = true; - // optional attributes (because flow and routeflows share tag) - const std::string from = attrs.getOpt(SUMO_ATTR_FROM, flowParameter->id.c_str(), parsedOk, ""); - const std::string to = attrs.getOpt(SUMO_ATTR_TO, flowParameter->id.c_str(), parsedOk, ""); - const std::vector via = attrs.getOptStringVector(SUMO_ATTR_VIA, flowParameter->id.c_str(), parsedOk); - if (parsedOk) { - if ((from.empty() && !to.empty()) || (!from.empty() && to.empty())) { - WRITE_ERROR("from and to atribute must de defined together"); - } else { + // set vehicle parameters + myCommonXMLStructure.getCurrentSumoBaseObject()->setVehicleParameter(flowParameter); + // check from/to edge/junction + if (attrs.hasAttribute(SUMO_ATTR_FROM) && attrs.hasAttribute(SUMO_ATTR_FROMJUNCTION)) { + WRITE_ERROR("Attributes 'from' and 'fromJunction' cannot be defined together"); + } else if (attrs.hasAttribute(SUMO_ATTR_TO) && attrs.hasAttribute(SUMO_ATTR_TOJUNCTION)) { + WRITE_ERROR("Attributes 'to' and 'toJunction' cannot be defined together"); + } else if (attrs.hasAttribute(SUMO_ATTR_FROM) && attrs.hasAttribute(SUMO_ATTR_TO)) { + // from-to attributes + const std::string from = attrs.get(SUMO_ATTR_FROM, flowParameter->id.c_str(), parsedOk); + const std::string to = attrs.get(SUMO_ATTR_TO, flowParameter->id.c_str(), parsedOk); + // optional attributes + const std::vector via = attrs.getOptStringVector(SUMO_ATTR_VIA, flowParameter->id.c_str(), parsedOk); + if (parsedOk) { // set tag myCommonXMLStructure.getCurrentSumoBaseObject()->setTag(SUMO_TAG_FLOW); - // set vehicle parameters - myCommonXMLStructure.getCurrentSumoBaseObject()->setVehicleParameter(flowParameter); // add other attributes - if (!from.empty() && !to.empty()) { - myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_FROM, from); - myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_TO, to); - myCommonXMLStructure.getCurrentSumoBaseObject()->addStringListAttribute(SUMO_ATTR_VIA, via); - } + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_FROM, from); + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_TO, to); + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringListAttribute(SUMO_ATTR_VIA, via); } + } else if (attrs.hasAttribute(SUMO_ATTR_FROMJUNCTION) && attrs.hasAttribute(SUMO_ATTR_TOJUNCTION)) { + // from-to attributes + const std::string fromJunction = attrs.get(SUMO_ATTR_FROMJUNCTION, flowParameter->id.c_str(), parsedOk); + const std::string toJunction = attrs.get(SUMO_ATTR_TOJUNCTION, flowParameter->id.c_str(), parsedOk); + if (parsedOk) { + // set tag + myCommonXMLStructure.getCurrentSumoBaseObject()->setTag(SUMO_TAG_FLOW); + // add other attributes + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_FROMJUNCTION, fromJunction); + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_TOJUNCTION, toJunction); + } + } else if (attrs.hasAttribute(SUMO_ATTR_ROUTE)) { + // from-to attributes + const std::string route = attrs.get(SUMO_ATTR_ROUTE, flowParameter->id.c_str(), parsedOk); + if (parsedOk) { + // set tag + myCommonXMLStructure.getCurrentSumoBaseObject()->setTag(SUMO_TAG_FLOW); + // add other attributes + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_ROUTE, route); + } + } else { + // set tag + myCommonXMLStructure.getCurrentSumoBaseObject()->setTag(SUMO_TAG_FLOW); } // delete flow parameter (because in XMLStructure we have a copy) delete flowParameter; @@ -526,6 +612,8 @@ // optional attributes const std::string from = attrs.getOpt(SUMO_ATTR_FROM, "", parsedOk, ""); const std::string to = attrs.getOpt(SUMO_ATTR_TO, "", parsedOk, ""); + const std::string fromJunction = attrs.getOpt(SUMO_ATTR_FROMJUNCTION, "", parsedOk, ""); + const std::string toJunction = attrs.getOpt(SUMO_ATTR_TOJUNCTION, "", parsedOk, ""); const std::vector via = attrs.getOptStringVector(SUMO_ATTR_VIA, "", parsedOk); const std::string busStop = attrs.getOpt(SUMO_ATTR_BUS_STOP, "", parsedOk, ""); const std::vector vTypes = attrs.getOptStringVector(SUMO_ATTR_VTYPES, "", parsedOk); @@ -538,6 +626,8 @@ // add all attributes myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_FROM, from); myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_TO, to); + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_FROMJUNCTION, fromJunction); + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_TOJUNCTION, toJunction); myCommonXMLStructure.getCurrentSumoBaseObject()->addStringListAttribute(SUMO_ATTR_VIA, via); myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_BUS_STOP, busStop); myCommonXMLStructure.getCurrentSumoBaseObject()->addStringListAttribute(SUMO_ATTR_VTYPES, vTypes); @@ -557,6 +647,8 @@ const std::vector edges = attrs.getOptStringVector(SUMO_ATTR_EDGES, "", parsedOk); const std::string from = attrs.getOpt(SUMO_ATTR_FROM, "", parsedOk, ""); const std::string to = attrs.getOpt(SUMO_ATTR_TO, "", parsedOk, ""); + const std::string fromJunction = attrs.getOpt(SUMO_ATTR_FROMJUNCTION, "", parsedOk, ""); + const std::string toJunction = attrs.getOpt(SUMO_ATTR_TOJUNCTION, "", parsedOk, ""); const std::string busStop = attrs.getOpt(SUMO_ATTR_BUS_STOP, "", parsedOk, ""); const double duration = attrs.getOpt(SUMO_ATTR_DURATION, "", parsedOk, 0); const double speed = attrs.getOpt(SUMO_ATTR_SPEED, "", parsedOk, 0); @@ -571,6 +663,8 @@ myCommonXMLStructure.getCurrentSumoBaseObject()->addStringListAttribute(SUMO_ATTR_EDGES, edges); myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_FROM, from); myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_TO, to); + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_FROMJUNCTION, fromJunction); + myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_TOJUNCTION, toJunction); myCommonXMLStructure.getCurrentSumoBaseObject()->addStringAttribute(SUMO_ATTR_BUS_STOP, busStop); myCommonXMLStructure.getCurrentSumoBaseObject()->addDoubleAttribute(SUMO_ATTR_DURATION, duration); myCommonXMLStructure.getCurrentSumoBaseObject()->addDoubleAttribute(SUMO_ATTR_SPEED, speed); @@ -728,7 +822,7 @@ } -void +bool RouteHandler::parseNestedCFM(const SumoXMLTag tag, const SUMOSAXAttributes& attrs) { // get vehicle type Base object const auto vTypeObject = myCommonXMLStructure.getCurrentSumoBaseObject()->getParentSumoBaseObject(); @@ -740,12 +834,14 @@ // parse nested CFM attributes if (SUMOVehicleParserHelper::parseCFMParams(&vType, tag, attrs, true)) { vTypeObject->setVehicleTypeParameter(&vType); + return true; } else if (myHardFail) { throw ProcessError("Invalid parsing embedded VType"); } else { WRITE_ERROR("Invalid parsing embedded VType"); } } + return false; } diff -Nru sumo-1.11.0/src/utils/handlers/RouteHandler.h sumo-1.12.0/src/utils/handlers/RouteHandler.h --- sumo-1.11.0/src/utils/handlers/RouteHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/handlers/RouteHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -40,7 +40,7 @@ ~RouteHandler(); /// @brief begin parse attributes - void beginParseAttributes(SumoXMLTag tag, const SUMOSAXAttributes& attrs); + bool beginParseAttributes(SumoXMLTag tag, const SUMOSAXAttributes& attrs); /// @brief end parse attributes void endParseAttributes(); @@ -55,7 +55,8 @@ virtual void buildVType(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVTypeParameter& vTypeParameter) = 0; /// @brief build vType distribution - virtual void buildVTypeDistribution(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id) = 0; + virtual void buildVTypeDistribution(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, + const std::vector& vTypes) = 0; /// @brief build route virtual void buildRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, SUMOVehicleClass vClass, @@ -76,14 +77,22 @@ /// @brief build a flow over an existent route virtual void buildFlowOverRoute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters) = 0; - /// @brief build trip + /// @brief build trip (from-to edges) virtual void buildTrip(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, const std::string& fromEdgeID, const std::string& toEdgeID, const std::vector& viaIDs) = 0; - /// @brief build flow + /// @brief build trip (from-to junctions) + virtual void buildTrip(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, + const std::string& fromJunctionID, const std::string& toJunctionID) = 0; + + /// @brief build flow (from-to edges) virtual void buildFlow(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, const std::string& fromEdgeID, const std::string& toEdgeID, const std::vector& viaIDs) = 0; + /// @brief build flow (from-to junctions) + virtual void buildFlow(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameters, + const std::string& fromJunctionID, const std::string& toJunctionID) = 0; + /// @brief build person virtual void buildPerson(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& personParameters) = 0; @@ -92,11 +101,13 @@ /// @brief build person trip virtual void buildPersonTrip(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& fromEdgeID, const std::string& toEdgeID, - const std::string& toBusStopID, double arrivalPos, const std::vector& types, const std::vector& modes) = 0; + const std::string& fromJunctionID, const std::string& toJunctionID, const std::string& toBusStopID, double arrivalPos, + const std::vector& types, const std::vector& modes) = 0; /// @brief build walk virtual void buildWalk(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& fromEdgeID, const std::string& toEdgeID, - const std::string& toBusStopID, const std::vector& edgeIDs, const std::string& routeID, double arrivalPos) = 0; + const std::string& fromJunctionID, const std::string& toJunctionID, const std::string& toBusStopID, + const std::vector& edgeIDs, const std::string& routeID, double arrivalPos) = 0; /// @brief build ride virtual void buildRide(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& fromEdgeID, const std::string& toEdgeID, @@ -198,7 +209,7 @@ void parseParameters(const SUMOSAXAttributes& attrs); /// @brief parse nested CarFollowingModel - void parseNestedCFM(const SumoXMLTag tag, const SUMOSAXAttributes& attrs); + bool parseNestedCFM(const SumoXMLTag tag, const SUMOSAXAttributes& attrs); /// @} diff -Nru sumo-1.11.0/src/utils/importio/LineHandler.h sumo-1.12.0/src/utils/importio/LineHandler.h --- sumo-1.11.0/src/utils/importio/LineHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/importio/LineHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/importio/LineReader.cpp sumo-1.12.0/src/utils/importio/LineReader.cpp --- sumo-1.11.0/src/utils/importio/LineReader.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/importio/LineReader.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/importio/LineReader.h sumo-1.12.0/src/utils/importio/LineReader.h --- sumo-1.11.0/src/utils/importio/LineReader.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/importio/LineReader.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/importio/NamedColumnsParser.cpp sumo-1.12.0/src/utils/importio/NamedColumnsParser.cpp --- sumo-1.11.0/src/utils/importio/NamedColumnsParser.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/importio/NamedColumnsParser.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/importio/NamedColumnsParser.h sumo-1.12.0/src/utils/importio/NamedColumnsParser.h --- sumo-1.11.0/src/utils/importio/NamedColumnsParser.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/importio/NamedColumnsParser.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/iodevices/OutputDevice_CERR.cpp sumo-1.12.0/src/utils/iodevices/OutputDevice_CERR.cpp --- sumo-1.11.0/src/utils/iodevices/OutputDevice_CERR.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/iodevices/OutputDevice_CERR.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/iodevices/OutputDevice_CERR.h sumo-1.12.0/src/utils/iodevices/OutputDevice_CERR.h --- sumo-1.11.0/src/utils/iodevices/OutputDevice_CERR.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/iodevices/OutputDevice_CERR.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/iodevices/OutputDevice_COUT.cpp sumo-1.12.0/src/utils/iodevices/OutputDevice_COUT.cpp --- sumo-1.11.0/src/utils/iodevices/OutputDevice_COUT.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/iodevices/OutputDevice_COUT.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/iodevices/OutputDevice_COUT.h sumo-1.12.0/src/utils/iodevices/OutputDevice_COUT.h --- sumo-1.11.0/src/utils/iodevices/OutputDevice_COUT.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/iodevices/OutputDevice_COUT.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/iodevices/OutputDevice.cpp sumo-1.12.0/src/utils/iodevices/OutputDevice.cpp --- sumo-1.11.0/src/utils/iodevices/OutputDevice.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/iodevices/OutputDevice.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ @@ -85,9 +85,8 @@ throw IOError("No port number given."); } } else { - const int len = (int)name.length(); - std::string name2 = name; - if (OptionsCont::getOptions().isSet("output-prefix") && name != "/dev/null") { + std::string name2 = (name == "nul" || name == "NUL") ? "/dev/null" : name; + if (OptionsCont::getOptions().isSet("output-prefix") && name2 != "/dev/null") { std::string prefix = OptionsCont::getOptions().getString("output-prefix"); const std::string::size_type metaTimeIndex = prefix.find("TIME"); if (metaTimeIndex != std::string::npos) { @@ -100,6 +99,7 @@ } name2 = FileHelpers::prependToLastPathComponent(prefix, name); } + const int len = (int)name.length(); dev = new OutputDevice_File(name2, len > 3 && name.substr(len - 3) == ".gz"); } dev->setPrecision(); diff -Nru sumo-1.11.0/src/utils/iodevices/OutputDevice_File.cpp sumo-1.12.0/src/utils/iodevices/OutputDevice_File.cpp --- sumo-1.11.0/src/utils/iodevices/OutputDevice_File.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/iodevices/OutputDevice_File.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ @@ -36,17 +36,18 @@ // method definitions // =========================================================================== OutputDevice_File::OutputDevice_File(const std::string& fullName, const bool compressed) - : OutputDevice(0, fullName), myFileStream(nullptr) { -#ifdef WIN32 + : OutputDevice(0, fullName) { if (fullName == "/dev/null") { + myAmNull = true; +#ifdef WIN32 myFileStream = new std::ofstream("NUL"); if (!myFileStream->good()) { delete myFileStream; throw IOError("Could not redirect to NUL device (" + std::string(std::strerror(errno)) + ")."); } return; - } #endif + } const std::string& localName = StringUtils::transcodeToLocal(fullName); #ifdef HAVE_ZLIB if (compressed) { diff -Nru sumo-1.11.0/src/utils/iodevices/OutputDevice_File.h sumo-1.12.0/src/utils/iodevices/OutputDevice_File.h --- sumo-1.11.0/src/utils/iodevices/OutputDevice_File.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/iodevices/OutputDevice_File.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ @@ -48,6 +48,13 @@ /// @brief Destructor ~OutputDevice_File(); + /** @brief returns the information whether the device will discard all output + * @return Whether the device redirects to /dev/null + */ + bool isNull() { + return myAmNull; + } + protected: /// @name Methods that override/implement OutputDevice-methods @@ -62,6 +69,9 @@ private: /// The wrapped ofstream - std::ostream* myFileStream; + std::ostream* myFileStream = nullptr; + + /// am I redirecting to /dev/null + bool myAmNull = false; }; diff -Nru sumo-1.11.0/src/utils/iodevices/OutputDevice.h sumo-1.12.0/src/utils/iodevices/OutputDevice.h --- sumo-1.11.0/src/utils/iodevices/OutputDevice.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/iodevices/OutputDevice.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ @@ -146,6 +146,13 @@ */ virtual bool ok(); + /** @brief returns the information whether the device will discard all output + * @return Whether the device redirects to /dev/null + */ + virtual bool isNull() { + return false; + } + /// @brief get filename or suitable description of this device const std::string& getFilename(); @@ -243,6 +250,10 @@ return *this; } + inline bool useAttribute(const SumoXMLAttr attr, long long int attributeMask) const { + return (attributeMask & ((long long int)1 << attr)) != 0; + } + /** @brief writes a named attribute unless filtered * * @param[in] attr The attribute (name) @@ -253,7 +264,7 @@ template OutputDevice& writeOptionalAttr(const SumoXMLAttr attr, const T& val, long long int attributeMask) { assert((int)attr <= 63); - if (attributeMask == 0 || attributeMask & ((long long int)1 << attr)) { + if (attributeMask == 0 || useAttribute(attr, attributeMask)) { PlainXMLFormatter::writeAttr(getOStream(), attr, val); } return *this; diff -Nru sumo-1.11.0/src/utils/iodevices/OutputDevice_Network.cpp sumo-1.12.0/src/utils/iodevices/OutputDevice_Network.cpp --- sumo-1.11.0/src/utils/iodevices/OutputDevice_Network.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/iodevices/OutputDevice_Network.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/utils/iodevices/OutputDevice_Network.h sumo-1.12.0/src/utils/iodevices/OutputDevice_Network.h --- sumo-1.11.0/src/utils/iodevices/OutputDevice_Network.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/iodevices/OutputDevice_Network.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/utils/iodevices/OutputDevice_String.cpp sumo-1.12.0/src/utils/iodevices/OutputDevice_String.cpp --- sumo-1.11.0/src/utils/iodevices/OutputDevice_String.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/iodevices/OutputDevice_String.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2009-2022 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/ diff -Nru sumo-1.11.0/src/utils/iodevices/OutputDevice_String.h sumo-1.12.0/src/utils/iodevices/OutputDevice_String.h --- sumo-1.11.0/src/utils/iodevices/OutputDevice_String.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/iodevices/OutputDevice_String.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2009-2022 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/ diff -Nru sumo-1.11.0/src/utils/iodevices/OutputFormatter.h sumo-1.12.0/src/utils/iodevices/OutputFormatter.h --- sumo-1.11.0/src/utils/iodevices/OutputFormatter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/iodevices/OutputFormatter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/utils/iodevices/PlainXMLFormatter.cpp sumo-1.12.0/src/utils/iodevices/PlainXMLFormatter.cpp --- sumo-1.11.0/src/utils/iodevices/PlainXMLFormatter.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/iodevices/PlainXMLFormatter.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/utils/iodevices/PlainXMLFormatter.h sumo-1.12.0/src/utils/iodevices/PlainXMLFormatter.h --- sumo-1.11.0/src/utils/iodevices/PlainXMLFormatter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/iodevices/PlainXMLFormatter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/utils/options/Option.cpp sumo-1.12.0/src/utils/options/Option.cpp --- sumo-1.11.0/src/utils/options/Option.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/options/Option.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/options/Option.h sumo-1.12.0/src/utils/options/Option.h --- sumo-1.11.0/src/utils/options/Option.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/options/Option.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/options/OptionsCont.cpp sumo-1.12.0/src/utils/options/OptionsCont.cpp --- sumo-1.11.0/src/utils/options/OptionsCont.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/options/OptionsCont.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -62,7 +62,7 @@ OptionsCont::OptionsCont() : myAddresses(), myValues(), myDeprecatedSynonymes() { - myCopyrightNotices.push_back("Copyright (C) 2001-2021 German Aerospace Center (DLR) and others; https://sumo.dlr.de"); + myCopyrightNotices.push_back("Copyright (C) 2001-2022 German Aerospace Center (DLR) and others; https://sumo.dlr.de"); } diff -Nru sumo-1.11.0/src/utils/options/OptionsCont.h sumo-1.12.0/src/utils/options/OptionsCont.h --- sumo-1.11.0/src/utils/options/OptionsCont.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/options/OptionsCont.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/options/OptionsIO.cpp sumo-1.12.0/src/utils/options/OptionsIO.cpp --- sumo-1.11.0/src/utils/options/OptionsIO.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/options/OptionsIO.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -114,7 +114,10 @@ if (!FileHelpers::isReadable(path)) { throw ProcessError("Could not access configuration '" + oc.getString("configuration-file") + "'."); } - PROGRESS_BEGIN_MESSAGE("Loading configuration"); + const bool verbose = !oc.exists("verbose") || oc.getBool("verbose"); + if (verbose) { + PROGRESS_BEGIN_MESSAGE("Loading configuration"); + } oc.resetWritable(); // build parser XERCES_CPP_NAMESPACE::SAXParser parser; @@ -139,7 +142,9 @@ oc.resetWritable(); OptionsParser::parse(myArgC, myArgV); } - PROGRESS_DONE_MESSAGE(); + if (verbose) { + PROGRESS_DONE_MESSAGE(); + } } diff -Nru sumo-1.11.0/src/utils/options/OptionsIO.h sumo-1.12.0/src/utils/options/OptionsIO.h --- sumo-1.11.0/src/utils/options/OptionsIO.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/options/OptionsIO.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/options/OptionsLoader.cpp sumo-1.12.0/src/utils/options/OptionsLoader.cpp --- sumo-1.11.0/src/utils/options/OptionsLoader.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/options/OptionsLoader.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/options/OptionsLoader.h sumo-1.12.0/src/utils/options/OptionsLoader.h --- sumo-1.11.0/src/utils/options/OptionsLoader.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/options/OptionsLoader.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/options/OptionsParser.cpp sumo-1.12.0/src/utils/options/OptionsParser.cpp --- sumo-1.11.0/src/utils/options/OptionsParser.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/options/OptionsParser.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/options/OptionsParser.h sumo-1.12.0/src/utils/options/OptionsParser.h --- sumo-1.11.0/src/utils/options/OptionsParser.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/options/OptionsParser.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/AccessEdge.h sumo-1.12.0/src/utils/router/AccessEdge.h --- sumo-1.11.0/src/utils/router/AccessEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/AccessEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/AStarLookupTable.h sumo-1.12.0/src/utils/router/AStarLookupTable.h --- sumo-1.11.0/src/utils/router/AStarLookupTable.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/AStarLookupTable.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/AStarRouter.h sumo-1.12.0/src/utils/router/AStarRouter.h --- sumo-1.11.0/src/utils/router/AStarRouter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/AStarRouter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/CarEdge.h sumo-1.12.0/src/utils/router/CarEdge.h --- sumo-1.11.0/src/utils/router/CarEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/CarEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/CHBuilder.h sumo-1.12.0/src/utils/router/CHBuilder.h --- sumo-1.11.0/src/utils/router/CHBuilder.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/CHBuilder.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/CHRouter.h sumo-1.12.0/src/utils/router/CHRouter.h --- sumo-1.11.0/src/utils/router/CHRouter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/CHRouter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -266,6 +266,14 @@ mySVC, myWeightPeriod, this->myHavePermissions, this->myHaveRestrictions); } + + virtual void prohibit(const std::vector& toProhibit) { + if (toProhibit.size() > 0) { + WRITE_WARNINGF("Routing algorith CH does not support dynamic closing of edges%", ""); + } + } + + /// trigger hierarchy rebuild virtual void reset(const V* const vehicle) { if (myValidUntil == 0) { diff -Nru sumo-1.11.0/src/utils/router/CHRouterWrapper.h sumo-1.12.0/src/utils/router/CHRouterWrapper.h --- sumo-1.11.0/src/utils/router/CHRouterWrapper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/CHRouterWrapper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -80,6 +80,11 @@ } } + virtual void prohibit(const std::vector& toProhibit) { + if (toProhibit.size() > 0) { + WRITE_WARNINGF("Routing algorith CHWrapper does not support dynamic closing of edges%", ""); + } + } virtual SUMOAbstractRouter* clone() { CHRouterWrapper* clone = new CHRouterWrapper(myEdges, myIgnoreErrors, this->myOperation, myBegin, myEnd, myWeightPeriod, this->myHavePermissions, myMaxNumInstances); diff -Nru sumo-1.11.0/src/utils/router/DijkstraRouter.h sumo-1.12.0/src/utils/router/DijkstraRouter.h --- sumo-1.11.0/src/utils/router/DijkstraRouter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/DijkstraRouter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/EffortCalculator.h sumo-1.12.0/src/utils/router/EffortCalculator.h --- sumo-1.11.0/src/utils/router/EffortCalculator.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/EffortCalculator.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/FareModul.h sumo-1.12.0/src/utils/router/FareModul.h --- sumo-1.11.0/src/utils/router/FareModul.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/FareModul.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/FareToken.h sumo-1.12.0/src/utils/router/FareToken.h --- sumo-1.11.0/src/utils/router/FareToken.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/FareToken.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/FareZones.h sumo-1.12.0/src/utils/router/FareZones.h --- sumo-1.11.0/src/utils/router/FareZones.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/FareZones.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/GawronCalculator.h sumo-1.12.0/src/utils/router/GawronCalculator.h --- sumo-1.11.0/src/utils/router/GawronCalculator.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/GawronCalculator.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/IntermodalEdge.h sumo-1.12.0/src/utils/router/IntermodalEdge.h --- sumo-1.11.0/src/utils/router/IntermodalEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/IntermodalEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/IntermodalNetwork.h sumo-1.12.0/src/utils/router/IntermodalNetwork.h --- sumo-1.11.0/src/utils/router/IntermodalNetwork.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/IntermodalNetwork.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -656,24 +656,24 @@ } } else { if (validStops.size() != lineEdges.size() + 1) { - WRITE_WARNING("Number of stops for public transport line '" + pars.line + "' does not match earlier definitions, ignoring schedule."); + WRITE_WARNINGF("Number of stops for public transport line '%' does not match earlier definitions, ignoring schedule.", pars.line); return; } if (lineEdges.front()->getEntryStop() != myStopConnections[validStops.front().busstop]) { - WRITE_WARNING("Different stop for '" + pars.line + "' compared to earlier definitions, ignoring schedule."); + WRITE_WARNINGF("Different stop for '%' compared to earlier definitions, ignoring schedule.", pars.line); return; } typename std::vector<_PTEdge*>::const_iterator lineEdge = lineEdges.begin(); typename std::vector::const_iterator s = validStops.begin() + 1; for (; s != validStops.end(); ++s, ++lineEdge) { if ((*lineEdge)->getSuccessors(SVC_IGNORING)[0] != myStopConnections[s->busstop]) { - WRITE_WARNING("Different stop for '" + pars.line + "' compared to earlier definitions, ignoring schedule."); + WRITE_WARNINGF("Different stop for '%' compared to earlier definitions, ignoring schedule.", pars.line); return; } } SUMOTime lastTime = validStops.front().until; if (lineEdges.front()->hasSchedule(lastTime)) { - WRITE_WARNING("Duplicate schedule for '" + pars.line + "' at time " + time2string(lastTime) + "."); + WRITE_WARNINGF("Duplicate schedule for '%' at time=%.", pars.line, time2string(lastTime)); } for (lineEdge = lineEdges.begin(), s = validStops.begin() + 1; lineEdge != lineEdges.end(); ++lineEdge, ++s) { (*lineEdge)->addSchedule(pars.id, lastTime, pars.repetitionNumber, pars.repetitionOffset, s->until - lastTime); diff -Nru sumo-1.11.0/src/utils/router/IntermodalRouter.h sumo-1.12.0/src/utils/router/IntermodalRouter.h --- sumo-1.11.0/src/utils/router/IntermodalRouter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/IntermodalRouter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -109,17 +109,18 @@ /** @brief Builds the route between the given edges using the minimum effort at the given time The definition of the effort depends on the wished routing scheme */ - bool compute(const E* from, const E* to, const double departPos, const double arrivalPos, - const std::string stopID, const double speed, - const V* const vehicle, const SVCPermissions modeSet, const SUMOTime msTime, + bool compute(const E* from, const E* to, + const double departPos, const std::string& originStopID, + const double arrivalPos, const std::string& stopID, + const double speed, const V* const vehicle, const SVCPermissions modeSet, const SUMOTime msTime, std::vector& into, const double externalFactor = 0.) { createNet(); _IntermodalTrip trip(from, to, departPos, arrivalPos, speed, msTime, 0, vehicle, modeSet, myExternalEffort, externalFactor); std::vector intoEdges; //std::cout << "compute from=" << from->getID() << " to=" << to->getID() << " dPos=" << departPos << " aPos=" << arrivalPos << " stopID=" << stopID << " speed=" << speed << " veh=" << Named::getIDSecure(vehicle) << " modeSet=" << modeSet << " t=" << msTime << " iFrom=" << myIntermodalNet->getDepartEdge(from, trip.departPos)->getID() << " iTo=" << (stopID != "" ? myIntermodalNet->getStopEdge(stopID) : myIntermodalNet->getArrivalEdge(to, trip.arrivalPos))->getID() << "\n"; - const bool success = myInternalRouter->compute(myIntermodalNet->getDepartEdge(from, trip.departPos), - stopID != "" ? myIntermodalNet->getStopEdge(stopID) : myIntermodalNet->getArrivalEdge(to, trip.arrivalPos), - &trip, msTime, intoEdges); + const _IntermodalEdge* iFrom = originStopID != "" ? myIntermodalNet->getStopEdge(originStopID) : myIntermodalNet->getDepartEdge(from, trip.departPos); + const _IntermodalEdge* iTo = stopID != "" ? myIntermodalNet->getStopEdge(stopID) : myIntermodalNet->getArrivalEdge(to, trip.arrivalPos); + const bool success = myInternalRouter->compute(iFrom, iTo, &trip, msTime, intoEdges); if (success) { std::string lastLine = ""; double time = STEPS2TIME(msTime); diff -Nru sumo-1.11.0/src/utils/router/IntermodalTrip.h sumo-1.12.0/src/utils/router/IntermodalTrip.h --- sumo-1.11.0/src/utils/router/IntermodalTrip.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/IntermodalTrip.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/LogitCalculator.h sumo-1.12.0/src/utils/router/LogitCalculator.h --- sumo-1.11.0/src/utils/router/LogitCalculator.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/LogitCalculator.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/PedestrianEdge.h sumo-1.12.0/src/utils/router/PedestrianEdge.h --- sumo-1.11.0/src/utils/router/PedestrianEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/PedestrianEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/PedestrianRouter.h sumo-1.12.0/src/utils/router/PedestrianRouter.h --- sumo-1.11.0/src/utils/router/PedestrianRouter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/PedestrianRouter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/PublicTransportEdge.h sumo-1.12.0/src/utils/router/PublicTransportEdge.h --- sumo-1.11.0/src/utils/router/PublicTransportEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/PublicTransportEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/RailEdge.h sumo-1.12.0/src/utils/router/RailEdge.h --- sumo-1.11.0/src/utils/router/RailEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/RailEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/RailwayRouter.h sumo-1.12.0/src/utils/router/RailwayRouter.h --- sumo-1.11.0/src/utils/router/RailwayRouter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/RailwayRouter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -112,7 +112,7 @@ while (backDist > 0) { const E* prev = getStraightPredecessor(start); if (prev == nullptr) { - //WRITE_WARNING("Could not determine back edge for vehicle '" + vehicle->getID() + "' when routing from edge '" + from->getID() + "' at time " + time2string(msTime)); + //WRITE_WARNING("Could not determine back edge for vehicle '" + vehicle->getID() + "' when routing from edge '" + from->getID() + "' at time=" + time2string(msTime)); break; } backDist -= prev->getLength(); diff -Nru sumo-1.11.0/src/utils/router/ReversedEdge.h sumo-1.12.0/src/utils/router/ReversedEdge.h --- sumo-1.11.0/src/utils/router/ReversedEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/ReversedEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/RouteCostCalculator.h sumo-1.12.0/src/utils/router/RouteCostCalculator.h --- sumo-1.11.0/src/utils/router/RouteCostCalculator.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/RouteCostCalculator.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/RouterProvider.h sumo-1.12.0/src/utils/router/RouterProvider.h --- sumo-1.11.0/src/utils/router/RouterProvider.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/RouterProvider.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/SPTree.h sumo-1.12.0/src/utils/router/SPTree.h --- sumo-1.11.0/src/utils/router/SPTree.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/SPTree.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/StopEdge.h sumo-1.12.0/src/utils/router/StopEdge.h --- sumo-1.11.0/src/utils/router/StopEdge.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/StopEdge.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/router/SUMOAbstractRouter.h sumo-1.12.0/src/utils/router/SUMOAbstractRouter.h --- sumo-1.11.0/src/utils/router/SUMOAbstractRouter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/router/SUMOAbstractRouter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2006-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2006-2022 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/ diff -Nru sumo-1.11.0/src/utils/shapes/PointOfInterest.h sumo-1.12.0/src/utils/shapes/PointOfInterest.h --- sumo-1.11.0/src/utils/shapes/PointOfInterest.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/shapes/PointOfInterest.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ diff -Nru sumo-1.11.0/src/utils/shapes/PolygonDynamics.cpp sumo-1.12.0/src/utils/shapes/PolygonDynamics.cpp --- sumo-1.11.0/src/utils/shapes/PolygonDynamics.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/shapes/PolygonDynamics.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/shapes/PolygonDynamics.h sumo-1.12.0/src/utils/shapes/PolygonDynamics.h --- sumo-1.11.0/src/utils/shapes/PolygonDynamics.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/shapes/PolygonDynamics.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/shapes/ShapeContainer.cpp sumo-1.12.0/src/utils/shapes/ShapeContainer.cpp --- sumo-1.11.0/src/utils/shapes/ShapeContainer.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/shapes/ShapeContainer.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/shapes/ShapeContainer.h sumo-1.12.0/src/utils/shapes/ShapeContainer.h --- sumo-1.11.0/src/utils/shapes/ShapeContainer.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/shapes/ShapeContainer.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2005-2022 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/ diff -Nru sumo-1.11.0/src/utils/shapes/Shape.cpp sumo-1.12.0/src/utils/shapes/Shape.cpp --- sumo-1.11.0/src/utils/shapes/Shape.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/shapes/Shape.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/utils/shapes/Shape.h sumo-1.12.0/src/utils/shapes/Shape.h --- sumo-1.11.0/src/utils/shapes/Shape.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/shapes/Shape.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/utils/shapes/ShapeHandler.cpp sumo-1.12.0/src/utils/shapes/ShapeHandler.cpp --- sumo-1.11.0/src/utils/shapes/ShapeHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/shapes/ShapeHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/shapes/ShapeHandler.h sumo-1.12.0/src/utils/shapes/ShapeHandler.h --- sumo-1.11.0/src/utils/shapes/ShapeHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/shapes/ShapeHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/shapes/SUMOPolygon.cpp sumo-1.12.0/src/utils/shapes/SUMOPolygon.cpp --- sumo-1.11.0/src/utils/shapes/SUMOPolygon.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/shapes/SUMOPolygon.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/shapes/SUMOPolygon.h sumo-1.12.0/src/utils/shapes/SUMOPolygon.h --- sumo-1.11.0/src/utils/shapes/SUMOPolygon.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/shapes/SUMOPolygon.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2004-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2004-2022 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/ diff -Nru sumo-1.11.0/src/utils/threadpool/TaskQueue.h sumo-1.12.0/src/utils/threadpool/TaskQueue.h --- sumo-1.11.0/src/utils/threadpool/TaskQueue.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/threadpool/TaskQueue.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2020-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2020-2022 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/ diff -Nru sumo-1.11.0/src/utils/threadpool/WorkStealingThreadPool.h sumo-1.12.0/src/utils/threadpool/WorkStealingThreadPool.h --- sumo-1.11.0/src/utils/threadpool/WorkStealingThreadPool.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/threadpool/WorkStealingThreadPool.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2020-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2020-2022 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/ diff -Nru sumo-1.11.0/src/utils/traci/TraCIAPI.cpp sumo-1.12.0/src/utils/traci/TraCIAPI.cpp --- sumo-1.11.0/src/utils/traci/TraCIAPI.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/traci/TraCIAPI.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ @@ -1803,7 +1803,7 @@ content.writeInt(logic.currentPhaseIndex); content.writeUnsignedByte(libsumo::TYPE_COMPOUND); content.writeInt((int)logic.phases.size()); - for (const libsumo::TraCIPhase* p : logic.phases) { + for (const std::shared_ptr& p : logic.phases) { content.writeUnsignedByte(libsumo::TYPE_COMPOUND); content.writeInt(6); content.writeUnsignedByte(libsumo::TYPE_DOUBLE); diff -Nru sumo-1.11.0/src/utils/traci/TraCIAPI.h sumo-1.12.0/src/utils/traci/TraCIAPI.h --- sumo-1.11.0/src/utils/traci/TraCIAPI.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/traci/TraCIAPI.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/utils/traction_wire/Circuit.cpp sumo-1.12.0/src/utils/traction_wire/Circuit.cpp --- sumo-1.11.0/src/utils/traction_wire/Circuit.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/traction_wire/Circuit.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -33,9 +33,17 @@ #include #ifdef HAVE_EIGEN +#ifdef _MSC_VER +#pragma warning(push) +/* Disable "conditional expression is constant" warnings. */ +#pragma warning(disable: 4127) +#endif #include "Eigen/Dense" #include "Eigen/Sparse" #include "Eigen/Geometry" +#ifdef _MSC_VER +#pragma warning(pop) +#endif #endif #include "Element.h" diff -Nru sumo-1.11.0/src/utils/traction_wire/Circuit.h sumo-1.12.0/src/utils/traction_wire/Circuit.h --- sumo-1.11.0/src/utils/traction_wire/Circuit.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/traction_wire/Circuit.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/traction_wire/Element.cpp sumo-1.12.0/src/utils/traction_wire/Element.cpp --- sumo-1.11.0/src/utils/traction_wire/Element.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/traction_wire/Element.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/traction_wire/Element.h sumo-1.12.0/src/utils/traction_wire/Element.h --- sumo-1.11.0/src/utils/traction_wire/Element.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/traction_wire/Element.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/traction_wire/Node.cpp sumo-1.12.0/src/utils/traction_wire/Node.cpp --- sumo-1.11.0/src/utils/traction_wire/Node.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/traction_wire/Node.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/traction_wire/Node.h sumo-1.12.0/src/utils/traction_wire/Node.h --- sumo-1.11.0/src/utils/traction_wire/Node.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/traction_wire/Node.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/vehicle/SUMORouteHandler.cpp sumo-1.12.0/src/utils/vehicle/SUMORouteHandler.cpp --- sumo-1.11.0/src/utils/vehicle/SUMORouteHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/vehicle/SUMORouteHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -59,7 +59,7 @@ SUMORouteHandler::checkLastDepart() { if (myVehicleParameter->departProcedure == DEPART_GIVEN) { if (myVehicleParameter->depart < myLastDepart) { - WRITE_WARNING("Route file should be sorted by departure time, ignoring '" + myVehicleParameter->id + "'!"); + WRITE_WARNINGF("Route file should be sorted by departure time, ignoring '%'!", myVehicleParameter->id); return false; } } diff -Nru sumo-1.11.0/src/utils/vehicle/SUMORouteHandler.h sumo-1.12.0/src/utils/vehicle/SUMORouteHandler.h --- sumo-1.11.0/src/utils/vehicle/SUMORouteHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/vehicle/SUMORouteHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -191,7 +191,7 @@ //@} /// @brief Checks whether the route file is sorted by departure time if needed - bool checkLastDepart(); + virtual bool checkLastDepart(); /// @brief save last depart (only to be used if vehicle is not discarded) void registerLastDepart(); diff -Nru sumo-1.11.0/src/utils/vehicle/SUMORouteLoaderControl.cpp sumo-1.12.0/src/utils/vehicle/SUMORouteLoaderControl.cpp --- sumo-1.11.0/src/utils/vehicle/SUMORouteLoaderControl.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/vehicle/SUMORouteLoaderControl.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/vehicle/SUMORouteLoaderControl.h sumo-1.12.0/src/utils/vehicle/SUMORouteLoaderControl.h --- sumo-1.11.0/src/utils/vehicle/SUMORouteLoaderControl.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/vehicle/SUMORouteLoaderControl.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/vehicle/SUMORouteLoader.cpp sumo-1.12.0/src/utils/vehicle/SUMORouteLoader.cpp --- sumo-1.11.0/src/utils/vehicle/SUMORouteLoader.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/vehicle/SUMORouteLoader.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/vehicle/SUMORouteLoader.h sumo-1.12.0/src/utils/vehicle/SUMORouteLoader.h --- sumo-1.11.0/src/utils/vehicle/SUMORouteLoader.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/vehicle/SUMORouteLoader.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/vehicle/SUMOTrafficObject.h sumo-1.12.0/src/utils/vehicle/SUMOTrafficObject.h --- sumo-1.11.0/src/utils/vehicle/SUMOTrafficObject.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/vehicle/SUMOTrafficObject.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/vehicle/SUMOVehicle.h sumo-1.12.0/src/utils/vehicle/SUMOVehicle.h --- sumo-1.11.0/src/utils/vehicle/SUMOVehicle.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/vehicle/SUMOVehicle.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -93,6 +93,13 @@ */ virtual const MSEdge* succEdge(int nSuccs) const = 0; + /** @brief Returns the starting point for reroutes (usually the current edge) + * + * This differs from *myCurrEdge only if the vehicle is on an internal edge + * @return The rerouting start point + */ + virtual const MSEdge* getRerouteOrigin() const = 0; + /** @brief Replaces the current route by the given edges * * It is possible that the new route is not accepted, if a) it does not @@ -340,7 +347,7 @@ virtual SUMOTime getTimeLoss() const = 0; /// @brief get distance for coming to a stop (used for rerouting checks) - virtual double getBrakeGap() const = 0; + virtual double getBrakeGap(bool delayed = false) const = 0; /// @brief Returns this vehicles impatience virtual double getImpatience() const = 0; @@ -363,8 +370,16 @@ /// @brief Returns the vehicles's length virtual double getLength() const = 0; - virtual void rememberBlockedParkingArea(const MSParkingArea* pa) = 0; - virtual SUMOTime sawBlockedParkingArea(const MSParkingArea* pa) = 0; + /// @name parking memory io + //@{ + virtual void rememberBlockedParkingArea(const MSParkingArea* pa, bool local) = 0; + virtual SUMOTime sawBlockedParkingArea(const MSParkingArea* pa, bool local) const = 0; + virtual void rememberParkingAreaScore(const MSParkingArea* pa, const std::string& score) = 0; + virtual void resetParkingAreaScores() = 0; + virtual int getNumberParkingReroutes() const = 0; + virtual void setNumberParkingReroutes(int value) = 0; + //@} + /// @name state io //@{ diff -Nru sumo-1.11.0/src/utils/vehicle/SUMOVehicleParameter.cpp sumo-1.12.0/src/utils/vehicle/SUMOVehicleParameter.cpp --- sumo-1.11.0/src/utils/vehicle/SUMOVehicleParameter.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/vehicle/SUMOVehicleParameter.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -177,31 +177,33 @@ void -SUMOVehicleParameter::Stop::write(OutputDevice& dev, bool close) const { - dev.openTag(SUMO_TAG_STOP); - if (busstop != "") { - dev.writeAttr(SUMO_ATTR_BUS_STOP, busstop); - } - if (containerstop != "") { - dev.writeAttr(SUMO_ATTR_CONTAINER_STOP, containerstop); - } - if (chargingStation != "") { - dev.writeAttr(SUMO_ATTR_CHARGING_STATION, chargingStation); - } - if (parkingarea != "") { - dev.writeAttr(SUMO_ATTR_PARKING_AREA, parkingarea); - } - if ((busstop == "") && (containerstop == "") && (parkingarea == "") && (chargingStation == "")) { - if (lane != "") { - dev.writeAttr(SUMO_ATTR_LANE, lane); - } else { - dev.writeAttr(SUMO_ATTR_EDGE, edge); - } - if ((parametersSet & STOP_START_SET) != 0) { - dev.writeAttr(SUMO_ATTR_STARTPOS, startPos); - } - if ((parametersSet & STOP_END_SET) != 0) { - dev.writeAttr(SUMO_ATTR_ENDPOS, endPos); +SUMOVehicleParameter::Stop::write(OutputDevice& dev, const bool close, const bool writeTagAndParents) const { + if (writeTagAndParents) { + dev.openTag(SUMO_TAG_STOP); + if (busstop != "") { + dev.writeAttr(SUMO_ATTR_BUS_STOP, busstop); + } + if (containerstop != "") { + dev.writeAttr(SUMO_ATTR_CONTAINER_STOP, containerstop); + } + if (chargingStation != "") { + dev.writeAttr(SUMO_ATTR_CHARGING_STATION, chargingStation); + } + if (parkingarea != "") { + dev.writeAttr(SUMO_ATTR_PARKING_AREA, parkingarea); + } + if ((busstop == "") && (containerstop == "") && (parkingarea == "") && (chargingStation == "")) { + if (lane != "") { + dev.writeAttr(SUMO_ATTR_LANE, lane); + } else { + dev.writeAttr(SUMO_ATTR_EDGE, edge); + } + if ((parametersSet & STOP_START_SET) != 0) { + dev.writeAttr(SUMO_ATTR_STARTPOS, startPos); + } + if ((parametersSet & STOP_END_SET) != 0) { + dev.writeAttr(SUMO_ATTR_ENDPOS, endPos); + } } } if ((parametersSet & STOP_POSLAT_SET) != 0 && posLat != INVALID_DOUBLE) { @@ -229,13 +231,13 @@ if ((parametersSet & STOP_PARKING_SET) != 0) { dev.writeAttr(SUMO_ATTR_PARKING, parking); } - if ((parametersSet & STOP_EXPECTED_SET) != 0) { + if ((parametersSet & STOP_EXPECTED_SET) != 0 && awaitedPersons.size() > 0) { dev.writeAttr(SUMO_ATTR_EXPECTED, awaitedPersons); } - if ((parametersSet & STOP_PERMITTED_SET) != 0) { + if ((parametersSet & STOP_PERMITTED_SET) != 0 && permitted.size() > 0) { dev.writeAttr(SUMO_ATTR_PERMITTED, permitted); } - if ((parametersSet & STOP_EXPECTED_CONTAINERS_SET) != 0) { + if ((parametersSet & STOP_EXPECTED_CONTAINERS_SET) != 0 && awaitedContainers.size() > 0) { dev.writeAttr(SUMO_ATTR_EXPECTED_CONTAINERS, awaitedContainers); } if ((parametersSet & STOP_TRIP_ID_SET) != 0) { @@ -423,6 +425,10 @@ dsd = DepartSpeedDefinition::DESIRED; } else if (val == "speedLimit") { dsd = DepartSpeedDefinition::LIMIT; + } else if (val == "last") { + dsd = DepartSpeedDefinition::LAST; + } else if (val == "avg") { + dsd = DepartSpeedDefinition::AVG; } else { try { speed = StringUtils::toDouble(val); @@ -806,6 +812,9 @@ case DepartSpeedDefinition::LIMIT: val = "speedLimit"; break; + case DepartSpeedDefinition::LAST: + val = "last"; + break; case DepartSpeedDefinition::DEFAULT: default: break; diff -Nru sumo-1.11.0/src/utils/vehicle/SUMOVehicleParameter.h sumo-1.12.0/src/utils/vehicle/SUMOVehicleParameter.h --- sumo-1.11.0/src/utils/vehicle/SUMOVehicleParameter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/vehicle/SUMOVehicleParameter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -206,7 +206,11 @@ /// @brief The maximum lane speed is used (speedLimit * speedFactor) DESIRED, /// @brief The maximum lane speed is used (speedLimit) - LIMIT + LIMIT, + /// @brief The speed of the last vehicle. Fallback to DepartSpeedDefinition::DESIRED if there is no vehicle on the departLane yet. + LAST, + /// @brief The average speed on the lane. Fallback to DepartSpeedDefinition::DESIRED if there is no vehicle on the departLane yet. + AVG }; @@ -331,7 +335,7 @@ * @param[in, out] dev The device to write into * @exception IOError not yet implemented */ - void write(OutputDevice& dev, bool close = true) const; + void write(OutputDevice& dev, const bool close = true, const bool writeTagAndParents = true) const; /// @brief write trigger attribute void writeTriggers(OutputDevice& dev) const; diff -Nru sumo-1.11.0/src/utils/vehicle/SUMOVehicleParserHelper.cpp sumo-1.12.0/src/utils/vehicle/SUMOVehicleParserHelper.cpp --- sumo-1.11.0/src/utils/vehicle/SUMOVehicleParserHelper.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/vehicle/SUMOVehicleParserHelper.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2008-2022 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/ @@ -56,7 +56,7 @@ SUMOVehicleParserHelper::parseFlowAttributes(SumoXMLTag tag, const SUMOSAXAttributes& attrs, const bool hardFail, const bool needID, const SUMOTime beginDefault, const SUMOTime endDefault) { // first parse ID - std::string id = parseID(attrs, tag); + const std::string id = attrs.hasAttribute(SUMO_ATTR_ID) ? parseID(attrs, tag) : ""; // check if ID is valid if (!needID || !id.empty()) { if (needID && !SUMOXMLDefinitions::isValidVehicleID(id)) { @@ -649,7 +649,7 @@ double calibratorSpeed = attrs.get(SUMO_ATTR_SPEED, ret->id.c_str(), ok); if (!ok) { handleVehicleError(true, ret); - } else if (calibratorSpeed >= 0) { + } else if (calibratorSpeed >= 0 || calibratorSpeed == -1) { ret->parametersSet |= VEHPARS_CALIBRATORSPEED_SET; ret->calibratorSpeed = calibratorSpeed; } else { @@ -814,7 +814,7 @@ } if (attrs.hasAttribute(SUMO_ATTR_GUISHAPE)) { vType->shape = parseGuiShape(attrs, vType->id); - if (vType->shape != SVS_UNKNOWN) { + if (vType->shape != SUMOVehicleShape::UNKNOWN) { vType->parametersSet |= VTYPEPARS_SHAPE_SET; } } @@ -1139,14 +1139,6 @@ default: break; } - // special check for TAU attribute - if (it == SUMO_ATTR_TAU) { - // check tau in time format - if ((string2time(parsedCFMAttribute) < DELTA_T) && gSimulation) { - WRITE_WARNING("Value of tau=" + parsedCFMAttribute + " in car following model '" + - toString(into->cfModel) + "' lower than simulation step size may cause collisions"); - } - } // add parsedCFMAttribute to cfParameter into->cfParameter[it] = parsedCFMAttribute; } @@ -1415,7 +1407,7 @@ lc2013Params.insert(SUMO_ATTR_LCA_SIGMA); lc2013Params.insert(SUMO_ATTR_LCA_KEEPRIGHT_ACCEPTANCE_TIME); lc2013Params.insert(SUMO_ATTR_LCA_EXPERIMENTAL1); - allowedLCModelAttrs[LCM_LC2013] = lc2013Params; + allowedLCModelAttrs[LaneChangeModel::LC2013] = lc2013Params; // sl2015 (extension of lc2013) std::set sl2015Params = lc2013Params; sl2015Params.insert(SUMO_ATTR_LCA_PUSHY); @@ -1426,13 +1418,13 @@ sl2015Params.insert(SUMO_ATTR_LCA_ACCEL_LAT); sl2015Params.insert(SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE); sl2015Params.insert(SUMO_ATTR_LCA_LANE_DISCIPLINE); - allowedLCModelAttrs[LCM_SL2015] = sl2015Params; + allowedLCModelAttrs[LaneChangeModel::SL2015] = sl2015Params; // DK2008 std::set noParams; - allowedLCModelAttrs[LCM_DK2008] = noParams; + allowedLCModelAttrs[LaneChangeModel::DK2008] = noParams; // default model may be either LC2013 or SL2015 // we allow both sets (sl2015 is a superset of lc2013Params) - allowedLCModelAttrs[LCM_DEFAULT] = sl2015Params; + allowedLCModelAttrs[LaneChangeModel::DEFAULT] = sl2015Params; } std::set allowed = allowedLCModelAttrs[model]; // iterate over LCM attributes @@ -1588,7 +1580,7 @@ return result; } else { WRITE_ERROR("The shape '" + vclassS + "' for " + attrs.getObjectType() + " '" + id + "' is not known."); - return SVS_UNKNOWN; + return SUMOVehicleShape::UNKNOWN; } } diff -Nru sumo-1.11.0/src/utils/vehicle/SUMOVehicleParserHelper.h sumo-1.12.0/src/utils/vehicle/SUMOVehicleParserHelper.h --- sumo-1.11.0/src/utils/vehicle/SUMOVehicleParserHelper.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/vehicle/SUMOVehicleParserHelper.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/src/utils/vehicle/SUMOVTypeParameter.cpp sumo-1.12.0/src/utils/vehicle/SUMOVTypeParameter.cpp --- sumo-1.11.0/src/utils/vehicle/SUMOVTypeParameter.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/vehicle/SUMOVTypeParameter.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -44,7 +44,7 @@ maxSpeed(200. / 3.6), width(1.8), height(1.5), - shape(SVS_UNKNOWN), + shape(SUMOVehicleShape::UNKNOWN), emissionClass(PollutantsInterface::getClassByName(EMPREFIX + "PC_G_EU4", vclass)), speedFactor("normc", 1.0, 0.0, 0.2, 2.0), personCapacity(4), @@ -59,7 +59,7 @@ maxSpeed = DEFAULT_PEDESTRIAN_SPEED; width = 0.478; height = 1.719; - shape = SVS_PEDESTRIAN; + shape = SUMOVehicleShape::PEDESTRIAN; emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "zero", vclass); speedFactor.getParameter()[1] = 0.1; break; @@ -68,7 +68,7 @@ maxSpeed = 20. / 3.6; width = 0.65; height = 1.7; - shape = SVS_BICYCLE; + shape = SUMOVehicleShape::BICYCLE; personCapacity = 1; emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "zero", vclass); speedFactor.getParameter()[1] = 0.1; @@ -77,7 +77,7 @@ maxSpeed = 60. / 3.6; width = 0.78; height = 1.7; - shape = SVS_MOPED; + shape = SUMOVehicleShape::MOPED; personCapacity = 1; emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "LDV_G_EU6", vclass); speedFactor.getParameter()[1] = 0.1; @@ -85,7 +85,7 @@ case SVC_MOTORCYCLE: width = 0.9; height = 1.5; - shape = SVS_MOTORCYCLE; + shape = SUMOVehicleShape::MOTORCYCLE; personCapacity = 1; emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "LDV_G_EU6", vclass); speedFactor.getParameter()[1] = 0.1; @@ -94,7 +94,7 @@ maxSpeed = 130. / 3.6; width = 2.4; height = 2.4; - shape = SVS_TRUCK; + shape = SUMOVehicleShape::TRUCK; osgFile = "car-microcargo-citrus.obj"; personCapacity = 2; containerCapacity = 1; @@ -105,7 +105,7 @@ maxSpeed = 130. / 3.6; width = 2.55; height = 4.; - shape = SVS_TRUCK_1TRAILER; + shape = SUMOVehicleShape::TRUCK_1TRAILER; osgFile = "car-microcargo-citrus.obj"; personCapacity = 2; containerCapacity = 2; @@ -116,7 +116,7 @@ maxSpeed = 100. / 3.6; width = 2.5; height = 3.4; - shape = SVS_BUS; + shape = SUMOVehicleShape::BUS; osgFile = "car-minibus-citrus.obj"; personCapacity = 85; emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "Bus", vclass); @@ -125,7 +125,7 @@ maxSpeed = 100. / 3.6; width = 2.6; height = 4.; - shape = SVS_BUS_COACH; + shape = SUMOVehicleShape::BUS_COACH; osgFile = "car-minibus-citrus.obj"; personCapacity = 70; emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "Coach", vclass); @@ -135,7 +135,7 @@ maxSpeed = 80. / 3.6; width = 2.4; height = 3.2; - shape = SVS_RAIL_CAR; + shape = SUMOVehicleShape::RAIL_CAR; osgFile = "tram.obj"; carriageLength = 5.71; // http://de.wikipedia.org/wiki/Bombardier_Flexity_Berlin locomotiveLength = 5.71; @@ -147,7 +147,7 @@ minGap = 5; width = 3.0; height = 3.6; - shape = SVS_RAIL_CAR; + shape = SUMOVehicleShape::RAIL_CAR; carriageLength = 18.4; // https://en.wikipedia.org/wiki/DBAG_Class_481 locomotiveLength = 18.4; personCapacity = 300; @@ -158,7 +158,7 @@ minGap = 5; width = 2.84; height = 3.75; - shape = SVS_RAIL; + shape = SUMOVehicleShape::RAIL; carriageLength = 24.5; // http://de.wikipedia.org/wiki/UIC-Y-Wagen_%28DR%29 locomotiveLength = 16.4; // https://en.wikipedia.org/wiki/DB_Class_218 personCapacity = 434; @@ -170,7 +170,7 @@ minGap = 5; width = 2.95; height = 3.89; - shape = SVS_RAIL; + shape = SUMOVehicleShape::RAIL; carriageLength = 24.775; locomotiveLength = 19.100; // https://en.wikipedia.org/wiki/DB_Class_101 personCapacity = 425; @@ -181,7 +181,7 @@ minGap = 5; width = 2.95; height = 3.89; - shape = SVS_RAIL; + shape = SUMOVehicleShape::RAIL; carriageLength = 24.775; // http://de.wikipedia.org/wiki/ICE_3 locomotiveLength = 25.835; personCapacity = 425; @@ -190,7 +190,7 @@ case SVC_DELIVERY: width = 2.16; height = 2.86; - shape = SVS_DELIVERY; + shape = SUMOVehicleShape::DELIVERY; personCapacity = 2; emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "LDV", vclass); speedFactor.getParameter()[1] = 0.05; @@ -198,7 +198,7 @@ case SVC_EMERGENCY: width = 2.16; height = 2.86; - shape = SVS_DELIVERY; + shape = SUMOVehicleShape::DELIVERY; personCapacity = 2; emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "LDV", vclass); break; @@ -208,15 +208,15 @@ case SVC_HOV: case SVC_CUSTOM1: case SVC_CUSTOM2: - shape = SVS_PASSENGER; + shape = SUMOVehicleShape::PASSENGER; speedFactor.getParameter()[1] = 0.1; break; case SVC_TAXI: - shape = SVS_PASSENGER; + shape = SUMOVehicleShape::PASSENGER; speedFactor.getParameter()[1] = 0.05; break; case SVC_E_VEHICLE: - shape = SVS_E_VEHICLE; + shape = SUMOVehicleShape::E_VEHICLE; emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "zero", vclass); speedFactor.getParameter()[1] = 0.1; break; @@ -224,7 +224,7 @@ width = 4; maxSpeed = 8 / 1.94; // 8 knots height = 4; - shape = SVS_SHIP; + shape = SUMOVehicleShape::SHIP; // slight understatement (-: emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "HDV_D_EU0", vclass); speedFactor.getParameter()[1] = 0.1; @@ -256,10 +256,10 @@ loadingDuration(90000), width(1.8), height(1.5), - shape(SVS_UNKNOWN), + shape(SUMOVehicleShape::UNKNOWN), osgFile("car-normal-citrus.obj"), cfModel(SUMO_TAG_CF_KRAUSS), - lcModel(LCM_DEFAULT), + lcModel(LaneChangeModel::DEFAULT), maxSpeedLat(1.0), latAlignmentOffset(0.0), latAlignmentProcedure(LatAlignmentDefinition::CENTER), @@ -299,7 +299,7 @@ speedFactor.getParameter()[1] = defaultSpeedDev; } } else { - speedFactor.getParameter()[1] = 0; + speedFactor.getParameter()[1] = -1; } setManoeuverAngleTimes(vclass); } @@ -610,25 +610,25 @@ parametersSet |= VTYPEPARS_CARRIAGE_LENGTH_SET; } else { switch (shape) { - case SVS_BUS_FLEXIBLE: + case SUMOVehicleShape::BUS_FLEXIBLE: carriageLength = 8.25; // 16.5 overall, 2 modules http://de.wikipedia.org/wiki/Ikarus_180 carriageGap = 0; break; - case SVS_RAIL: + case SUMOVehicleShape::RAIL: carriageLength = 24.5; // http://de.wikipedia.org/wiki/UIC-Y-Wagen_%28DR%29 break; - case SVS_RAIL_CAR: + case SUMOVehicleShape::RAIL_CAR: carriageLength = 16.85; // 67.4m overall, 4 carriages http://de.wikipedia.org/wiki/DB-Baureihe_423 break; - case SVS_RAIL_CARGO: + case SUMOVehicleShape::RAIL_CARGO: carriageLength = 13.86; // UIC 571-1 http://de.wikipedia.org/wiki/Flachwagen break; - case SVS_TRUCK_SEMITRAILER: + case SUMOVehicleShape::TRUCK_SEMITRAILER: carriageLength = 13.5; locomotiveLength = 2.5; carriageGap = 0.5; break; - case SVS_TRUCK_1TRAILER: + case SUMOVehicleShape::TRUCK_1TRAILER: carriageLength = 6.75; locomotiveLength = 2.5 + 6.75; carriageGap = 0.5; @@ -652,28 +652,28 @@ parametersSet |= VTYPEPARS_FRONT_SEAT_POS_SET; } else { switch (shape) { - case SVS_SHIP: + case SUMOVehicleShape::SHIP: frontSeatPos = 5; break; - case SVS_DELIVERY: + case SUMOVehicleShape::DELIVERY: frontSeatPos = 1.2; break; - case SVS_BICYCLE: + case SUMOVehicleShape::BICYCLE: frontSeatPos = 0.6; break; - case SVS_MOPED: - case SVS_MOTORCYCLE: + case SUMOVehicleShape::MOPED: + case SUMOVehicleShape::MOTORCYCLE: frontSeatPos = 0.9; break; - case SVS_BUS: - case SVS_BUS_COACH: - case SVS_BUS_FLEXIBLE: - case SVS_BUS_TROLLEY: + case SUMOVehicleShape::BUS: + case SUMOVehicleShape::BUS_COACH: + case SUMOVehicleShape::BUS_FLEXIBLE: + case SUMOVehicleShape::BUS_TROLLEY: frontSeatPos = 0.5; break; - case SVS_TRUCK: - case SVS_TRUCK_1TRAILER: - case SVS_TRUCK_SEMITRAILER: + case SUMOVehicleShape::TRUCK: + case SUMOVehicleShape::TRUCK_1TRAILER: + case SUMOVehicleShape::TRUCK_SEMITRAILER: frontSeatPos = 0.8; break; default: diff -Nru sumo-1.11.0/src/utils/vehicle/SUMOVTypeParameter.h sumo-1.12.0/src/utils/vehicle/SUMOVTypeParameter.h --- sumo-1.11.0/src/utils/vehicle/SUMOVTypeParameter.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/vehicle/SUMOVTypeParameter.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/CommonXMLStructure.cpp sumo-1.12.0/src/utils/xml/CommonXMLStructure.cpp --- sumo-1.11.0/src/utils/xml/CommonXMLStructure.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/CommonXMLStructure.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/CommonXMLStructure.h sumo-1.12.0/src/utils/xml/CommonXMLStructure.h --- sumo-1.11.0/src/utils/xml/CommonXMLStructure.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/CommonXMLStructure.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/GenericSAXHandler.cpp sumo-1.12.0/src/utils/xml/GenericSAXHandler.cpp --- sumo-1.11.0/src/utils/xml/GenericSAXHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/GenericSAXHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/GenericSAXHandler.h sumo-1.12.0/src/utils/xml/GenericSAXHandler.h --- sumo-1.11.0/src/utils/xml/GenericSAXHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/GenericSAXHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/IStreamInputSource.h sumo-1.12.0/src/utils/xml/IStreamInputSource.h --- sumo-1.11.0/src/utils/xml/IStreamInputSource.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/IStreamInputSource.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/SAXWeightsHandler.cpp sumo-1.12.0/src/utils/xml/SAXWeightsHandler.cpp --- sumo-1.11.0/src/utils/xml/SAXWeightsHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/SAXWeightsHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/SAXWeightsHandler.h sumo-1.12.0/src/utils/xml/SAXWeightsHandler.h --- sumo-1.11.0/src/utils/xml/SAXWeightsHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/SAXWeightsHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/SUMOSAXAttributes.cpp sumo-1.12.0/src/utils/xml/SUMOSAXAttributes.cpp --- sumo-1.11.0/src/utils/xml/SUMOSAXAttributes.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/SUMOSAXAttributes.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/SUMOSAXAttributes.h sumo-1.12.0/src/utils/xml/SUMOSAXAttributes.h --- sumo-1.11.0/src/utils/xml/SUMOSAXAttributes.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/SUMOSAXAttributes.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/SUMOSAXAttributesImpl_Cached.cpp sumo-1.12.0/src/utils/xml/SUMOSAXAttributesImpl_Cached.cpp --- sumo-1.11.0/src/utils/xml/SUMOSAXAttributesImpl_Cached.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/SUMOSAXAttributesImpl_Cached.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/SUMOSAXAttributesImpl_Cached.h sumo-1.12.0/src/utils/xml/SUMOSAXAttributesImpl_Cached.h --- sumo-1.11.0/src/utils/xml/SUMOSAXAttributesImpl_Cached.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/SUMOSAXAttributesImpl_Cached.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp sumo-1.12.0/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp --- sumo-1.11.0/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h sumo-1.12.0/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h --- sumo-1.11.0/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/SUMOSAXHandler.cpp sumo-1.12.0/src/utils/xml/SUMOSAXHandler.cpp --- sumo-1.11.0/src/utils/xml/SUMOSAXHandler.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/SUMOSAXHandler.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/SUMOSAXHandler.h sumo-1.12.0/src/utils/xml/SUMOSAXHandler.h --- sumo-1.11.0/src/utils/xml/SUMOSAXHandler.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/SUMOSAXHandler.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/SUMOSAXReader.cpp sumo-1.12.0/src/utils/xml/SUMOSAXReader.cpp --- sumo-1.11.0/src/utils/xml/SUMOSAXReader.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/SUMOSAXReader.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/SUMOSAXReader.h sumo-1.12.0/src/utils/xml/SUMOSAXReader.h --- sumo-1.11.0/src/utils/xml/SUMOSAXReader.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/SUMOSAXReader.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/SUMOXMLDefinitions.cpp sumo-1.12.0/src/utils/xml/SUMOXMLDefinitions.cpp --- sumo-1.11.0/src/utils/xml/SUMOXMLDefinitions.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/SUMOXMLDefinitions.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -87,10 +87,13 @@ { "overheadWireClamp", SUMO_TAG_OVERHEAD_WIRE_CLAMP }, { "vTypeProbe", SUMO_TAG_VTYPEPROBE }, { "routes", SUMO_TAG_ROUTES }, + { "trip", SUMO_TAG_TRIP }, + { "tripJunctions", GNE_TAG_TRIP_JUNCTIONS }, { "vehicle", SUMO_TAG_VEHICLE }, + { "vehicleWithRoute", GNE_TAG_VEHICLE_WITHROUTE }, { "vType", SUMO_TAG_VTYPE }, - { "pType", SUMO_TAG_PTYPE }, { "route", SUMO_TAG_ROUTE }, + { "routeEmbedded", GNE_TAG_ROUTE_EMBEDDED }, { "request", SUMO_TAG_REQUEST }, { "source", SUMO_TAG_SOURCE }, { "taz", SUMO_TAG_TAZ }, @@ -99,9 +102,10 @@ { "trafficLight", SUMO_TAG_TRAFFIC_LIGHT }, { "tlLogic", SUMO_TAG_TLLOGIC }, { "phase", SUMO_TAG_PHASE }, - { "trip", SUMO_TAG_TRIP }, + { "condition", SUMO_TAG_CONDITION }, { "tripTAZ", SUMO_TAG_TRIP_TAZ }, { "flow", SUMO_TAG_FLOW }, + { "flowJunctions", GNE_TAG_FLOW_JUNCTIONS }, { "flowState", SUMO_TAG_FLOWSTATE }, { "edgeRelation", SUMO_TAG_EDGEREL }, @@ -246,18 +250,18 @@ { "poiGeo", GNE_TAG_POIGEO }, { "rerouterSymbol", GNE_TAG_REROUTER_SYMBOL }, { "variableSpeedSignSymbol", GNE_TAG_VSS_SYMBOL }, - { "vehicleWithRoute", GNE_TAG_VEHICLE_WITHROUTE }, - { "routeEmbedded", GNE_TAG_ROUTE_EMBEDDED }, { "flowRoute", GNE_TAG_FLOW_ROUTE }, { "flowWithRoute", GNE_TAG_FLOW_WITHROUTE }, // GNE Person trips { "personTrip: edge->edge", GNE_TAG_PERSONTRIP_EDGE }, { "personTrip: edge->busStop", GNE_TAG_PERSONTRIP_BUSSTOP }, + { "personTrip: junctions", GNE_TAG_PERSONTRIP_JUNCTIONS }, // GNE Walks { "walk: edge->edge", GNE_TAG_WALK_EDGE }, { "walk: edge->busStop", GNE_TAG_WALK_BUSSTOP }, { "walk: edges", GNE_TAG_WALK_EDGES }, { "walk: route", GNE_TAG_WALK_ROUTE }, + { "walk: junctions", GNE_TAG_WALK_JUNCTIONS }, // GNE Rides { "ride: edge->edge", GNE_TAG_RIDE_EDGE }, { "ride: edge->busStop", GNE_TAG_RIDE_BUSSTOP }, @@ -292,6 +296,7 @@ { "waitingTime", SUMO_ATTR_WAITINGTIME }, { "timeLoss", SUMO_ATTR_TIMELOSS }, { "speed", SUMO_ATTR_SPEED }, + { "speedRelative", SUMO_ATTR_SPEEDREL }, { "departed", SUMO_ATTR_DEPARTED }, { "arrived", SUMO_ATTR_ARRIVED }, { "entered", SUMO_ATTR_ENTERED }, @@ -664,6 +669,10 @@ { "minDur", SUMO_ATTR_MINDURATION }, { "maxDur", SUMO_ATTR_MAXDURATION }, + { "earliestEnd", SUMO_ATTR_EARLIEST_END }, + { "latestEnd", SUMO_ATTR_LATEST_END }, + { "earlyTarget", SUMO_ATTR_EARLY_TARGET }, + { "finalTarget", SUMO_ATTR_FINAL_TARGET }, { "vehext", SUMO_ATTR_VEHICLEEXTENSION }, { "yellow", SUMO_ATTR_YELLOW }, { "red", SUMO_ATTR_RED }, @@ -814,6 +823,7 @@ { "tlsIgnoreInternalJunctionJam", SUMO_ATTR_TLS_IGNORE_INTERNAL_JUNCTION_JAM }, { "avoidOverlap", SUMO_ATTR_AVOID_OVERLAP }, { "junctionHigherSpeed", SUMO_ATTR_HIGHER_SPEED }, + { "internalJunctionsVehicleWidth", SUMO_ATTR_INTERNAL_JUNCTIONS_VEHICLE_WIDTH }, { "actorConfig", SUMO_ATTR_ACTORCONFIG }, { "startTime", SUMO_ATTR_STARTTIME }, @@ -874,6 +884,7 @@ { "parentItem", GNE_ATTR_PARENT }, { "dataSet", GNE_ATTR_DATASET }, { "genericParameter", GNE_ATTR_PARAMETERS }, + { "flowParameter", GNE_ATTR_FLOWPARAMETERS }, { "defaultVTypeModified", GNE_ATTR_DEFAULT_VTYPE_MODIFIED }, { "centerAfterCreation", GNE_ATTR_CENTER_AFTER_CREATION }, { "toBusStop", GNE_ATTR_TO_BUSSTOP }, @@ -882,6 +893,7 @@ { "shiftLaneIndex", GNE_ATTR_SHIFTLANEINDEX }, { "stopOffset", GNE_ATTR_STOPOFFSET }, { "stopOException", GNE_ATTR_STOPOEXCEPTION }, + { "VTypeDist.", GNE_ATTR_VTYPE_DISTRIBUTION }, { "carriageLength", SUMO_ATTR_CARRIAGE_LENGTH }, { "locomotiveLength", SUMO_ATTR_LOCOMOTIVE_LENGTH }, @@ -1053,10 +1065,10 @@ StringBijection::Entry SUMOXMLDefinitions::laneChangeModelValues[] = { - { "DK2008", LCM_DK2008 }, - { "LC2013", LCM_LC2013 }, - { "SL2015", LCM_SL2015 }, - { "default", LCM_DEFAULT } //< must be the last one + { "DK2008", LaneChangeModel::DK2008 }, + { "LC2013", LaneChangeModel::LC2013 }, + { "SL2015", LaneChangeModel::SL2015 }, + { "default", LaneChangeModel::DEFAULT } //< must be the last one }; StringBijection::Entry SUMOXMLDefinitions::carFollowModelValues[] = { @@ -1103,14 +1115,14 @@ }; StringBijection::Entry SUMOXMLDefinitions::trainTypeValues[] = { - { "NGT400", TRAINTYPE_NGT400 }, - { "NGT400_16", TRAINTYPE_NGT400_16 }, - { "RB425", TRAINTYPE_RB425 }, - { "RB628", TRAINTYPE_RB628 }, - { "ICE1", TRAINTYPE_ICE1 }, - { "REDosto7", TRAINTYPE_REDOSTO7 }, - { "Freight", TRAINTYPE_FREIGHT }, - { "ICE3", TRAINTYPE_ICE3 } + { "NGT400", TrainType::NGT400 }, + { "NGT400_16", TrainType::NGT400_16 }, + { "RB425", TrainType::RB425 }, + { "RB628", TrainType::RB628 }, + { "ICE1", TrainType::ICE1 }, + { "REDosto7", TrainType::REDOSTO7 }, + { "Freight", TrainType::FREIGHT }, + { "ICE3", TrainType::ICE3 } }; @@ -1151,7 +1163,7 @@ SUMOXMLDefinitions::trafficLightLayoutValues, TrafficLightLayout::DEFAULT); StringBijection SUMOXMLDefinitions::LaneChangeModels( - SUMOXMLDefinitions::laneChangeModelValues, LCM_DEFAULT); + SUMOXMLDefinitions::laneChangeModelValues, LaneChangeModel::DEFAULT); StringBijection SUMOXMLDefinitions::CarFollowModels( SUMOXMLDefinitions::carFollowModelValues, SUMO_TAG_CF_WIEDEMANN); @@ -1160,7 +1172,7 @@ SUMOXMLDefinitions::laneChangeActionValues, LCA_UNKNOWN); StringBijection SUMOXMLDefinitions::TrainTypes( - SUMOXMLDefinitions::trainTypeValues, TRAINTYPE_ICE3); + SUMOXMLDefinitions::trainTypeValues, TrainType::ICE3); std::string diff -Nru sumo-1.11.0/src/utils/xml/SUMOXMLDefinitions.h sumo-1.12.0/src/utils/xml/SUMOXMLDefinitions.h --- sumo-1.11.0/src/utils/xml/SUMOXMLDefinitions.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/SUMOXMLDefinitions.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ @@ -141,14 +141,20 @@ SUMO_TAG_VTYPEPROBE, /// @brief root element of a route file SUMO_TAG_ROUTES, + /// @brief a single trip definition (used by router) + SUMO_TAG_TRIP, + /// @brief a trip between junctions (used in NETEDIT) + GNE_TAG_TRIP_JUNCTIONS, /// @brief description of a vehicle SUMO_TAG_VEHICLE, - /// @brief description of a vehicle type + /// @brief description of a vehicle with an embedded route (used in NETEDIT) + GNE_TAG_VEHICLE_WITHROUTE, + /// @brief description of a vehicle/person/container type SUMO_TAG_VTYPE, - /// @brief description of a person type (used in NETEDIT) - SUMO_TAG_PTYPE, /// @brief begin/end of the description of a route SUMO_TAG_ROUTE, + /// @brief embedded route (used in NETEDIT) + GNE_TAG_ROUTE_EMBEDDED, /// @brief description of a logic request within the junction SUMO_TAG_REQUEST, /// @brief a source @@ -165,12 +171,14 @@ SUMO_TAG_TLLOGIC, /// @brief a single phase description SUMO_TAG_PHASE, - /// @brief a single trip definition (used by router) - SUMO_TAG_TRIP, + /// @brief a condition for phase switching + SUMO_TAG_CONDITION, /// @brief a single trip definition that uses TAZs (used in NETEDIT) SUMO_TAG_TRIP_TAZ, /// @brief a flow definitio nusing a from-to edges instead of a route (used by router) SUMO_TAG_FLOW, + /// @brief a flow between junctions (used in NETEDIT) + GNE_TAG_FLOW_JUNCTIONS, /// @brief a flow state definition (used when saving and loading simulatino state) SUMO_TAG_FLOWSTATE, /// @brief a relation between two edges @@ -394,36 +402,34 @@ GNE_TAG_REROUTER_SYMBOL, /// @brief VSS Symbol GNE_TAG_VSS_SYMBOL, - /// @brief description of a vehicle with an embedded route (used in NETEDIT) - GNE_TAG_VEHICLE_WITHROUTE, - /// @brief embedded route (used in NETEDIT) - GNE_TAG_ROUTE_EMBEDDED, /// @brief a flow definition using a route instead of a from-to edges route (used in NETEDIT) GNE_TAG_FLOW_ROUTE, /// @brief description of a vehicle with an embedded route (used in NETEDIT) GNE_TAG_FLOW_WITHROUTE, - // person trips + // @brief person trips GNE_TAG_PERSONTRIP_EDGE, GNE_TAG_PERSONTRIP_BUSSTOP, - // walks + GNE_TAG_PERSONTRIP_JUNCTIONS, + // @brief walks GNE_TAG_WALK_EDGE, GNE_TAG_WALK_BUSSTOP, GNE_TAG_WALK_EDGES, GNE_TAG_WALK_ROUTE, - // rides + GNE_TAG_WALK_JUNCTIONS, + // @brief rides GNE_TAG_RIDE_EDGE, GNE_TAG_RIDE_BUSSTOP, - // person stops + // @brief person stops GNE_TAG_STOPPERSON_BUSSTOP, GNE_TAG_STOPPERSON_EDGE, - // person trips + // @brief person trips GNE_TAG_TRANSPORT_EDGE, GNE_TAG_TRANSPORT_CONTAINERSTOP, - // walks + // @brief walks GNE_TAG_TRANSHIP_EDGE, GNE_TAG_TRANSHIP_CONTAINERSTOP, GNE_TAG_TRANSHIP_EDGES, - // container stops + // @brief container stops GNE_TAG_STOPCONTAINER_CONTAINERSTOP, GNE_TAG_STOPCONTAINER_EDGE, /// @} @@ -452,61 +458,62 @@ SUMO_ATTR_WAITINGTIME = 6, SUMO_ATTR_TIMELOSS = 7, SUMO_ATTR_SPEED = 8, - SUMO_ATTR_DEPARTED = 9, - SUMO_ATTR_ARRIVED = 10, - SUMO_ATTR_ENTERED = 11, - SUMO_ATTR_LEFT = 12, - SUMO_ATTR_VAPORIZED = 13, - SUMO_ATTR_TELEPORTED = 14, - SUMO_ATTR_TRAVELTIME = 15, - SUMO_ATTR_LANECHANGEDFROM = 16, - SUMO_ATTR_LANECHANGEDTO = 17, - SUMO_ATTR_OVERLAPTRAVELTIME = 18, + SUMO_ATTR_SPEEDREL = 9, + SUMO_ATTR_DEPARTED = 10, + SUMO_ATTR_ARRIVED = 11, + SUMO_ATTR_ENTERED = 12, + SUMO_ATTR_LEFT = 13, + SUMO_ATTR_VAPORIZED = 14, + SUMO_ATTR_TELEPORTED = 15, + SUMO_ATTR_TRAVELTIME = 16, + SUMO_ATTR_LANECHANGEDFROM = 17, + SUMO_ATTR_LANECHANGEDTO = 18, + SUMO_ATTR_OVERLAPTRAVELTIME = 19, /// MSMeanData_Emissions - SUMO_ATTR_CO_ABS = 19, - SUMO_ATTR_CO2_ABS = 20, - SUMO_ATTR_HC_ABS = 21, - SUMO_ATTR_PMX_ABS = 22, - SUMO_ATTR_NOX_ABS = 23, - SUMO_ATTR_FUEL_ABS = 24, - SUMO_ATTR_ELECTRICITY_ABS = 25, - SUMO_ATTR_CO_NORMED = 26, - SUMO_ATTR_CO2_NORMED = 27, - SUMO_ATTR_HC_NORMED = 28, - SUMO_ATTR_PMX_NORMED = 29, - SUMO_ATTR_NOX_NORMED = 30, - SUMO_ATTR_FUEL_NORMED = 31, - SUMO_ATTR_ELECTRICITY_NORMED = 32, - SUMO_ATTR_CO_PERVEH = 33, - SUMO_ATTR_CO2_PERVEH = 34, - SUMO_ATTR_HC_PERVEH = 35, - SUMO_ATTR_PMX_PERVEH = 36, - SUMO_ATTR_NOX_PERVEH = 37, - SUMO_ATTR_FUEL_PERVEH = 38, - SUMO_ATTR_ELECTRICITY_PERVEH = 39, + SUMO_ATTR_CO_ABS = 20, + SUMO_ATTR_CO2_ABS = 21, + SUMO_ATTR_HC_ABS = 22, + SUMO_ATTR_PMX_ABS = 23, + SUMO_ATTR_NOX_ABS = 24, + SUMO_ATTR_FUEL_ABS = 25, + SUMO_ATTR_ELECTRICITY_ABS = 26, + SUMO_ATTR_CO_NORMED = 27, + SUMO_ATTR_CO2_NORMED = 28, + SUMO_ATTR_HC_NORMED = 29, + SUMO_ATTR_PMX_NORMED = 30, + SUMO_ATTR_NOX_NORMED = 31, + SUMO_ATTR_FUEL_NORMED = 32, + SUMO_ATTR_ELECTRICITY_NORMED = 33, + SUMO_ATTR_CO_PERVEH = 34, + SUMO_ATTR_CO2_PERVEH = 35, + SUMO_ATTR_HC_PERVEH = 36, + SUMO_ATTR_PMX_PERVEH = 37, + SUMO_ATTR_NOX_PERVEH = 38, + SUMO_ATTR_FUEL_PERVEH = 39, + SUMO_ATTR_ELECTRICITY_PERVEH = 40, /// MSMeanData_Harmonoise - SUMO_ATTR_NOISE = 40, + SUMO_ATTR_NOISE = 41, /// MSMeanData_Amitran - SUMO_ATTR_AMOUNT = 41, - SUMO_ATTR_AVERAGESPEED = 42, + SUMO_ATTR_AMOUNT = 42, + SUMO_ATTR_AVERAGESPEED = 43, // FCD-Output - SUMO_ATTR_X = 43, - SUMO_ATTR_Y = 44, - SUMO_ATTR_Z = 45, - SUMO_ATTR_ANGLE = 46, - SUMO_ATTR_TYPE = 47, - SUMO_ATTR_POSITION = 48, - SUMO_ATTR_EDGE = 49, - SUMO_ATTR_LANE = 50, - SUMO_ATTR_SLOPE = 51, - SUMO_ATTR_SIGNALS = 52, - SUMO_ATTR_ACCELERATION = 53, - SUMO_ATTR_ACCELERATION_LAT = 54, - SUMO_ATTR_DISTANCE = 55, - SUMO_ATTR_LEADER_ID = 56, - SUMO_ATTR_LEADER_SPEED = 57, - SUMO_ATTR_LEADER_GAP = 58, - SUMO_ATTR_VEHICLE = 59, + SUMO_ATTR_X = 44, + SUMO_ATTR_Y = 45, + SUMO_ATTR_Z = 46, + SUMO_ATTR_ANGLE = 47, + SUMO_ATTR_TYPE = 48, + SUMO_ATTR_POSITION = 49, + SUMO_ATTR_EDGE = 50, + SUMO_ATTR_LANE = 51, + SUMO_ATTR_SLOPE = 52, + SUMO_ATTR_SIGNALS = 53, + SUMO_ATTR_ACCELERATION = 54, + SUMO_ATTR_ACCELERATION_LAT = 55, + SUMO_ATTR_DISTANCE = 56, + SUMO_ATTR_LEADER_ID = 57, + SUMO_ATTR_LEADER_SPEED = 58, + SUMO_ATTR_LEADER_GAP = 59, + SUMO_ATTR_VEHICLE = 60, /// @} /// @name common attributes @@ -980,6 +987,14 @@ SUMO_ATTR_MINDURATION, /// @brief maximum duration of a phase SUMO_ATTR_MAXDURATION, + /// @brief The minimum time within the cycle for switching (for coordinated actuation) + SUMO_ATTR_EARLIEST_END, + /// @brief The maximum time within the cycle for switching (for coordinated actuation) + SUMO_ATTR_LATEST_END, + /// @brief The condition expression for an early switch into this phase + SUMO_ATTR_EARLY_TARGET, + /// @brief The condition expression for switching into this phase when the active phase must end + SUMO_ATTR_FINAL_TARGET, /// @brief vehicle extension time of a phase SUMO_ATTR_VEHICLEEXTENSION, /// @brief yellow duration of a phase @@ -1146,6 +1161,7 @@ SUMO_ATTR_TLS_IGNORE_INTERNAL_JUNCTION_JAM, SUMO_ATTR_AVOID_OVERLAP, SUMO_ATTR_HIGHER_SPEED, + SUMO_ATTR_INTERNAL_JUNCTIONS_VEHICLE_WIDTH, SUMO_ATTR_COMMAND, SUMO_ATTR_ACTORCONFIG, @@ -1249,6 +1265,8 @@ GNE_ATTR_DATASET, /// @brief parameters "key1=value1|key2=value2|...|keyN=valueN" GNE_ATTR_PARAMETERS, + /// @brief flow parameters (integer for mask end, number, etc...) + GNE_ATTR_FLOWPARAMETERS, /// @brief min source (used only by TAZs) GNE_ATTR_MIN_SOURCE, /// @brief min sink (used only by TAZs) @@ -1281,6 +1299,8 @@ GNE_ATTR_STOPOFFSET, /// @brief stop exceptions (virtual, used by edge and lanes) GNE_ATTR_STOPOEXCEPTION, + /// @brief vehicle type distribution + GNE_ATTR_VTYPE_DISTRIBUTION, // @} @@ -1468,21 +1488,21 @@ */ enum class LinkDirection { /// @brief The link is a (hard) right direction - RIGHT = 0, + RIGHT = 1 << 0, /// @brief The link is a partial right direction - PARTRIGHT, + PARTRIGHT = 1 << 1, /// @brief The link is a straight direction - STRAIGHT, + STRAIGHT = 1 << 2, /// @brief The link is a partial left direction - PARTLEFT, + PARTLEFT = 1 << 3, /// @brief The link is a (hard) left direction - LEFT, + LEFT = 1 << 4, /// @brief The link is a 180 degree turn - TURN, + TURN = 1 << 5, /// @brief The link is a 180 degree turn (left-hand network) - TURN_LEFTHAND, + TURN_LEFTHAND = 1 << 6, /// @brief The link has no direction (is a dead end link) - NODIR + NODIR = 1 << 7 }; @@ -1602,24 +1622,24 @@ /// @enum LaneChangeModel -enum LaneChangeModel { - LCM_DK2008, - LCM_LC2013, - LCM_SL2015, - LCM_DEFAULT +enum class LaneChangeModel { + DK2008, + LC2013, + SL2015, + DEFAULT }; /// @enum train types -enum TrainType { - TRAINTYPE_NGT400, - TRAINTYPE_NGT400_16, - TRAINTYPE_RB425, - TRAINTYPE_RB628, - TRAINTYPE_ICE1, - TRAINTYPE_REDOSTO7, - TRAINTYPE_FREIGHT, - TRAINTYPE_ICE3, - TRAINTYPE_UNKNOWN +enum class TrainType { + NGT400, + NGT400_16, + RB425, + RB628, + ICE1, + REDOSTO7, + FREIGHT, + ICE3, + UNKNOWN }; // @} diff -Nru sumo-1.11.0/src/utils/xml/XMLSubSys.cpp sumo-1.12.0/src/utils/xml/XMLSubSys.cpp --- sumo-1.11.0/src/utils/xml/XMLSubSys.cpp 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/XMLSubSys.cpp 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/src/utils/xml/XMLSubSys.h sumo-1.12.0/src/utils/xml/XMLSubSys.h --- sumo-1.11.0/src/utils/xml/XMLSubSys.h 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/src/utils/xml/XMLSubSys.h 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2002-2022 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/ diff -Nru sumo-1.11.0/tools/assign/bestIteration.py sumo-1.12.0/tools/assign/bestIteration.py --- sumo-1.11.0/tools/assign/bestIteration.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/assign/bestIteration.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/tools/assign/cadytsIterate.py sumo-1.12.0/tools/assign/cadytsIterate.py --- sumo-1.11.0/tools/assign/cadytsIterate.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/assign/cadytsIterate.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2010-2022 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/ diff -Nru sumo-1.11.0/tools/assign/costFunctionChecker.py sumo-1.12.0/tools/assign/costFunctionChecker.py --- sumo-1.11.0/tools/assign/costFunctionChecker.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/assign/costFunctionChecker.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2009-2022 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/ diff -Nru sumo-1.11.0/tools/assign/costMemory.py sumo-1.12.0/tools/assign/costMemory.py --- sumo-1.11.0/tools/assign/costMemory.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/assign/costMemory.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/tools/assign/duaIterate_analysis.py sumo-1.12.0/tools/assign/duaIterate_analysis.py --- sumo-1.11.0/tools/assign/duaIterate_analysis.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/assign/duaIterate_analysis.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2012-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2012-2022 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/ diff -Nru sumo-1.11.0/tools/assign/duaIterate.py sumo-1.12.0/tools/assign/duaIterate.py --- sumo-1.11.0/tools/assign/duaIterate.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/assign/duaIterate.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/tools/assign/one-shot.py sumo-1.12.0/tools/assign/one-shot.py --- sumo-1.11.0/tools/assign/one-shot.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/assign/one-shot.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/tools/averageTripStatistics.py sumo-1.12.0/tools/averageTripStatistics.py --- sumo-1.11.0/tools/averageTripStatistics.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/averageTripStatistics.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2007-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2007-2022 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/ diff -Nru sumo-1.11.0/tools/build/buildPyDoc.py sumo-1.12.0/tools/build/buildPyDoc.py --- sumo-1.11.0/tools/build/buildPyDoc.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/buildPyDoc.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2011-2022 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/ diff -Nru sumo-1.11.0/tools/build/build_wheels.sh sumo-1.12.0/tools/build/build_wheels.sh --- sumo-1.11.0/tools/build/build_wheels.sh 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/build_wheels.sh 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/bash # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/tools/build/checkAuthors.py sumo-1.12.0/tools/build/checkAuthors.py --- sumo-1.11.0/tools/build/checkAuthors.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/checkAuthors.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2011-2022 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/ diff -Nru sumo-1.11.0/tools/build/checkStyle.py sumo-1.12.0/tools/build/checkStyle.py --- sumo-1.11.0/tools/build/checkStyle.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/checkStyle.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2010-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2010-2022 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/ @@ -73,7 +73,7 @@ """ EPL_GPL_HEADER = """/****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2001-2022 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/ @@ -91,10 +91,10 @@ """Reads the svn properties of files as written by svn pl -v --xml""" - def __init__(self, doFix, doPep, doLicense): + def __init__(self, doFix, doPep, license_attrs): self._fix = doFix self._pep = doPep - self._license = doFix or doLicense + self._license = dict([e.split(":") for e in license_attrs.split(",")]) if license_attrs else None self._file = "" self._property = None self._value = "" @@ -169,23 +169,26 @@ if ext in (".py", ".pyw"): if lines[0][:2] == '#!': idx += 1 - if lines[0] not in ('#!/usr/bin/env python\n', '#!/usr/bin/env python3\n'): + if lines[0] not in ('#!/usr/bin/env python\n', '#!/usr/bin/env python3\n', '#!/usr/bin/env python2\n'): print(self._file, "wrong shebang") if self._fix: lines[0] = '#!/usr/bin/env python\n' self._haveFixed = True if lines[idx][:5] == '# -*-': idx += 1 - end = lines.index("\n", idx) + end = lines.index("\n", idx) if "\n" in lines else idx if len(lines) < 13: print(self._file, "is too short (%s lines, at least 13 required for valid header)" % len(lines)) - return - year = lines[idx + 1][16:20] + if not self._license: + return + year = lines[idx + 1][16:20] if len(lines) > idx + 1 else "" + if self._license: + year = self._license.get("year", "2001") license = EPL_HEADER.replace("// ", "# ").replace("// ", "# ").replace("\n//", "") license = license.replace("2001", year).replace(SEPARATOR, "") newLicense = EPL_GPL_HEADER.replace("// ", "# ").replace("// ", "# ").replace("\n//", "") newLicense = newLicense.replace("2001", year).replace(SEPARATOR, "") - if "module" in lines[idx + 2]: + if len(lines) > idx + 4 and "module" in lines[idx + 2]: fileLicense = "".join(lines[idx:idx + 2]) + "".join(lines[idx + 4:end]) else: fileLicense = "".join(lines[idx:end]) @@ -200,11 +203,21 @@ end += 4 self._haveFixed = True elif fileLicense != newLicense: - print(self._file, "different license:") - print(fileLicense) - if options.verbose: - print("!!%s!!" % os.path.commonprefix([fileLicense, license])) - print(license) + if self._license: + lines[idx:idx] = newLicense.splitlines(True) + ["\n", + "# @file %s\n" % os.path.basename(self._file), + "# @author %s\n" % self._license.get("author", ""), + "# @date %s\n" % self._license.get("date", ""), + "\n"] + if "module" in self._license: + lines[idx+2:idx+2] = ["# %s\n" % l for l in self._license["module"].split('\\n')] + self._haveFixed = True + else: + print(self._file, "different license:") + print(fileLicense) + if options.verbose: + print("!!%s!!" % os.path.commonprefix([fileLicense, license])) + print(license) self.checkDoxyLines(lines, end + 1, "#") if self._haveFixed: open(self._file, "w").write("".join(lines)) @@ -308,8 +321,8 @@ default=False, help="tell me what you are doing") optParser.add_option("-f", "--fix", action="store_true", default=False, help="fix invalid svn properties, run astyle and autopep8") -optParser.add_option("-l", "--license", action="store_true", - default=False, help="fix license only") +optParser.add_option("-l", "--license", + help="fix / insert license (needs at least one of the attributes module, author, year, date)") optParser.add_option("-s", "--skip-pep", action="store_true", default=False, help="skip autopep8 and flake8 tests") optParser.add_option("-d", "--directory", help="check given subdirectory of sumo tree") diff -Nru sumo-1.11.0/tools/build/configTemplateToWiki.py sumo-1.12.0/tools/build/configTemplateToWiki.py --- sumo-1.11.0/tools/build/configTemplateToWiki.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/configTemplateToWiki.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/tools/build/dailyBuildMSVC.py sumo-1.12.0/tools/build/dailyBuildMSVC.py --- sumo-1.11.0/tools/build/dailyBuildMSVC.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/dailyBuildMSVC.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ @@ -25,22 +25,26 @@ """ from __future__ import absolute_import from __future__ import print_function -import io import datetime -import optparse import os import glob -import subprocess import zipfile import shutil import sys -import filterDebugDLL import status import wix -sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +env = os.environ +if "SUMO_HOME" not in env: + env["SUMO_HOME"] = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +SUMO_HOME = env["SUMO_HOME"] +env["PYTHON"] = "python" +env["SMTP_SERVER"] = "smtprelay.dlr.de" + +sys.path += [os.path.join(SUMO_HOME, "tools"), os.path.join(SUMO_HOME, "tests")] import sumolib # noqa +import runExtraTests # noqa BINARIES = ("activitygen", "emissionsDrivingCycle", "emissionsMap", "dfrouter", "duarouter", "jtrrouter", "marouter", @@ -49,34 +53,32 @@ "TraCITestClient") -def repositoryUpdate(options, log): +def repositoryUpdate(options): gitrev = "" cwd = os.getcwd() for d in options.repositories.split(","): os.chdir(os.path.join(options.rootDir, d)) - subprocess.call(["git", "pull"], stdout=log, stderr=subprocess.STDOUT) - subprocess.call(["git", "submodule", "update"], stdout=log, stderr=subprocess.STDOUT) + status.log_subprocess(["git", "pull"]) + status.log_subprocess(["git", "submodule", "update"]) if gitrev == "": gitrev = sumolib.version.gitDescribe() os.chdir(cwd) return gitrev -def runTests(options, env, gitrev, log, debugSuffix=""): +def runTests(options, env, gitrev, debugSuffix=""): if not options.tests: return prefix = env["FILEPREFIX"] + debugSuffix - env["SUMO_BATCH_RESULT"] = os.path.join( - options.rootDir, prefix + "batch_result") + env["SUMO_BATCH_RESULT"] = os.path.join(options.rootDir, prefix + "batch_result") env["SUMO_REPORT"] = os.path.join(options.remoteDir, prefix + "report") - env["TEXTTEST_TMP"] = os.path.join( - options.rootDir, prefix + "texttesttmp") - env["TEXTTEST_HOME"] = os.path.join(options.rootDir, options.testsDir) + env["TEXTTEST_TMP"] = os.path.join(options.rootDir, prefix + "texttesttmp") + env["TEXTTEST_HOME"] = os.path.join(SUMO_HOME, "tests") shutil.rmtree(env["TEXTTEST_TMP"], True) if not os.path.exists(env["SUMO_REPORT"]): os.makedirs(env["SUMO_REPORT"]) for name in BINARIES: - binary = os.path.join(options.rootDir, options.binDir, name + debugSuffix + ".exe") + binary = os.path.join(SUMO_HOME, "bin", name + debugSuffix + ".exe") if name == "sumo-gui": if os.path.exists(binary): env["GUISIM_BINARY"] = binary @@ -87,23 +89,18 @@ (datetime.date.today().strftime("%d%b%y"), gitrev)] ttBin = "texttest" if options.suffix == "extra": - runExtraTests.run(debugSuffix, fullOpt, log, True, True, debugSuffix == "") + runExtraTests.run(debugSuffix, fullOpt, True, debugSuffix == "") else: - subprocess.call([ttBin] + fullOpt, env=env, - stdout=log, stderr=subprocess.STDOUT, shell=True) - subprocess.call([ttBin, "-a", "sumo.gui"] + fullOpt, env=env, - stdout=log, stderr=subprocess.STDOUT, shell=True) - subprocess.call([ttBin, "-b", env["FILEPREFIX"], "-coll"], env=env, - stdout=log, stderr=subprocess.STDOUT, shell=True) + status.log_subprocess([ttBin] + fullOpt, env) + status.log_subprocess([ttBin, "-a", "sumo.gui"] + fullOpt, env) + status.log_subprocess([ttBin, "-b", env["FILEPREFIX"], "-coll"], env) status.killall((debugSuffix,), BINARIES) -def generateCMake(generator, platform, log, checkOptionalLibs, python): - buildDir = os.path.join(env["SUMO_HOME"], "build", "cmake-build-" + platform) +def generateCMake(generator, platform, checkOptionalLibs, python): + buildDir = os.path.join(SUMO_HOME, "build", "cmake-build-" + platform) cmakeOpt = ["-DCOMPILE_DEFINITIONS=MSVC_TEST_SERVER", "-DCHECK_OPTIONAL_LIBS=%s" % checkOptionalLibs] - if platform == "Win32": - cmakeOpt += ["-DENABLE_PYTHON_BINDINGS=false"] if python: cmakeOpt += ["-DPYTHON_EXECUTABLE=%s" % python] if checkOptionalLibs: @@ -111,167 +108,135 @@ # Create directory or clear it if already exists try: if os.path.exists(buildDir): - status.printLog("Cleaning directory of %s." % generator, log) + status.printLog("Cleaning directory of %s." % generator) shutil.rmtree(buildDir) os.makedirs(buildDir) except Exception as e: - status.printLog("Error occured on build dir cleanup: %s." % e, log) - status.printLog("Creating solution for %s." % generator, log) - subprocess.call(["cmake", "../..", "-G", generator, "-A", platform] + cmakeOpt, - cwd=buildDir, stdout=log, stderr=subprocess.STDOUT) + status.printLog("Error occured on build dir cleanup: %s." % e) + status.printLog("Creating solution for %s." % generator) + status.log_subprocess(["cmake", "../..", "-G", generator, "-A", platform] + cmakeOpt, cwd=buildDir) return buildDir -optParser = optparse.OptionParser() -optParser.add_option("-r", "--root-dir", dest="rootDir", - default=r"D:\Sumo", help="root for git and log output") -optParser.add_option("-s", "--suffix", default="", help="suffix to the fileprefix") -optParser.add_option("-b", "--bin-dir", dest="binDir", default=r"git\bin", - help="directory containg the binaries, relative to the root dir") -optParser.add_option("-t", "--tests-dir", dest="testsDir", default=r"git\tests", - help="directory containg the tests, relative to the root dir") -optParser.add_option("-m", "--remote-dir", dest="remoteDir", default="S:\\daily", - help="directory to move the results to") -optParser.add_option("-n", "--no-tests", dest="tests", action="store_false", - default=True, help="skip tests") -optParser.add_option("-x", "--x64only", action="store_true", - default=False, help="skip Win32 and debug build (as well as netedit tests)") -optParser.add_option("-p", "--python", help="path to python interpreter to use") -optParser.add_option("-c", "--msvc-version", default="msvc16", - help="Visual Studio version to use (either msvc12 or msvc16)") -optParser.add_option("-u", "--repositories", default="git", - help="repositories to update") -(options, args) = optParser.parse_args() - -sys.path.append(os.path.join(options.rootDir, options.testsDir)) -import runExtraTests # noqa - -env = os.environ -if "SUMO_HOME" not in env: - env["SUMO_HOME"] = os.path.dirname( - os.path.dirname(os.path.dirname(__file__))) -env["PYTHON"] = "python" -env["SMTP_SERVER"] = "smtprelay.dlr.de" - -maxTime = 0 -sumoAllZip = None -for fname in glob.glob(os.path.join(options.remoteDir, "sumo-all-*.zip")): - if os.path.getmtime(fname) > maxTime: - maxTime = os.path.getmtime(fname) - sumoAllZip = fname -for platform in (["x64"] if options.x64only else ["Win32", "x64"]): +def main(options, platform="x64"): env["FILEPREFIX"] = options.msvc_version + options.suffix + platform prefix = os.path.join(options.remoteDir, env["FILEPREFIX"]) makeLog = prefix + "Release.log" makeAllLog = prefix + "Debug.log" statusLog = prefix + "status.log" - binDir = "sumo-git/bin/" status.killall(("", "D"), BINARIES) - toClean = [makeLog, makeAllLog] - toolsDir = os.path.join(options.rootDir, options.binDir.replace("bin", "tools")) - shareDir = os.path.join(options.rootDir, options.binDir.replace("bin", "share")) + toClean = [] for ext in ("*.exe", "*.ilk", "*.pdb", "*.py", "*.pyd", "*.dll", "*.lib", "*.exp", "*.jar", "*.manifest"): - toClean += glob.glob(os.path.join(options.rootDir, options.binDir, ext)) - toClean += glob.glob(os.path.join(toolsDir, "lib*", "*lib*")) - toClean += glob.glob(os.path.join(shareDir, "*", "*")) + toClean += glob.glob(os.path.join(SUMO_HOME, "bin", ext)) + toClean += glob.glob(os.path.join(SUMO_HOME, "tools", "lib*", "*lib*")) + toClean += glob.glob(os.path.join(SUMO_HOME, "share", "*", "*")) for f in toClean: try: os.remove(f) except Exception: pass + for d in (glob.glob(os.path.join(SUMO_HOME, "bin", "osgPlugins*")) + + glob.glob(os.path.join(SUMO_HOME, "tools", "*.egg-info"))): + shutil.rmtree(d, ignore_errors=True) + for d in glob.glob(os.path.join(SUMO_HOME, "docs", "*")): + if os.path.basename(d) in ('examples', 'javadoc', 'man', 'pydoc', 'tutorial', 'userdoc'): + shutil.rmtree(d, ignore_errors=True) + # we need to use io.open here due to http://bugs.python.org/issue16273 - with io.open(makeLog, 'a') as log: - status.printLog("Running %s build using python %s." % (options.msvc_version, sys.version), log) - gitrev = repositoryUpdate(options, log) - generator = "Visual Studio " + ("12 2013" if options.msvc_version == "msvc12" else "16 2019") - buildDir = generateCMake(generator, platform, log, options.suffix == "extra", options.python) - ret = subprocess.call(["cmake", "--build", ".", "--config", "Release"], - cwd=buildDir, stdout=log, stderr=subprocess.STDOUT) - subprocess.call(["cmake", "--build", ".", "--target", "lisum"], - cwd=buildDir, stdout=log, stderr=subprocess.STDOUT) - plat = platform.lower().replace("x", "win") - if options.msvc_version != "msvc16": - plat += options.msvc_version - if ret == 0 and sumoAllZip: - try: - binaryZip = sumoAllZip.replace("-all-", "-%s%s-" % (plat, options.suffix)) - zipf = zipfile.ZipFile(binaryZip, 'w', zipfile.ZIP_DEFLATED) - srcZip = zipfile.ZipFile(sumoAllZip) - write = False - for f in srcZip.namelist(): - if f.count('/') == 1: - write = f.endswith(".md") or os.path.basename(f) in ["AUTHORS", "ChangeLog", "LICENSE"] - if f.endswith('/') and f.count('/') == 2: - write = f.endswith(('/bin/', '/tools/', '/data/', '/docs/')) - if f.endswith('/bin/'): - binDir = f - elif f.endswith('/') and '/docs/' in f and f.count('/') == 3: - write = not f.endswith('/doxygen/') and not f.endswith('/web/') - elif write and not f.endswith(".jar"): - zipf.writestr(f, srcZip.read(f)) - srcZip.close() - for ext in ("*.exe", "*.dll", "*.lib", "*.exp", "*.jar"): - filelist = glob.glob(os.path.join(options.rootDir, options.binDir, ext)) - if ext == "*.dll": - filelist = filterDebugDLL.filterDLL(filelist) - for f in filelist: - if ext != "*.exe" or any([os.path.basename(f).startswith(b) for b in BINARIES]): - zipf.write(f, os.path.join(binDir, os.path.basename(f))) - srcDir = os.path.join(options.rootDir, options.binDir.replace("bin", "src")) - includeDir = binDir.replace("bin", "include") - status.printLog("Creating sumo.zip.", log) - for f in glob.glob(os.path.join(srcDir, "libsumo", "*.h")): - if not f.endswith("Helper.h") and not f.endswith("Subscription.h"): - zipf.write(f, includeDir + f[len(srcDir):]) - zipf.write(os.path.join(buildDir, "src", "version.h"), os.path.join(includeDir, "version.h")) - for f in glob.glob(os.path.join(toolsDir, "lib*", "*lib*.py*")): - zipf.write(f, binDir.replace("bin", "tools") + f[len(toolsDir):]) - for f in glob.glob(os.path.join(shareDir, "*", "*")): - zipf.write(f, binDir.replace("bin", "share") + f[len(shareDir):]) - zipf.close() - if options.suffix == "": - # installers only for the vanilla build - status.printLog("Creating sumo.msi.", log) - wix.buildMSI(binaryZip, binaryZip.replace(".zip", ".msi"), log=log) - except Exception as ziperr: - status.printLog("Warning: Could not zip to %s (%s)!" % (binaryZip, ziperr), log) - if platform == "x64": - status.printLog("Creating sumo-game.zip.", log) - try: - try: - import py2exe # noqa - setup = os.path.join(env["SUMO_HOME"], 'tools', 'game', 'setup.py') - subprocess.call(['python', setup, binaryZip], stdout=log, stderr=subprocess.STDOUT) - except ImportError: - subprocess.call(["cmake", "--build", ".", "--target", "game"], - cwd=buildDir, stdout=log, stderr=subprocess.STDOUT) - shutil.move(os.path.join(buildDir, "sumo-game.zip"), binaryZip.replace("sumo-", "sumo-game-")) - except Exception as e: - status.printLog("Warning: Could not create nightly sumo-game.zip! (%s)" % e, log) - with open(makeAllLog, 'a') as debugLog: - ret = subprocess.call(["cmake", "--build", ".", "--config", "Debug"], - cwd=buildDir, stdout=debugLog, stderr=subprocess.STDOUT) - if ret == 0 and sumoAllZip: - status.printLog("Creating sumoDebug.zip.", debugLog) - try: - debugZip = sumoAllZip.replace("-all-", "-%s%sDebug-" % (plat, options.suffix)) - zipf = zipfile.ZipFile(debugZip, 'w', zipfile.ZIP_DEFLATED) - for ext in ("*D.exe", "*.dll", "*D.pdb"): - for f in glob.glob(os.path.join(options.rootDir, options.binDir, ext)): - zipf.write(f, os.path.join(binDir, os.path.basename(f))) - for f in glob.glob(os.path.join(toolsDir, "lib*", "*lib*.p*")): - zipf.write(f, binDir.replace("bin", "tools") + f[len(toolsDir):]) - zipf.close() - except IOError as ziperr: - status.printLog("Warning: Could not zip to %s (%s)!" % (binaryZip, ziperr), debugLog) - status.printLog("Running tests.", log) - runTests(options, env, gitrev, log) + log_handler = status.set_rotating_log(makeLog) + status.printLog("Running %s build using python %s." % (options.msvc_version, sys.version)) + gitrev = repositoryUpdate(options) + generator = "Visual Studio " + ("12 2013" if options.msvc_version == "msvc12" else "16 2019") + buildDir = generateCMake(generator, platform, options.suffix == "extra", options.python) + ret = status.log_subprocess(["cmake", "--build", ".", "--config", "Release"], cwd=buildDir) + status.log_subprocess(["cmake", "--build", ".", "--config", "Release", "--target", "lisum"], cwd=buildDir) + status.log_subprocess(["cmake", "--build", ".", "--config", "Release", "--target", "userdoc", "examples"], + cwd=buildDir) + status.log_subprocess(["cmake", "--install", "."], cwd=buildDir) + plat = platform.lower().replace("x", "win") + if options.msvc_version != "msvc16": + plat += options.msvc_version + for d in glob.glob(os.path.join(buildDir, "sumo-*")): + if os.path.isdir(d): + installDir = d + installBase = os.path.basename(installDir) + binaryZip = os.path.join(buildDir, "sumo-%s%s-%s" % (plat, options.suffix, installBase[5:])) + if ret == 0: + try: + for f in (glob.glob(os.path.join(SUMO_HOME, "*.md")) + + [os.path.join(SUMO_HOME, n) for n in ("AUTHORS", "ChangeLog", "LICENSE")]): + shutil.copy(f, installDir) + if options.suffix == "extra": + shutil.copy(os.path.join(SUMO_HOME, "build", "wix", "gpl-2.0.txt"), os.path.join(installDir, "LICENSE")) + for f in glob.glob(os.path.join(SUMO_HOME, "bin", "*.jar")): + shutil.copy(f, os.path.join(installDir, "bin")) + shutil.copytree(os.path.join(SUMO_HOME, "docs"), os.path.join(installDir, "docs"), + ignore=shutil.ignore_patterns('web')) + shutil.copy(os.path.join(buildDir, "src", "version.h"), os.path.join(installDir, "include")) + status.printLog("Creating sumo.zip.") + shutil.make_archive(binaryZip, 'zip', buildDir, installBase) + shutil.copy(binaryZip + ".zip", options.remoteDir) + status.printLog("Creating sumo.msi.") + if options.suffix == "extra": + wix.buildMSI(binaryZip + ".zip", binaryZip + ".msi", + license=os.path.join(SUMO_HOME, "build", "wix", "gpl-2.0.rtf")) + else: + wix.buildMSI(binaryZip + ".zip", binaryZip + ".msi") + shutil.copy(binaryZip + ".msi", options.remoteDir) + except Exception as ziperr: + status.printLog("Warning: Could not zip to %s.zip (%s)!" % (binaryZip, ziperr)) + + gameZip = os.path.join(buildDir, "sumo-game-%s%s-%s.zip" % (plat, options.suffix, installBase[5:])) + status.printLog("Creating sumo-game.zip.") + try: + status.log_subprocess(["cmake", "--build", ".", "--target", "game"], cwd=buildDir) + shutil.move(os.path.join(buildDir, "sumo-game.zip"), gameZip) + shutil.copy(gameZip, options.remoteDir) + except Exception as e: + status.printLog("Warning: Could not create nightly sumo-game.zip! (%s)" % e) + + debug_handler = status.set_rotating_log(makeAllLog, log_handler) + ret = status.log_subprocess(["cmake", "--build", ".", "--config", "Debug"], cwd=buildDir) + if ret == 0: + debugZip = os.path.join(buildDir, "sumo-%s%sDebug-%s.zip" % (plat, options.suffix, installBase[5:])) + status.printLog("Creating sumoDebug.zip.") + try: + with zipfile.ZipFile(debugZip, 'w', zipfile.ZIP_DEFLATED) as zipf: + for ext in ("*D.exe", "*.dll", "*D.pdb"): + for f in glob.glob(os.path.join(SUMO_HOME, "bin", ext)): + zipf.write(f, os.path.join(installBase, "bin", os.path.basename(f))) + shutil.copy(debugZip, options.remoteDir) + except IOError as ziperr: + status.printLog("Warning: Could not zip to %s (%s)!" % (debugZip, ziperr)) + + log_handler = status.set_rotating_log(makeLog, debug_handler) + status.printLog("Running tests.") + runTests(options, env, gitrev) with open(statusLog, 'w') as log: status.printStatus(makeLog, makeAllLog, env["SMTP_SERVER"], log) -if not options.x64only: - with open(makeAllLog, 'a') as debugLog: - status.printLog("Running debug tests.", debugLog) - runTests(options, env, gitrev, debugLog, "D") - with open(prefix + "Dstatus.log", 'w') as log: - status.printStatus(makeAllLog, makeAllLog, env["SMTP_SERVER"], log) + if not options.x64only: + debug_handler = status.set_rotating_log(makeAllLog, log_handler) + status.printLog("Running debug tests.") + runTests(options, env, gitrev, "D") + with open(prefix + "Dstatus.log", 'w') as log: + status.printStatus(makeAllLog, makeAllLog, env["SMTP_SERVER"], log) + + +if __name__ == "__main__": + optParser = sumolib.options.ArgumentParser() + optParser.add_option("-r", "--root-dir", dest="rootDir", + default=r"D:\Sumo", help="root for git and log output") + optParser.add_option("-s", "--suffix", default="", help="suffix to the fileprefix") + optParser.add_option("-m", "--remote-dir", dest="remoteDir", default="S:\\daily", + help="directory to move the results to") + optParser.add_option("-n", "--no-tests", dest="tests", action="store_false", + default=True, help="skip tests") + optParser.add_option("-x", "--x64only", action="store_true", + default=False, help="skip debug build") + optParser.add_option("-p", "--python", help="path to python interpreter to use") + optParser.add_option("--msvc-version", default="msvc16", + help="Visual Studio version to use (either msvc12 or msvc16)") + optParser.add_option("-u", "--repositories", default="git", + help="repositories to update") + main(optParser.parse_args()) diff -Nru sumo-1.11.0/tools/build/dailyNetedit.py sumo-1.12.0/tools/build/dailyNetedit.py --- sumo-1.11.0/tools/build/dailyNetedit.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/dailyNetedit.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ @@ -29,10 +29,7 @@ import optparse import os import glob -import subprocess import sys -import logging -import logging.handlers import status @@ -61,8 +58,7 @@ taskID = os.path.basename(tasks[today.toordinal() % len(tasks)])[10:] cmd = [ttBin, "-b", prefix, "-a", taskID, "-name", "%sr%s" % (today.strftime("%d%b%y"), gitrev)] for call in (cmd, [ttBin, "-b", env["FILEPREFIX"], "-coll"]): - status.log_subprocess_output(subprocess.Popen( - call, env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True)) + status.log_subprocess(call, env) status.killall((debugSuffix,), BINARIES) @@ -90,14 +86,7 @@ platform = "x64" env["FILEPREFIX"] = msvcVersion + options.suffix + platform prefix = os.path.join(options.remoteDir, env["FILEPREFIX"]) -testLog = prefix + "NeteditTest.log" gitrev = sumolib.version.gitDescribe() -logger = logging.getLogger() -logger.setLevel(logging.INFO) -try: - handler = logging.handlers.TimedRotatingFileHandler(testLog, when="d", interval=1, backupCount=5) - logger.addHandler(handler) -except Exception as e: - logger.error(e) -logger.info(u"%s: %s" % (datetime.datetime.now(), "Running tests.")) +status.set_rotating_log(prefix + "NeteditTest.log") +status.printLog("Running tests.") runTests(options, env, gitrev) diff -Nru sumo-1.11.0/tools/build/dailyUpdateMakeGCC.sh sumo-1.12.0/tools/build/dailyUpdateMakeGCC.sh --- sumo-1.11.0/tools/build/dailyUpdateMakeGCC.sh 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/dailyUpdateMakeGCC.sh 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/bash # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ @@ -75,7 +75,12 @@ tests/runTests.sh -b $FILEPREFIX -name $TESTLABEL &> $TESTLOG if which Xvfb &>/dev/null; then tests/runTests.sh -a sumo.gui -b $FILEPREFIX -name $TESTLABEL >> $TESTLOG 2>&1 - tests/runNeteditDailyTests.sh -b $FILEPREFIX -name $TESTLABEL >> $TESTLOG 2>&1 + if test "$FILEPREFIX" == "gcc4_64"; then + tests/runNeteditDailyTests.sh -b $FILEPREFIX -name $TESTLABEL >> $TESTLOG 2>&1 + fi +# if test "$FILEPREFIX" == "coverage_gcc4_64"; then +# tests/runTests.sh -a netedit.gui -b $FILEPREFIX -name $TESTLABEL >> $TESTLOG 2>&1 +# fi fi fi tests/runTests.sh -b $FILEPREFIX -name $TESTLABEL -coll >> $TESTLOG 2>&1 @@ -105,3 +110,7 @@ fi echo `grep -ci 'warn[iu]ng:' $MAKEALLLOG` warnings >> $STATUSLOG echo "--" >> $STATUSLOG + +basename $TESTLOG >> $STATUSLOG +date >> $STATUSLOG +echo "--" >> $STATUSLOG diff -Nru sumo-1.11.0/tools/build/filterDebugDLL.py sumo-1.12.0/tools/build/filterDebugDLL.py --- sumo-1.11.0/tools/build/filterDebugDLL.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/filterDebugDLL.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/tools/build/history.py sumo-1.12.0/tools/build/history.py --- sumo-1.11.0/tools/build/history.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/history.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2011-2022 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/ diff -Nru sumo-1.11.0/tools/build/pom.py sumo-1.12.0/tools/build/pom.py --- sumo-1.11.0/tools/build/pom.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/pom.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2011-2022 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/ diff -Nru sumo-1.11.0/tools/build/rebuildSchemata.py sumo-1.12.0/tools/build/rebuildSchemata.py --- sumo-1.11.0/tools/build/rebuildSchemata.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/rebuildSchemata.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2011-2022 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/ diff -Nru sumo-1.11.0/tools/build/schemaCheck.py sumo-1.12.0/tools/build/schemaCheck.py --- sumo-1.11.0/tools/build/schemaCheck.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/schemaCheck.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2009-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2009-2022 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/ diff -Nru sumo-1.11.0/tools/build/setup-libsumo.py sumo-1.12.0/tools/build/setup-libsumo.py --- sumo-1.11.0/tools/build/setup-libsumo.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/setup-libsumo.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2017-2022 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/ @@ -52,6 +52,7 @@ license='EPL-2.0', description="The python version of the libsumo API to communicate with the traffic simulation Eclipse SUMO", long_description=open(os.path.join(os.path.dirname(package_dir), 'README.md')).read(), + long_description_content_type='text/markdown', classifiers=[ 'Development Status :: 4 - Beta', diff -Nru sumo-1.11.0/tools/build/setup-libtraci.py sumo-1.12.0/tools/build/setup-libtraci.py --- sumo-1.11.0/tools/build/setup-libtraci.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/setup-libtraci.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2017-2022 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/ @@ -52,6 +52,7 @@ license='EPL-2.0', description="The python version of the libtraci API to communicate with the traffic simulation Eclipse SUMO", long_description=open(os.path.join(os.path.dirname(package_dir), 'README.md')).read(), + long_description_content_type='text/markdown', classifiers=[ 'Development Status :: 4 - Beta', diff -Nru sumo-1.11.0/tools/build/setup-sumolib.py sumo-1.12.0/tools/build/setup-sumolib.py --- sumo-1.11.0/tools/build/setup-sumolib.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/setup-sumolib.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2017-2022 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/ @@ -35,6 +35,7 @@ description=("Python helper modules to read networks, parse output data and " + "do other useful stuff related to the traffic simulation Eclipse SUMO"), long_description=open(os.path.join(os.path.dirname(package_dir), 'README.md')).read(), + long_description_content_type='text/markdown', classifiers=[ 'Development Status :: 5 - Production/Stable', diff -Nru sumo-1.11.0/tools/build/setup-sumo.py sumo-1.12.0/tools/build/setup-sumo.py --- sumo-1.11.0/tools/build/setup-sumo.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/setup-sumo.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2020-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2020-2022 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/ @@ -32,6 +32,7 @@ license='EPL-2.0', description=("A microscopic, multi-modal traffic simulation package"), long_description=open(os.path.join(os.path.dirname(package_dir), 'README.md')).read(), + long_description_content_type='text/markdown', classifiers=[ 'Development Status :: 5 - Production/Stable', diff -Nru sumo-1.11.0/tools/build/setup-traci.py sumo-1.12.0/tools/build/setup-traci.py --- sumo-1.11.0/tools/build/setup-traci.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/setup-traci.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2017-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2017-2022 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/ @@ -34,6 +34,7 @@ license='EPL-2.0', description="The pure python version of the TraCI API to communicate with the traffic simulation Eclipse SUMO", long_description=open(os.path.join(os.path.dirname(package_dir), 'README.md')).read(), + long_description_content_type='text/markdown', classifiers=[ 'Development Status :: 5 - Production/Stable', diff -Nru sumo-1.11.0/tools/build/status.py sumo-1.12.0/tools/build/status.py --- sumo-1.11.0/tools/build/status.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/status.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ @@ -27,6 +27,7 @@ from os.path import basename, commonprefix from datetime import datetime import logging +import logging.handlers def killall(debugSuffix, binaries): @@ -38,16 +39,31 @@ bins.remove(task[0]) -def log_subprocess_output(process): +def set_rotating_log(filename, remove=None): + logger = logging.getLogger() + logger.setLevel(logging.INFO) + try: + if remove: + logger.removeHandler(remove) + handler = logging.handlers.TimedRotatingFileHandler(filename, when="midnight", backupCount=5) + logger.addHandler(handler) + return handler + except Exception as e: + logger.error(e) + return None + + +def log_subprocess(call, env=None, cwd=None): + process = subprocess.Popen(call, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, + shell=True, cwd=cwd, env=env) with process.stdout: for line in process.stdout: - logging.info(line) - process.wait() + logging.info(line.rstrip().decode("ascii", "ignore")) + return process.wait() -def printLog(msg, log): - print(u"%s: %s" % (datetime.now(), msg), file=log) - log.flush() +def printLog(msg): + logging.info(u"%s: %s" % (datetime.now(), msg)) def findErrors(line, warnings, errors, failed): diff -Nru sumo-1.11.0/tools/build/sumo/__init__.py sumo-1.12.0/tools/build/sumo/__init__.py --- sumo-1.11.0/tools/build/sumo/__init__.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/sumo/__init__.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,5 +1,5 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2020-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2020-2022 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/ diff -Nru sumo-1.11.0/tools/build/typemap.py sumo-1.12.0/tools/build/typemap.py --- sumo-1.11.0/tools/build/typemap.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/typemap.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2015-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2015-2022 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/ diff -Nru sumo-1.11.0/tools/build/version.py sumo-1.12.0/tools/build/version.py --- sumo-1.11.0/tools/build/version.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/version.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2008-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2008-2022 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/ diff -Nru sumo-1.11.0/tools/build/wix.py sumo-1.12.0/tools/build/wix.py --- sumo-1.11.0/tools/build/wix.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/build/wix.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2011-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2011-2022 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/ @@ -18,7 +18,6 @@ from __future__ import absolute_import import optparse -import subprocess import zipfile import os import tempfile @@ -26,6 +25,7 @@ import shutil import version +import status SUMO_VERSION = version.get_pep440_version().replace("post", "") INPUT_DEFAULT = r"S:\daily\sumo-win64-git.zip" @@ -38,12 +38,11 @@ "netedit.exe", "start-command-line.bat"] -def buildFragment(wixBin, sourceDir, targetLabel, tmpDir, log=None): +def buildFragment(wixBin, sourceDir, targetLabel, tmpDir): base = os.path.basename(sourceDir) - subprocess.call([os.path.join(wixBin, "heat.exe"), "dir", sourceDir, - "-cg", base, "-gg", "-dr", targetLabel, "-sreg", - "-out", os.path.join(tmpDir, base + "RawFragment.wxs")], - stdout=log, stderr=log) + status.log_subprocess([os.path.join(wixBin, "heat.exe"), "dir", sourceDir, + "-cg", base, "-gg", "-dr", targetLabel, "-sreg", + "-out", os.path.join(tmpDir, base + "RawFragment.wxs")]) fragIn = open(os.path.join(tmpDir, base + "RawFragment.wxs")) fragOut = open(os.path.join(tmpDir, base + "Fragment.wxs"), "w") skip = 0 @@ -62,16 +61,16 @@ def buildMSI(sourceZip=INPUT_DEFAULT, outFile=OUTPUT_DEFAULT, wixBin=WIX_DEFAULT, wxsPattern=WXS_DEFAULT, - license=LICENSE, log=None): + license=LICENSE): tmpDir = tempfile.mkdtemp() zipfile.ZipFile(sourceZip).extractall(tmpDir) sumoRoot = glob.glob(os.path.join(tmpDir, "sumo-*"))[0] - fragments = [buildFragment(wixBin, os.path.join( - sumoRoot, d), "INSTALLDIR", tmpDir, log) for d in ["bin", "data", "share", "include", "tools"]] + fragments = [buildFragment(wixBin, os.path.join(sumoRoot, d), "INSTALLDIR", tmpDir) + for d in ["bin", "data", "share", "include", "tools"]] for d in ["userdoc", "pydoc", "javadoc", "tutorial", "examples"]: docDir = os.path.join(sumoRoot, "docs", d) if os.path.exists(docDir): - fragments.append(buildFragment(wixBin, docDir, "DOCDIR", tmpDir, log)) + fragments.append(buildFragment(wixBin, docDir, "DOCDIR", tmpDir)) for wxs in glob.glob(wxsPattern): with open(os.path.join(tmpDir, os.path.basename(wxs)), "w") as wxsOut: dataDir = os.path.dirname(license) @@ -81,12 +80,10 @@ dialogbg=os.path.join(dataDir, "dlgbmp.bmp"), webwizico=os.path.join(dataDir, "webWizard.ico"))) fragments.append(wxsOut.name) - subprocess.call([os.path.join(wixBin, "candle.exe"), "-o", tmpDir + "\\"] + fragments, - stdout=log, stderr=log) + status.log_subprocess([os.path.join(wixBin, "candle.exe"), "-o", tmpDir + "\\"] + fragments) wixObj = [f.replace(".wxs", ".wixobj") for f in fragments] - subprocess.call([os.path.join(wixBin, "light.exe"), "-sw1076", - "-ext", "WixUIExtension", "-o", outFile] + wixObj, - stdout=log, stderr=log) + status.log_subprocess([os.path.join(wixBin, "light.exe"), "-sw1076", + "-ext", "WixUIExtension", "-o", outFile] + wixObj) shutil.rmtree(tmpDir, True) # comment this out when debugging diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/pom.xml sumo-1.12.0/tools/contributed/lisum/lisum-core/pom.xml --- sumo-1.11.0/tools/contributed/lisum/lisum-core/pom.xml 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/pom.xml 2022-01-24 20:43:50.000000000 +0000 @@ -44,7 +44,7 @@ org.apache.logging.log4j log4j-core - 2.13.2 + 2.17.1 jar diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/DateTools.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/DateTools.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/DateTools.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/DateTools.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/DLRLogger.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/DLRLogger.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/DLRLogger.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/DLRLogger.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/FileLogger.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/FileLogger.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/FileLogger.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/FileLogger.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/LogLevel.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/LogLevel.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/LogLevel.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/LogLevel.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/MyString.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/MyString.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/MyString.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/MyString.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/ToString.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/ToString.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/ToString.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/ToString.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/WriteToDisk.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/WriteToDisk.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/WriteToDisk.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/logger/WriteToDisk.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/BytesTools.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/BytesTools.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/BytesTools.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/BytesTools.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/DLRProperties.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/DLRProperties.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/DLRProperties.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/DLRProperties.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/FileTools.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/FileTools.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/FileTools.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/FileTools.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/MathTools.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/MathTools.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/MathTools.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/MathTools.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/NiceTimeTool.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/NiceTimeTool.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/NiceTimeTool.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/NiceTimeTool.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2018-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2018-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/StackTraceUtil.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/StackTraceUtil.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/StackTraceUtil.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/StackTraceUtil.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/StringTools.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/StringTools.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/StringTools.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/StringTools.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/TimeTools.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/TimeTools.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/TimeTools.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/tools/TimeTools.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/utils/print/Color.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/utils/print/Color.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/utils/print/Color.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/utils/print/Color.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/utils/print/ColorString.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/utils/print/ColorString.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/utils/print/ColorString.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/utils/print/ColorString.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/utils/print/Effect.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/utils/print/Effect.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/utils/print/Effect.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/commons/utils/print/Effect.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/Constants.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/Constants.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/Constants.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/Constants.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/enums/LightColor.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/enums/LightColor.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/enums/LightColor.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/enums/LightColor.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/exceptions/InvalidSignalGroupsNumberException.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/exceptions/InvalidSignalGroupsNumberException.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/exceptions/InvalidSignalGroupsNumberException.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/exceptions/InvalidSignalGroupsNumberException.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/exceptions/LisaRESTfulServerNotFoundException.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/exceptions/LisaRESTfulServerNotFoundException.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/exceptions/LisaRESTfulServerNotFoundException.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/exceptions/LisaRESTfulServerNotFoundException.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/exceptions/LisumException.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/exceptions/LisumException.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/exceptions/LisumException.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/exceptions/LisumException.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/CityInterface.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/CityInterface.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/CityInterface.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/CityInterface.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/ControlUnitInterface.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/ControlUnitInterface.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/ControlUnitInterface.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/ControlUnitInterface.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/DetectorInterface.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/DetectorInterface.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/DetectorInterface.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/DetectorInterface.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/SignalGroupInterface.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/SignalGroupInterface.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/SignalGroupInterface.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/SignalGroupInterface.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/SignalProgramInterface.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/SignalProgramInterface.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/SignalProgramInterface.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/SignalProgramInterface.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/SimulationListener.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/SimulationListener.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/SimulationListener.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/interfaces/SimulationListener.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/IstVektorType.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/IstVektorType.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/IstVektorType.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/IstVektorType.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaCommands.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaCommands.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaCommands.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaCommands.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaConfigurationFiles.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaConfigurationFiles.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaConfigurationFiles.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaConfigurationFiles.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaControlUnit.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaControlUnit.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaControlUnit.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaControlUnit.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaControlUnits.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaControlUnits.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaControlUnits.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaControlUnits.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaDetector.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaDetector.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaDetector.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaDetector.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaDetectors.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaDetectors.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaDetectors.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaDetectors.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Lisa.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Lisa.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Lisa.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Lisa.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalGroup.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalGroup.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalGroup.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalGroup.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalGroups.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalGroups.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalGroups.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalGroups.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalProgram.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalProgram.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalProgram.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalProgram.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalPrograms.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalPrograms.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalPrograms.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/LisaSignalPrograms.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Message.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Message.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Message.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Message.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Persistence.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Persistence.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Persistence.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Persistence.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/PutMessageResponse.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/PutMessageResponse.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/PutMessageResponse.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/PutMessageResponse.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Requests.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Requests.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Requests.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/Requests.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/WunschVector.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/WunschVector.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/WunschVector.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/lisa/WunschVector.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/Main.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/Main.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/Main.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/Main.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/ConfigurationFile.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/ConfigurationFile.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/ConfigurationFile.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/ConfigurationFile.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/LisumSimulation.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/LisumSimulation.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/LisumSimulation.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/LisumSimulation.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/SimulationControlUnits.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/SimulationControlUnits.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/SimulationControlUnits.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/SimulationControlUnits.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/SimulationDetectors.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/SimulationDetectors.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/SimulationDetectors.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/SimulationDetectors.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/SimulationFiles.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/SimulationFiles.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/SimulationFiles.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/SimulationFiles.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/VehicleTypes.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/VehicleTypes.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/VehicleTypes.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/simulation/VehicleTypes.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/SplashScreen.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/SplashScreen.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/SplashScreen.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/SplashScreen.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoControlUnit.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoControlUnit.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoControlUnit.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoControlUnit.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoControlUnits.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoControlUnits.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoControlUnits.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoControlUnits.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoDetector.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoDetector.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoDetector.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoDetector.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoDetectors.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoDetectors.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoDetectors.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/SumoDetectors.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/Sumo.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/Sumo.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/Sumo.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/lisum/sumo/Sumo.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Attribute.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Attribute.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Attribute.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Attribute.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/AttributeNotFoundException.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/AttributeNotFoundException.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/AttributeNotFoundException.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/AttributeNotFoundException.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Attributes.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Attributes.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Attributes.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Attributes.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/KeyNode.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/KeyNode.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/KeyNode.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/KeyNode.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/MalformedKeyOrNameException.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/MalformedKeyOrNameException.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/MalformedKeyOrNameException.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/MalformedKeyOrNameException.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Tools.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Tools.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Tools.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Tools.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Value.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Value.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Value.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/Value.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLAdmin2.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLAdmin2.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLAdmin2.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLAdmin2.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLNodeBase.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLNodeBase.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLNodeBase.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLNodeBase.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLNode.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLNode.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLNode.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLNode.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLNodeNotFoundException.java sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLNodeNotFoundException.java --- sumo-1.11.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLNodeNotFoundException.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-core/src/main/java/de/dlr/ts/utils/xmladmin2/XMLNodeNotFoundException.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttons/CustomButton.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttons/CustomButton.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttons/CustomButton.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttons/CustomButton.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttons/CustomToggleButton.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttons/CustomToggleButton.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttons/CustomToggleButton.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttons/CustomToggleButton.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttons/tools/FileChooserCombo.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttons/tools/FileChooserCombo.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttons/tools/FileChooserCombo.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttons/tools/FileChooserCombo.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/ButtonsPane.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/ButtonsPane.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/ButtonsPane.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/ButtonsPane.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/OkApplyCancelButtonsPanel.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/OkApplyCancelButtonsPanel.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/OkApplyCancelButtonsPanel.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/OkApplyCancelButtonsPanel.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/OkCancelButtonsPanel.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/OkCancelButtonsPanel.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/OkCancelButtonsPanel.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/OkCancelButtonsPanel.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/OneButtonsPanel.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/OneButtonsPanel.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/OneButtonsPanel.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/buttonspanels/OneButtonsPanel.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/bottom/BottomArea.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/bottom/BottomArea.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/bottom/BottomArea.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/bottom/BottomArea.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/bottom/DebugScreen.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/bottom/DebugScreen.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/bottom/DebugScreen.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/bottom/DebugScreen.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/bottom/StatusBar.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/bottom/StatusBar.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/bottom/StatusBar.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/bottom/StatusBar.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/center/CenterArea.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/center/CenterArea.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/center/CenterArea.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/center/CenterArea.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/Colors.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/Colors.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/Colors.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/Colors.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/MainWindow.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/MainWindow.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/MainWindow.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/MainWindow.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/right/RightArea.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/right/RightArea.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/right/RightArea.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/right/RightArea.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/EditMenu.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/EditMenu.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/EditMenu.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/EditMenu.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/FileMenu.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/FileMenu.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/FileMenu.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/FileMenu.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/MainMenu.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/MainMenu.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/MainMenu.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/MainMenu.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/MainToolBar.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/MainToolBar.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/MainToolBar.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/MainToolBar.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/RecentFiles.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/RecentFiles.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/RecentFiles.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/RecentFiles.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/TestToolBar.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/TestToolBar.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/TestToolBar.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/TestToolBar.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/TopArea.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/TopArea.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/TopArea.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/mainwindow/top/TopArea.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/ConfirmationMessage.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/ConfirmationMessage.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/ConfirmationMessage.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/ConfirmationMessage.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/ErrorMessage.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/ErrorMessage.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/ErrorMessage.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/ErrorMessage.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/ExceptionMessage.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/ExceptionMessage.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/ExceptionMessage.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/ExceptionMessage.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/InformationMessage.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/InformationMessage.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/InformationMessage.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/InformationMessage.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/Message.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/Message.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/Message.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/Message.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/OkApplyCancelMessage.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/OkApplyCancelMessage.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/OkApplyCancelMessage.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/messages/OkApplyCancelMessage.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2014-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2014-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/misc/Tools.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/misc/Tools.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/misc/Tools.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/misc/Tools.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/windows/AboutWindow.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/windows/AboutWindow.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/windows/AboutWindow.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/commons/javafx/windows/AboutWindow.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/Actions.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/Actions.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/Actions.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/Actions.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/center/CenterAdmin.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/center/CenterAdmin.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/center/CenterAdmin.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/center/CenterAdmin.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/debug/DebugConsole.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/debug/DebugConsole.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/debug/DebugConsole.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/debug/DebugConsole.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/debug/TextAreaConsole.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/debug/TextAreaConsole.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/debug/TextAreaConsole.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/debug/TextAreaConsole.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/GlobalConfig.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/GlobalConfig.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/GlobalConfig.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/GlobalConfig.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/GUITools.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/GUITools.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/GUITools.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/GUITools.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/Icons.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/Icons.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/Icons.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/Icons.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/LogTest.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/LogTest.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/LogTest.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/LogTest.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/LSPreLoader.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/LSPreLoader.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/LSPreLoader.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/LSPreLoader.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/MainApp.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/MainApp.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/MainApp.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/MainApp.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/MainAppWrapper.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/MainAppWrapper.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/MainAppWrapper.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/MainAppWrapper.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/MainProgram.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/MainProgram.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/MainProgram.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/MainProgram.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/menus/MenuAdmin.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/menus/MenuAdmin.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/menus/MenuAdmin.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/menus/MenuAdmin.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/misc/LisumAboutWindow.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/misc/LisumAboutWindow.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/misc/LisumAboutWindow.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/misc/LisumAboutWindow.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/misc/Splash.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/misc/Splash.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/misc/Splash.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/misc/Splash.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/LisaControlUnitPreferencesBody.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/LisaControlUnitPreferencesBody.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/LisaControlUnitPreferencesBody.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/LisaControlUnitPreferencesBody.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/LisaControlUnitPreferences.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/LisaControlUnitPreferences.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/LisaControlUnitPreferences.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/LisaControlUnitPreferences.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/SystemPreferencesWindow.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/SystemPreferencesWindow.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/SystemPreferencesWindow.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/SystemPreferencesWindow.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/WorkspaceWindow.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/WorkspaceWindow.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/WorkspaceWindow.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/options/WorkspaceWindow.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/SuperMain.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/SuperMain.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/SuperMain.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/SuperMain.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/SystemClipboard.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/SystemClipboard.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/SystemClipboard.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/SystemClipboard.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/SystemProperties.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/SystemProperties.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/SystemProperties.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/SystemProperties.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/toolbars/FileToolBar.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/toolbars/FileToolBar.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/toolbars/FileToolBar.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/toolbars/FileToolBar.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/toolbars/SimulationToolBar.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/toolbars/SimulationToolBar.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/toolbars/SimulationToolBar.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/toolbars/SimulationToolBar.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/toolbars/ToolBarInterface.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/toolbars/ToolBarInterface.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/toolbars/ToolBarInterface.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/toolbars/ToolBarInterface.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/Tools.java sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/Tools.java --- sumo-1.11.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/Tools.java 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/lisum/lisum-gui/src/main/java/de/dlr/ts/lisum/gui/Tools.java 2022-01-24 20:43:50.000000000 +0000 @@ -1,6 +1,6 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +// Copyright (C) 2016-2022 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/ diff -Nru sumo-1.11.0/tools/contributed/saga/README.md sumo-1.12.0/tools/contributed/saga/README.md --- sumo-1.11.0/tools/contributed/saga/README.md 2021-11-22 23:06:33.000000000 +0000 +++ sumo-1.12.0/tools/contributed/saga/README.md 2022-01-24 23:06:38.000000000 +0000 @@ -16,7 +16,7 @@ Weekly update against the SUMO master branch. -[![linux-master](https://github.com/lcodeca/SUMOActivityGen/actions/workflows/linux-master.yml/badge.svg)](https://github.com/lcodeca/SUMOActivityGen/actions/workflows/linux-master.yml) +[![linux-master](https://github.com/lcodeca/SUMOActivityGen/actions/workflows/linux-master.yml/badge.svg)](https://github.com/lcodeca/SUMOActivityGen/actions/workflows/linux-master.yml) [![linux-release](https://github.com/lcodeca/SUMOActivityGen/actions/workflows/linux-release.yml/badge.svg)](https://github.com/lcodeca/SUMOActivityGen/actions/workflows/linux-release.yml) [![windows-pypi](https://github.com/lcodeca/SUMOActivityGen/actions/workflows/windows-pypi.yml/badge.svg)](https://github.com/lcodeca/SUMOActivityGen/actions/workflows/windows-pypi.yml) ## Overview diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/__init__.py sumo-1.12.0/tools/contributed/sumopy/agilepy/__init__.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/__init__.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/__init__.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file __init__.py # @author Joerg Schweizer -# @date +# @date 2012 import os diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/arrayman.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/arrayman.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/arrayman.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/arrayman.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file arrayman.py # @author Joerg Schweizer -# @date +# @date 2012 from classman import * import numpy as np @@ -91,6 +91,12 @@ #sortarray = np.concatenate((self.get_value()[inds],inds)) + def _del_rows(self, ids_del, inds_remain): + """ + Multiple row delete method used by attrsman + """ + self.set_value(self.get_value()[inds_remain]) + def delete_ind(self, i): # called from del_rows if self._is_index: @@ -245,6 +251,7 @@ # fd.write(xm.num(self.xmltag,val)) def format_value(self, _id, show_unit=False, show_parentesis=False): + # TODO: handle also linked ids, etc... if show_unit: unit = ' '+self.format_unit(show_parentesis) else: @@ -266,7 +273,10 @@ digits_fraction = self.digits_fraction else: digits_fraction = 3 + s = "%."+str(digits_fraction)+"f" + # print 'format_value df=',digits_fraction,'val=',val + return s % (val)+unit else: @@ -377,6 +387,29 @@ ArrayConfMixin.__init__(self, attrname, default, metatype='number', **attrs) + def format_value(self, _id, show_unit=False, show_parentesis=False): + # TODO: handle also linked ids, etc... + if show_unit: + unit = ' '+self.format_unit(show_parentesis) + else: + unit = '' + # return repr(self[_id])+unit + + #self.min = minval + #self.max = maxval + #self.digits_integer = digits_integer + #self.digits_fraction = digits_fraction + val = self[_id] + if self.digits_fraction is None: + digits_fraction = 3 + else: + digits_fraction = self.digits_fraction + + s = "%."+str(digits_fraction)+"f" + # print 'format_value df=',digits_fraction,'val=',val + + return s % (val)+unit + class IdsArrayConf(ArrayConfMixin, ColConf): """ @@ -406,6 +439,7 @@ # ------------------------------------------------------------------------------- # copied from IdsConf!!! + def set_linktab(self, tab): self._tab = tab @@ -855,6 +889,31 @@ return + def __getitem__(self, args): + if type(args) == types.TupleType: + attrnames = args[0] + ids = args[1] + else: + attrnames = args + ids = self._ids + + if hasattr(attrnames, '__iter__'): + n_rows = len(ids) + n_cols = len(attrnames) + # print ' n_rows',n_rows,'n_cols',n_cols,attrnames + if (n_rows == 0) | (n_cols == 0): + return np.array([[]]) + else: + #attrconf = getattr(self,attrnames[0]) + # TODO: detect dtype by adding numbers or use fields!!! + dtype = np.float32 + out = np.zeros((n_rows, n_cols), dtype=dtype) + for i, attrname in zip(xrange(n_cols), attrnames): + out[:, i] = getattr(self, attrname)[ids] + return out + else: + return getattr(self, attrnames)[ids] + def get_ind(self, id): return self._inds[id] @@ -992,7 +1051,7 @@ if n is not None: ids = self.suggest_ids(n) elif (len(ids) == 0) & (len(attrs) > 0): - # get number of rows from any valye vector provided + # get number of rows from any value vector provided ids = self.suggest_ids(len(attrs.values()[0])) elif (n is None) & (len(ids) == 0) & (len(attrs) > 0): # nothing given really-> do nothing @@ -1012,6 +1071,8 @@ return ids def copy_cols(self, attrman2, ids=None): + # WARNING: this method is unsafe for indexed colums as values are + # copied and are no longer unique # print 'copy_cols' if ids is None: ids2 = attrman2.get_ids() @@ -1060,16 +1121,37 @@ if self.plugin: self.plugin.exec_events_ids(EVTSETITEM, [id]) + def del_rows(self, ids_del): + # print '\n\ndel_rows',self.ident,ids_del + # remaining index + if self.plugin: + self.plugin.exec_events_ids(EVTDELITEM, ids_del) + + inds_remain = np.ones(len(self), dtype=np.bool_) + inds_remain[self._inds[ids_del]] = False + inds_remain = np.flatnonzero(inds_remain) + for colconfig in self._colconfigs: + colconfig._del_rows(ids_del, inds_remain) + self._ids = self._ids[inds_remain] + if len(self._ids) == 0: + n = 0 + else: + n = np.max(self._ids) + self._inds = np.zeros(n+1, dtype=np.int32) + self._inds[self._ids] = np.arange(len(self._ids)) + def del_row(self, _id): # print 'del_row',id - self.del_rows([_id]) + self.del_rows_simple([_id]) - def del_rows(self, ids): + def del_rows_simple(self, ids): # print '\n\ndel_rows',self.ident,ids # print ' self._ids',self._ids # print ' self._inds',self._inds # TODO: this could be done in with array methods + if self.plugin: + self.plugin.exec_events_ids(EVTDELITEM, ids) for _id in ids: i = self._inds[_id] # print ' id to eliminate _id=',_id @@ -1101,12 +1183,10 @@ # print ' self._inds',self._inds - if self.plugin: - self.plugin.exec_events_ids(EVTDELITEM, ids) - # print ' del',ids,' done.' def clear_rows(self): + # attention: overridden by ArrayObjman # print 'clear_rows',self.ident if self.plugin: @@ -1177,3 +1257,5 @@ self.clear_rows() self._init_constants() self.set_modified() + + # print ' check: suggest_ids',self.suggest_ids(5) diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/classman.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/classman.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/classman.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/classman.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file classman.py # @author Joerg Schweizer -# @date +# @date 2012 # python classman.py @@ -32,11 +32,13 @@ # xml mixin # different attrconfig classe (numbers, strings, lists, colors,...) + import types import os import pickle import sys import string +import math from collections import OrderedDict from datetime import datetime #import numpy as np @@ -71,6 +73,7 @@ NUMERICTYPES = (types.BooleanType, types.FloatType, types.IntType, types.LongType, types.ComplexType) STRINGTYPES = (types.StringType, types.UnicodeType) +NODATATYPES = (types.FunctionType, types.InstanceType, types.LambdaType) def save_obj(obj, filename, is_not_save_parent=False): @@ -81,7 +84,7 @@ """ # print 'save_obj',is_not_save_parent,filename,obj.parent try: - file = open(filename, 'wb') + f = open(filename, 'wb') except: print 'WARNING in save: could not open', filename return False @@ -90,8 +93,8 @@ parent = obj.parent obj.parent = None # print ' before',is_not_save_parent,parent,obj.parent - pickle.dump(obj, file, protocol=2) - file.close() + pickle.dump(obj, f, protocol=2) + f.close() # set all objects and attrubutes to unsaved again # obj.set_unsaved() # no, decided to eliminate _is_saved restriction @@ -224,6 +227,7 @@ unit='', xmltag=None, xmlsep=' ', + xmlmap=None, is_plugin=False, struct='scalar', metatype='', @@ -261,7 +265,7 @@ self.init_plugin(is_plugin) # self._init_xml(xmltag) - self.set_xmltag(xmltag, xmlsep) + self.set_xmltag(xmltag, xmlsep, xmlmap) # set rest of attributes passed as keyword args # no matter what they are used for @@ -281,6 +285,14 @@ self.groupnames = list(set(self.groupnames+groupnames)) self._manager.insert_groupnames(self) + def del_groupname(self, groupname): + if groupname in self.groupnames: + self.groupnames.remove(groupname) + + # do this update in any case to be sure + # it disappears in the centralized database + self._manager.del_groupname(self) + def has_group(self, groupname): return groupname in self.groupnames @@ -305,9 +317,10 @@ # else: # self.xmltag = self.attrname - def set_xmltag(self, xmltag, xmlsep=' '): + def set_xmltag(self, xmltag, xmlsep=' ', xmlmap=None): self.xmltag = xmltag self.xmlsep = xmlsep + self.xmlmap = xmlmap def get_value_from_xmlattr(self, xmlattrs): """ @@ -346,7 +359,7 @@ # # don't even write empty lists # pass - elif hasattr(self, 'xmlmap'): + elif self.xmlmap is not None: imap = get_inversemap(self.xmlmap) # print 'get_value_from_string',s,imap if imap.has_key(s): @@ -357,8 +370,12 @@ else: return self.get_numvalue_from_string(s) - def get_numvalue_from_string(self, s): - t = type(self._default) + def get_numvalue_from_string(self, s, valtype=None): + if valtype is None: + t = type(self._default) + else: + t = valtype + if t in (types.UnicodeType, types.StringType): return s @@ -376,7 +393,7 @@ return True else: return False - + # 'MethodType', 'ModuleType', 'NoneType', 'NotImplementedType', 'ObjectType' else: return None # unsuccessful @@ -385,7 +402,7 @@ self._write_xml_value(self.get_value(), fd) def _write_xml_value(self, val, fd): - # print 'write_xml',self.xmltag,hasattr(val, '__iter__') + # print 'write_xml',self.xmltag,'is array',hasattr(val, '__iter__'),'xmlmap',self.xmlmap if self.metatype == 'color': fd.write(xm.color(self.xmltag, val)) @@ -403,7 +420,7 @@ # don't even write empty lists pass - elif hasattr(self, 'xmlmap'): + elif self.xmlmap is not None: if self.xmlmap.has_key(val): fd.write(xm.num(self.xmltag, self.xmlmap[val])) else: @@ -581,17 +598,32 @@ else: unit = '' # return repr(self.get_value())+unit - return str(self.get_value())+unit + v = self.get_value() + # print 'format_value',self.attrname,v,type(v) - def format_symbol(self): + if not hasattr(v, '__iter__'): + # print ' ',hasattr(self, 'digits_fraction'),(not math.isnan(v)),(not math.isinf(v)) + if hasattr(self, 'digits_fraction'): + if (not math.isnan(v)) & (not math.isinf(v)): + printformat = "%."+str(self.digits_fraction)+"f" + return printformat % v+unit + else: + return str(v)+unit + else: + return str(v)+unit + else: + return str(v)+unit + + def format_symbol(self, show_parentesis=True): if hasattr(self, 'symbol'): symbol = self.symbol else: symbol = self._name - return symbol+' '+self.format_unit(show_parentesis=True) + return symbol+' '+self.format_unit(show_parentesis=show_parentesis) #### + def get_value(self): # always return attribute, no indexing, no plugin if self._is_localvalue: @@ -705,6 +737,10 @@ setattr(self._obj, self.attrname, self.value) # TODO: could be made nicer with method del self.value # no longer needed + # this attribute became compulsory + if not hasattr(self, 'xmlmap'): + self.xmlmap = None + # print ' check',hasattr(self,'value') # print ' value=',self.get_value() self._is_saved = False @@ -733,6 +769,43 @@ ) +class ListConf(AttrConf): + """ + Specifies a list of objects. + Objects may be editable or selectable in the GUI + """ + + def __init__(self, attrname, default, + sep=',', valtype=None, is_fixedlength=False, + perm='rw', **kwargs): + #self._is_child = is_child + if valtype is None: + if len(default) > 0: + valtype = type(default[0]) + else: + valtype = types.UnicodeType + + AttrConf.__init__(self, attrname, default, + struct='scalar', + metatype='list', + sep=sep, + valtype=valtype, + is_fixedlength=is_fixedlength, + perm=perm, + **kwargs + ) + + def get_value_from_string(self, s, sep=None): + """ + Returns the attribute value from a string in the correct type. + """ + value = [] + for val in s.split(self.sep): + value.append(self.get_numvalue_from_string(val, valtype=self.valtype)) + + return value + + class ObjConf(AttrConf): """ Contains additional information on the object's attribute. @@ -788,6 +861,7 @@ before returning states. To be overridden. """ + # print 'ObjConf._getstate_specific',self.attrname,self._is_child,self._is_save if self._is_save: if self._is_child: @@ -796,7 +870,12 @@ else: # print ' remove object reference from value and create ident' state['value'] = None - state['_ident_value'] = self.get_value().get_ident_abs() + if self.get_value() is not None: + # print ' found object',self.get_value().get_ident_abs() + state['_ident_value'] = self.get_value().get_ident_abs() + else: + print 'WARNING in ObjConf._getstate_specific', self.attrname, 'lost linked object' + state['_ident_value'] = [] # print ' ', def is_modified(self): @@ -836,13 +915,17 @@ # Called from init_postload_external of attrsman during load_obj # ident_abs = self._ident_value - # print 'reset_linkobj',self.attrname,ident_abs - obj = self.get_obj() - rootobj = obj.get_root() - # print ' rootobj',rootobj.ident - linkobj = rootobj.get_obj_from_ident(ident_abs) - # print ' linkobj',linkobj.ident - self.set_value(linkobj) + if len(ident_abs) > 0: + # print 'reset_linkobj',self.attrname,ident_abs + obj = self.get_obj() + rootobj = obj.get_root() + # print ' rootobj',rootobj.ident + linkobj = rootobj.get_obj_from_ident(ident_abs) + # print ' linkobj',linkobj.ident + self.set_value(linkobj) + else: + print 'WARNING in ObjConf._getstate_specific', self.attrname, 'lost linked object' + self.set_value(BaseObjman('lost_object')) # def get_valueobj(self): # """ @@ -937,6 +1020,14 @@ def get_id_from_index(self, index): return self._index_to_id[index] + def has_indices(self, indices): + ans = len(indices)*[False] + for i in range(len(indices)): + if self._index_to_id.has_key(indices[i]): + ans[i] = True + + return ans + def has_index(self, index): return self._index_to_id.has_key(index) @@ -959,6 +1050,7 @@ return ids # use set instead of add + def add_indices(self, ids, indices): for _id, index in zip(ids, indices): self.add_index(_id, index) @@ -1788,17 +1880,20 @@ modified.append(attrconf) return modified + def __getitem__(self, attrname): + return getattr(self, attrname).get_value() + def get_config(self, attrname): return getattr(self, attrname) # a bit risky - def get_configs(self, is_all=False, structs=None, filtergroupnames=None): + def get_configs(self, is_all=False, structs=None, filtergroupnames=None, is_private=False): # print 'get_configs',self,self._obj.ident,structs,filtergroupnames,len(self._attrconfigs) if is_all: return self._attrconfigs else: attrconfigs = [] for attrconf in self._attrconfigs: - # print ' found',attrconf.attrname,attrconf.struct + # print ' found',attrconf.attrname,attrconf.struct,'groupnames',attrconf.groupnames is_check = True if (structs is not None): if (attrconf.struct not in structs): @@ -1807,7 +1902,7 @@ if is_check: # print ' **is_check',is_check if len(attrconf.groupnames) > 0: - if '_private' not in attrconf.groupnames: + if ('_private' not in attrconf.groupnames) | is_private: # print ' not private' if filtergroupnames is not None: # print ' apply filtergroupnames',filtergroupnames,attrconf.groupnames @@ -1829,7 +1924,7 @@ def get_obj(self): return self._obj - def add(self, attrconf, is_overwrite=False): + def add(self, attrconf, is_overwrite=False, is_prepend=False): """ Add a one or several new attributes to be managed. kwargs has attribute name as key and Attribute configuration object @@ -1838,7 +1933,7 @@ attrname = attrconf.attrname # print '\n\nAttrsman.add',self.get_obj().ident,'add',attrname,self.has_attrname(attrname) - dir(self._obj) + # dir(self._obj) if (not self.has_attrname(attrname)) | is_overwrite: attrconf.set_obj(self._obj) attrconf.set_manager(self) @@ -1847,7 +1942,10 @@ setattr(self, attrname, attrconf) # append also to the list of managed objects - self._attrconfigs.append(attrconf) + if is_prepend: + self._attrconfigs.insert(0, attrconf) + else: + self._attrconfigs.append(attrconf) # insert in groups self.insert_groupnames(attrconf) @@ -1892,6 +1990,14 @@ if attrconf not in self._groups[groupname]: self._groups[groupname].append(attrconf) + def del_groupname(self, attrconf): + if len(attrconf.groupnames) > 0: + for groupname in self._groups.keys(): + attrconfigs = self._groups[groupname] + if attrconf in attrconfigs: + if groupname not in attrconf.groupnames: + attrconfigs.remove(attrconf) + def get_groups(self): return self._groups @@ -1923,13 +2029,33 @@ # print ' attrs',attrs return attrs + def write_csv(self, fd, sep=',', + show_parentesis=False, attrconfigs=None, + groupnames=None, + is_export_not_save=True): + # print 'Attrsman.write_csv attrconfigs'#,attrconfigs,'groupnames',groupnames, + if attrconfigs is None: + attrconfigs = self.get_configs(is_all=False, structs=STRUCTS_SCALAR, filtergroupnames=groupnames) + + for attrconf in attrconfigs: + # print ' attrconfig', attrconf.attrname,attrconf.struct,attrconf.metatype + if (attrconf.is_save() | is_export_not_save) & (attrconf.struct in STRUCTS_SCALAR): + mt = attrconf.metatype + + if mt == 'id': + fd.write('%s %s%s%s\n' % (attrconf.attrname, attrconf.format_unit(show_parentesis), + sep, attrconf.get_linktab().format_ids([attrconf.get_value()]))) + else: + fd.write('%s %s%s%s\n' % (attrconf.attrname, attrconf.format_unit( + show_parentesis), sep, attrconf.format_value())) + def print_attrs(self, show_unit=True, show_parentesis=False, attrconfigs=None): print 'Attributes of', self._obj._name, 'ident_abs=', self._obj.get_ident_abs() if attrconfigs is None: - attrconfigs = self.get_configs() + attrconfigs = self.get_configs(structs=STRUCTS_SCALAR) - for attrconf in attrconfigs: - print ' %s =\t %s' % (attrconf.attrname, attrconf.format_value(show_unit=True)) + # for attrconf in attrconfigs: + # print ' %s =\t %s'%(attrconf.attrname, attrconf.format_value(show_unit=True)) def save_values(self, state): """ @@ -1941,7 +2067,7 @@ def delete(self, attrname): """ - Delete attibite with respective name + Delete attribute with respective name """ # print '.__delitem__','attrname=',attrname @@ -1967,9 +2093,10 @@ def __getstate__(self): # if hasattr(self,'attrname'): - # print 'Attrsman.__getstate__',self.attrname,' of obj=',self._obj.ident + # print 'Attrsman.__getstate__ of',self.attrname,' of obj=',self._obj.ident,'id',id(self),'id obj',id(self._obj) + # # else: - # print 'WARNING in Attrsman.__getstate__','attrname missing' + # print 'WARNING in Attrsman.__getstate__',self,'attrname missing','id',id(self),'id obj',id(self._obj) if not hasattr(self, '_obj'): print 'WARNING: unknown obj in attrman', self, type(self) @@ -1989,8 +2116,8 @@ state = {} for attr in self.__dict__.keys(): - # print ' attr',attr,self.__dict__[attr] - # TODO: optimize and put this at the end + # print ' attr',attr,self.__dict__[attr] + # TODO: optimize and put this at the end if attr == 'plugin': plugin = self.__dict__[attr] if plugin is not None: @@ -2001,7 +2128,11 @@ elif attr == '_attrconfigs': attrconfigs_save = [] for attrconfig in self._attrconfigs: + if attrconfig.is_save(): + # print ' save',attrconfig.attrname + # if attrconfig.struct == 'array': + # print ' size =',len(self) attrconfigs_save.append(attrconfig) state[attr] = attrconfigs_save @@ -2053,10 +2184,10 @@ Called after set state. Link external states. """ - # print 'init_postload_external',self._obj.get_ident() + # print 'Attrsman.init_postload_external',self._obj.get_ident() for attrconfig in self.get_configs(is_all=True): - # print ' ***',attrconfig.attrname,attrconfig.metatype + # print ' call',attrconfig.attrname,attrconfig.metatype attrconfig.init_postload_external() @@ -2113,11 +2244,13 @@ return self._colconfigs else: colconfigs = [] + if filtergroupnames is not None: + filtergroupnameset = set(filtergroupnames) for colconfig in self._colconfigs: if len(colconfig.groupnames) > 0: - if colconfig.groupnames[0] != '_private': + if '_private' not in colconfig.groupnames: if filtergroupnames is not None: - if not set(filtergroupnames).isdisjoint(colconfig.groupnames): + if not filtergroupnameset.isdisjoint(colconfig.groupnames): colconfigs.append(colconfig) else: colconfigs.append(colconfig) @@ -2270,14 +2403,83 @@ else: self.del_row(ids) - def print_attrs(self, **kwargs): + def print_attrs(self, ids=None, **kwargs): # print 'Attributes of',self._obj._name,'(ident=%s)'%self._obj.ident Attrsman.print_attrs(self, attrconfigs=self.get_configs(structs=['scalar']), **kwargs) # print ' ids=',self._ids - for _id in self.get_ids(): + if ids is None: + ids = self.get_ids() + + for _id in ids: for attrconf in self.get_configs(structs=STRUCTS_COL): print ' %s[%d] =\t %s' % (attrconf.attrname, _id, attrconf.format_value(_id, show_unit=True)) + def write_csv(self, fd, sep=',', ids=None, + attrconfigs=None, + groupnames=None, + show_parentesis=True, + is_export_not_save=True, # export attr, also non save + name_id='ID', + ): + # if attrconfigs is None: + # attrconfigs = self.get_configs() + # print 'Tabman.write_csv attrconfigs is_export_not_save',is_export_not_save + + Attrsman.write_csv(self, fd, sep=sep, + show_parentesis=show_parentesis, + groupnames=groupnames, + attrconfigs=attrconfigs, + #is_export_private = False, + is_export_not_save=is_export_not_save, # export attr, also non save + ) + # fd.write('\n') + # for attrconf in attrconfigs: + # #print ' %s =\t %s'%(attrconf.attrname, attrconf.format_value(show_unit=True)) + # fd.write( '%s %s%s%s\n'%(attrconf.attrname,format_unit(show_parentesis), sep, attrconf.format_value())) + + if ids is None: + ids = self.get_ids() + + if groupnames is not None: + #attrconfigs = self.get_group(groupname) + attrconfigs = self.get_configs(is_all=False, filtergroupnames=groupnames) + is_exportall = False + + elif attrconfigs is None: + attrconfigs = self.get_colconfigs(is_all=False) + #is_exportall = False + + # check if attributes are all column attribute and indicted for save + attrconfigs_checked = [] + for attrconf in attrconfigs: + if (attrconf.is_save() | is_export_not_save) & (attrconf.struct in STRUCTS_COL): + + attrconfigs_checked.append(attrconf) + + # first table row + row = name_id + for attrconf in attrconfigs_checked: + # print ' attrconfig', attrconf.attrname,attrconf.metatype + row += sep+self._clean_csv(attrconf.format_symbol(show_parentesis=show_parentesis), sep) + fd.write(row+'\n') + + # rest + for _id in ids: + row = str(_id) + row = self._clean_csv(row, sep) + for attrconf in attrconfigs: + mt = attrconf.metatype + # print ' attrconf,',attrconf.attrname,mt,attrconf[_id] + if mt == 'id': + # print ' ', + row += sep+self._clean_csv(attrconf.get_linktab().format_ids([attrconf[_id]]), sep) + else: + row += sep+self._clean_csv('%s' % (attrconf.format_value(_id, show_unit=False)), sep) + + # make sure there is no CR in the row!! + # print row + fd.write(row+'\n') + class BaseObjman: """ @@ -2343,10 +2545,15 @@ pass def set_version(self, version): + self._version = version def get_version(self): - return self._version + if hasattr(self, '_version'): + return self._version + else: + # for compatibility + return 0.0 # def _upgrade_version(self): # pass @@ -2467,6 +2674,43 @@ s += self._format_ident(ident)+'.' return s[:-1] + def export_csv(self, filepath, sep=',', + attrconfigs=None, groupnames=None, + is_header=True, is_ident=False, is_timestamp=True, + show_parentesis=True): + """ + Export scalars to file feed in csv format. + """ + print 'BaseObjman.export_csv', filepath, "*"+sep+"*", 'attrconfigs', attrconfigs, self.get_attrsman() + fd = open(filepath, 'w') + + # header + if is_header: + + row = self._clean_csv(self.get_name(), sep) + if is_ident: + row += sep+'(ident=%s)' % self.format_ident_abs() + fd.write(row+'\n') + if is_timestamp: + now = datetime.now() + fd.write(self._clean_csv(now.isoformat(), sep)+'\n') + fd.write('\n\n') + + self.get_attrsman().write_csv(fd, sep=sep, + show_parentesis=show_parentesis, groupnames=groupnames, + attrconfigs=attrconfigs) + + fd.close() + + def _clean_csv(self, row, sep): + row = row.replace('\n', ' ') + #row=row.replace('\b',' ') + row = row.replace('\r', ' ') + #row=row.replace('\f',' ') + #row=row.replace('\newline',' ') + row = row.replace(sep, ' ') + return row + def get_root(self): # if hasattr(self,'_is_root'): # print 'get_root',self.ident,'is_root',self._is_root @@ -2659,7 +2903,7 @@ """ #self._is_root = is_root - print 'init_postload_external', self.ident # ,self._is_root + # print 'init_postload_external',self.ident#,self._is_root # set default logger self.set_logger(Logger(self)) # for child in self.childs.values(): @@ -2812,26 +3056,16 @@ self._init_attributes() self._init_constants() - def export_csv(self, filepath, sep=',', name_id='ID', - file=None, attrconfigs=None, ids=None, groupname=None, - is_header=True, is_ident=False, is_timestamp=True): - - # print 'export_csv',filepath,"*"+sep+"*" + def export_csv(self, filepath, sep=',', + ids=None, attrconfigs=None, groupnames=None, + is_header=True, is_ident=False, is_timestamp=True, + show_parentesis=True, name_id='ID'): + """ + Export scalars to file feed in csv format. + """ + print 'TableMixin.export_csv', filepath, "*"+sep+"*" # ,'attrconfigs',attrconfigs,self.get_attrsman() fd = open(filepath, 'w') - if ids is None: - ids = self.get_ids() - - if groupname is not None: - attrconfigs = self.get_group(groupname) - is_exportall = False - - if attrconfigs is None: - attrconfigs = self.get_colconfigs(is_all=True) - is_exportall = False - else: - is_exportall = True - # header if is_header: @@ -2844,42 +3078,11 @@ fd.write(self._clean_csv(now.isoformat(), sep)+'\n') fd.write('\n\n') - # first table row - row = name_id - for attrconf in attrconfigs: - # print ' write first row',attrconf.attrname - is_private = attrconf.has_group('_private') - if ((not is_private) & (attrconf.is_save())) | is_exportall: - row += sep+self._clean_csv(attrconf.format_symbol(), sep) - fd.write(row+'\n') + self.get_attrsman().write_csv(fd, sep=sep, ids=ids, + show_parentesis=show_parentesis, groupnames=groupnames, + attrconfigs=attrconfigs, name_id='ID') - # rest - for _id in ids: - # if self._is_keyindex: - # row = str(self.get_key_from_id(id))#.__repr__() - # else: - row = str(_id) - row = self._clean_csv(row, sep) - for attrconf in attrconfigs: - is_private = attrconf.has_group('_private') - if ((not is_private) & (attrconf.is_save())) | is_exportall: - row += sep+self._clean_csv('%s' % (attrconf.format_value(_id, show_unit=False)), sep) - - # make sure there is no CR in the row!! - # print row - fd.write(row+'\n') - - if filepath is not None: - fd.close() - - def _clean_csv(self, row, sep): - row = row.replace('\n', ' ') - #row=row.replace('\b',' ') - row = row.replace('\r', ' ') - #row=row.replace('\f',' ') - #row=row.replace('\newline',' ') - row = row.replace(sep, ' ') - return row + fd.close() def clear_rows(self): if self.plugin: @@ -3069,7 +3272,6 @@ self.set_attrsman(self) - ############################################################################### if __name__ == '__main__': """ diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/exports.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/exports.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/exports.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/exports.py 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,203 @@ +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. +# SUMOPy module +# Copyright (C) 2012-2021 University of Bologna - DICAM +# 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 exports.py +# @author Joerg Schweizer +# @date 2012 + + +import os +import sys +import types +import numpy as np +import agilepy.lib_base.classman as cm +import agilepy.lib_base.arrayman as am + + +from agilepy.lib_base.processes import Process + +#global IS_EXCEL + +try: + from openpyxl import Workbook + + IS_EXCEL = True + + +except: + print 'WARNING: No Exel export possible. Install openpyxl python package.' + IS_EXCEL = False + +# if 'Workbook' in dir(): +# print 'detected Exel' +# IS_EXCEL = True +# else: +# IS_EXCEL = False + +print 'IS_EXCEL', IS_EXCEL + + +def export_excel(filepath, obj, ids=None, attrconfigs=None, groupnames=None, + is_header=True, is_ident=False, is_timestamp=True, + show_parentesis=True, name_id='ID', is_export_not_save=True): + + print 'export_excel' # ,attrconfigs,'groupnames',groupnames, + + wb = Workbook() + if (wb.worksheets) >= 1: + ws = wb.worksheets[0] + ws.title = "Scalar attributes" + else: + ws = wb.create_sheet(title="Scalar attributes") + + attrsman = obj.get_attrsman() + if attrconfigs is None: + attrconfigs = attrsman.get_configs(is_all=False, filtergroupnames=groupnames) + #attrconfigs_cols = attrsman.get_configs(is_all = False, structs = cm.STRUCTS_COL, filtergroupnames = groupnames) + ind_row = 1 + + for attrconf in attrconfigs: + # print ' attrconfig', attrconf.attrname,attrconf.struct + if (attrconf.is_save() | is_export_not_save) & (attrconf.struct in cm.STRUCTS_SCALAR): + # print ' attrconf.attrname',attrconf.attrname,'val',attrconf.get_value() + cell = ws.cell(row=ind_row, column=1) + cell.value = attrconf.attrname+attrconf.format_unit(show_parentesis) + cell = ws.cell(row=ind_row, column=2) + value = attrconf.get_value() + tv = type(value) + if tv in cm.NODATATYPES: + value = str(value) + elif tv in (types.ListType, types.TupleType, np.ndarray): + value = str(value) + + cell.value = value + #d.value = 3.14 + # print " cell",ind_row,'value',cell.value + ind_row += 1 + + # check if attributes are all column attribute and indicted for save + + ws = wb.create_sheet(title="Table attributes") + if hasattr(obj, 'get_ids'): + if ids is None: + ids = obj.get_ids() + + attrconfigs_checked = [] + for attrconf in attrconfigs: + if (attrconf.is_save() | is_export_not_save) & (attrconf.struct in cm.STRUCTS_COL): + attrconfigs_checked.append(attrconf) + + # first table row + ind_row = 1 + ind_col = 1 + cell = ws.cell(row=ind_row, column=ind_col) + cell.value = name_id + + for attrconf in attrconfigs_checked: + + cell = ws.cell(row=ind_row, column=ind_col) + cell.value = attrconf.format_symbol(show_parentesis=show_parentesis) + ind_col += 1 + + # rest + for _id in ids: + ind_row += 1 + ind_col = 1 + cell = ws.cell(row=ind_row, column=ind_col) + cell.value = _id + + for attrconf in attrconfigs_checked: + + cell = ws.cell(row=ind_row, column=ind_col) + value = attrconf[_id] + # print ' attrconfig', attrconf.attrname,type(value) + tv = type(value) + mt = attrconf.metatype + if tv in cm.NODATATYPES: + value = str(value) + + elif mt == 'id': + value = attrconf.get_linktab().format_ids([value]) + elif tv in (types.ListType, types.TupleType, np.ndarray): + value = str(value) + cell.value = value + ind_col += 1 + + wb.save(filepath) + + +class CsvExporter(Process): + def __init__(self, obj, ident='csvexporter', name='CSV exporter', + info='Export data from a CSV file into object', + logger=None, **kwargs): + print 'CsvExporter.__init__' + self._init_common(ident, + parent=obj, + name=name, + logger=logger, + info=info, + ) + + attrsman = self.set_attrsman(cm.Attrsman(self)) + self.csvfilepath = attrsman.add(cm.AttrConf('csvfilepath', kwargs.get('csvfilepath', ''), + groupnames=['options'], + perm='rw', + name='CSV file', + wildcards='CSV file (*.csv)|*.csv|*.CSV', + metatype='filepath', + info="CSV plain text file path.", + )) + + self.sep = attrsman.add(cm.AttrConf('sep', kwargs.get('sep', ","), + groupnames=['options', ], + perm='rw', + name='Separator', + info="""Seperator used in SCV file. Exampe: ; , """, + )) + + self.is_header = attrsman.add(cm.AttrConf('is_header', kwargs.get('is_header', True), + groupnames=['options', ], + perm='rw', + name='Make header', + info="""Make header with date and time.""", + )) + + self.show_parentesis = attrsman.add(cm.AttrConf('show_parentesis', kwargs.get('show_parentesis', True), + groupnames=['options', ], + perm='rw', + name='Show units in parenthesis', + info="""Show units (if any) in parenthesis.""", + )) + # self.name_id = attrsman.add(cm.AttrConf('name_id', kwargs.get('name_id',"ID"), + # groupnames = ['options',], + # perm='rw', + # name = 'ID string', + # info = """String to be used to indicate IDs""", + # )) + + def do(self): + print 'CsvExporter.do', + obj = self.parent + attrsman = self.get_attrsman() + sep = self.sep + #logger = self._logger + + obj.export_csv(self.csvfilepath, sep=self.sep, + #ids = None, + attrconfigs=None, + groupnames=None, + show_parentesis=self.show_parentesis, + is_export_not_save=True, # export attr, also non save + # name_id='ID', + is_header=self.is_header) diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/geometry.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/geometry.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/geometry.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/geometry.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,10 +14,33 @@ # @file geometry.py # @author Joerg Schweizer -# @date +# @date 2012 import numpy as np - +try: + from shapely.geometry import MultiPoint, Polygon, Point, LineString + IS_SHAPELY = True +except: + IS_SHAPELY = False + + +# >>> from geometry import * +# >>> cv = [(0,0),(0,1),(0,2),(0,3),(3,3),(3,0)] +# >>> cc = [(0,0),(0,1),(1,1),(1,2),(0,2),(0,3),(3,3),(3,0)] +# >>> +# >>> p=Point(0.5,2) +# >>> policc=Polygon(cc) +# >>> policv=Polygon(cv) +# >>> is_point_in_polygon(p,cv, is_use_shapely = True) +# >>> pc = [0.5,2] +# >>> is_point_in_polygon(pc,cv, is_use_shapely = True) +# True +# >>> is_point_in_polygon(pc,cc, is_use_shapely = True) +# False +# >>> is_point_in_polygon(pc,cc, is_use_shapely = False) +# False +# >>> is_point_in_polygon(pc,cv, is_use_shapely = False) +# True def get_norm_2d(vertex3d): # print 'get_norm_2d',vertex3d.shape @@ -262,8 +285,8 @@ If is_return_pos then the position on the section is returned. - Inspired by the description by Paul Bourke, October 1988 - http://paulbourke.net/geometry/pointlineplane/ + Written by Paul Bourke, October 1988 + http://astronomy.swin.edu.au/~pbourke/geometry/pointline/ Rewritten in vectorial form by Joerg Schweizer """ @@ -294,12 +317,15 @@ y = y1 + u * dy21 if is_ending: - ie = u < 0 - x[ie] = x1[ie] - y[ie] = y1[ie] - ie = u > 1 - x[ie] = x2[ie] - y[ie] = y2[ie] + if not is_detect_initial: + ie = u < 0 + x[ie] = x1[ie] + y[ie] = y1[ie] + + if not is_detect_final: + ie = u > 1 + x[ie] = x2[ie] + y[ie] = y2[ie] dx30 = x3-x dy30 = y3-y @@ -346,20 +372,27 @@ return a/2, p -def find_area(array): +def find_area(array, is_use_shapely=True): """ Single polygon with 2D coordinates. """ # TODO: check, there are negative A!!!! # print 'find_area',array - a = 0 - ox, oy = array[0] - for x, y in array[1:]: - a += (x*oy-y*ox) - ox, oy = x, y + if len(array) >= 3: + if IS_SHAPELY & is_use_shapely: + return Polygon(np.array(array)[:, :2]).area - # print ' =',np.abs(a/2) - return np.abs(a/2) + else: + a = 0 + ox, oy = array[0] + for x, y in array[1:]: + a += (x*oy-y*ox) + ox, oy = x, y + + # print ' =',np.abs(a/2) + return np.abs(a/2) + else: + return 0.0 def get_polygonarea_fast(x, y): @@ -371,50 +404,76 @@ return 0.5*np.abs(np.dot(x, np.roll(y, 1))-np.dot(y, np.roll(x, 1))) -def is_point_in_polygon(point, poly): +def is_point_in_polygon(point, poly, is_use_shapely=True): """ Scalar! """ - is_3d = len(point) == 3 + if len(poly) >= 3: + if IS_SHAPELY & is_use_shapely: + pol = Polygon(np.array(poly)[:, :2]) + return Point(point[:2]).within(pol) + else: + is_3d = len(point) == 3 + + if is_3d: + x, y, z = point + p1x, p1y, p1z = poly[0] + else: + x, y = point + p1x, p1y = poly[0] + n = len(poly) + inside = False + + for i in range(n+1): + if is_3d: + p2x, p2y, p2z = poly[i % n] + else: + p2x, p2y = poly[i % n] + if y > min(p1y, p2y): + if y <= max(p1y, p2y): + if x <= max(p1x, p2x): + if p1y != p2y: + xints = (y-p1y)*(p2x-p1x)/(p2y-p1y)+p1x + if p1x == p2x or x <= xints: + inside = not inside + p1x, p1y = p2x, p2y + + return inside - if is_3d: - x, y, z = point - p1x, p1y, p1z = poly[0] else: - x, y = point - p1x, p1y = poly[0] - n = len(poly) - inside = False - - for i in range(n+1): - if is_3d: - p2x, p2y, p2z = poly[i % n] + return False + + +def is_polyline_intersect_polygon(polyline, polygon, is_use_shapely=True, is_lineinterpolate=True): + if IS_SHAPELY & is_use_shapely: + poly = Polygon(np.array(polygon)[:, :2]) + if is_lineinterpolate: + # requires that any line interpolation between 2 points + # intersects the polygon + return LineString(np.array(polyline)[:, :2]).intersects(poly) else: - p2x, p2y = poly[i % n] - if y > min(p1y, p2y): - if y <= max(p1y, p2y): - if x <= max(p1x, p2x): - if p1y != p2y: - xints = (y-p1y)*(p2x-p1x)/(p2y-p1y)+p1x - if p1x == p2x or x <= xints: - inside = not inside - p1x, p1y = p2x, p2y - - return inside - - -def is_polyline_intersect_polygon(polyline, polygon): - for p in polyline: - if is_point_in_polygon(p, polygon): - return True - return False - - -def is_polyline_in_polygon(polyline, polygon): - for p in polyline: - if not is_point_in_polygon(p, polygon): - return False - return True + # requires that at least one point is inside the polygon + return MultiPoint(np.array(polyline)[:, :2]).intersects(poly) + + else: + # WARNING: this dows not work if no point of the polyline + # resides within the polygon + for p in polyline: + if is_point_in_polygon(p, polygon): + return True + return False + + +def is_polyline_in_polygon(polyline, polygon, is_use_shapely=True): + if IS_SHAPELY & is_use_shapely: + poly = Polygon(np.array(polygon)[:, :2]) + return MultiPoint(np.array(polyline)[:, :2]).within(poly) + + else: + for p in polyline: + if not is_point_in_polygon(p, polygon): + return False + return True def get_angles_perpendicular(shape): @@ -528,25 +587,105 @@ ang1 = np.arctan2(*p1[::-1]) ang2 = np.arctan2(*p2[::-1]) # return np.rad2deg((ang1 - ang2) % (2 * np.pi)) - return (ang1 - ang2) % (2 * np.pi) + if hasattr(ang1, '__iter__'): + return anglediffs(ang1, ang2) + else: + return anglediff(ang1, ang2) ################################################################ # old -# find indees where 2 arrays are identical -#idx = np.argwhere(np.diff(np.sign(f - g)) != 0).reshape(-1) + 0 +def anglediff(a1, a2): + """Compute the smallest difference between two angle arrays. + Parameters + ---------- + a1, a2 : np.ndarray + The angle arrays to subtract + Returns + ------- + out : np.ndarray + The difference between a1 and a2 + """ -def angle2D(p1, p2): - theta1 = math.atan2(p1[1], p1[0]) - theta2 = math.atan2(p2[1], p2[0]) - dtheta = theta2 - theta1 + dtheta = a1 - a2 while dtheta > np.pi: dtheta -= 2.0*np.pi while dtheta < -np.pi: dtheta += 2.0*np.pi + return dtheta +def anglediffs(a1, a2, deg=False): + """Compute the smallest difference between two angle arrays. + Parameters + ---------- + a1, a2 : np.ndarray + The angle arrays to subtract + deg : bool (default=False) + Whether to compute the difference in degrees or radians + Returns + ------- + out : np.ndarray + The difference between a1 and a2 + """ + print 'anglediffs', a1, a2 + return wrapanglediffs(a1 - a2, deg=deg) + + +def wrapanglediffs(diff, deg=False): + """Given an array of angle differences, make sure that they lie + between -pi and pi. + Parameters + ---------- + diff : np.ndarray + The angle difference array + deg : bool (default=False) + Whether the angles are in degrees or radians + Returns + ------- + out : np.ndarray + The updated angle differences + """ + + if deg: + base = 360 + else: + base = np.pi * 2 + + i = np.abs(diff) > (base / 2.0) + out = diff.copy() + out[i] -= np.sign(diff[i]) * base + return out + +# find indees where 2 arrays are identical +#idx = np.argwhere(np.diff(np.sign(f - g)) != 0).reshape(-1) + 0 + + +def azimut_from_origin(p, origin=[0, 0]): + # determine the azimut angle relative to a 2D point + p = np.array(p) - np.array(origin) + if p[0] > 0 and p[1] > 0: + return np.arctan(p[0]/p[1]) + if p[0] > 0 and p[1] < 0: + return np.arctan(p[0]/p[1])+np.pi + if p[0] < 0 and p[1] < 0: + return np.arctan(p[0]/p[1])+np.pi + if p[0] < 0 and p[1] > 0: + return np.arctan(p[0]/p[1])+2*np.pi + + +def angle2D(p1, p2): + theta1 = math.atan2(p1[1], p1[0]) + theta2 = math.atan2(p2[1], p2[0]) + #dtheta = theta2 - theta1; + # while dtheta > np.pi: + # dtheta -= 2.0*np.pi + # while dtheta < -np.pi: + # dtheta += 2.0*np.pi + return wrapanglediffs(theta2 - theta1) + + def is_point_within_polygon(pos, shape): angle = 0. pos = np.array(pos, float) @@ -560,3 +699,11 @@ p2 = ((shape[0][0] - pos[0]), (shape[0][1] - pos[1])) angle = angle + angle2D(p1, p2) return math.fabs(angle) >= np.pi + + +if __name__ == '__main__': + a1 = 0.0 + a2 = +0.1 + print 'a1', a1/np.pi*180 + print 'a2', a2/np.pi*180 + print 'anglediff(a1, a2)', anglediff(a1, a2)/np.pi*180 diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/imports.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/imports.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/imports.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/imports.py 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,180 @@ +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. +# SUMOPy module +# Copyright (C) 2012-2021 University of Bologna - DICAM +# 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 imports.py +# @author Joerg Schweizer +# @date 2012 + + +import os +import sys +import types +import numpy as np +import agilepy.lib_base.classman as cm +import agilepy.lib_base.arrayman as am + +from agilepy.lib_base.processes import Process + + +class CsvImporter(Process): + def __init__(self, obj, ident='csvimporter', name='CSV importer', + info='Import data from a CSV file into object', + logger=None, **kwargs): + print 'CsvImporter.__init__' + self._init_common(ident, + parent=obj, + name=name, + logger=logger, + info=info, + ) + + attrsman = self.set_attrsman(cm.Attrsman(self)) + self.csvfilepath = attrsman.add(cm.AttrConf('csvfilepath', kwargs.get('csvfilepath', ''), + groupnames=['options'], + perm='rw', + name='CSV file', + wildcards='CSV file (*.csv)|*.csv|*.CSV', + metatype='filepath', + info="CSV plain text file path.", + )) + + self.sep = attrsman.add(cm.AttrConf('sep', kwargs.get('sep', ","), + groupnames=['options', ], + perm='rw', + name='Separator', + info="""Seperator used in SCV file. Exampe: ; , """, + )) + + self.is_use_default_for_invalid = attrsman.add(cm.AttrConf('is_use_default_for_invalid', kwargs.get('is_use_default_for_invalid', True), + groupnames=['options', ], + perm='rw', + name='Use default for invalid', + info="""Use default for invalid.""", + )) + + for attrconf in obj.get_colconfigs(): + colattrname = self._get_colattrname(attrconf.attrname) + setattr(self, colattrname, + attrsman.add(cm.AttrConf(colattrname, attrconf.attrname, + groupnames=['options', 'colnames'], + perm='rw', + attrname_orig=attrconf.attrname, + name='Column name for %s' % attrconf.get_name(), + info='Name of column in CSV file for column %s. Include also hyphens and other delimiters when present in CSV file.' % attrconf.get_name(), + ))) + + def _get_colattrname(self, attrname): + return 'colname_'+attrname + + def do(self): + print 'CsvImporter.do', + obj = self.parent + attrsman = self.get_attrsman() + sep = self.sep + logger = self._logger + + aa = '\"' + emptycol = ("", "None", "NONE") + INTTYPE = 'i' + FLOATTYPE = 'f' + STRINGTYPE = 's' + BOOLTYPE = 'b' + is_use_nan = not self.is_use_default_for_invalid + + #INTLISTTYPE = 'li' + #FLOATLISTTYPE = 'lf' + #STRINGLISTTYPE = 'ls' + filepath = self.csvfilepath + f = open(filepath, 'r') + + INTTYPES = (types.IntType, np.int, np.int32, np.int64) + FLOATTYPES = (types.FloatType, types.LongType, types.ComplexType, np.float, np.float32, np.float64) + BOOLTYPES = (types.BooleanType, np.bool_) + + #line = f.readline() + # print ' line[:-1] = *%s*'%(line[:-1],) + index_to_value = {} + index_to_type = {} + index_to_attrname = {} + i = 0 + for csvattr_raw in f.readline().split(sep): + + csvattr = self._get_colattrname(csvattr_raw.strip().strip(aa)) + # print ' check csvattr *%s*, %d'%(csvattr,i),hasattr(self, csvattr) + + if hasattr(self, csvattr): + colnameconf = attrsman.get_config(csvattr) + index_to_attrname[i] = colnameconf.attrname_orig + index_to_value[i] = [] + attrconfig = obj.get_config(colnameconf.attrname_orig) + defaulttype = type(attrconfig.get_default()) + # print ' defaulttype',defaulttype + if defaulttype in INTTYPES: + index_to_type[i] = INTTYPE + elif defaulttype in FLOATTYPES: + index_to_type[i] = FLOATTYPE + elif defaulttype in BOOLTYPES: + index_to_type[i] = BOOLTYPE + else: + index_to_type[i] = STRINGTYPE + i += 1 + + if len(index_to_type) == 0: + if logger: + logger.w('file %s does not contain valid column names.' % os.path.basename(filepath)) + return False + + # print 'index_to_attrname',index_to_attrname + # print 'index_to_value',index_to_value + # print 'index_to_type',index_to_type + #n_cols = len(attrsinds) + if logger: + logger.w('import CSV from %s' % os.path.basename(filepath)) + n_imported = 0 + ind_max = max(index_to_value.keys()) + for line in f.readlines(): + cols = line.split(sep) + if len(cols) > ind_max: # restrictive! + for ind, vals, valtype in zip(index_to_value.keys(), index_to_value.values(), index_to_type.values()): + val = cols[ind].strip() + if val not in emptycol: + if valtype == INTTYPE: + vals.append(int(val)) + elif valtype == FLOATTYPE: + vals.append(float(val)) + elif valtype == BOOLTYPE: + if val in TRUEVALS: + vals.append(True) + else: + vals.append(False) + else: # type == STRINGTYPE: + vals.append(val.strip(aa)) + + elif is_use_nan: + if valtype == INTTYPE: + vals.append(np.nan) + elif valtype == FLOATTYPE: + vals.append(np.nan) + elif valtype == BOOLTYPE: + vals.append(np.nan) + else: # type == STRINGTYPE: + vals.append("") + n_imported += 1 + + ids = obj.add_rows(n_imported) + for ind, values in index_to_value.iteritems(): + getattr(obj, index_to_attrname[ind])[ids] = values + + f.close() + return True diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/__init__.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/__init__.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/__init__.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/__init__.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,6 +14,6 @@ # @file __init__.py # @author Joerg Schweizer -# @date +# @date 2012 __version__ = "0.0" diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/logger.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/logger.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/logger.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/logger.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file logger.py # @author Joerg Schweizer -# @date +# @date 2012 import types from time import gmtime, strftime @@ -49,7 +49,7 @@ del self._callbacks[key] def progress(self, percent): - pass + self.w(percent, key='progress') def w(self, data, key='message', **kwargs): # print 'Logger.w:',self._logfile is not None,self._is_stdout,data diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/misc.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/misc.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/misc.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/misc.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,9 +14,10 @@ # @file misc.py # @author Joerg Schweizer -# @date +# @date 2012 +import platform import types import numpy as np import time @@ -24,11 +25,25 @@ # default file path priming # this did depend on operating system, now " for all P = '"' -#import platform # if platform.system()=='Windows': -# P = '"' -# else: -# P='' +if platform.system() == 'Linux': + IS_LINUX = True +else: + IS_LINUX = False + + +def string_to_float(s): + """Returns a float from a string while cleaning it""" + q = '' + is_sample = False + for c in s: + if c.isdigit(): + q += c + elif c == '.': + q += c + else: + break + return float(q) def get_inversemap(m): @@ -138,3 +153,11 @@ for filepath in filepathstring.split(sep): filepaths.append(P+filepath.strip().replace('"', '')+P) return filepaths + + +def dict_to_str(d, intend=0): + s = '' + for key, value in d.iteritems(): + s += intend*" "+"%s: %s\n" % (key, value) + + return s diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/processes.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/processes.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/processes.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/processes.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,13 +14,14 @@ # @file processes.py # @author Joerg Schweizer -# @date +# @date 2012 import subprocess import os import sys import types +import pickle #SUMOPYDIR = os.path.join(os.path.dirname(__file__),"..") @@ -82,6 +83,7 @@ def _init_common(self, ident, parent=None, name=None, **kwargs): self._init_objman(ident=ident, parent=parent, name=name, **kwargs) attrsman = self.set_attrsman(cm.Attrsman(self)) + self.optiongroupnames = ['options'] #self.net = attrsman.add( cm.ObjConf( network.Network(self) ) ) self.status = attrsman.add(cm.AttrConf( 'status', 'preparation', @@ -90,8 +92,8 @@ name='Status', info='Process status: preparation-> running -> success|error.' )) - self._logger.w(self.get_name(), key='action') - self._logger.w('Prepare', key='message') + #self._logger.w(self.get_name(), key='action') + #self._logger.w('Prepare', key='message') def _set_status(self, status): self.status = status @@ -106,7 +108,7 @@ if self.is_ready(): logger = self.get_logger() self.status = 'running' - logger.start('Start process: %s' % self.get_name()) + logger.start('Run process: %s' % self.get_name()) #logger.w('start', key='message') # @@ -150,6 +152,40 @@ """ return True + def save_options(self, filepath): + optiondata = {} + for attrconf in self.get_attrsman().get_configs(filtergroupnames=self.optiongroupnames): + optiondata[attrconf.attrname] = attrconf.get_value() + + cm.save_obj(optiondata, filepath, is_not_save_parent=False) + + try: + f = open(filepath, 'wb') + except: + print 'WARNING in save: could not open', filepath + return False + + # print ' before',is_not_save_parent,parent,obj.parent + pickle.dump(optiondata, f, protocol=2) + f.close() + + def load_options(self, filepath): + try: + f = open(filepath, 'rb') + except: + print 'WARNING in load_options: could not open', filepath + return None + + # try: + # print ' pickle.load...' + optiondata = pickle.load(f) + f.close() + + attrsman = self.get_attrsman() + for attrname, value in optiondata.iteritems(): + if attrsman.has_attrname(attrname): + attrsman.get_config(attrname).set_value(value) + class Options: """ @@ -158,14 +194,17 @@ def __init__(self, **kwargs): self._optionattrs = [] + self._cmlvaluemaps = [] self._transdir = {} self._filepathattrs = [] for attr, value in kwargs.iteritems(): self.add_option(attr, value) - def add_option(self, attr='', value='', cml=None, is_filepath=False): + def add_option(self, attr='', value='', cml=None, + is_filepath=False, cmlvaluemap=None): setattr(self, attr, value) self._optionattrs.append(attr) + self._cmlvaluemaps.append(cmlvaluemap) if cml is not None: self._transdir[attr] = cml if is_filepath: @@ -187,31 +226,45 @@ def get_optionstring(self): # print 'get_optionstring' s = '' - for attr in self._optionattrs: + for attr, cmlvaluemap in zip(self._optionattrs, self._cmlvaluemaps): value = getattr(self, attr) cmlattr = self._transdir.get(attr, attr) - # print ' option',attr,cmlattr,attr in self._filepathattrs,type(value) - if attr in self._filepathattrs: - if value != '': - s += ' '+cmlattr+' %s' % filepathlist_to_filepathstring(value.split(',')) - elif type(value) == types.BooleanType: - if value: - s += ' '+cmlattr - elif type(value) in [types.StringTypes, types.UnicodeType]: - if P == '"': # windows - s += ' '+cmlattr+' "%s"' % value + is_continue = True + if cmlvaluemap is not None: + if cmlvaluemap.has_key(value): + is_continue = False # take value from mapping + if P == '"': # windows + s += ' '+cmlattr+' "%s"' % cmlvaluemap[value] + else: + s += ' '+cmlattr+" '%s'" % cmlvaluemap[value] + # print ' option',attr,cmlattr, 'cmlvaluemap',cmlvaluemap + + if is_continue: + + if attr in self._filepathattrs: + if value != '': + s += ' '+cmlattr+' %s' % filepathlist_to_filepathstring(value.split(',')) + elif type(value) == types.BooleanType: + if value: + s += ' '+cmlattr + elif type(value) in [types.StringTypes, types.UnicodeType]: + if P == '"': # windows + s += ' '+cmlattr+' "%s"' % value + else: + s += ' '+cmlattr+" '%s'" % value else: - s += ' '+cmlattr+" '%s'" % value - else: - s += ' '+cmlattr+' %s' % value + s += ' '+cmlattr+' %s' % value return s class CmlMixin: - def init_cml(self, command, is_run_background=False, is_nohup=False): + def init_cml(self, command, is_run_background=False, is_nohup=False, workdirpath=None): + self.optiongroupname = 'cml-options' + self.optiongroupnames.append(self.optiongroupname) attrsman = self.get_attrsman() self.pathmetatypes = ['filepath', 'dirpath', 'filepaths', 'dirpaths'] + self.workdirpath = workdirpath self._command = attrsman.add(cm.AttrConf( '_command', command, groupnames=['_private'], @@ -265,15 +318,19 @@ options = Options() for attrconfig in self.get_attrsman().get_configs(is_all=True): if self.optiongroupname in attrconfig.groupnames: - print ' option', attrconfig.attrname, attrconfig.groupnames, attrconfig.get_metatype() in self.pathmetatypes + print ' option', attrconfig.attrname, attrconfig.groupnames, 'is path', attrconfig.get_metatype() in self.pathmetatypes, 'has cmlmap', hasattr(attrconfig, 'cmlvaluemap') is_enabled = True if hasattr(attrconfig, 'is_enabled'): - # print ' is_enabled=',attrconfig.is_enabled(self), attrconfig.get_value() + print ' is_enabled=', attrconfig.is_enabled(self), attrconfig.get_value() is_enabled = attrconfig.is_enabled(self) if is_enabled: # disabeled options are simply not added + if hasattr(attrconfig, 'cmlvaluemap'): + cmlvaluemap = attrconfig.cmlvaluemap + else: + cmlvaluemap = None is_filepath = attrconfig.get_metatype() in self.pathmetatypes - options.add_option(attrconfig.attrname, attrconfig.get_value(), - attrconfig.cml, is_filepath=is_filepath) + options.add_option(attrconfig.attrname, attrconfig.get_value(), attrconfig.cml, + is_filepath=is_filepath, cmlvaluemap=cmlvaluemap) return options @@ -286,33 +343,49 @@ def reset_cml(self, cml): self._command = cml - def get_cml(self, is_changecwd=False): + def get_cml(self, is_changecwd=False, is_without_command=False): """ Returns commandline with all options. To be overridden by costum class. """ + # is_changecwd is obsolete, chenge in different directory + # if self.workdirpath is not None options = self.get_options() - - if is_changecwd: - if self.get_workdirpath() is None: - cwd = '' + optionstr = options.get_optionstring() + print 'get_cml command', self._command, 'workdirpath', self.workdirpath + if True: # self.workdirpath is None: + if is_without_command: + cml = optionstr else: - cwd = 'cd '+self.get_workdirpath()+' ;' + cml = P+self._command+P + optionstr else: - cwd = '' - return cwd+self._command + options.get_optionstring() + cml = 'cd '+P+self.workdirpath+P+' ;'\ + + P+self._command+P + optionstr + + # print ' now call get_optionstring',options.get_optionstring + return cml def run_cml(self, cml=None): if cml is None: cml = self.get_cml() attrsman = self.get_attrsman() - self._subprocess = subprocess.Popen(cml, shell=True) + if self.workdirpath is not None: + wd = self.workdirpath + # os.chdir(self.workdirpath) + self._subprocess = subprocess.Popen(cml, shell=True, cwd=wd) + + else: + wd = os.getcwd() + self._subprocess = subprocess.Popen(cml, shell=True) + attrsman.pid.set(self._subprocess.pid) attrsman.status.set('running') print 'run_cml cml=', cml - print ' pid = ', self.pid + print ' pid = ', self.pid, 'cwd', wd if not self.is_run_background: self._subprocess.wait() + # if self.workdirpath is not None: + # os.chdir(wd) if self._subprocess.returncode == 0: attrsman.status.set('success') @@ -323,457 +396,6 @@ return False -class ProcessOld(cm.BaseObjman): - def __init__(self, ident, command=None, parent=None, name=None, - is_inputfilelist=True, is_outputfilelist=True, - is_force=False, is_run_background=False, is_nohup=False, - workdirpath=None): - self._init_objman(ident, parent=parent, name=name) - self.attrs = self.set_attrman(cm.AttrsManager(self, 'attrs')) - - if command is None: - command_default = '' - else: - command_default = command - - self.set_workdirpath(workdirpath) - - self.status = self.attrs.add(cm.AttrConf( - 'status', 'preparation', - groupnames=['parameters'], - perm='r', - metatype='internal', - name='Status', - info='Process status: preparation-> running -> success|error.' - )) - - self._command = self.attrs.add(cm.AttrConf( - '_command', command_default, - groupnames=['parameters', '_private', 'advanced'], - perm='r', - metatype='internal', - name='command', - info='Command to be executed.' - )) - - self.progress = self.attrs.add(cm.AttrConf( - 'progress', 0.0, - groupnames=['parameters'], - perm='r', - metatype='progress', - unit='%', - name='Progress', - info='Indicates the percentage of completion of the process.' - )) - - self.pid = self.attrs.add(cm.AttrConf( - 'pid', -1, - groupnames=['parameters', 'advanced'], - perm='r', - name='Process ID', - info="The system's Process ID", - )) - - self.is_force = self.attrs.add(cm.AttrConf( - 'is_force', is_force, - groupnames=['parameters', 'advanced'], - perm='rw', - name='is_force', - info='If set, process will be executed even if output files exist.', - )) - - self.is_run_background = self.attrs.add(cm.AttrConf( - 'is_run_background', is_run_background, - groupnames=['parameters', 'advanced'], - perm='rw', - name='Run in background', - info='If set, process will run in background.', - )) - - self.is_nohup = self.attrs.add(cm.AttrConf( - 'is_nohup', is_nohup, - groupnames=['parameters', 'advanced'], - perm='rw', - name='No hangup', - info="""If set, process will run in the background and will continue to run after logout. (Currently on UNIX platforms only.) """, - )) - - if is_inputfilelist: - self.files_input = self.add_tableman(cm.TableManager(ident='files_input', - parent=self, - name='Input files', - is_keyindex=True), - ) - - self.files_input.add(cm.DictConf('filename', '', - groupnames=['input'], - perm='rw', - name='Name', - info='File name of input file', - )) - - self.files_input.add(cm.DictConf('is_existent', False, - groupnames=['output'], - perm='r', - name='Exists?', - info='If set, this input file is exists.', - )) - - self.files_input.add(cm.DictConf('is_required', True, - groupnames=['output'], - perm='r', - name='Required?', - info='If set, this input file is required.', - )) - - self.files_input.add(cm.DictConf('filepath', '', - groupnames=['input'], - perm='rw', - metatype='filepath', - name='Path', - info='Filepath of input file', - )) - - self.files_input.add(cm.DictConf('fileoption', '', - groupnames=['input', 'advanced'], - perm='r', - name='Option', - info='Command line option', - )) - - self.files_input.add(cm.DictConf('fileinfo', '', - groupnames=['input', 'advanced'], - perm='rw', - name='Info', - info='File info of input file', - )) - self.files_input.add(cm.DictConf('wildcards', '', - groupnames=['input', 'advanced'], - perm='rw', - name='wildcards', - info='Wildcards for file filtering', - )) - - if is_outputfilelist: - self.files_output = self.add_tableman(cm.TableManager( - ident='files_output', - parent=self, - name='Output files', - is_keyindex=True), - ) - - self.files_output.add(cm.DictConf('filename', '', - groupnames=['output'], - perm='rw', - name='Name', - info='File name of output file', - )) - - self.files_output.add(cm.DictConf('filepath', '', - groupnames=['output'], - perm='rw', - metatype='filepath', - name='Path', - info='Filepath of output file', - )) - - self.files_output.add(cm.DictConf('fileoption', '', - groupnames=['advanced'], - perm='r', - name='Option', - info='Command line option', - )) - - self.files_output.add(cm.DictConf('fileinfo', '', - groupnames=['output', 'advanced'], - perm='r', - is_save=True, - name='Info', - info='File info of output file', - )) - - self.files_output.add(cm.DictConf('wildcards', '', - groupnames=['output', 'advanced'], - perm='rw', - is_save=True, - name='wildcards', - info='Wildcards for file filtering', - )) - - def add_option(self, option, value, **kwargs): - """ - option = string with option - value = value of option - name = human readable name - info = help info - cml = string to be specified if command line string different from option - """ - kwargs0 = {'cml': None, - 'groupnames': [], - 'perm': 'rw', - 'is_save': True, - 'name': None, - 'info': '', } - - kwargs0.update(kwargs) - if not ('options' in kwargs0['groupnames']): - kwargs0['groupnames'] += ['options'] - - default = self.attrs.add(cm.AttrConf(option, value, **kwargs0)) - - setattr(self, option, default) - - def add_inputfile(self, filekey, filepath, is_required=True, - cml=None, name=None, info='', wildcards=''): - self.files_input.add_row(key=filekey) - self.files_input.filepath.set(filekey, filepath) - self.files_input.is_existent.set(filekey, self.is_inputfile(filekey)) - self.files_input.is_required.set(filekey, is_required) - self.files_input.fileoption.set(filekey, cml) - self.files_input.filename.set(filekey, name) - self.files_input.fileinfo.set(filekey, info) - self.files_input.wildcards.set(filekey, wildcards) - - def add_outputfile(self, filekey, filepath, - cml=None, name=None, info='', wildcards=''): - self.files_output.add_row(key=filekey) - self.files_output.filepath.set(filekey, filepath) - self.files_output.fileoption.set(filekey, cml) - self.files_output.filename.set(filekey, name) - self.files_output.fileinfo.set(filekey, info) - self.files_output.wildcards.set(filekey, wildcards) - - def set_workdirpath(self, workdirpath): - """ - Set working directory for process. - If this directory is set then processes will be run - in this path and outputs without explicit path - will end in this directory. - Moreover, all filenames withot explicit path (absolue or relative) - are supposed to be in this directory. - """ - self._workdirpath = workdirpath - - def get_workdirpath(self): - return self._workdirpath - - def set_path_inputfile(self, filekey, filepaths): - self.files_input.filepath.set(filekey, filepaths) - self.files_input.is_existent.set(filekey, self.is_inputfile(filekey)) - - def set_path_outputfile(self, filekey, filepaths): - self.files_output.filepath.set(filekey, filepaths) - - def get_path_inputfile(self, filekey): - return self.files_input.filepath.get(filekey) - - def get_path_outputfile(self, filekey): - return self.files_output.filepath.get(filekey) - - def get_name_inputfile(self, filekey): - return os.path.basename(self.files_input.filepath.get(filekey)) - - def get_name_outputfile(self, filekey): - return os.path.basename(self.files_output.filepath.get(filekey)) - - def set_existents_inputfiles(self): - for filekey in self.files_input.get_keys(): - self.files_input.is_existent.set(filekey, self.is_inputfile(filekey)) - - def get_inputfiles_missing(self): - """ - Returns list with paths of all input files that - are required but not existent in filesystem - """ - files_missing = [] - if hasattr(self, 'files_input'): - for filekey in self.files_input.get_keys(): - if (not self.is_inputfile(filekey)) & (self.files_input.is_required.get(filekey)): - files_missing.append(self.files_input.filepath.get(filekey)) - - return files_missing - - def get_outputfiles_missing(self): - """ - Returns list with paths of all output files that - are expected to be produced and are currently not existent in filesystem - """ - # print '\n\nget_outputfiles_missing' - files_missing = [] - if hasattr(self, 'files_output'): - for filekey in self.files_output.get_keys(): - if not self.is_outputfile(filekey): - files_missing.append(self.files_output.filepath.get(filekey)) - - return files_missing - - def is_inputfile(self, filekey): - print 'is_inputfile', filekey - - filepaths = self.files_input.filepath.get(filekey) - # print ' filepaths =',filepaths,type(filepaths) - if type(filepaths) in types.StringTypes: - # print ' call filepathstring_to_filepathlist' - filepaths = filepathstring_to_filepathlist(filepaths) - - # print ' filepaths list',filepaths - if len(filepaths) > 0: - ans = True - for filepath in filepaths: - dirpath = os.path.dirname(filepath) - # this is to make sure that check always works - # either with filename or with filepath - if (self._workdirpath is not None) & (dirpath == ''): - filepath = os.path.join(self._workdirpath, filepath) - print ' check is_inputfile: >>%s<< exists = %d' % (filepath, os.path.isfile(filepath)) - ans = ans & os.path.isfile(filepath) - # print ' is_inputfile=',ans - return ans - else: - return False # no path given - - def is_outputfile(self, filekey): - ans = True - filepaths = self.files_output.filepath.get(filekey) - # print '\nis_outputfile filepaths = >%s<'%filepaths,type(filepaths) - if type(filepaths) in types.StringTypes: - # print ' call filepathstring_to_filepathlist' - filepaths = filepathstring_to_filepathlist(filepaths) - - # print ' filepaths list',filepaths - for filepath in filepaths: - dirpath = os.path.dirname(filepath) - # this is to make sure that check always works - # either with filename or with filepath - if (self._workdirpath is not None) & (dirpath == ''): - filepath = os.path.join(self._workdirpath, filepath) - # print ' check is_outputfile: >>%s<< exists = %d'%(filepath,os.path.isfile(filepath)) - ans = ans & os.path.isfile(filepath) - # print ' is_outputfile=',ans - return ans - - #ans = True - #filepaths = self.files_output.filepath.get(filekey) - # for filepath in cm.filepathstring_to_filepathlist(filepaths): - # dirpath = os.path.dirname(filepath) - # if (self._workdirpath is not None)&(dirpath==''): - # filepath = os.path.join(self._workdirpath,filepath) - # #print ' check is_outputfile:',filepath,os.path.isfile(filepath) - # ans = ans & os.path.isfile(filepath) - # return ans - - def update_params(self): - """ - Make all parameters consistent. - example: used by import OSM to calculate/update number of tiles - from process dialog - """ - pass - - def is_ready(self): - """ - Returns True if process is ready to run. - - """ - if (self._command is not None) & (self._command != ''): - # check if all input files exist - return len(self.get_inputfiles_missing()) == 0 - - else: - print 'WARNING: command has not been set' - return False - - def is_done(self): - """ - Returns True if process produced all output files. - """ - return len(self.get_outputfiles_missing()) == 0 - - def get_options(self): - options = Options() - for attrconfig in self.attrs.get_configs(): - if 'cml-options' in attrconfig.groupnames: - options.add_option(attrconfig.attrname, attrconfig.get_attr(), attrconfig.cml, is_filepath=False) - - if hasattr(self, 'files_input'): - for filekey in self.files_input.get_keys(): - filepath = self.files_input.filepath.get(filekey) - - cml = self.files_input.fileoption.get(filekey) - options.add_option(filekey, filepath.replace(',', ' '), cml, is_filepath=True) - - if hasattr(self, 'files_output'): - for filekey in self.files_output.get_keys(): - filepath = self.files_output.filepath.get(filekey) - cml = self.files_output.fileoption.get(filekey) - options.add_option(filekey, filepath.replace(',', ' '), cml, is_filepath=True) - - return options - - def print_options(self): - print 'Options of process ident:', self.ident - print ' Keywordoptions:' - for attrconfig in self.attrs.get_configs(): - if 'options' in attrconfig.groupnames: - print ' ', attrconfig.attrname, '=', attrconfig.get_attr() - - print ' Input files:' - if hasattr(self, 'files_input'): - for filekey in self.files_input.get_keys(): - filepath = self.files_input.filepath.get(filekey) - print ' ', filekey, '=', filepath - - print ' Output files:' - if hasattr(self, 'files_output'): - for filekey in self.files_output.get_keys(): - filepath = self.files_input.filepath.get(filekey) - print ' ', filekey, '=', filepath - - def get_cml(self, is_changecwd=False): - """ - Returns commandline with all options. - To be overridden by costum class. - """ - options = self.get_options() - - if is_changecwd: - if self.get_workdirpath() is None: - cwd = '' - else: - cwd = 'cd '+self.get_workdirpath()+' ;' - else: - cwd = '' - return cwd+self._command + options.get_optionstring() - - def run(self): - if self.is_ready(): - if (not self.is_done()) | self.is_force: - cml = self.get_cml() - self._subprocess = subprocess.Popen(cml, shell=True) - self.attrs.pid.set(self._subprocess.pid) - self.attrs.status.set('running') - print 'run cml=', cml - print ' pid = ', self.pid - if not self.is_run_background: - self._subprocess.wait() - - if self._subprocess.returncode == 0: - self.attrs.status.set('success') - return True - - else: - self.attrs.status.set('error') - return False - else: - print 'WARNING in run: process has already generated output files.' - else: - print 'WARNING: process not ready to run.' - return False - - def kill(self): - pass - - # print '\n Starting command:',cmd ##p = subprocess.Popen(cmd, shell=True) # print "p.pid",p.pid, "p.poll=",p.poll() @@ -781,8 +403,6 @@ # print '\n\nreturncode',p.poll(),p.returncode # print 'p.stdout=\n', p.stdout # call(cmd) - - ############################################################################### if __name__ == '__main__': """ diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_classes.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_classes.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_classes.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_classes.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file test_classman_classes.py # @author Joerg Schweizer -# @date +# @date 2012 """ Test for callsman @@ -206,7 +206,7 @@ xmltag='workdirpath', )) - self.access = attrsman.add(AttrConf('access', ['bus', 'bike', 'tram'], + self.access = attrsman.add(ListConf('access', ['bus', 'bike', 'tram'], groupnames=['state'], perm='rw', is_save=True, @@ -264,6 +264,35 @@ name='Pos OK', info='True if position greater than thhreshold.', )) + self.testlist = attrsman.add(ListConf('testlist', ['1', 'dd', 'cvc'], + groupnames=['state'], + choices=['1', 'dd', 'cvc', 'dddd', 'eeeee'], + perm='rw', + is_save=True, + name='Test list', + info='This is a test list', + xmltag='testList', + )) + + self.testlist_dict = attrsman.add(ListConf('testlist_dict', [1, 2, 3], + groupnames=['state'], + choices={'aa': 1, 'bb': 2, 'ccc': 3, 'dddd': 4, 'eeeee': 5}, + perm='rw', + is_save=True, + name='Dictchoice Test list', + info='This is a Dictchoice test list', + xmltag='testList', + )) + + self.testlist_read = attrsman.add(ListConf('testlist_read', [1, 2, 3], + groupnames=['state'], + choices={'aa': 1, 'bb': 2, 'ccc': 3, 'dddd': 4, 'eeeee': 5}, + perm='r', + is_save=True, + name='Readonly Test list', + info='This is a readonly test list', + xmltag='testList', + )) attrsman.print_attrs() diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_misc.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_misc.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_misc.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_misc.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file test_classman_misc.py # @author Joerg Schweizer -# @date +# @date 2012 from classman import * diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_save.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_save.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_save.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_save.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file test_classman_save.py # @author Joerg Schweizer -# @date +# @date 2012 #from classman import * diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_tables.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_tables.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_tables.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/test_classman_tables.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file test_classman_tables.py # @author Joerg Schweizer -# @date +# @date 2012 #from classman import * diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/xmlman.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/xmlman.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_base/xmlman.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_base/xmlman.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file xmlman.py # @author Joerg Schweizer -# @date +# @date 2012 #import classman as cm #XMLTAG = 'xmltag' @@ -22,7 +22,7 @@ np.set_printoptions(suppress=True, precision=4) -def write_obj_to_xml(obj, filepath, attrname_id=None, +def write_obj_to_xml(obj, filepath, encoding='UTF-8', # 'iso-8859-1' ): """ @@ -113,7 +113,7 @@ def parse_color(s, sep=','): - # print 'parseColor',s + # print 'parseColor',s arr = s.split(sep) color = [1.0, 1.0, 1.0, 1.0] #np.ones(4,dtype = np.float32) @@ -134,19 +134,6 @@ return tuple(ret) -# def process_shape(s, offset = [0.0,0.0], is_flatarray=False): -# cshape = [] -# #print 'process_shape',type(s),s -# es = s.rstrip().split(" ") -# for e in es: -# p = e.split(",") -# if is_flatarray: -# cshape.append(float(p[0])-offset[0]) -# cshape.append(float(p[1]) - offset[1]) -# else: -# cshape.append((float(p[0])-offset[0], float(p[1]) - offset[1])) -# return cshape - def process_shape(shapeString, offset=[0.0, 0.0]): cshape = [] @@ -154,7 +141,7 @@ for e in es: p = e.split(",") if len(p) == 2: - # 2D coordinates with elevetion = 0 + # 2D coordinates with elevetion = 0 cshape.append(np.array([float(p[0])-offset[0], float(p[1]) - offset[1], 0.0], np.float32)) elif len(p) == 3: # 3D coordinates @@ -168,15 +155,7 @@ return cshape # keep list of vertex arrays -def conver_val(s): - """ - Convert attribute s from a string to a number, if this is possible. - """ - # if - # helper function for parsing comment line in xml file - - def read_keyvalue(line, key): data = line.split(' ') for element in data: diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_misc/docgen.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_misc/docgen.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_misc/docgen.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_misc/docgen.py 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,470 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. +# SUMOPy module +# Copyright (C) 2012-2021 University of Bologna - DICAM +# 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 docgen.py +# @author Joerg Schweizer +# @date 2012 + +# """ +## +## +# """ +##__author__ = """Joerg Schweizer""" +## +## +##import networkx as nx +## + +import numpy as np +from matplotlibtools import save_fig, init_plot + +# needed for doc gen + import numpy as np +from os import system, path, getcwd, chdir +import types + +############################################################################## +# convenience functions for Doc +ARRAYTYPES = (types.TupleType, np.ndarray, types.ListType, types.XRangeType) +INTTYPES = (types.IntType, np.int32, np.int64, np.int0, np.int16, np.int8, types.LongType) +FLOATTYPES = (types.FloatType, np.float64) + + +def is_arraytype(obj): + """ + Returns True if n is an array type of any kind + """ + return type(obj) in ARRAYTYPES + + +def is_integer(n): + """ + Returns True if n is an integer type of any kind + """ + return type(n) in INTTYPES + + +def is_float(x): + """ + Returns True if n is a float type of any kind + """ + return type(x) in FLOATTYPES + + +class Document: + def __init__(self, filename, workdir=None, preample=None, is_compile=False, is_maketitle=True): + """ + Create a document and open as file + filename = filename, excluding path and extension .tex + preample = enything that goes before begin document + If preample is given then an enire Latex document + will be created. Otherwise the document will be + created as an \\input{} file within another document + """ + # print 'Doc.__init__',filename + if not workdir: + workdir = path.dirname(filename) + if not workdir: + workdir = getcwd() + + self.workdir = workdir + # print ' workdir',workdir + self.filename = filename + self.path_file = path.join(self.workdir, filename)+'.tex' + # print ' path_file',self.path_file + self.f = open(self.path_file, 'w') + self.preample = preample + self.is_maketitle = is_maketitle + if self.preample: + self.f.write(preample+"""\n\\begin{document}\n""") + if self.is_maketitle: + self.f.write("""\n\maketitle""") + # return self.f + self.is_compile = is_compile + + def section(self, name, mode='', label=None): + + self.f.write("""\n\\section"""+mode+"""{"""+name + """}\n""") + if label: + self.f.write("""\\label{"""+label + """}\n""") + + def subsection(self, name, mode='', label=None): + + self.f.write("""\n\\subsection"""+mode+"""{"""+name + """}\n""") + if label: + self.f.write("""\\label{"""+label + """}\n""") + + def subsubsection(self, name, mode='', label=None): + + self.f.write("""\n\\subsubsection"""+mode+"""{"""+name + """}\n""") + if label: + self.f.write("""\\label{"""+label + """}\n""") + + def new_line(self, mode=""): + self.f.write(mode+"""\\\\ \n\n""") + + def hline(self): + self.f.write("""\\hline \n""") + + def newpage(self): + self.f.write("""\\newpage \n""") + + def make_tableofcontents(self): + self.f.write("""\\tableofcontents + \\thispagestyle{empty}\\clearpage \n""") + + def clearpage(self): + self.f.write("""\\clearpage \n""") + + def write_objvaltable(self, obj, groupname=None, + attrsname="Attributes", valuesname="Value", symbolsname=None, + **kwargs): + + attrsman = obj.get_attrsman() + + if (groupname is None) | (not attrsman.has_group(groupname)): + attrconfigs = attrsman.get_configs() + + else: + attrconfigs = attrsman.get_group(groupname) + attrsname = groupname + + # first make a table of scalars only + if symbolsname is None: + self.begin_tabular(firstrow=[attrsname.capitalize(), valuesname.capitalize()], **kwargs) + else: + self.begin_tabular(firstrow=[attrsname.capitalize(), symbolsname.capitalize(), + valuesname.capitalize()], **kwargs) + + for attrconfig in attrconfigs: + if not attrconfig.is_colattr(): + if symbolsname is None: + self.add_tabular_row([attrconfig.get_name(), + attrconfig.format_value(show_unit=True, show_parentesis=False)]) + else: + if hasattr(attrconfig, 'symbol'): + symbol = "$%s$" % attrconfig.symbol + else: + symbol = "" + + self.add_tabular_row([attrconfig.get_name(), + symbol, + attrconfig.format_value() + + "$\,%s$" % attrconfig.format_unit(show_parentesis=False), + ]) + self.end_tabular() + + def begin_tabular(self, firstrow=[], firstcol=[], sep="|", align="c", n_cols=0, n_rows=0, + is_hline=True, is_vline=True, is_centered=True, stretch=1.2): + self.tab_firstrow = firstrow + self.tab_firstcol = firstcol + self.tab_rowcount = 0 + self.tab_sep = sep + self.tab_is_hline = is_hline + self.tab_is_vline = is_vline + self.tab_is_centered = is_centered + + if self.tab_is_centered: + self.begin_center() + + format = "" + if len(firstrow) > 0: + self.tab_n_cols = len(firstrow) + else: + self.tab_n_cols = n_cols + + if len(firstcol) > 0: + self.tab_n_rows = len(firstcol) + if is_vline: + format = "|"+align+"||" + else: + format = align+"|" + else: + self.tab_n_rows = n_rows + if is_vline: + format = "|" + + for col in range(self.tab_n_cols): + if col == (self.tab_n_cols-1): + if is_vline: + form_col = align+"|" + else: + form_col = align + else: + form_col = align+sep + + format += form_col + + if stretch != None: + self.f.write("""\\renewcommand\\arraystretch{%s}\n""" % stretch) + + self.f.write("""\\begin{tabular}{"""+format + """}\n""") + self._make_tableheader() + + def _make_tableheader(self): + + if self.tab_is_hline: + self.f.write("""\\hline\\hline \n""") + elif len(self.tab_firstrow) > 0: + self.f.write("""\\hline \n """) + else: + self.f.write("""\n """) + + if len(self.tab_firstrow) > 0: + if len(self.tab_firstcol) > 0: + + self.f.write("\t &") # make empty top left table corner + + for col in range(self.tab_n_cols): + if col == (self.tab_n_cols-1): + sep = "\t \\\\ \n" + else: + sep = "\t &" + + self._write_arrayelement(self.tab_firstrow[col], sep, is_math=False) + + if self.tab_is_hline: + self.f.write("""\\hline\\hline \n""") + else: + self.f.write("""\\hline \n """) + + def add_tabular_row(self, row): + + # print 'add_tabular_row',self.tab_rowcount + if len(self.tab_firstcol) > 0: + self._write_arrayelement(self.tab_firstcol[self.tab_rowcount], "\t &", + is_math=False) + + for col in range(self.tab_n_cols): + if col == (self.tab_n_cols-1): + sep = "\t\\\\ \n" + else: + sep = "\t &" + + self._write_arrayelement(row[col], sep, is_math=False) + + if self.tab_is_hline: + self.f.write("""\\hline \n""") + + self.tab_rowcount += 1 + + def end_tabular(self): + if self.tab_is_hline: + self.f.write("""\\hline \n""") + + self.f.write("\\end{tabular} \n") + + if self.tab_is_centered: + self.end_center() + + def begin_equation(self, mode="$", label=None): + if label != None: + mode = 'enum' + self.eqn_mode = mode + if self.eqn_mode in ("$", "inline"): + self.f.write("$") + elif self.eqn_mode in ("*", "nolabels"): + self.f.write("""\\begin{equation*}\n""") + elif self.eqn_mode in ("enum", "enumerated"): + self.f.write("""\\begin{equation}\n""") + else: + self.eqn_mode = "[" + self.f.write("""\\[\n""") + + if label != None: + self.write("""\\label{%s}""" % label) + + def end_equation(self): + if self.eqn_mode in ("$", "inline"): + self.f.write("$\n") + elif self.eqn_mode in ("*", "nolabels"): + self.f.write("""\\end{equation*}\n""") + elif self.eqn_mode in ("enum", "enumerated"): + self.f.write("""\\end{equation}\n""") + else: + self.eqn_mode = "[" + self.f.write("""\\]\n""") + + def begin_description(self): + self.f.write("\n\\begin{description}\n") + + def item(self, item, label=None): + if label == None: + self.f.write("\n\\item %s\n" % item) + else: + self.f.write("\n\\item[%s] %s\n" % (label, item)) + + def end_description(self): + self.f.write("\\end{description} \n") + + def begin_array(self, n_col=1, brace="(", arraystretch=1): + self.f.write("\\renewcommand\\arraystretch{%.2f}" % arraystretch) + self.f.write("\\left"+brace+"\\begin{array}{"+n_col*"c"+"}\n") + + def end_array(self, brace=")"): + self.f.write("\\end{array}\\right"+brace+" \n") + + def matrix(self, matrix, format=None, is_math=True, leftbrace='(', rightbrace=')', arraystretch=1): + # print 'pmatrix',matrix + # n_row,n_col=matrix.shape + n_row = len(matrix) + n_col = len(matrix[0]) + self.begin_array(n_col, leftbrace, arraystretch) + for row in xrange(0, n_row): + for col in xrange(0, n_col): + # print ' ',col,row,matrix[row,col] + if col == (n_col-1): + sep = "\\\\ \n" + else: + sep = " & " + # pick matrix element at row,col and decide what to do + elem = matrix[row][col] + self._write_arrayelement(elem, sep, format_default=format, is_math=is_math) + + self.end_array(rightbrace) + + def colvec(self, vec, format=None, is_math=True): + # print 'pmatrix',matrix + n_row = len(vec) + sep = "\\\\ \n" + self.begin_array(1) + for col in xrange(0, n_row): + self._write_arrayelement(vec[col], sep, format_default=format, is_math=is_math) + + self.end_array() + + def rowvec(self, vec, format=None, is_math=True): + n_row = len(vec) + + self.begin_array(n_row) + for row in xrange(0, n_row): + # print ' ',col,row,matrix[row,col] + if row == (n_row-1): + sep = "\\\\ \n" + else: + sep = " & " + self._write_arrayelement(vec[row], sep, format_default=format, is_math=is_math) + + self.end_array() + + def _write_arrayelement(self, elem, sep, format_default=None, is_math=False): + """ + Write to document the formated characters dependend on type + """ + # print '_write_arrayelement' + # print ' elem,format_default',elem,type(elem),type(elem)==np.float64,format_default + if is_math: + mathsep = "" + else: + mathsep = "$" # create in-line mat env + + if is_arraytype(elem): + self.f.write(mathsep) + if is_arraytype(elem[0]): + self.matrix(elem, is_math=False) # write entire matrix + else: + self.rowvec(elem, is_math=False) # write entire matrix + self.f.write(mathsep+sep) + + elif format_default != None: # scalar with default format + self.f.write((format_default+sep) % (elem)) + + elif is_integer(elem): + format = "%d" + self.f.write((mathsep+format+mathsep+sep) % (elem)) + + elif is_float(elem): + format = "%.2f" + self.f.write((mathsep+format+mathsep+sep) % (elem)) + + else: # probably a string, just as is + self.f.write(elem+sep) + + def begin_center(self): + self.f.write("""\n\\begin{center}\n""") + + def end_center(self): + self.f.write("""\\end{center}\n""") + + def include_graphics(self, filename, options=None, is_centered=True, + method='matplotlib', label=None, caption=None, envoptions='h!'): + print 'include_graphics ', filename + path_file = path.join(self.workdir, filename) + if options is None: + options = 'width = \\textwidth' + is_figure_env = (label != None) | (caption != None) + if is_figure_env: + if label != None: + self.write("""\\begin{figure}[%s]""" % envoptions) + else: + self.write("""\\begin{figure*}[%s]""" % envoptions) + + if is_centered: + self.begin_center() + # print ' method=',method + if method == 'matplotlib': + + workdir = getcwd() + chdir(self.workdir) + # print ' safe matplotlib figure and convert to pdf' + ffilename = save_fig(filename) + # print ' done safe' + chdir(workdir) + self.f.write("""\\includegraphics["""+options+"""]{"""+ffilename + """}\n""") + else: + self.f.write("""\\includegraphics["""+options+"""]{"""+filename + """}\n""") + + if is_centered: + self.end_center() + if is_figure_env: + if caption != None: + self.write("""\\caption{%s}""" % caption) + if label != None: + self.write("""\\label{%s}""" % label) + + if label != None: + self.write("""\\end{figure}""") + else: + self.write("""\\end{figure*}""") + + def save_graphics_matplotlib(self, filename): + """ + Save current matplotlib graphics in working directory. + """ + workdir = getcwd() + chdir(self.workdir) + save_fig(filename) + chdir(workdir) + + def write(self, text): + self.f.write(text+"\n") + + def stream(self, text): + self.f.write(text) + + def end(self): + if self.preample: + self.f.write("""\\end{document}\n""") + self.f.close() + if self.is_compile: + print 'compile latex ', self.path_file + system('pdflatex ' + self.path_file) + + +def ref(label, reftype=None): + if reftype == None: + return '~\\ref{%s}' % label + else: + return '%s~\\ref{%s}' % (reftype, label) diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_misc/__init__.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_misc/__init__.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_misc/__init__.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_misc/__init__.py 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,19 @@ +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. +# SUMOPy module +# Copyright (C) 2012-2021 University of Bologna - DICAM +# 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 __init__.py +# @author Joerg Schweizer +# @date 2012 + +__version__ = "0.0" diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_misc/matplotlibtools.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_misc/matplotlibtools.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_misc/matplotlibtools.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_misc/matplotlibtools.py 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,84 @@ +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. +# SUMOPy module +# Copyright (C) 2012-2021 University of Bologna - DICAM +# 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 matplotlibtools.py +# @author Joerg Schweizer +# @date 2012 + +from os import system +import matplotlib +import matplotlib.pyplot as plt +from mpl_toolkits.mplot3d import Axes3D +from matplotlib.collections import PolyCollection + + +from mpl_toolkits.axes_grid import make_axes_locatable + +############################################################################## +# matplotlib configuration + +linewidth = 2.0 +fontsize = 12 + + +params = { # 'backend': 'ps', + 'axes.labelsize': fontsize, + 'text.fontsize': fontsize, + 'legend.fontsize': 0.9*fontsize, + 'xtick.labelsize': 0.9*fontsize, + 'ytick.labelsize': 0.9*fontsize, + 'text.usetex': False, + # 'figure.figsize': fig_size +} + +matplotlib.rcParams.update(params) + +markers = ['o', 's', '^', 'd', 'v', '*', 'h', '<', '>'] +markersize = 8 +nodesize = 1000 +############################################################################## + + +def init_plot(is_tight_layout=False, ind_fig=0, **kwargs): + plt.close("all") + fig = plt.figure(ind_fig, **kwargs) + ax = fig.add_subplot(111) + if is_tight_layout: + fig.tight_layout() + return ax + + +def new_plot(is_tight_layout=False, ind_fig=0): + + fig = plt.figure(ind_fig) + ax = fig.add_subplot(111) + if is_tight_layout: + fig.tight_layout() + ind_fig += 1 + return ax, ind_fig + + +def save_fig(figname, is_adjust_border=False): + #ffigname = figname+".png" + # plt.savefig(ffigname,format='PNG') + + ffigname = figname+".pdf" + if is_adjust_border: + plt.subplots_adjust(left=0.12, bottom=0.1, right=0.86, top=0.9, wspace=0.2, hspace=0.2) + + plt.savefig(figname+".pdf", format='PDF') + # plt.savefig(figname+".eps",format='eps',transparent=True) + #system("ps2pdf -dEPSCrop "+figname+".eps "+figname+".pdf") + #system("rm "+figname+".eps") + return ffigname diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_misc/runner.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_misc/runner.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_misc/runner.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_misc/runner.py 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,65 @@ +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. +# SUMOPy module +# Copyright (C) 2012-2021 University of Bologna - DICAM +# 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 runner.py +# @author Joerg Schweizer +# @date 2012 + + +class Runner: + """Class to manage the execution of processes in a script. + The class initialized with the following list of tasks: + [ + ('taskname1', True|False), + ('taskname2', True|False), + : + : + ] + The first argument is the task name, the second is whether the task should be executed or not. + + """ + + def __init__(self, tasks): + self._tasknames = [] + self._taskinfos = [] + self._taskindex = -1 + for taskname, info in tasks: + self._tasknames.append(taskname) + self._taskinfos.append(info) + + def has_task(self, taskname): + """Returns True if taskname must be executed""" + if self._tasknames.count(taskname) > 0: + ind = self._tasknames.index(taskname) + + # check if info foresees this task + if self._taskinfos[ind]: # could be modified in the future + self._taskindex = ind + return True + + else: + return False + + else: + return False + + def get_index_current(self): + """ + Returns index of currently executed task + """ + return self._taskindex + + def format_task_current(self): + # print 'format_task_current',self._taskindex,self._tasknames + return "%03d_%s" % (self._taskindex, self._tasknames[self._taskindex]) Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/images/fig_menu_icon.png and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/images/fig_menu_icon.png differ Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/images/icon_results_24px.png and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/images/icon_results_24px.png differ diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/__init__.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/__init__.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/__init__.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/__init__.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,6 +14,6 @@ # @file __init__.py # @author Joerg Schweizer -# @date +# @date 2012 __version__ = "0.0" diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/mainframe.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/mainframe.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/mainframe.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/mainframe.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file mainframe.py # @author Joerg Schweizer -# @date +# @date 2012 import wx @@ -74,7 +74,7 @@ is_noimport = (modulename in ['__init__.py', ]) | (modulename.split('.')[-1] == 'pyc') is_dir = os.path.isdir(os.path.join(appdir, modulesdir, modulename)) - # print ' modulename',modulename,is_noimport,is_dir + # print ' GUI modulename',modulename,is_noimport,is_dir if (not is_noimport) & is_dir: lib = __import__(modulesdir+'.'+modulename) @@ -83,9 +83,8 @@ # has module gui support specified in __init__.py if hasattr(module, 'get_wxgui'): wxgui = module.get_wxgui() - # print ' wxgui',wxgui if wxgui is not None: - # print ' append',(wxgui.get_initpriority(), wxgui) + # print ' append',(wxgui.get_initpriority(), wxgui.get_ident()) moduleguilist.append((wxgui.get_initpriority(), wxgui)) @@ -205,7 +204,7 @@ Simple wx frame with some special features. """ - def __init__(self, parent=None, title='mainframe', + def __init__(self, parent=None, title='mainframe', appname=None, moduledirs=[], args=[], appdir='', is_maximize=False, is_centerscreen=True, pos=wx.DefaultPosition, size=wx.DefaultSize, @@ -218,8 +217,13 @@ # Forcing a specific style on the window. # Should this include styles passed? - wx.Frame.__init__(self, parent, wx.ID_ANY, title, + if appname is not None: + self.appname = appname + else: + self.appname = title + wx.Frame.__init__(self, parent, wx.ID_ANY, self.appname, pos, size=size, style=style, name=name) + #super(GLFrame, self).__init__(parent, id, title, pos, size, style, name) self._splitter = MainSplitter(self) self._views = {} @@ -301,6 +305,9 @@ # wx.EVT_CLOSE(self, self.on_close) #wx.EVT_IDLE(self, self.on_idle) + def set_title(self, titlename): + self.SetTitle(self.appname+' - '+titlename) + def refresh_moduleguis(self): # print 'refresh_moduleguis',len(self._moduleguis) self.browse_obj(None) diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/modulegui.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/modulegui.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/modulegui.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/modulegui.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file modulegui.py # @author Joerg Schweizer -# @date +# @date 2012 import os import wx diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/objbrowser.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/objbrowser.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/objbrowser.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/objbrowser.py 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,295 @@ +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. +# SUMOPy module +# Copyright (C) 2012-2021 University of Bologna - DICAM +# 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 objbrowser.py +# @author Joerg Schweizer +# @date 2012 + +import wx +from objpanel import * +from mainframe import AgileMainframe, AgileStatusbar, AgileMenubar + + +class ObjBrowserMainframe(AgileMainframe): + def __init__(self, obj=None, table=None, _id=None, parent=None, + title='Object browser', appname='Object browser app', + moduledirs=[], args=[], appdir='', + is_maximize=False, is_centerscreen=True, + pos=wx.DefaultPosition, size=wx.DefaultSize, + style=wx.DEFAULT_FRAME_STYLE, logger=None, + name='Object browser frame', size_toolbaricons=(24, 24)): + + # print 'AgileMainframe.__init__',title,appdir + + # Forcing a specific style on the window. + # Should this include styles passed? + + if appname is not None: + self.appname = appname + else: + self.appname = title + wx.Frame.__init__(self, parent, wx.ID_ANY, self.appname, + pos, size=size, style=style, name=name) + + if obj is not None: + # print ' init ObjPanel' + #self.browser = ObjPanel(self, obj) + self.browser = NaviPanel(self, obj, _id) + elif table is not None: + # print ' init TablePanel' + self.browser = TablePanel(self, table) + else: + obj = cm.BaseObjman('empty') + self.browser = NaviPanel(self, obj, _id) + + if logger is not None: + self._logger = logger + else: + self._logger = Logger() + + if is_maximize: + self.Maximize() + if is_centerscreen: + self.CenterOnScreen() + + ################################################################# + # create statusbar + self.statusbar = AgileStatusbar(self) + self.SetStatusBar(self.statusbar) + # self.count=0.0 + + ################################################################# + # create toolbar + + self.init_toolbar(size=size_toolbaricons) + # + #new_bmp = wx.ArtProvider.GetBitmap(wx.ART_NEW, wx.ART_TOOLBAR, tsize) + #open_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR, tsize) + #save_bmp= wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_TOOLBAR, tsize) + #cut_bmp = wx.ArtProvider.GetBitmap(wx.ART_CUT, wx.ART_TOOLBAR, tsize) + #copy_bmp = wx.ArtProvider.GetBitmap(wx.ART_COPY, wx.ART_TOOLBAR, tsize) + #paste_bmp= wx.ArtProvider.GetBitmap(wx.ART_PASTE, wx.ART_TOOLBAR, tsize) + + #self.add_tool('new',self.on_open,new_bmp,'create new doc') + #self.add_tool('open',self.on_open,open_bmp,'Open doc') + #self.add_tool('save',self.on_save,save_bmp,'Save doc') + # self.toolbar.AddSeparator() + # self.add_tool('cut',self.on_open,cut_bmp,'Cut') + # self.add_tool('copy',self.on_open,copy_bmp,'Copy') + # self.add_tool('paste',self.on_open,paste_bmp,'Paste') + + # self.SetToolBar(self.toolbar) + + ################################################################# + # create the menu bar + + self.menubar = AgileMenubar(self) + self.make_menu() + # self.menubar.append_menu('tools') + self.SetMenuBar(self.menubar) + + ################################################################# + # init logger + #self._logger = Logger() + #self._logger.add_callback(self.write_message, 'message') + #self._logger.add_callback(self.write_action, 'action') + #self._logger.add_callback(self.show_progress, 'progress') + ################################################################# + + ################################################################# + # event section: specify in App + + self.MsgWindow = py.shell.Shell(self) + # Create a sizer to manage the Canvas and message window + MainSizer = wx.BoxSizer(wx.VERTICAL) + MainSizer.Add(self.browser, 4, wx.EXPAND) + MainSizer.Add(self.MsgWindow, 1, wx.EXPAND | wx.ALL, 5) + + self.SetSizer(MainSizer) + #self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) + + self.EventsAreBound = False + + #wx.EVT_BUTTON(self, 1003, self.on_close) + # wx.EVT_CLOSE(self, self.on_close) + #wx.EVT_IDLE(self, self.on_idle) + def show_progress(self, percent, **kwargs): + pass + + def get_args(self): + pass + + def browse_obj(self, obj, **kwargs): + self.browser.change_obj(obj, **kwargs) + + def get_obj(self): + return self.browser.get_obj() + + def make_menu(self): + # event section + #wx.EVT_BUTTON(self._mainframe, 1003, self.on_close) + wx.EVT_CLOSE(self, self.on_close) + #wx.EVT_IDLE(self._mainframe, self.on_idle) + + # print 'make_menu' + menubar = self.menubar + menubar.append_menu('Object') + + menubar.append_item('Object/open...', + self.on_open, + info='Open a object from a Python binary file.', + bitmap=wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_MENU), + ) + + menubar.append_item('Object/browse', + self.on_browse_obj, # common function in modulegui + info='View and browse object in object panel.', + bitmap=wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, wx.ART_MENU), + ) + + menubar.append_item('Object/safe as', + self.on_save_as, shortkey='Ctrl+S', + info='Save current scenario in a Python binary file.', + bitmap=wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE, wx.ART_MENU), + ) + + self.make_menu_specific() + + def make_menu_specific(self): + """Here we can add App specific main menu items""" + pass + + def on_close(self, event): + self.destroy() + + def on_exit(self, event): + """Close browser application""" + dlg = wx.MessageDialog(self, + 'Browser is about to close.\nDo you want to SAVE the current object before closing?', + 'Closing Browser', + wx.YES_NO | wx.CANCEL | wx.ICON_QUESTION) + ans = dlg.ShowModal() + dlg.Destroy() + # print ' ans,wx.ID_CANCEL,wx.ID_YES,wx.ID_NO',ans,wx.ID_CANCEL,wx.ID_YES,wx.ID_NO + if ans == wx.ID_CANCEL: + # print ' do not quit!' + pass + + elif ans == wx.ID_YES: + # print ' save and quit' + self.on_save_as(event) + self.destroy() + + elif ans == wx.ID_NO: + # print 'quit immediately' + self._mainframe.destroy() + + def on_open(self, event=None): + """ + Opens object from a binary file. + """ + wildcards_all = "All files (*.*)|*.*" + wildcards_obj = "Python binary files (*.obj)|*.obj" + wildcards = wildcards_obj+"|"+wildcards_all + + # Finally, if the directory is changed in the process of getting files, this + # dialog is set up to change the current working directory to the path chosen. + dlg = wx.FileDialog(self, message="Open object file", + #defaultDir = scenario.get_workdirpath(), + #defaultFile = os.path.join(scenario.get_workdirpath(), scenario.format_ident()+'.obj'), + wildcard=wildcards, + style=wx.OPEN | wx.CHANGE_DIR + ) + + # Show the dialog and retrieve the user response. If it is the OK response, + # process the data. + if dlg.ShowModal() == wx.ID_OK: + # This returns a Python list of files that were selected. + filepath = dlg.GetPath() + if len(filepath) > 0: + obj = cm.load_obj(filepath) + self.browse_obj(obj) + + # Destroy the dialog. Don't do this until you are done with it! + dlg.Destroy() + + def on_browse_obj(self, event=None): + """ + Browse main object. + """ + self.browse_obj(self.get_obj()) + + def on_save_as(self, event=None): + """ + Saves current object into a binary file. + """ + obj = self.get_obj() + wildcards_all = "All files (*.*)|*.*" + wildcards_obj = "Python binary files (*.obj)|*.obj" + wildcards = wildcards_obj+"|"+wildcards_all + + # Finally, if the directory is changed in the process of getting files, this + # dialog is set up to change the current working directory to the path chosen. + dlg = wx.FileDialog( + self, message="Save Object to file", + #defaultDir = scenario.get_workdirpath(), + #defaultFile = scenario.get_rootfilepath()+'.obj', + wildcard=wildcards, + style=wx.SAVE | wx.CHANGE_DIR + ) + + # Show the dialog and retrieve the user response. If it is the OK response, + # process the data. + if dlg.ShowModal() == wx.ID_OK: + # This returns a Python list of files that were selected. + filepath = dlg.GetPath() + if len(filepath) > 0: + # now set new filename and workdir + + cm.save_obj(obj, filepath) + + # Destroy the dialog. Don't do this until you are done with it! + # BAD things can happen otherwise! + dlg.Destroy() + + def add_view(self, name, ViewClass, **args): + pass + + def select_view(self, ind=0, name=None): + pass + + def on_size(self, event=None): + pass + + +class ObjBrowserApp(wx.App): + """ + + """ + + def OnInit(self): + wx.InitAllImageHandlers() + #DrawFrame = BuildDrawFrame() + #frame = ObjBrowserMainframe(None, -1, "Object browser",wx.DefaultPosition,(700,700),obj=self._obj, _id = self._id) + frame = ObjBrowserMainframe(obj=self._obj, table=None, parent=None, + title='Object browser', appname='Object browser app', + logger=self._logger, + appdir='', is_maximize=False, is_centerscreen=True, + pos=wx.DefaultPosition, size=wx.DefaultSize, + style=wx.DEFAULT_FRAME_STYLE, + name='Object browser frame', size_toolbaricons=(24, 24)) + self.SetTopWindow(frame) + frame.Show() + + return True diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/objpanel.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/objpanel.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/objpanel.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/objpanel.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,8 @@ +#!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,27 +15,42 @@ # @file objpanel.py # @author Joerg Schweizer -# @date +# @date 2012 # cd /home/joerg/projects/sumopy/tools/sumopy/wxpython # python objpanel.py +import string +import random +from agilepy.lib_base.misc import filepathlist_to_filepathstring, filepathstring_to_filepathlist +from wxmisc import KEYMAP, AgilePopupMenu, AgileToolbarMixin, get_tablecolors +import agilepy.lib_base.exports as ex +import time +from agilepy.lib_base.logger import Logger +import agilepy.lib_base.classman as cm +import wx.py as py # pyshell +from collections import OrderedDict +import wx.lib.colourselect as coloursel +import wx.lib.editor as editor +from wx.lib import scrolledpanel, hyperlink, colourdb, masked +import wx.grid as gridlib +import wx.lib as wxlib +import wx +import numpy as np import sys import os import types +if __name__ == '__main__': + # search SUMOPy in local directory (where this file is located) + try: + APPDIR = os.path.dirname(os.path.abspath(__file__)) + except: + APPDIR = os.path.dirname(os.path.abspath(sys.argv[0])) + sys.path.append(os.path.join(APPDIR, '..', '..')) -import time -import random -import string -import numpy as np -import wx -import wx.lib as wxlib -import wx.grid as gridlib -from wx.lib import scrolledpanel, hyperlink, colourdb, masked -import wx.lib.editor as editor -import wx.lib.colourselect as coloursel -from collections import OrderedDict +# from processdialog import ProcessDialog # no! uses objectpanel + havePopupWindow = 1 if wx.Platform == '__WXMAC__': havePopupWindow = 0 @@ -47,38 +63,34 @@ IMAGEDIR = os.path.join(os.path.dirname(__file__), 'images') -from wxmisc import KEYMAP, AgilePopupMenu, AgileToolbarMixin, get_tablecolors # used for demo: -import wx.py as py # pyshell wildcards_all = "All files (*.*)|*.*" provider = wx.SimpleHelpProvider() wx.HelpProvider_Set(provider) -import agilepy.lib_base.classman as cm -from agilepy.lib_base.misc import filepathlist_to_filepathstring, filepathstring_to_filepathlist - METATYPES_LINKSTYLE = ('obj', 'id', 'tabid', 'ids') NUMERICTYPES = cm.NUMERICTYPES # (types.BooleanType,types.FloatType,types.IntType,types.LongType,types.ComplexType) STRINGTYPES = cm.STRINGTYPES # (types.StringType,types.UnicodeType) -def list_to_str(l, lb='', rb=''): +def list_to_str(l, lb='', rb='', sep=','): # print 'list_to_str',l,len(l) if len(l) == 0: return lb+rb else: s = lb for e in l[:-1]: - s += unicode(e)+',' + s += unicode(e)+sep # print ' returns',s+unicode(l[-1])+rb return s+unicode(l[-1])+rb def is_list_flat(l): - if type(l) in STRINGTYPES: + if type(l) not in (types.ListType, types.TupleType): # STRINGTYPES: + # not a list return False is_flat = True @@ -243,6 +255,7 @@ # the following methods are usually overwritten to create # attribute specific widgets + def define_widgetset(self): """ Generates the widgets representing this attribute. @@ -536,10 +549,13 @@ def set_tooltip(self, widget=None): # TODO : check for global tooltip on/off + infostr = '%s (%s)' % (self._attrconf.get_name(), self._attrconf.attrname) if self._attrconf.has_info(): # print 'set_tooltip',self.attr,self.config_attr['info'] - widget.SetToolTipString(self._attrconf.get_info()) - widget.SetHelpText(self._attrconf.get_info()) + for infoline in self._attrconf.get_info().split('\n'): + infostr += '\n '+infoline.strip() + widget.SetToolTipString(infostr) + widget.SetHelpText(infostr) class NumericWidgetContainer(AttrBase, WidgetContainer): @@ -802,7 +818,7 @@ class ChoiceWidgetContainer(WidgetContainer): """ - Contains one or several widgets representing a text attribute. + Contains widget to select one item from a choice list. """ @@ -894,8 +910,7 @@ #ind = self._choicenames.index(value) ind = self._choicevalues.index(val) except: - print 'WARNING in ChoiceWidgetContainer.set_widgetvalue: %s with value "%s" not in choice list' % ( - self._attrconf.attrname, val) + print 'WARNING in ChoiceWidgetContainer.set_widgetvalue: %s with value "%s" not in choice list' % (self._attrconf.attrname, val) return # print ' ind',ind,self.valuewidget if self._attrconf.is_writable(): @@ -904,6 +919,98 @@ self.valuewidget.SetValue(self._choicenames[ind]) +class ChecklistWidgetContainer(ChoiceWidgetContainer): + """ + Contains widchet to chosse several items from a choice list. + + """ + + def get_valuewidget_read(self): + """ + Return widget to read only numeric value of attribute + This is effectively the parametrisation of the masked.NumCtrl widget. + """ + # this is a list: + values = self.get_value_obj() + # print 'ChoiceWidgetContainer.get_valuewidget_read',value,type(value) + # print ' choices',self._attrconf.choices + + # mal values in list with .choices dictionary + if (len(values) > 0) & (type(self._attrconf.choices) in (OrderedDict, types.DictionaryType)): + #value = self._attrconf.choices[value] + values = [] + for val in self.get_value_obj(): + if val in self._choicevalues: + values.append(self._choicenames[self._choicevalues.index(val)]) + + # print ' value =',value + widget = wx.TextCtrl(self.parent, -1, list_to_str(values, sep=self._attrconf.sep), style=wx.ALIGN_RIGHT) + widget.Enable(False) + return widget + + def get_valuewidget_write(self): + """ + Return widget to edit numeric value of attribute + This is effectively the parametrisation of the masked.NumCtrl widget. + """ + + value = self.get_value_obj() + # print 'ChoiceWidgetContainer.get_valuewidget_write',self._attrconf.attrname, value,type(value),self.immediate_apply + # print ' choices',self._attrconf.choices + # print ' self._choicenames',self._choicenames + # print ' self._choicevalues',self._choicevalues + + widget = wx.CheckListBox(self.parent, -1, (80, 50), wx.DefaultSize, self._choicenames) + #wx.ComboBox(self.parent,choices = self._choicenames) + # print 'widget',widget,'dir:',dir(widget) + + if self.immediate_apply: + + # ATTENTION: this does not work because self.parent is not + # a panel, but a windoe, without EvtListBox !!! + #self.parent.Bind(wx.EVT_LISTBOX, self.parent.EvtListBox, widget) + self.parent.Bind(wx.EVT_CHECKLISTBOX, self.on_apply_immediate, widget) + + self.set_checkbox(widget, value) + + return widget + + def get_widgetvalue(self): + """ + Returnes current value from valuewidget. + Depends on attribute type and hence widgettype. + To be overwritten. + """ + values = [] + # print 'get_widgetvalue Checked',self.valuewidget.Checked + for ind in self.valuewidget.Checked: + values.append(self._choicevalues[ind]) + + return values + + def set_checkbox(self, widget, values): + # print 'set_checkbox',values + is_set = False + for val in values: # values must be a list + # print ' test',val,val in self._choicevalues + if val in self._choicevalues: + # print ' select ind',self._choicevalues.index(val) + ind = self._choicevalues.index(val) + widget.Check(ind, True) + is_set = True + + def set_widgetvalue(self, val): + """ + Sets value for valuewidget. + Depends on attribute type and hence widgettype. + To be overwritten. + """ + if self._attrconf.is_writable(): + self.set_checkbox(self.valuewidget, val) + else: + self.valuewidget.SetValue(str(val)) + + class TextWidgetContainer(WidgetContainer): """ Contains one or several widgets representing a text attribute. @@ -1038,9 +1145,15 @@ Return widget to edit numeric value of attribute This is effectively the parametrisation of the masked.NumCtrl widget. """ + if self._attrconf.get_metatype() == 'list': + sep = self._attrconf.sep + is_ok = True # assuming that List configs are flat + else: + sep = ',' + is_ok = is_list_flat(self.get_value_obj()) - value = list_to_str(self.get_value_obj()) - if is_list_flat(value): + value = list_to_str(self.get_value_obj(), sep=sep) + if is_ok: widget = wx.TextCtrl(self.parent, -1, value, style=wx.ALIGN_LEFT | wx.TE_MULTILINE) else: # only flat lists can be edited :( widget = wx.TextCtrl(self.parent, -1, value, style=wx.ALIGN_RIGHT | wx.TE_MULTILINE) @@ -1057,7 +1170,10 @@ """ # print 'get_widgetvalue', self.widgets['value'][0].GetValue() # print ' returns', str_to_list(self.widgets['value'][0].GetValue()) - return str_to_list(self.widgets['value'][0].GetValue()) + if self._attrconf.get_metatype() == 'list': + return self._attrconf.get_value_from_string(self.widgets['value'][0].GetValue()) + else: + return str_to_list(self.widgets['value'][0].GetValue()) def set_widgetvalue(self, value): """ @@ -1066,10 +1182,16 @@ To be overwritten. """ # print 'set_widgetvalue',value,is_list_flat(value) + if self._attrconf.get_metatype() == 'list': + sep = self._attrconf.sep + + else: + sep = ',' + if is_list_flat(value): # &self._attrconf.is_editable(): - self.widgets['value'][0].SetValue(list_to_str(value)) + self.widgets['value'][0].SetValue(list_to_str(value, sep=sep)) else: # only flat lists can be edited :( - self.widgets['value'][0].SetValue(repr(value)) + self.widgets['value'][0].SetValue(repr(value, sep=sep)) class ObjWidgetContainer(AttrBase, WidgetContainer): @@ -1399,13 +1521,17 @@ filepath = self.get_objvalue() if type(filepath) not in STRINGTYPES: filepath = "" - dirpath = os.getcwd() + dirpath = os.path.expanduser("~") # os.getcwd() else: - dirpath = os.path.dirname(filepath) + if len(filepath) == 0: + dirpath = os.path.expanduser("~") # os.getcwd() + else: + dirpath = os.path.dirname(filepath) + # print 'on_fileopen dirpath',dirpath dlg = wx.FileDialog(self.parent, message="Open file", defaultDir=dirpath, - defaultFile=filepath, + #defaultFile= filepath, wildcard=wildcards, style=wx.OPEN | wx.CHANGE_DIR ) @@ -1443,15 +1569,19 @@ # print ' filepath',filepath,type(filepath) if type(filepath) not in STRINGTYPES: filepath = "" - dirpath = os.getcwd() + dirpath = dirpath = os.path.expanduser("~") # os.getcwd() else: - dirpath = os.path.dirname(filepath.split(',')[0]) + if len(filepath) == 0: + dirpath = dirpath = os.path.expanduser("~") # os.getcwd() + else: + # take directory of first filepath + dirpath = os.path.dirname(filepath.split(',')[0]) # print ' dirpath',dirpath # print ' filepath',filepath dlg = wx.FileDialog(self.parent, message="Open file", defaultDir=dirpath, - defaultFile=filepath, + #defaultFile= filepath, wildcard=wildcards, style=wx.OPEN | wx.MULTIPLE | wx.CHANGE_DIR ) @@ -1658,6 +1788,12 @@ elif mt == 'color': return ColorWidgetContainer(self, attrconf, **args) + elif (mt == 'list') & hasattr(attrconf, 'choices'): + return ChecklistWidgetContainer(self, attrconf, **args) + + elif (mt == 'list'): + return ListWidgetContainer(self, attrconf, **args) + elif hasattr(attrconf, 'choices'): return ChoiceWidgetContainer(self, attrconf, **args) @@ -2239,6 +2375,7 @@ # Called to determine the kind of editor/renderer to use by # default, doesn't necessarily have to be the same type used # natively by the editor/renderer if they know how to convert. + def GetTypeName(self, row, col): if (col > -1) & (col < len(self.celltypes)): return self.celltypes[col] @@ -2467,14 +2604,14 @@ # popup row options menu self._contextfunctions = {} # print ' configs',self.tab.get_configs(is_all=True) - for config in self.tab.get_configs(is_all=True): + for config in self.tab.get_configs(filtergroupnames=['rowfunctions'], is_private=True): # (is_all=True): # print ' ',config.attrname,config.groupnames,'rowfunctions' in config.groupnames - if 'rowfunctions' in config.groupnames: - item, id = menu.append_item(config.get_name(), self.on_select_rowfunction, info=config.get_info()) - #item,id = menu.append_item( config.name,config.get_function(), info=config.info) - self._contextfunctions[id] = config.get_function() - # print ' append ',config.name,id - #menu.append_item( config.name,self.on_select_contextmenu, info=config.info) + # if 'rowfunctions' in config.groupnames: + item, _id = menu.append_item(config.get_name(), self.on_select_rowfunction, info=config.get_info()) + #item,id = menu.append_item( config.name,config.get_function(), info=config.info) + self._contextfunctions[_id] = config.get_function() + # print ' append ',config.name,_id + #menu.append_item( config.name,self.on_select_contextmenu, info=config.info) # default menu.append_item('Export to CSV...', self.on_export_csv, @@ -2499,17 +2636,17 @@ table = self.GetTable() row = popupmenu.get_row() col = popupmenu.get_col() - id, attrconf = table.get_id_attrconf(row, col) + _id, attrconf = table.get_id_attrconf(row, col) id_menu = event.GetId() - # print 'on_select_contextmenu id_menu,id, attrconf',id_menu,id, attrconf + # print 'on_select_contextmenu id_menu,_id, attrconf',id_menu,_id, attrconf # print ' GetSelection',event.GetSelection() # print ' GetString',event.GetString() # print ' GetId',id_menu,event.Id # print ' GetClientObject',event.GetClientObject() - # call selected row function with row id - self._contextfunctions[id_menu](id) + # call selected row function with row _id + self._contextfunctions[id_menu](_id) # item = popupmenu.get_menuitem_from_id(event.GetId())# OK but not neede # if self._rowfunctions.has_keid_menu: @@ -2517,7 +2654,7 @@ # #help = item.GetHelp() # #??? menu id->name->function?????????? # print 'on_select_contextmenu: found function:',funcname#,getattr(table,funcname) - # self._rowfunctions[id] + # self._rowfunctions[_id] # else: # print 'on_select_contextmenu: No function found' @@ -2555,11 +2692,11 @@ if dlg.ShowModal() == wx.ID_OK: # This returns a Python list of files that were selected. path = dlg.GetPath() - # print 'You selected %d files:' % len(paths) + print 'on_export_csv', type(path), path if type(path) in STRINGTYPES: - self.tab.export_csv(path, sep=',', name_id='ID', - file=None, attrconfigs=self.GetTable().get_valueconfigs(), - groupname=None, is_header=True) + self.tab.export_csv(path, sep=',', + attrconfigs=self.GetTable().get_valueconfigs(), + groupnames=None, is_header=True) def on_click_cell(self, event): """ @@ -3524,8 +3661,9 @@ def on_cancel(self, event): """ - Apply values, destroy itself and parent + Destroy itself and parent """ + # print 'OP.on_cancel' self.Close() def apply(self): @@ -4135,6 +4273,13 @@ #self.toolbar.AddControl(wx.TextCtrl(self.toolbar, -1, "Toolbar controls!!", size=(150, -1))) # self.toolbar.AddSeparator() + bitmap = wx.Bitmap(os.path.join(IMAGEDIR, 'fig_menu_icon.png'), wx.BITMAP_TYPE_PNG) + b = wx.BitmapButton(self, -1, bitmap, bottonsize, + (bitmap.GetWidth()+bottonborder, bitmap.GetHeight()+bottonborder)) + b.SetToolTipString("Object browser menu. Click for actions on this object") + #b = wx.Button(self, label="Show/Hide") + self.Bind(wx.EVT_BUTTON, self.popup_menu, b) + self.toolbar.Add(b) # panel.SetAutoLayout(True) # panel.SetSizer(buttons) @@ -4144,6 +4289,70 @@ # only for frames # self.SetToolBar(self.toolbar) + def popup_menu(self, event): + #btn = event.GetEventObject() + #drawing = self._canvas.get_drawing() + + # Create the popup menu + self._popupmenu = AgilePopupMenu(self) + self._popupmenu.append_item( + 'Export to CSV...', + self.on_export_csv, + info='Export current object in CSV format.', + #check= drawobj.is_visible(), + ) + + if ex.IS_EXCEL: + self._popupmenu.append_item( + 'Export to Excel...', + self.on_export_excel, + info='Export current object in EXCEL format.', + #check= drawobj.is_visible(), + ) + + self.PopupMenu(self._popupmenu) + self._popupmenu.Destroy() + event.Skip() + + def on_export_excel(self, event): + print 'on_export_excel' + obj = self.objpanel.get_obj() + + #dirpath = self.get_scenario().get_workdirpath() + #defaultFile = self.get_scenario().get_rootfilename()+'.rou.xml' + wildcards_all = 'Excel files (*.xls)|*.xls|All files (*.*)|*.*' + dlg = wx.FileDialog(None, message='Export object to Excel file', + # defaultDir=dirpath, + # defaultFile=defaultFile, + wildcard=wildcards_all, style=wx.SAVE | wx.CHANGE_DIR) + if dlg.ShowModal() == wx.ID_OK: + filepath = dlg.GetPath() + ex.export_excel(filepath, obj, ids=None, attrconfigs=None, groupnames=None, + is_header=True, is_ident=False, is_timestamp=True, + show_parentesis=True, name_id='ID', is_export_not_save=True) + else: + return + + def on_export_csv(self, event): + print 'on_export_csv' + obj = self.objpanel.get_obj() + + #dirpath = self.get_scenario().get_workdirpath() + #defaultFile = self.get_scenario().get_rootfilename()+'.rou.xml' + wildcards_all = 'CSV files (*.csv)|*.csv|Text files (*.txt)|*.txt|All files (*.*)|*.*' + dlg = wx.FileDialog(None, message='Export object to CSV file', + # defaultDir=dirpath, + # defaultFile=defaultFile, + wildcard=wildcards_all, style=wx.SAVE | wx.CHANGE_DIR) + if dlg.ShowModal() == wx.ID_OK: + filepath = dlg.GetPath() + obj.export_csv(filepath, sep=',', + attrconfigs=None, groupnames=None, + is_header=True, is_ident=False, is_timestamp=True, + show_parentesis=True) + else: + return + def get_ident_abs(self, obj, _id): if _id is not None: return obj.format_ident_row_abs(_id) @@ -4269,9 +4478,12 @@ # print ' init ObjPanel' #self.browser = ObjPanel(self, obj) self.browser = NaviPanel(self, obj, _id) - else: + elif table is not None: # print ' init TablePanel' self.browser = TablePanel(self, table) + else: + obj = cm.BaseObjman('empty') + self.browser = NaviPanel(self, obj, _id) #browser = TablePanel(self,obj) # self.MsgWindow = wx.TextCtrl(self, wx.ID_ANY, # "Look Here for output from events\n", @@ -4302,8 +4514,13 @@ wxlib.colourdb.updateColourDB() self.colors = wxlib.colourdb.getColourList() + self.__init_specific() + return None + def __init_specific(self): + pass + def OnAbout(self, event): dlg = wx.MessageDialog(self, "This is a small program to demonstrate\n" @@ -4317,7 +4534,7 @@ dlg = wx.FileDialog(self, message="Open object", defaultDir=os.getcwd(), - defaultFile="", + # defaultFile="", wildcard=wildcards_all, style=wx.OPEN | wx.MULTIPLE | wx.CHANGE_DIR ) @@ -4360,7 +4577,8 @@ def OnSave(self, event): dlg = wx.FileDialog( self, message="Save file as ...", defaultDir=os.getcwd(), - defaultFile="", wildcard=wildcards_all, style=wx.SAVE + # defaultFile="", + wildcard=wildcards_all, style=wx.SAVE ) # This sets the default filter that the user will initially see. Otherwise, @@ -4385,19 +4603,32 @@ """ - def __init__(self, obj, _id=None, output=False, **kwargs): + def __init__(self, obj, _id=None, output=False, logger=None, **kwargs): + if obj is None: + obj = cm.BaseObjman('empty') self._obj = obj self._id = _id # print 'ObjBrowserApp.__init__',obj.ident, _id - + self._logger = logger wx.App.__init__(self, output, **kwargs) def OnInit(self): wx.InitAllImageHandlers() #DrawFrame = BuildDrawFrame() - frame = ObjBrowserMainframe(None, -1, "Object browser", wx.DefaultPosition, - (700, 700), obj=self._obj, _id=self._id) + #frame = ObjBrowserMainframe(None, -1, "Object browser",wx.DefaultPosition,(700,700),obj=self._obj, _id = self._id) + frame = ObjBrowserMainframe(None, -1, 'Object browser', wx.DefaultPosition, + size=wx.DefaultSize, obj=self._obj, table=None) + #title ='Object browser', + #appname = 'Object browser app', + #logger = self._logger, + #appdir = '', + # is_maximize = False, is_centerscreen = True, + #pos=wx.DefaultPosition, size=wx.DefaultSize, + # style=wx.DEFAULT_FRAME_STYLE, + #name='Object browser frame', + #size_toolbaricons = (24,24) + # ) self.SetTopWindow(frame) frame.Show() diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/ogleditor.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/ogleditor.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/ogleditor.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/ogleditor.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,8 @@ +#!/usr/bin/env python # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,14 +15,25 @@ # @file ogleditor.py # @author Joerg Schweizer -# @date +# @date 2012 -#!/usr/bin/env python; """OpenGL editor""" +import types +import os +import sys +from toolbox import * +from wxmisc import * +from agilepy.lib_base.geometry import * +import agilepy.lib_base.arrayman as am +import agilepy.lib_base.classman as cm +from wx.lib.buttons import GenBitmapTextButton, GenBitmapButton +from wx import glcanvas +from collections import OrderedDict +import wx if __name__ == '__main__': - __version__ = "0.1a" + __version__ = "0.3" __licence__ = """licensed under the GPL.""" - __copyright__ = "(c) 2012-2016 University of Bologna - DICAM" + __copyright__ = "(c) 2012-2018 University of Bologna - DICAM" __author__ = "Joerg Schweizer" __usage__ = """USAGE: @@ -40,10 +52,6 @@ #import wxversion # wxversion.select("2.8") -import wx -from collections import OrderedDict -from wx import glcanvas -from wx.lib.buttons import GenBitmapTextButton, GenBitmapButton try: from OpenGL.GL import * from OpenGL.GLU import * # project , unproject , tess @@ -57,9 +65,6 @@ except ImportError: raise ImportError, "Required dependencies numpy or OpenGL not present" -import sys -import os -import types if __name__ == '__main__': try: FILEDIR = os.path.dirname(os.path.abspath(__file__)) @@ -70,14 +75,8 @@ IMAGEDIR = os.path.join(os.path.dirname(__file__), "images") -import agilepy.lib_base.classman as cm -import agilepy.lib_base.arrayman as am - -from agilepy.lib_base.geometry import * # wx gui stuff -from wxmisc import * -from toolbox import * FLATHEAD = 0 @@ -96,6 +95,52 @@ } # to be deleted + +############################################################################### +# vbo test +vertices = [ + [0.1, 0.1, 0], # 0 + [0.1, 0.5, 0.5], # 1 + [0, 0.9, 0], # 2 + [0.2, 0.0, 0], # 3 + [0.5, 0.0, 0], # 4 + [0.9, 0, 0], # 5 + [0.2, 0.2, 0.5], # 6 + [0.5, 0.5, 0.5], # 7 + [0.9, 0.9, 0], # 8 +] + +indexes = [ + 0, 1, + 2, 7, + 5, 6, +] + +colors = [ + [0.9, 0.9, 0.0, 0.9], # 0 + [0.9, 0.9, 0.0, 0.9], # 1 + [0.9, 0.0, 0.9, 0.9], # 2 + [0.9, 0.0, 0.9, 0.9], # 3 + [0.0, 0.9, 0.9, 0.9], # 4 + [0.0, 0.9, 0.9, 0.9], # 5 + [0.0, 0.9, 0.9, 0.9], # 6 + [0.9, 0.0, 0.9, 0.9], # 7 + [0.9, 0.0, 0.9, 0.9], # 8 +] + +# Create the VBO +vertexarray = np.array(vertices, dtype=np.float32) +indexarray = np.array(indexes, dtype=np.int32) + +vertexvbo = vbo.VBO(vertexarray) +indexvbo = vbo.VBO(indexarray, target=GL_ELEMENT_ARRAY_BUFFER) + +colorarray = np.array(colors, dtype=np.float32) +colorvbo = vbo.VBO(colorarray) + +############################################################################### + + #import test_glcanvas as testogl # class TestVbo(Vbo): # def draw(self, resolution): @@ -127,7 +172,6 @@ # self._indexvbo.unbind() # self._colorvbo.unbind() - def normalize(v): norm = np.linalg.norm(v) if norm == 0: @@ -304,12 +348,13 @@ self.highlight_current() def on_left_down_select(self, event): - # print 'on_left_down_select' + # print 'on_left_down_select',len(self)>0,event.ShiftDown(),'is_show_selected',self.is_show_selected is_draw = False if len(self) > 0: + # print ' len(self)',len(self) if event.ShiftDown(): - + # print ' ShiftDown' self.iterate_selection() self.on_change_selection(event) is_draw = True @@ -321,11 +366,14 @@ self.parent.refresh_optionspanel(self) else: + # print ' no selection len(self)',len(self) is_draw |= self.pick_all(event) self.highlight_current() if not event.ShiftDown(): + # print ' no shift down' if self.is_preselected(): + # print ' is_preselected len(self)',len(self) self.coord_last = self._canvas.unproject(event.GetPosition()) # print ' on_execute_selection 2' is_draw |= self.on_execute_selection(event) @@ -333,9 +381,11 @@ # objects in list with self.unselect_all() else: + # print ' shift down' self.coord_last = self._canvas.unproject(event.GetPosition()) if self.is_show_selected: + # print ' is_show_selected',self.is_show_selected self.parent.refresh_optionspanel(self) return is_draw @@ -397,7 +447,7 @@ # calculate detectwidth based on current resolution self.detectwidth = self._canvas.get_resolution()*self.detectpix - # print 'pick_all',self.detectwidth,self.detectpix,self._canvas.get_resolution() + print 'pick_all', self.detectwidth, self.detectpix, self._canvas.get_resolution() self._idcounter = 0 is_draw = False @@ -1080,7 +1130,7 @@ Pick all objets with id and vertex index, that are near the pointer coordinates. """ - # print 'pick_all' + # print 'HandleTool.pick_all' p = self._canvas.unproject_event(event) if self.detectpix > 0: @@ -1097,6 +1147,7 @@ # experiment if drawobj.is_visible(): handles = drawobj.pick_handle(p, detectwidth=self.detectwidth) + # print ' handles',handles if len(handles) > 0: # print ' handles',drawobj.get_ident(),handles for id_handle, ind_vertex in handles: @@ -1369,6 +1420,7 @@ """ Definively execute operation on currently selected drawobjects. """ + print 'Stretch', self.is_tool_allowed_on_selection() if self.is_tool_allowed_on_selection(): if not self.is_animated: return self.begin_animation(event) @@ -1649,7 +1701,6 @@ self.id_anim = self._drawobj_anim.add_drawobj(np.array(self.vertices[id_target]), self.color_anim.value, ) - # print 'begin_animation',self.ident,_id,self._drawobj_anim return True def end_animation(self, is_del_last_vert=False): @@ -2376,6 +2427,197 @@ return self._ids[np.flatnonzero(inds1 | inds2)] +class Triangles(Lines): + def __init__(self, ident, parent, name='Triangles', + is_parentobj=False, + is_fill=True, + is_outline=True, # currently only fill implemented + c_highl=0.3, + linewidth=3, + **kwargs): + + n_vert = 3 # 3 verts for triangle draw obj + self.init_common(ident, parent=parent, name=name, + linewidth=linewidth, # for outline only + is_parentobj=is_parentobj, + is_fill=is_fill, + is_outline=is_outline, + n_vert=n_vert, + c_highl=c_highl, + **kwargs) + + # ident of drawobject used for animations + # must be defined AFTER init_common + self._ident_drawobj_anim = 'anim_triangles' + + # if is_outline: + # self.add_vbo(Vbo('outline',GL_LINES,2, noncyclic = 0)) + + if is_fill: + self.add_vbo(Vbo('triangle_filled', GL_TRIANGLES, 3, objtype='fill')) + if is_outline: + self.add_vbo(Vbo('triangle_outline', GL_LINES, 2, objtype='outline')) + + self.add_col(am.ArrayConf('vertices', np.zeros((n_vert, 3), dtype=np.float32), + dtype=np.float32, + groupnames=['_private'], + perm='rw', + name='Vertex', + unit='m', + is_save=True, + info='Triangle vertex coordinate vectors of points: [[[x11,y11,z11],[x12,y12,z12],[x13,y13,z13]],[[x21,y21,z21],[x22,y22,z122],[x13,y13,z13]],...]', + )) + + def add_drawobj(self, vertex, + color, color_fill=None, + color_highl=None, color_fill_highl=None, + is_update=True): + # print 'Fancylines.add_drawobj' + if color_highl is None: + color_highl = self._get_colors_highl(np.array([color]))[0] + + if color_fill is None: + color_fill = color + + if color_fill_highl is None: + color_fill_highl = self._get_colors_highl(np.array([color_fill]))[0] + + # print ' ids',self.get_ids() + _id = self.add_row(vertices=vertex, + colors=color, + colors_highl=color_highl, + colors_fill=color_fill, + colors_fill_highl=color_fill_highl, + ) + if is_update: + self._update_vertexvbo() + self._update_colorvbo() + return _id + + def add_drawobjs(self, vertices, + colors, colors_fill=None, + colors_highl=None, colors_fill_highl=None, + is_update=True): + # print 'add_drawobjs' + if colors_highl is None: + colors_highl = self._get_colors_highl(colors) + + n = len(vertices) + if colors_fill_highl is None: + colors_fill_highl = self._get_colors_highl(colors_fill) + ids = self.add_rows(n, + vertices=vertices, + colors=colors, + colors_highl=colors_highl, + colors_fill=colors_fill, + colors_fill_highl=colors_fill_highl, + ) + # self.print_attrs() + if is_update: + self._update_vertexvbo() + self._update_colorvbo() + return ids + + def _update_vertexvbo(self): + if self.is_fill(): + self.get_vbo('triangle_filled').update_vertices(self.get_vertices_array().reshape((-1, 3*3)), len(self)) + if self.is_outline(): + self.get_vbo('triangle_outline').update_vertices(self._get_linevertices(), len(self)) + + def _get_linevertices(self): + # print '_make_lines' + + vertices = self.get_vertices_array() + + n = len(self) + n_lpe = 3 # lines per element (here 4 lines for a rectangle) + n_lines_tot = n*n_lpe + + linevertices = np.zeros((n, 2*n_lpe, 3), np.float32) + + # fix first and last point of each rectangle + linevertices[:, 0, :] = vertices[:, 0, :] + linevertices[:, -1, :] = vertices[:, 0, :] + # do rest of the vertices by doubling orginal + linevertices[:, 1:-1, :] = np.repeat(vertices[:, 1:, :], 2, 1) + # print ' linevertices\n',linevertices + + #vertexinds = np.zeros((n_lines_tot,2),np.int32) + #inds = self.get_inds() + #vertexinds = np.repeat(inds,2*n_lpe).reshape((n_lines_tot,2)) + # print ' vertexinds\n',vertexinds + #rectinds = np.zeros(n_lines_tot,np.int32) + #rectinds = np.repeat(inds,n_lpe) + + #self._vertices = vertices + return linevertices.reshape((2*n_lines_tot, 3)) + # print ' self._linevertices',self._linevertices + #self._rectinds = rectinds + #self._vertexinds = vertexinds + + def pick(self, p, detectwidth=0.1): + """ + Returns a binary vector which is True values for lines that have been selected + by point p. + + """ + # print 'pick' + if len(self) == 0: + return np.array([], np.int) + + vertices = self.get_vertices_array() + # print ' vertices.shape',vertices.shape,'\n',vertices + inds = is_inside_triangles(p, vertices[:, 0, 0], vertices[:, 0, 1], + vertices[:, 1, 0], vertices[:, 1, 1], + vertices[:, 2, 0], vertices[:, 2, 1]) + + return self._ids[np.flatnonzero(inds)] + + def pick_handle(self, coord, detectwidth=0.1): + """ + Retuns list [ id, ind_vert] when handle is near coord, + otherwise [] + + """ + # print 'Triangles.pick_handle',self.get_ident(),len(self) + dw = detectwidth**2 + + if len(self) == 0: + return np.zeros((0, 2), np.int) + + vertices = self.get_vertices_array() + handles = [] + # print ' vertices',vertices + # print ' vertices.shape',vertices.shape + dx = vertices[:, 0, 0]-coord[0] + dy = vertices[:, 0, 1]-coord[1] + + ids = self._ids[dx*dx+dy*dy < dw] + handle1 = np.ones((len(ids), 2), np.int) + handle1[:, 0] = ids + handle1[:, 1] = 0 + # print ' ',d,handle1 + + dx = vertices[:, 1, 0]-coord[0] + dy = vertices[:, 1, 1]-coord[1] + ids = self._ids[dx*dx+dy*dy < dw] + handle2 = np.ones((len(ids), 2), np.int) + handle2[:, 0] = ids + handle2[:, 1] = 1 + + dx = vertices[:, 2, 0]-coord[0] + dy = vertices[:, 2, 1]-coord[1] + ids = self._ids[dx*dx+dy*dy < dw] + handle3 = np.ones((len(ids), 2), np.int) + handle3[:, 0] = ids + handle3[:, 1] = 2 + + # print ' ',d,handle2 + handles = np.concatenate((handle1, handle2, handle3), 0) + + return handles + + class Fancylines(Lines): def __init__(self, ident, parent, name='Fancy lines', is_parentobj=False, @@ -3858,21 +4100,44 @@ size=wx.DefaultSize, ): - wx.Panel.__init__(self, parent, wx.ID_ANY, size=size) - sizer = wx.BoxSizer(wx.VERTICAL) - - # initialize GL canvas - self._canvas = OGLcanvas(self, mainframe,) + wx.Panel.__init__(self, parent, -1) + box = wx.BoxSizer(wx.VERTICAL) + #box.Add((20, 30)) + #keys = buttonDefs.keys() + # keys.sort() + # for k in keys: + # text = buttonDefs[k][1] + # btn = wx.Button(self, k, text) + # box.Add(btn, 0, wx.ALIGN_CENTER|wx.ALL, 15) + # self.Bind(wx.EVT_BUTTON, self.OnButton, btn) + #btn = wx.Button(self, 1, "test") + #box.Add(btn, 0, wx.ALIGN_CENTER|wx.ALL, 15) + + # With this enabled, you see how you can put a GLCanvas on the wx.Panel + # if 1: + c = OGLcanvas(self, mainframe=mainframe) + # important to give a value + c.SetMinSize((200, 200)) + self._canvas = c # navigation bar self._navbar = self.make_navbar() # compose navcanvas window - sizer.Add(self._canvas, 1, wx.GROW) - sizer.Add(self._navbar, 0, wx.ALL | wx.ALIGN_LEFT | wx.GROW, 4) # from NaviPanelTest - # finish panel setup - self.SetSizer(sizer) - sizer.Fit(self) + #box.Add(self._canvas,1,wx.GROW)# + box.Add(self._canvas, 1, wx.EXPAND) + box.Add(self._navbar, 0, wx.ALL | wx.ALIGN_LEFT | wx.GROW, 4) # from NaviPanelTest + + #box.Add(c, 0, wx.ALIGN_CENTER|wx.ALL, 15) + #box.Add(c, 0, wx.EXPAND) + # sizer.Add(self._toolspanel,0,wx.EXPAND) + + self.SetAutoLayout(True) + self.SetSizer(box) + #self.Bind(wx.EVT_SIZE, self.OnSize) + + # def OnSize(self, event): + # self.Show(show=True, recursive=True) def get_canvas(self): return self._canvas @@ -4013,12 +4278,50 @@ class OGLcanvas(glcanvas.GLCanvas): - def __init__(self, parent, mainframe=None): + def __init__(self, parent, mainframe=None): if mainframe is None: self._mainframe = parent else: self._mainframe = mainframe + attribList = (glcanvas.WX_GL_RGBA, # RGBA + glcanvas.WX_GL_DOUBLEBUFFER, # Double Buffered + glcanvas.WX_GL_DEPTH_SIZE, 24) # 24 bit + glcanvas.GLCanvas.__init__(self, parent, attribList=attribList) + self.init = False + + self.context = glcanvas.GLContext(self) + + self.xRotate = 0. + self.yRotate = 0. + self.zRotate = 0. + + self.xTrans = 0. + self.yTrans = 0. + + # initial mouse position + self.lastx = self.x = 30 + self.lasty = self.y = 30 + self.size = None + + # gui event binding + self.Bind(wx.EVT_ERASE_BACKGROUND, self.OnEraseBackground) + self.Bind(wx.EVT_SIZE, self.OnSize) + self.Bind(wx.EVT_PAINT, self.OnPaint) + + # mouse event binding + self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) + self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDclick) + self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp) + self.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown) + self.Bind(wx.EVT_RIGHT_UP, self.OnRightUp) + self.Bind(wx.EVT_MOTION, self.OnMotion) + self.Bind(wx.EVT_MOUSEWHEEL, self.OnWheel) + + # + self.action = "" + + # 2D geom specific self.eyex = 0.0 self.eyey = 0.0 self.eyez = -30000.0 # -9.0 @@ -4037,61 +4340,190 @@ self.g_nearPlane = 10.0 # 10. self.g_farPlane = 10.0**8 # 10.0**8 #10000. - self.action = "" self.pos_start = (0.0, 0.0) self.trans_start = (0.0, 0.0) self.resetView(is_draw=False) self._tool = None + self._drawing = None + # self.Parent.Fit() + # wx.CallAfter(self.Parent.Fit) + # wx.CallAfter(self.OnSize) + # self.Show() + # self.SetCurrent(self.context)# too e - # Forcing a specific style on the window. - # Should this include styles passed? - style = wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE + def polarView(self): + glTranslatef(self.trans[1], 0.0, 0.0) + glTranslatef(0.0, -self.trans[0], 0.0) - attribList = (glcanvas.WX_GL_RGBA, # RGBA - glcanvas.WX_GL_DOUBLEBUFFER, # Double Buffered - glcanvas.WX_GL_DEPTH_SIZE, 24) # 24 bit + glRotatef(-self.zRotate, 0.0, 0.0, 1.0) + glRotatef(-self.xRotate, 1.0, 0.0, 0.0) + glRotatef(-self.yRotate, 0.0, 1.0, 0.0) - glcanvas.GLCanvas.__init__(self, parent, -1, attribList=attribList) + def OnEraseBackground(self, event): + pass # Do nothing, to avoid flashing on MSW. - self._wxversion = wx.__version__[:3] - if self._wxversion == '2.8': - self.GLinitialized = False - else: - self.init = False # 3.0 - self.context = glcanvas.GLContext(self) + def OnSize(self, event): + wx.CallAfter(self.DoSetViewport) + event.Skip() + # self.DoSetViewport() - # Set the event handlers. - self.Bind(wx.EVT_ERASE_BACKGROUND, self.processEraseBackgroundEvent) - self.Bind(wx.EVT_SIZE, self.OnSize) - self.Bind(wx.EVT_PAINT, self.processPaintEvent) + def DoSetViewport(self): + # self.Show() + size = self.size = self.GetClientSize() + # print 'DoSetViewport',size.width, size.height,self.IsShown() + # if self.IsShown(): + + # sufficient to call SetCurrent in OnPaint + # try: + # #if self.context is not None: + # #self.SetCurrent(self.context) + # pass + # except: + # print 'WARNING in DoSetViewport: caoon set context' + #glViewport(0, 0, size.width, size.height) + self.OnReshape(size.width, size.height) + # self.OnPaint() - self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown) - self.Bind(wx.EVT_LEFT_DCLICK, self.OnLeftDclick) - self.Bind(wx.EVT_LEFT_UP, self.OnLeftUp) - self.Bind(wx.EVT_RIGHT_DOWN, self.OnRightDown) - self.Bind(wx.EVT_RIGHT_UP, self.OnRightUp) - self.Bind(wx.EVT_MOTION, self.OnMotion) - self.Bind(wx.EVT_MOUSEWHEEL, self.OnWheel) + def set_color_background(self, color): + glClearColor(color[0], color[1], color[2], color[3]) + self.draw() - #self.Bind(wx.EVT_CHAR, self.on_key_down) - # wx.EVT_KEY_DOWN(self, self.on_key_down) # NO, does not get focus - # EVT_LEFT_DCLICK - # EVT_MIDDLE_DCLICK - # EVT_RIGHT_DCLICK - # EVT_LEAVE_WINDOW - # EVT_ENTER_WINDOW - # EVT_MOUSE_EVENTS + def OnReshape(self, width, height): + """Reshape the OpenGL viewport based on the dimensions of the window.""" + #global g_Width, g_Height + self.g_Width = width + self.g_Height = height + glViewport(0, 0, self.g_Width, self.g_Height) - # self.SetFocus() + def OnPaint(self, event=None): + # print 'OnPaint',self.IsShown() + dc = wx.PaintDC(self) + self.SetCurrent(self.context) + if not self.init: + self.InitGL() + self.init = True + self.OnDraw() + # err self.SendSizeEventToParent() + #del dc - self._drawing = None - # if drawing is not None: - # self.set_drawing(drawing) + def InitGL(self): + glClearColor(0, 0, 0, 1) + + def get_intersection(self, v_near, v_far): + # 150918 + # idea from http://www.bfilipek.com/2012/06/select-mouse-opengl.html + # https://en.wikipedia.org/wiki/Line%E2%80%93plane_intersection + d = -v_near + v_far + + t = -v_near[2]/d[2] + v_inter = v_near+t*d + + return v_inter + + def unproject_event(self, event): + return self.unproject(event.GetPosition())[0:2] - # this is needed to initialize GL projections for unproject - wx.CallAfter(self.OnSize) + def unproject(self, pos_display): + """Get the world coordinates for viewCoordinate for the event + """ + # print 'unproject',pos_display + x = pos_display[0] + y = self.g_Height-pos_display[1] + + modelviewmatrix = glGetDoublev(GL_MODELVIEW_MATRIX) + projectionmatrix = glGetDoublev(GL_PROJECTION_MATRIX) + viewport = glGetInteger(GL_VIEWPORT) + + z = 0.0 + worldCoordinate_near = np.array(gluUnProject( + x, y, z, + modelviewmatrix, + projectionmatrix, + viewport,), dtype=np.float32) + + z = 1.0 + worldCoordinate_far = np.array(gluUnProject( + x, y, z, + modelviewmatrix, + projectionmatrix, + viewport,), dtype=np.float32) + + v_inter = self.get_intersection(worldCoordinate_near, worldCoordinate_far) + # print ' world coords v_inter',v_inter + return v_inter + + def project(self, vertex): + """ + http://stackoverflow.com/questions/3792481/how-to-get-screen-coordinates-from-a-3d-point-opengl + """ + modelviewmatrix = glGetDoublev(GL_MODELVIEW_MATRIX) + projectionmatrix = glGetDoublev(GL_PROJECTION_MATRIX) + viewport = glGetInteger(GL_VIEWPORT) + + coords = np.array(gluProject(vertex[0], vertex[1], vertex[2], + modelviewmatrix, projectionmatrix, + viewport)) + + coords[1] = self.g_Height - coords[1] + # print 'project',coords + + return coords + + def OnDraw(self, *args, **kwargs): + """Draw the window.""" + + # print 'OGLCanvas.draw id(self._drawing)',id(self._drawing) + # Clear frame buffer and depth buffer + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) + # Set up viewing transformation, looking down -Z axis + if self._drawing is None: + self.SwapBuffers() + return + + glLoadIdentity() + gluLookAt(self.eyex, self.eyey, self.eyez, self.centerx, self.centery, + self.centerz, self.upx, self.upy, self.upz) # -.1,0,0 + + # Set perspective (also zoom) + glMatrixMode(GL_PROJECTION) + glLoadIdentity() + # the window corner OpenGL coordinates are (-+1, -+1) + glOrtho(-1, 1, 1, -1, -1, 1) + + aspect = float(self.g_Width)/float(self.g_Height) + + gluPerspective(self.zoom, aspect, self.g_nearPlane, self.g_farPlane) + glMatrixMode(GL_MODELVIEW) + self.polarView() + + # resolution in GL unit per scren pixel + #resolution = self.get_resolution() + # print ' get_resolution',resolution + + # draw actual scene + # if self._drawing: + # self._drawing.print_attrs() + for drawobj in self._drawing.get_drawobjs(is_anim=True): + #checkobj = self._drawing.get_drawobj_by_ident(drawobj.ident) + # if checkobj is not None: + # print '\n draw.drawobj',drawobj.ident, checkobj.ident + # else: + # print '\n draw.drawobj',drawobj.ident, checkobj,self._drawing.has_drawobj_with_ident(drawobj.ident) + drawobj.draw() # resolution) + + self.SwapBuffers() + + def draw(self, *args, **kwargs): + # print 'draw',self.IsShown() + # self.Show() # does not prevent error in SetCurrent + try: + self.SetCurrent(self.context) + self.OnDraw(*args, **kwargs) + # print 'draw',self.lastx,self.lasty,self.x,self.y + except: + print 'WARNING in draw: unable to set context' def set_drawing(self, drawing): if self._drawing != drawing: @@ -4101,7 +4533,7 @@ del self._drawing self._drawing = drawing - self.draw() + # self.draw() def activate_tool(self, tool): # called from tool @@ -4146,34 +4578,6 @@ self.draw() event.Skip() - def OnWheel(self, event, is_draw=False): - #EventType = FloatCanvas.EVT_FC_MOUSEWHEEL - # - Rot = event.GetWheelRotation() - # print 'OnWheel!!',Rot,event.ControlDown(),event.ShiftDown() - if (not event.ShiftDown()) & event.ControlDown(): # event.ControlDown(): # zoom - if Rot < 0: - self.zoom_in(is_draw=False) - else: - self.zoom_out(is_draw=False) - is_draw |= True - - if (event.ShiftDown()) & event.ControlDown(): # event.ControlDown(): # zoom - if Rot < 0: - self.xRotate -= 5.0 - else: - self.xRotate += 5.0 - is_draw |= True - - elif self._tool is not None: - is_draw |= self._tool.on_wheel(event) - self.draw() - event.Skip() - - if is_draw: - self.draw() - event.Skip() - def get_resolution(self): """ Resolution in GL unit per scren pixel @@ -4278,7 +4682,9 @@ self.draw() def OnLeftDown(self, event, is_draw=False): - if (event.ControlDown() & event.ShiftDown()) & (self.action == ''): + # print 'GLCanvas.OnLeftDown',self._tool + is_control_down = event.ControlDown() # | event.RawControlDown() | event.MetaDown() + if (is_control_down & event.ShiftDown()) & (self.action == ''): self.action = 'drag' self.BeginGrap(event) event.Skip() @@ -4371,289 +4777,33 @@ self.SetCursor(self._cursor_last) self.action = '' - # - # wxPython Window Handlers + def OnWheel(self, event, is_draw=False): + #EventType = FloatCanvas.EVT_FC_MOUSEWHEEL + # + Rot = event.GetWheelRotation() + # print 'OnWheel!!',Rot,event.ControlDown(),event.ShiftDown() + if (not event.ShiftDown()) & event.ControlDown(): # event.ControlDown(): # zoom + if Rot < 0: + self.zoom_in(is_draw=False) + else: + self.zoom_out(is_draw=False) + is_draw |= True - def processEraseBackgroundEvent(self, event): - """Process the erase background event.""" - pass # Do nothing, to avoid flashing on MSWin - - def OnSize(self, event=None, win=None): - """Process the resize event.""" - - if self.GetContext(): - # Make sure the frame is shown before calling SetCurrent. - self.Show() - if self._wxversion != '2.8': - self.SetCurrent(self.context) + if (event.ShiftDown()) & event.ControlDown(): # event.ControlDown(): # zoom + if Rot < 0: + self.xRotate -= 5.0 else: - self.SetCurrent() + self.xRotate += 5.0 + is_draw |= True - size = self.GetClientSize() - self.OnReshape(size.width, size.height) - self.Refresh(False) - if event: + elif self._tool is not None: + is_draw |= self._tool.on_wheel(event) + self.draw() event.Skip() - def processPaintEvent(self, event): - """Process the drawing event.""" - - # This is a 'perfect' time to initialize OpenGL ... only if we need to - - if self._wxversion != '2.8': - self.SetCurrent(self.context) - if not self.init: - self.OnInitGL() - else: - self.SetCurrent() - if not self.GLinitialized: - self.OnInitGL() - - self.draw() - event.Skip() - - # - # GLFrame OpenGL Event Handlers - - def OnInitGL(self): - """Initialize OpenGL for use in the window.""" - - if self._wxversion == '2.8': - self.GLinitialized = True - else: - self.InitGL() - self.init = True - - glClearColor(0, 0, 0, 1) - - def InitGL(self): - ''' - From 3.0 Demo - Initialize GL - ''' - pass - -# # set viewing projection -# glClearColor(0.0, 0.0, 0.0, 1.0) -# glClearDepth(1.0) -# -# glMatrixMode(GL_PROJECTION) -# glLoadIdentity() -# gluPerspective(40.0, 1.0, 1.0, 30.0) -# -# glMatrixMode(GL_MODELVIEW) -# glLoadIdentity() -# gluLookAt(0.0, 0.0, 10.0, -# 0.0, 0.0, 0.0, -# 0.0, 1.0, 0.0) - - def set_color_background(self, color): - glClearColor(color[0], color[1], color[2], color[3]) - self.draw() - - def OnReshape(self, width, height): - """Reshape the OpenGL viewport based on the dimensions of the window.""" - #global g_Width, g_Height - self.g_Width = width - self.g_Height = height - if self._wxversion != '2.8': - self.SetCurrent(self.context) - glViewport(0, 0, self.g_Width, self.g_Height) - - def draw(self, *args, **kwargs): - """Draw the window.""" - # print 'OGLCanvas.draw id(self._drawing)',id(self._drawing) - if self.GetContext(): - if self._wxversion != '2.8': - self.SetCurrent(self.context) - - # Clear frame buffer and depth buffer - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) - # Set up viewing transformation, looking down -Z axis - glLoadIdentity() - gluLookAt(self.eyex, self.eyey, self.eyez, self.centerx, self.centery, - self.centerz, self.upx, self.upy, self.upz) # -.1,0,0 - - # Set perspective (also zoom) - glMatrixMode(GL_PROJECTION) - glLoadIdentity() - # the window corner OpenGL coordinates are (-+1, -+1) - glOrtho(-1, 1, 1, -1, -1, 1) - - aspect = float(self.g_Width)/float(self.g_Height) - - gluPerspective(self.zoom, aspect, self.g_nearPlane, self.g_farPlane) - glMatrixMode(GL_MODELVIEW) - self.polarView() - - # resolution in GL unit per scren pixel - resolution = self.get_resolution() - # print ' get_resolution',resolution - - # draw actual scene - if self._drawing: - # self._drawing.print_attrs() - for drawobj in self._drawing.get_drawobjs(is_anim=True): - #checkobj = self._drawing.get_drawobj_by_ident(drawobj.ident) - # if checkobj is not None: - # print '\n draw.drawobj',drawobj.ident, checkobj.ident - # else: - # print '\n draw.drawobj',drawobj.ident, checkobj,self._drawing.has_drawobj_with_ident(drawobj.ident) - drawobj.draw(resolution) - - self.SwapBuffers() - - def polarView(self): - glTranslatef(self.trans[1], 0.0, 0.0) - glTranslatef(0.0, -self.trans[0], 0.0) - - glRotatef(-self.zRotate, 0.0, 0.0, 1.0) - glRotatef(-self.xRotate, 1.0, 0.0, 0.0) - glRotatef(-self.yRotate, 0.0, 1.0, 0.0) - - def get_intersection(self, v_near, v_far): - # 150918 - # idea from http://www.bfilipek.com/2012/06/select-mouse-opengl.html - # https://en.wikipedia.org/wiki/Line%E2%80%93plane_intersection - d = -v_near + v_far - - t = -v_near[2]/d[2] - v_inter = v_near+t*d - - return v_inter - - def unproject_event(self, event): - return self.unproject(event.GetPosition())[0:2] - - def unproject_noglu(self, pos_display): - """ - Unproject without GLU function gluUnProject - (does not work properly) - """ - print 'unproject' - mousex, mousey = pos_display - # http://antongerdelan.net/opengl/raycasting.html - # http://www1.cs.columbia.edu/~cs4160/html04f/slides/transformations.pdf - - # The next step is to transform it into 3d normalised device coordinates. - x = (2.0 * mousex) / self.g_Width - 1.0 - y = 1.0 - (2.0 * mousey) / self.g_Height - z = 1.0 - ray_nds = np.array([x, y, z], dtype=np.float32) - - ray_clip = np.array([[ray_nds[0], ray_nds[1], -1.0, 1.0]], dtype=np.float32).transpose() - print 'ray_clip=\n', ray_clip - - # projection matrix - aspect = float(self.g_Width)/float(self.g_Height) - f = 1.0/np.tan(self.zoom/2.0) - z_near = self.g_nearPlane - z_far = self.g_farPlane - a = (z_far+z_near)/(z_near-z_far) - b = (2*z_far*z_near)/(z_near-z_far) - - projection_matrix = np.array([ - [f/aspect, 0., 0., 0.], - [0., f, 0., 0.], - [0., 0., a, b], - [0., 0., -1., 0.], - ], dtype=np.float32) - - # 4d Eye (Camera) Coordinates - ray_eye = np.dot(np.linalg.inv(projection_matrix), ray_clip) - ray_eye = np.array([[ray_eye[0], ray_eye[1], -1.0, 0.0]], float).transpose() - print ' ray_eye=\n', ray_eye - - # 4d World Coordinates - #gluLookAt(self.eyex, self.eyey, self.eyez, self.centerx,self.centery, self.centerz, self.upx, self.upy, self.upz) - # print self.centerx,self.centery, self.centerz - # print self.eyex, self.eyey, self.eyez - - f_vec = np.array([ - [self.centerx - self.eyex], - [self.centery - self.eyey], - [self.centerz - self.eyez], - ], dtype=np.float32).flatten() - f_norm = normalize(f_vec) - # print 'f_vec=\n',f_vec - # print 'f_norm=\n',f_norm,np.linalg.norm(f_norm) - up_vec = np.array([ - [self.upx], - [self.upy], - [self.upz], - ], dtype=np.float32).flatten() - up_norm = normalize(up_vec) - - fxup = np.cross(f_norm, up_norm) - s = normalize(fxup) - sxf = np.cross(s, f_norm) - u = normalize(sxf) - - view_matrix = np.array([ - [s[0], s[1], s[2], 0.], - [u[0], u[1], u[2], 0.], - [-f_norm[0], -f_norm[1], -f_norm[2], 0.], - [0., 0., 0., 1.], - ], dtype=np.float32) - - ray_wor = np.dot(np.linalg.inv(view_matrix), ray_eye) - # print 'ray_wor=\n',ray_wor,ray_wor[0:3,0] - ray_wor = normalize(ray_wor[0:3, 0]) - print ' ray_wor=\n', ray_wor - i0 = 8*3 - - eye_vec = np.array([self.eyex, self.eyey, self.eyez], dtype=np.float32) - t = 1.0 - # vertexvbo[i0:i0+3]=eye_vec+ray_wor*t - - # self.vertexarray[8]=eye_vec+ray_wor*t - # self.vertexvbo.set_array(self.vertexarray) - v_inter = eye_vec+ray_wor*t - print ' ray pointer=', v_inter - - return v_inter[0:2] - - def unproject(self, pos_display): - """Get the world coordinates for viewCoordinate for the event - """ - - x = pos_display[0] - y = self.g_Height-pos_display[1] - - modelviewmatrix = glGetDoublev(GL_MODELVIEW_MATRIX) - projectionmatrix = glGetDoublev(GL_PROJECTION_MATRIX) - viewport = glGetInteger(GL_VIEWPORT) - - z = 0.0 - worldCoordinate_near = np.array(gluUnProject(x, y, z), - dtype=np.float32) - - z = 1.0 - worldCoordinate_far = np.array(gluUnProject( - x, y, z, - modelviewmatrix, - projectionmatrix, - viewport,), dtype=np.float32) - - v_inter = self.get_intersection(worldCoordinate_near, worldCoordinate_far) - return v_inter - - def project(self, vertex): - """ - http://stackoverflow.com/questions/3792481/how-to-get-screen-coordinates-from-a-3d-point-opengl - """ - modelviewmatrix = glGetDoublev(GL_MODELVIEW_MATRIX) - projectionmatrix = glGetDoublev(GL_PROJECTION_MATRIX) - viewport = glGetInteger(GL_VIEWPORT) - - coords = np.array(gluProject(vertex[0], vertex[1], vertex[2], - modelviewmatrix, projectionmatrix, - viewport)) - - coords[1] = self.g_Height - coords[1] - # print 'project',coords - - return coords + if is_draw: + self.draw() + event.Skip() class OGLcanvasTools(ToolsPanel): @@ -4717,12 +4867,13 @@ # sizer.Add(self._toolspanel,0, wx.ALL | wx.ALIGN_LEFT | wx.GROW, 4)# from NaviPanelTest # sizer.Add(navcanvas,1,wx.GROW) + # print 'OGleditor!!!!!!!!!!!!!!!!!!!' + + # 2.8 OK for 3.0 also sizer.Add(self._toolspanel, 0, wx.EXPAND) sizer.Add(navcanvas, 1, wx.EXPAND) - # navbar - #sizer.Add(self._canvas,1,wx.GROW)# - # sizer.Add(self._navbar,0, wx.ALL | wx.ALIGN_LEFT | wx.GROW, 4)# from NaviPanelTest + self.SetAutoLayout(True) # finish panel setup self.SetSizer(sizer) @@ -4732,6 +4883,164 @@ # no use: #wx.EVT_SIZE(self, self.on_size) + def on_test(self, event=None, drawing=None): + print '\non_test' + + if drawing is None: + drawing = OGLdrawing() + vertices = np.array([ + [[0.0, 0.0, 0.0], [0.2, 0.0, 0.0]], # 0 green + [[0.0, 0.0, 0.0], [0.0, 0.9, 0.0]], # 1 red + ]) + + colors = np.array([ + [0.0, 0.9, 0.0, 0.9], # 0 + [0.9, 0.0, 0.0, 0.9], # 1 + ]) + + colors2 = np.array([ + [0.5, 0.9, 0.5, 0.5], # 0 + [0.9, 0.5, 0.9, 0.5], # 1 + ]) + colors2o = np.array([ + [0.8, 0.9, 0.8, 0.9], # 0 + [0.9, 0.8, 0.9, 0.9], # 1 + ]) + + +# ------------------------------------------------------------------------------- + + if 1: + lines = Lines('lines', drawing) + lines.add_drawobjs(vertices, colors) + drawing.add_drawobj(lines) + + +# ------------------------------------------------------------------------------- + + if 1: + rectangles = Rectangles('rectangles', drawing, + is_fill=True, + is_outline=True) + + colors = np.array([ + [0.2, 0.9, 0.0, 0.9], # 0 + [0.9, 0.2, 0.0, 0.9], # 1 + ]) + + colors2 = np.array([ + [0.9, 0.9, 0.5, 0.3], # 0 + [0.9, 0.9, 0.5, 0.3], # 1 + ]) + + rectangles.add_drawobjs([[3.0, 0.0, 0.0], [0.0, 3.0, 0.0]], # offsets + widths=[1.0, 1.6], + lengths=[2.0, 0.4], + rotangles_xy=[0, 0.5], + colors=colors, + colors_fill=colors2) + drawing.add_drawobj(rectangles) + + +# ------------------------------------------------------------------------------- + if 1: + fancylines = Fancylines('fancylines', drawing, + arrowstretch=1.0, + is_lefthalf=True, + is_righthalf=True + ) + + colors_fancy = np.array([ + [0.0, 0.9, 0.0, 0.9], # 0 + # [0.9,0.0,0.0,0.9], # 1 + ]) + vertices_fancy = np.array([ + [[0.0, -1.0, 0.0], [2, -1.0, 0.0]], # 0 green + # [[0.0,-1.0,0.0],[0.0,-5.0,0.0]],# 1 red + ]) + + widths = [0.5, + # 0.3, + ] + # print ' vertices_fancy\n',vertices_fancy + # FLATHEAD = 0 + #BEVELHEAD = 1 + #TRIANGLEHEAD = 2 + #ARROWHEAD = 3 + fancylines.add_drawobjs(vertices_fancy, + widths, # width + colors_fancy, + beginstyles=[TRIANGLEHEAD, ], + endstyles=[TRIANGLEHEAD, ], + ) + drawing.add_drawobj(fancylines, layer=10) +# ------------------------------------------------------------------------------- + if 1: + polylines = Polylines('polylines', drawing, + joinstyle=FLATHEAD, + arrowstretch=1.0, + is_lefthalf=True, + is_righthalf=True + ) + colors_poly = np.array([ + [0.0, 0.8, 0.5, 0.9], # 0 + [0.8, 0.0, 0.5, 0.9], # 1 + ]) + + vertices_poly = np.array([ + [[0.0, 2.0, 0.0], [5.0, 2.0, 0.0], [5.0, 7.0, 0.0], [10.0, 7.0, 0.0]], # 0 green + [[0.0, -2.0, 0.0], [-2.0, -2.0, 0.0]], # 1 red + ], np.object) + + widths = [0.5, + 0.3, + ] + # print ' vertices_poly\n',vertices_poly + polylines.add_drawobjs(vertices_poly, + widths, # width + colors_poly, + beginstyles=[TRIANGLEHEAD, TRIANGLEHEAD], + endstyles=[TRIANGLEHEAD, TRIANGLEHEAD]) + drawing.add_drawobj(polylines, layer=-2) + +# ------------------------------------------------------------------------------- + if 1: + polygons = Polygons('polygons', drawing, linewidth=5) + colors_poly = np.array([ + [0.0, 0.9, 0.9, 0.9], # 0 + [0.8, 0.2, 0.2, 0.9], # 1 + ]) + + vertices_poly = [ + [[0.0, 2.0, 0.0], [5.0, 2.0, 0.0], [5.0, 7.0, 0.0], ], # 0 green + [[0.0, -2.0, 0.0], [-2.0, -2.0, 0.0], [-2.0, 0.0, 0.0]], # 1 red + ] + + print ' vertices_polygon\n', vertices_poly + polygons.add_drawobjs(vertices_poly, + colors_poly) + polygons.add_drawobj([[5.0, -2.0, 0.0], [3.0, -2.0, 0.0], [3.0, 0.0, 0.0]], + [0.8, 0.2, 0.8, 0.9]) + drawing.add_drawobj(polygons) + + +# ------------------------------------------------------------------------------- + + if 1: + circles = Circles('circles', drawing, + is_fill=False, # Fill objects, + is_outline=True, # show outlines + ) + circles.add_drawobjs([[0.0, 0.0, 0.0], [1.0, 0.5, 0.0]], [0.5, 0.25], colors2o, colors2) + drawing.add_drawobj(circles) + + # canvas.zoom_tofit() + # wx.CallAfter(canvas.zoom_tofit) + self.add_drawobjs_anim(drawing) + self.set_drawing(drawing) + if event: + event.Skip() + def get_canvas(self): # DEPRICATED: canvas should not be needed outside netwdit # this is used mainly by the tools to know on which canvas to operate on @@ -4800,6 +5109,12 @@ is_outline=True, # show outlines linewidth=1, ), + + Triangles(self.prefix_anim+'triangles', drawing, + is_fill=False, # Fill objects, + is_outline=True, # show outlines + linewidth=1, + ), ] for drawobj in drawobjs_anim: @@ -4809,21 +5124,11 @@ # this is used mainly by the tools to know on which mainframe to operate on return self._mainframe - def on_size(self, event=None): - # print 'on_size',self._toolspanel.GetSize() - # self._toolspanel.SetSize((300,-1)) - # self.tc.SetSize(self.GetSize()) - # self.tc.SetSize(self.GetSize()) - # self._viewtabs.SetSize(self.GetSize()) - # pass - #wx.LayoutAlgorithm().LayoutWindow(self, self.p1) - #wx.LayoutAlgorithm().LayoutWindow(self, self.p1) - - # important: - #wx.LayoutAlgorithm().LayoutWindow(self, self._toolspanel) - - if event: - event.Skip() + # def on_size(self,event=None): + # #print 'on_size',self._toolspanel.GetSize() + # + # if event: + # event.Skip() if __name__ == '__main__': @@ -4892,7 +5197,19 @@ lines.add_drawobjs(vertices, colors) drawing.add_drawobj(lines) - # ------------------------------------------------------------------------------- +# ------------------------------------------------------------------------------- + if 1: + triangles = Triangles('triangles', drawing, + is_fill=True, + is_outline=True) + triangles.add_drawobjs(np.array([ + [[0.0, 0.0, 0.0], [1.5, 0.0, 0.0], [1.5, 2.5, 0.0]], # 0 green + [[0.0, 0.0, 0.0], [-1.5, -0.9, 0.0], [-1.0, -2.5, 0.0]], # 1 red + ]), colors2, colors2o) + drawing.add_drawobj(triangles) + + +# ------------------------------------------------------------------------------- if 1: rectangles = Rectangles('rectangles', drawing, diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/processdialog.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/processdialog.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/processdialog.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/processdialog.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,10 +14,11 @@ # @file processdialog.py # @author Joerg Schweizer -# @date +# @date 2012 import wx +import os import objpanel from wxmisc import AgileStatusbar @@ -27,6 +28,57 @@ def get_status(self): return self.process.status + def clear_log(self): + self.get_logger().w('', 'message') + self.get_logger().w('', 'action') + + def copy_options_to_results(self, results): + # TODO + pass + + def on_save_options(self, event): + """ + Save current options to file. + """ + dlg = wx.FileDialog( + self, message="Save Options as ...", + # defaultDir=os.getcwd(), + # defaultFile="", + wildcard='Python obj files (*.obj)|*.obj|All files (*.*)|*.*', + style=wx.SAVE | wx.CHANGE_DIR + ) + + # This sets the default filter that the user will initially see. Otherwise, + # the first filter in the list will be used by default. + dlg.SetFilterIndex(0) + + # Show the dialog and retrieve the user response. If it is the OK response, + # process the data. + if dlg.ShowModal() == wx.ID_OK: + filepath = dlg.GetPath() + self.process.save_options(filepath) + + def on_load_options(self, event): + """ + Load previously saved options from file. + """ + + dlg = wx.FileDialog(self, message="Open object", + # defaultDir=os.getcwd(), + # defaultFile="", + wildcard='Python obj files (*.obj)|*.obj|All files (*.*)|*.*', + style=wx.OPEN | wx.CHANGE_DIR + ) + + # Show the dialog and retrieve the user response. If it is the OK response, + # process the data. + if dlg.ShowModal() == wx.ID_OK: + # This returns a Python list of files that were selected. + filepath = dlg.GetPath() + self.process.load_options(filepath) + + self.restore() + class ProcessDialog(ProcessDialogMixin, objpanel.ObjPanelDialog): def __init__(self, parent, @@ -67,7 +119,9 @@ def _get_buttons(self): buttons = [('Run', self.on_run, 'Start the process!'), #('Kill', self.on_kill, 'Kill process in background.'), - ('Apply', self.on_apply, 'Apply current values, complete them and make them consistent, but do not run.'), + ('Apply', self.on_apply, 'Apply current options, complete them and make them consistent, but do not run.'), + ('Save Options...', self.on_save_options, self.on_save_options.__doc__), + ('Load Options...', self.on_load_options, self.on_load_options.__doc__), ] defaultbutton = 'Run' standartbuttons = ['cancel', ] @@ -187,13 +241,23 @@ def __init__(self, parent, process, - title='Process Dialog', - func_close=None): + title=None, + func_close=None, + is_close_after_completion=True, + ): + + if title is None: + title = process.get_name() wx.Frame.__init__(self, parent, -1, title=title, pos=wx.DefaultPosition, size=wx.DefaultSize) self.parent = parent self.process = process + self.func_close = func_close + # if self.func_close is None: + self.is_close_after_completion = is_close_after_completion + # else: + # self.is_close_after_completion = False #self._is_run = False self.Bind(wx.EVT_TIMER, self.on_step) @@ -264,13 +328,20 @@ ('Done', self.on_done, 'Stop process and close window.'), ] defaultbutton = 'Start' - standartbuttons = [] + else: - buttons = [('Run', self.on_start, 'Start the process!'), - ('Done', self.on_done, 'Finish with process and close window.'), - ] - defaultbutton = 'Start' - standartbuttons = [] + if self.is_close_after_completion: + buttons = [('Run', self.on_start, 'Start the process!'), + ] + else: + buttons = [('Run', self.on_start, 'Start the process!'), + ('Done', self.on_done, 'Finish with process and close window.'), + ] + defaultbutton = 'Run' + + buttons.append(('Cancel', self.on_close, 'Close window, without running the process.')) + # standartbuttons=['cancel'] # uses also standard on_cancel :( + standartbuttons = [] return buttons, defaultbutton, standartbuttons # def on_idle(self,event): @@ -293,6 +364,11 @@ self.process.do() else: self.process.run() + + # no closing function defined + if self.is_close_after_completion: + self.on_close(event) + # print 'on_start: after preparation self.process.status=',self.process.status if hasattr(self.process, 'step'): @@ -328,33 +404,47 @@ wx.FutureCall(1, self.process.step) def on_close(self, event=None): - print 'on_close', self.process.status + # print 'on_close',self.process.status if self.process.status == 'running': self.process.aboard() - print ' aboarded.' + # print ' aboarded.' self.MakeModal(False) + # print ' call func_close',self.func_close if self.func_close is not None: self.func_close(self) + # print ' reput callbacks to main' if self.oldprogressfunc is not None: self.process.get_logger().add_callback(self.oldprogressfunc, 'progress') if self.oldmessagefunc is not None: self.process.get_logger().add_callback(self.oldmessagefunc, 'message') + # print ' call destroy' self.Destroy() + # self.Close() # no effect def on_done(self, event=None): # print 'on_done',self.process.status self.on_close(event) + def on_cancel(self, event): + """ + Apply values, destroy itself and parent + """ + # print 'on_cancel' + self.on_close(event) + def on_kill(self, event=None): # self.process.kill() pass def show_progress(self, percent, **kwargs): - print 'show_progress', percent + """ + Shows progress on progress bar. Plug-in funcion for logger. + """ + # print 'show_progress',percent self.statusbar.set_progress(percent) # self.Refresh() # wx.Yield() diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/test_app.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/test_app.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/test_app.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/test_app.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,8 +14,10 @@ # @file test_app.py # @author Joerg Schweizer -# @date +# @date 2012 +from ogleditor import * +from mainframe import * import os import sys @@ -39,11 +41,9 @@ # print ' append',lp sys.path.append(lp) -from mainframe import * # import corepackages #from test_glcanvas import * -from ogleditor import * ## ##import wx ## diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/test_glcanvas.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/test_glcanvas.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/test_glcanvas.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/test_glcanvas.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file test_glcanvas.py # @author Joerg Schweizer -# @date +# @date 2012 ''' @author: Stou Sandalski (stou@icapsid.net) @@ -25,6 +25,10 @@ #import wxversion # wxversion.select('2.8') +import wxmisc +import objpanel +from wxmisc import * +import classman as cm import math import wx @@ -49,13 +53,9 @@ APPDIR = os.path.join(os.path.dirname(__file__), "..") sys.path.append(os.path.join(APPDIR, "lib_base")) IMAGEDIR = os.path.join(os.path.dirname(__file__), "images") -import classman as cm # wx gui stuff -from wxmisc import * -import objpanel -import wxmisc stockIDs = [ wx.ID_ABOUT, @@ -649,8 +649,8 @@ Minimum Distance between a Point p = (x,y) and a Line segments , where vectors x1, y1 are the first points and x2,y2 are the second points of the line segments. - Inspired by the description by Paul Bourke, October 1988 - http://paulbourke.net/geometry/pointlineplane/ + Written by Paul Bourke, October 1988 + http://astronomy.swin.edu.au/~pbourke/geometry/pointline/ Rewritten in vectorial form by Joerg Schweizer """ diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/test_notebook.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/test_notebook.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/test_notebook.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/test_notebook.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file test_notebook.py # @author Joerg Schweizer -# @date +# @date 2012 #import images diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/toolbox.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/toolbox.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/toolbox.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/toolbox.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,8 +14,13 @@ # @file toolbox.py # @author Joerg Schweizer -# @date +# @date 2012 +import agilepy.lib_base.arrayman as am +import agilepy.lib_base.classman as cm +from objpanel import ObjPanel, NaviPanel +from wx.lib.buttons import GenBitmapTextButton, GenBitmapButton +import wx import sys import os import string @@ -29,14 +34,6 @@ IMAGEDIR = os.path.join(os.path.dirname(__file__), "images") -import wx -from wx.lib.buttons import GenBitmapTextButton, GenBitmapButton - -from objpanel import ObjPanel, NaviPanel - -import agilepy.lib_base.classman as cm -import agilepy.lib_base.arrayman as am - class BaseTool(am.ArrayObjman): """ diff -Nru sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/wxmisc.py sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/wxmisc.py --- sumo-1.11.0/tools/contributed/sumopy/agilepy/lib_wx/wxmisc.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/agilepy/lib_wx/wxmisc.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,9 +14,11 @@ # @file wxmisc.py # @author Joerg Schweizer -# @date +# @date 2012 +import zlib +import cPickle import sys import os import types @@ -844,6 +846,7 @@ self.Reposition() # reposition the checkbox + def Reposition(self): # print 1,rect rect = self.GetFieldRect(self._ind_fields['progress']) @@ -874,8 +877,6 @@ # These are some functions for bitmaps of icons. -import cPickle -import zlib def GetHandData(): diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/demandbase.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/demandbase.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/demandbase.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/demandbase.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,25 +14,102 @@ # @file demandbase.py # @author Joerg Schweizer -# @date +# @date 2012 import numpy as np +from xml.sax import saxutils, parse, handler import agilepy.lib_base.classman as cm import agilepy.lib_base.arrayman as am import agilepy.lib_base.xmlman as xm -from agilepy.lib_base.misc import random_choice, get_inversemap +from agilepy.lib_base.misc import random_choice, get_inversemap, dict_to_str OPTIONMAP_POS_DEPARTURE = {"random": -1, "free": -2, "random_free": -3, "base": -4, "last": -5, "first": -6} OPTIONMAP_POS_ARRIVAL = {"random": -1, "max": -2} OPTIONMAP_SPEED_DEPARTURE = {"random": -1, "max": -2} OPTIONMAP_SPEED_ARRIVAL = {"current": -1} -OPTIONMAP_LANE_DEPART = {"random": -1, "free": 2, + +OPTIONMAP_LANE_DEPART = {"random": -1, "free": -2, "allowed": -3, "best": -4, "first": -5} + OPTIONMAP_LANE_ARRIVAL = {"current": -1} +class TripoptionMixin: + """ + Class mixin wich defines some trip options. + To be used with different processes. + """ + + def add_posoptions(self): + attrsman = self.get_attrsman() + + self.add_option('pos_depart', OPTIONMAP_POS_DEPARTURE['base'], + groupnames=['options'], + cml='--departpos', + name='Departure position', + unit='m', + info="Departure position of vehicle.\n\nSpecial values:\n" + + dict_to_str(OPTIONMAP_POS_DEPARTURE, intend=2), + cmlvaluemap=get_inversemap(OPTIONMAP_POS_DEPARTURE), + ) + + self.add_option('pos_arrival', OPTIONMAP_POS_ARRIVAL['max'], + groupnames=['options'], + cml='--arrivalpos', + name='Arival position', + unit='m', + info="Arival position of vehicle.\n\nSpecial values:\n" + + dict_to_str(OPTIONMAP_POS_ARRIVAL, intend=2), + cmlvaluemap=get_inversemap(OPTIONMAP_POS_ARRIVAL), + ) + + def add_speedoptions(self): + attrsman = self.get_attrsman() + + self.add_option('speed_depart', OPTIONMAP_SPEED_DEPARTURE['max'], + groupnames=['options'], + cml='--departspeed', + name='Departure speed', + unit='m/s', + info="Departure speed of vehicle.\n\nSpecial values:\n" + + dict_to_str(OPTIONMAP_SPEED_DEPARTURE, intend=2), + cmlvaluemap=get_inversemap(OPTIONMAP_SPEED_DEPARTURE), + ) + + self.add_option('speed_arrival', OPTIONMAP_SPEED_ARRIVAL['current'], + groupnames=['options'], + cml='--arrivalspeed', + name='Arival speed', + unit='m/s', + info="Arival speed of vehicle.\n\nSpecial values:\n" + + dict_to_str(OPTIONMAP_SPEED_ARRIVAL, intend=2), + cmlvaluemap=get_inversemap(OPTIONMAP_SPEED_ARRIVAL), + ) + + def add_laneoptions(self): + attrsman = self.get_attrsman() + + self.add_option('ind_lane_depart', OPTIONMAP_LANE_DEPART['best'], + groupnames=['options'], + cml='--departlane', + name='Depart lane', + info="Departure lane index. 0 is rightmost lane or sidewalk, if existant.\n\nSpecial values:\n" + + dict_to_str(OPTIONMAP_LANE_DEPART, intend=2), + cmlvaluemap=get_inversemap(OPTIONMAP_LANE_DEPART), + ) + + self.add_option('ind_lane_arrival', OPTIONMAP_LANE_ARRIVAL['current'], + groupnames=['options'], + cml='--arrivallane', + name='Arrival lane', + info="Arrival lane index. 0 is rightmost lane or sidewalk, if existant.\n\nSpecial values:\n" + + dict_to_str(OPTIONMAP_LANE_ARRIVAL, intend=2), + cmlvaluemap=get_inversemap(OPTIONMAP_LANE_ARRIVAL), + ) + + class ModeShares(am.ArrayObjman): """ Utility table with some default mode shares. @@ -270,14 +347,14 @@ class DemandobjMixin: def export_trips_xml(self, filepath=None, encoding='UTF-8', - ids_vtype_exclude=[]): + ids_vtype_exclude=[], **kwargs): """ Export trips to SUMO xml file. Method takes care of sorting trips by departure time. """ return False - def get_writexmlinfo(self, is_route=False): + def get_writexmlinfo(self, is_route=False, **kwargs): """ Returns three array where the first array is the begin time of the first vehicle and the second array is the @@ -306,3 +383,446 @@ def get_time_depart_last(self): return 0.0 + + def import_routes_xml(self, routefilepath, **kwargs): + """ + Import routes from filepath an store them somwhere. + Demand object specific. + """ + + pass + + +class TripCounter(handler.ContentHandler): + """Parses a SUMO route XML file and counts trips.""" + + def __init__(self): + self.n_trip = 0 + + def startElement(self, name, attrs): + # print 'startElement',name,self.n_trip + if name == 'trip': + self.n_trip += 1 + + +class TripReader(handler.ContentHandler): + """Reads trips from trip or route file into trip table""" + + def __init__(self, trips, n_trip, vtype_default=None): + # print 'RouteReader.__init__',demand.ident + self._trips = trips + demand = trips.parent + + net = demand.get_scenario().net + + self._ids_vtype_sumo = demand.vtypes.ids_sumo + self._modemap = net.modes.names.get_indexmap() + self._get_vtype_for_mode = demand.vtypes.get_vtype_for_mode + + if id_vtype_default is None: + self._id_vtype_default = self.get_ids()[0] + else: + self._id_vtype_default = id_vtype_default + + self._ids_edge_sumo = net.edges.ids_sumo + + self.ids_sumo = np.zeros(n_trip, np.object) + self.ids_vtype = np.zeros(n_trip, np.int32) + self.times_depart = np.zeros(n_trip, np.int32) + self.ids_edge_depart = np.zeros(n_trip, np.int32) + self.ids_edge_arrival = np.zeros(n_trip, np.int32) + self.inds_lane_depart = np.zeros(n_trip, np.int32) + self.positions_depart = np.zeros(n_trip, np.float32) + self.speeds_depart = np.zeros(n_trip, np.float32) + self.inds_lane_arrival = np.zeros(n_trip, np.int32) + self.positions_arrival = np.zeros(n_trip, np.float32) + self.speeds_arrival = np.zeros(n_trip, np.float32) + self.routes = np.zeros(n_trip, np.object) + + self._ind_trip = -1 + + self._has_routes = False + self._ids_sumoedge_current = [] + self._id_sumoveh_current = None + #self._time_depart = 0 + #self._attrs = {} + #self._is_generate_ids = is_generate_ids + self._intervals_current = '' + + # def _init_reader(self): + + def _get_id_vtype(self, attrs): + vtype = str(attrs['type']) + if self._ids_vtype_sumo.has_index(vtype): + # vtype is known + return self._ids_vtype_sumo.get_id_from_index(vtype) + + # vtype is not known, so check out whether vtype + # is actually a mode + elif vtype in self._modemap: + # pick id_vtype according to its probability with + # all vtypes of this mode + id_vtype = self._get_vtype_for_mode(self._modemap[vtype]) + + if id_vtype >= 0: + return id_vtype + else: + return self._id_vtype_default + + else: + # no valid vtype, get a default + return self._id_vtype_default + + def startElement(self, name, attrs): + # + # + # + # print 'startElement',name + if name == 'trip': + # print ' startElement',attrs['id'],attrs['depart'] + self._ind_trip += 1 + + self._id_sumoveh_current = attrs['id'] + self.ids_sumo[self._ind_trip] = self._id_sumoveh_current + # print 'startElement ids_vtype',attrs['type'], self._ids_vtype_sumo.get_id_from_index(str(attrs['type'])) + + self.ids_vtype[self._ind_trip] = self._get_id_vtype(attrs) + self.times_depart[self._ind_trip] = int(float(attrs['depart'])) + + if attrs.has_key('from'): + self.ids_edge_depart[self._ind_trip] = self._ids_edge_sumo.get_id_from_index(str(attrs['from'])) + if attrs.has_key('to'): + self.ids_edge_arrival[self._ind_trip] = self._ids_edge_sumo.get_id_from_index(str(attrs['to'])) + + ind_lane_depart_raw = attrs.get('departLane', 'free') + if OPTIONMAP_LANE_DEPART.has_key(ind_lane_depart_raw): + self.inds_lane_depart[self._ind_trip] = OPTIONMAP_LANE_DEPART[ind_lane_depart_raw] + else: + self.inds_lane_depart[self._ind_trip] = int(ind_lane_depart_raw) + + positions_depart_raw = attrs.get('departPos', 'base') + if OPTIONMAP_POS_DEPARTURE.has_key(positions_depart_raw): + self.positions_depart[self._ind_trip] = OPTIONMAP_POS_DEPARTURE[positions_depart_raw] + else: + self.positions_depart[self._ind_trip] = float(positions_depart_raw) + + self.speeds_depart[self._ind_trip] = attrs.get('departSpeed', 0.0) + + ind_lane_arrival_raw = attrs.get('arrivalLane', 'current') + if OPTIONMAP_LANE_ARRIVAL.has_key(ind_lane_arrival_raw): + self.inds_lane_arrival[self._ind_trip] = OPTIONMAP_LANE_ARRIVAL[ind_lane_arrival_raw] + else: + self.inds_lane_arrival[self._ind_trip] = int(ind_lane_arrival_raw) + + positions_arrival_raw = attrs.get('arrivalPos', 'max') + if OPTIONMAP_POS_ARRIVAL.has_key(positions_arrival_raw): + self.positions_arrival[self._ind_trip] = OPTIONMAP_POS_ARRIVAL[positions_arrival_raw] + else: + self.positions_arrival[self._ind_trip] = float(positions_arrival_raw) + + self.speeds_arrival[self._ind_trip] = attrs.get('arrivalSpeed', 0.0) + + def _get_kwargs(self): + return {'ids_sumo': self.ids_sumo, + 'times_depart': self.times_depart, + 'ids_edge_depart': self.ids_edge_depart, + 'ids_edge_arrival': self.ids_edge_arrival, + 'inds_lane_depart': self.inds_lane_depart, + 'positions_depart': self.positions_depart, + 'speeds_depart': self.speeds_depart, + 'inds_lane_arrival': self.inds_lane_arrival, + 'positions_arrival': self.positions_arrival, + 'speeds_arrival': self.speeds_arrival, + } + + def insert_trips(self, is_generate_ids=True): + + # print 'TripReader.insert_trips self.ids_vtype',self.ids_vtype + kwargs = self._get_kwargs() + ids_trips = self._trips.make_trips(self.ids_vtype, + is_generate_ids=is_generate_ids, + **kwargs) + + return ids_trips + + +class RouteCounter(handler.ContentHandler): + """Parses a SUMO route XML file and counts trips.""" + + def __init__(self): + self.n_veh = 0 + self.n_pers = 0 + #self.n_rou = 0 + + def startElement(self, name, attrs): + # print 'startElement',name,self.n_trip + if name == 'vehicle': + self.n_veh += 1 + elif name == 'person': + self.n_pers += 1 + # elif name == 'route': + # if attrs.has_key('id'): + # self.n_rou += 1 + + +class RouteReader(TripReader): + """Reads trips from trip or route file into trip table""" + + def __init__(self, trips, counter): + # print 'RouteReader.__init__',demand.ident + self._trips = trips + n_veh = counter.n_veh + n_per = counter.n_pers + #n_rou = counter.n_rou + n_trip = n_veh+n_per + demand = trips.parent + + net = demand.get_scenario().net + self._modemap = net.modes.names.get_indexmap() + self._get_vtype_for_mode = demand.vtypes.get_vtype_for_mode + + self._ids_vtype_sumo = demand.vtypes.ids_sumo + self._ids_edge_sumo = net.edges.ids_sumo + + self.ids_sumo = np.zeros(n_trip, np.object) + self.ids_sumo[:] = '' + self.ids_vtype = np.zeros(n_trip, np.int32) + self.times_depart = np.zeros(n_trip, np.int32) + self.times_arrival = np.zeros(n_trip, np.int32) + self.type = np.zeros(n_trip, np.object) + self.ids_edge_depart = np.zeros(n_trip, np.int32) + self.ids_edge_arrival = np.zeros(n_trip, np.int32) + self.inds_lane_depart = np.zeros(n_trip, np.int32) + self.positions_depart = np.zeros(n_trip, np.float32) + self.speeds_depart = np.zeros(n_trip, np.float32) + self.inds_lane_arrival = np.zeros(n_trip, np.int32) + self.positions_arrival = np.zeros(n_trip, np.float32) + self.speeds_arrival = np.zeros(n_trip, np.float32) + self.routes = np.zeros(n_trip, np.object) + + self._ind_trip = -1 + + self._has_routes = False + self._ids_sumoedge_current = [] + self._id_sumoveh_current = None + #self._time_depart = 0 + #self._attrs = {} + #self._is_generate_ids = is_generate_ids + self._intervals_current = '' + + def startElement(self, name, attrs): + # + # + # + # print 'startElement',name + if name == 'vehicle': + # print ' startElement',attrs['id'],attrs['depart'] + self._ind_trip += 1 + + self._id_sumoveh_current = attrs['id'] + self.ids_sumo[self._ind_trip] = self._id_sumoveh_current + # print 'startElement ids_vtype',attrs['type'], self._ids_vtype_sumo.get_id_from_index(str(attrs['type'])) + + self.ids_vtype[self._ind_trip] = self.ids_vtype[self._ind_trip] = self._get_id_vtype(attrs) + + self.times_depart[self._ind_trip] = int(float(attrs['depart'])) + if attrs.has_key('arrival'): + self.times_arrival[self._ind_trip] = int(float(attrs['arrival'])) + else: + # duarouter is not calculating arrival time in results! + self.times_arrival[self._ind_trip] = 0.0 + + self.type[self._ind_trip] = attrs['type'] + if attrs.has_key('from'): + self.ids_edge_depart[self._ind_trip] = self._ids_edge_sumo.get_id_from_index(str(attrs['from'])) + if attrs.has_key('to'): + self.ids_edge_arrival[self._ind_trip] = self._ids_edge_sumo.get_id_from_index(str(attrs['to'])) + + ind_lane_depart_raw = attrs.get('departLane', 'free') + if OPTIONMAP_LANE_DEPART.has_key(ind_lane_depart_raw): + self.inds_lane_depart[self._ind_trip] = OPTIONMAP_LANE_DEPART[ind_lane_depart_raw] + else: + self.inds_lane_depart[self._ind_trip] = int(ind_lane_depart_raw) + + positions_depart_raw = attrs.get('departPos', 'base') + if OPTIONMAP_POS_DEPARTURE.has_key(positions_depart_raw): + self.positions_depart[self._ind_trip] = OPTIONMAP_POS_DEPARTURE[positions_depart_raw] + else: + self.positions_depart[self._ind_trip] = float(positions_depart_raw) + + speed_depart_raw = attrs.get('departSpeed', 'max') + if OPTIONMAP_SPEED_DEPARTURE.has_key(speed_depart_raw): + self.speeds_depart[self._ind_trip] = OPTIONMAP_SPEED_DEPARTURE[speed_depart_raw] + else: + self.speeds_depart[self._ind_trip] = float(speed_depart_raw) + + ind_lane_arrival_raw = attrs.get('arrivalLane', 'current') + if OPTIONMAP_LANE_ARRIVAL.has_key(ind_lane_arrival_raw): + self.inds_lane_arrival[self._ind_trip] = OPTIONMAP_LANE_ARRIVAL[ind_lane_arrival_raw] + else: + self.inds_lane_arrival[self._ind_trip] = int(ind_lane_arrival_raw) + + positions_arrival_raw = attrs.get('arrivalPos', 'max') + if OPTIONMAP_POS_ARRIVAL.has_key(positions_arrival_raw): + self.positions_arrival[self._ind_trip] = OPTIONMAP_POS_ARRIVAL[positions_arrival_raw] + else: + self.positions_arrival[self._ind_trip] = float(positions_arrival_raw) + + speed_arrival_raw = attrs.get('arrivalSpeed', 'current') + if OPTIONMAP_SPEED_ARRIVAL.has_key(speed_arrival_raw): + self.speeds_arrival[self._ind_trip] = OPTIONMAP_SPEED_ARRIVAL[speed_arrival_raw] + else: + self.speeds_arrival[self._ind_trip] = float(speed_arrival_raw) + + if name == 'route': + self._has_routes = True + # print ' ',attrs.get('edges', '') + self._ids_sumoedge_current = attrs.get('edges', '') + self._intervals_current = attrs.get('intervals', '') + + # def characters(self, content): + # if (len(self._route_current)>0)&(self._intervals_current!=''): + # self._intervals_current = self._intervals_current + content + + def endElement(self, name): + + if name == 'vehicle': + # print 'endElement',name,self._id_current,len(self._intervals_current) + if (self._id_sumoveh_current is not None): + ids_edge = [] + for id_sumoedge in self._ids_sumoedge_current.split(' '): + if not id_sumoedge in ('', ' ', ','): + if self._ids_edge_sumo.has_index(id_sumoedge): + ids_edge.append(self._ids_edge_sumo.get_id_from_index(id_sumoedge.strip())) + self.routes[self._ind_trip] = ids_edge + + if len(ids_edge) >= 1: + self.ids_edge_depart[self._ind_trip] = ids_edge[0] + self.ids_edge_arrival[self._ind_trip] = ids_edge[-1] + + self._id_sumoveh_current = None + #self._attrs = {} + self._ids_sumoedge_current = [] + + # elif name in ['routes','trips']: + # self.make_trips() + + def process_intervals(self): + interval = [] + es = self._intervals_current.rstrip().split(" ") + for e in es: + p = e.split(",") + interval.append((float(p[0]), float(p[1]))) + self._intervals_current = '' + return interval + + def _get_kwargs(self, inds=None): + if inds is None: + inds = np.arange(len(self.ids_sumo)) + return {'ids_sumo': self.ids_sumo[inds], + 'times_depart': self.times_depart[inds], + 'times_arrival': self.times_arrival[inds], + 'type': self.type[inds], + 'ids_edge_depart': self.ids_edge_depart[inds], + 'ids_edge_arrival': self.ids_edge_arrival[inds], + 'inds_lane_depart': self.inds_lane_depart[inds], + 'positions_depart': self.positions_depart[inds], + 'speeds_depart': self.speeds_depart[inds], + 'inds_lane_arrival': self.inds_lane_arrival[inds], + 'positions_arrival': self.positions_arrival[inds], + 'speeds_arrival': self.speeds_arrival[inds], + 'ids_edges': self.routes[inds] + } + + def insert_routes(self, is_generate_ids=True, is_add=False, is_overwrite_only=False): + print 'TripReader.make_routes is_generate_ids', is_generate_ids, 'is_add', is_add, 'is_overwrite_only', is_overwrite_only + + # self._trips is scenario trip database + # self.ids_sumo is a list of SUMO IDs read from xml file + + if is_overwrite_only & (not is_add): + is_generate_ids = False + is_add = False + # get trip ids from xml file + # ony import routes ids from existing sumo ids + + # this is index of self.ids_sumo to be overwritten + inds = np.flatnonzero(np.array(self._trips.ids_sumo.has_indices(self.ids_sumo))) + # print ' overwrite trip ids_sumo',self.ids_sumo[inds] + + ids_trip = np.array(self._trips.ids_sumo.get_ids_from_indices(self.ids_sumo[inds]), dtype=np.int32) + # print ' ids_trip',ids_trip + # print 'n_trips',len(ids_trip) + + ids_routes, ids_trip = self._trips.make_routes(self.ids_vtype[inds], + # is_generate_ids = is_generate_ids,# depricated + routes=self.routes[inds], + ids_trip=ids_trip, + is_add=is_add, + **self._get_kwargs(inds=inds) + ) + # print ' ids_routes',ids_routes + + else: + if is_add: + #is_generate_ids = False + # get trip ids from xml file + + inds = np.flatnonzero(self.ids_sumo != '') # ony import routes from specified sumo ids + # print ' self.ids_sumo',self.ids_sumo[inds] + # print ' inds',inds + ids_trip = np.array(self._trips.ids_sumo.get_ids_from_indices_save(self.ids_sumo[inds]), dtype=np.int32) + inds_valid = np.array(ids_trip, dtype=np.int32) > -1 + + ids_routes, ids_trip = self._trips.make_routes(self.ids_vtype[inds[inds_valid]], + # is_generate_ids = is_generate_ids,# depricated + routes=self.routes[inds[inds_valid]], + ids_trip=ids_trip[inds_valid], + is_add=is_add, + **self._get_kwargs(inds=inds[inds_valid]) + ) + + if (not is_add) & is_generate_ids: + inds = np.arange(len(self.routes)) + ids_trip = None + + # print ' ids_trip',ids_trip + ids_routes, ids_trip = self._trips.make_routes(self.ids_vtype[inds], + is_generate_ids=is_generate_ids, + routes=self.routes[inds], + ids_trip=ids_trip, + is_add=is_add, + **self._get_kwargs(inds=inds) + ) + + return ids_routes, ids_trip + +# def get_data(self): +# values = {'ids_sumo': {}, 'times_depart': {},'ids_edge_depart': {},'ids_edge_arrival': {},\ +# 'inds_lane_depart': {},'positions_depart': {},'speeds_depart': {},'inds_lane_arrival': {},\ +# 'positions_arrival': {},'speeds_arrival' : {}, 'ids_edges' : {}} +# attrnames = ['ids_sumo', 'times_depart','ids_edge_depart','ids_edge_arrival',\ +# 'inds_lane_depart','positions_depart','speeds_depart','inds_lane_arrival',\ +# 'positions_arrival','speeds_arrival', 'ids_edges' ] +# valuess = [self.ids_sumo, +# self.times_depart, +# self.ids_edge_depart, +# self.ids_edge_arrival, +# self.inds_lane_depart, +# self.positions_depart, +# self.speeds_depart, +# self.inds_lane_arrival, +# self.positions_arrival, +# self.speeds_arrival, +# self.routes +# ] +# for attrname, value in zip(attrnames, valuess): +# print attrname +# print values +# for id_elem , val in zip(self.get_ids(), value): +## values[attrname][id_elem] = (val,1) +# return values +## + +# def get_ids(self): +# return range(len(self.ids_sumo[(self.ids_sumo!='')])+1)[1:] diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/demand-o1-prefstar.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/demand-o1-prefstar.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/demand-o1-prefstar.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/demand-o1-prefstar.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,1051 +0,0 @@ -# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. -# SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM -# 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 demand-o1-prefstar.py -# @author Joerg Schweizer -# @date - -import os -import sys -import time -from xml.sax import saxutils, parse, handler -if __name__ == '__main__': - try: - APPDIR = os.path.dirname(os.path.abspath(__file__)) - except: - APPDIR = os.path.dirname(os.path.abspath(sys.argv[0])) - SUMOPYDIR = os.path.join(APPDIR, '..', '..') - sys.path.append(SUMOPYDIR) - - -# Trip depart and arrival options, see -# http://www.sumo.dlr.de/userdoc/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html#A_Vehicle.27s_depart_and_arrival_parameter - -OPTIONMAP_POS_DEPARTURE = {"random": -1, "free": -2, "random_free": -3, "base": -4, "last": -5, "first": -6} -OPTIONMAP_POS_ARRIVAL = {"random": -1, "max": -2} -OPTIONMAP_SPEED_DEPARTURE = {"random": -1, "max": -2} -OPTIONMAP_SPEED_ARRIVAL = {"current": -1} -OPTIONMAP_LANE_DEPART = {"random": -1, "free": -2, "allowed": -3, "best": -4, "first": -5} -OPTIONMAP_LANE_ARRIVAL = {"current": -1} - -from coremodules.modules_common import * -import numpy as np -import agilepy.lib_base.classman as cm -import agilepy.lib_base.arrayman as am -import agilepy.lib_base.xmlman as xm -from agilepy.lib_base.misc import get_inversemap -#from agilepy.lib_base.geometry import find_area -#from agilepy.lib_base.processes import Process,CmlMixin,ff,call -from coremodules.network.network import SumoIdsConf, MODES -from coremodules.network import routing -import vehicles -import origin_to_destination -import virtualpop -import turnflows - - -class Demand(cm.BaseObjman): - def __init__(self, scenario=None, net=None, zones=None, name='Demand', info='Transport demand', **kwargs): - # print 'Network.__init__',name,kwargs - - # we need a network from somewhere - if net is None: - net = scenario.net - zones = scenario.landuse.zones - - self._init_objman(ident='demand', parent=scenario, name=name, info=info, **kwargs) - attrsman = self.set_attrsman(cm.Attrsman(self)) - - self.vtypes = attrsman.add(cm.ObjConf(vehicles.VehicleTypes(self, net))) - self.trips = attrsman.add(cm.ObjConf(Trips(self, net))) - - self.odintervals = attrsman.add(cm.ObjConf(origin_to_destination.OdIntervals('odintervals', self, net, zones))) - self.turnflows = attrsman.add(cm.ObjConf(turnflows.Turnflows('turnflows', self, net))) - if scenario is not None: - self.virtualpop = attrsman.add(cm.ObjConf(virtualpop.Virtualpopulation(self))) - # print 'Demand',self.odintervals#,self.odintervals.times_start - # print ' ',dir(self.odintervals) - - def get_scenario(self): - return self.parent - - def get_net(self): - return self.parent.net - - def update_netoffset(self, deltaoffset): - """ - Called when network offset has changed. - Children may need to adjust theur coordinates. - """ - # self.odintervals.update_netoffset(deltaoffset) - pass - - def import_xml(self, rootname, dirname=''): - """ - Import whatever is available. - """ - - filepath = os.path.join(dirname, rootname+'.trip.xml') - if os.path.isfile(filepath): - # import trips - self.trips.import_trips_xml(filepath, is_generate_ids=False) - - # now try to add routes to existing trips - filepath = os.path.join(dirname, rootname+'.rou.xml') - if os.path.isfile(filepath): - self.trips.import_routes_xml(filepath, is_generate_ids=False, is_add=True) - - else: - self.get_logger().w('import_xml: files not found:'+filepath, key='message') - - else: - self.get_logger().w('import_xml: files not found:'+filepath, key='message') - - # no trip file exists, but maybe just a route file with trips - filepath = os.path.join(dirname, rootname+'.rou.xml') - if os.path.isfile(filepath): - self.trips.import_routes_xml(filepath, is_generate_ids=False, is_add=False) - - else: - self.get_logger().w('import_xml: files not found:'+filepath, key='message') - - -class Routes(am.ArrayObjman): - def __init__(self, ident, trips, net, **kwargs): - - self._init_objman(ident=ident, - parent=trips, - name='Routes', - info='Table with route info.', - xmltag=('routes', 'route', None), - **kwargs) - - #self.add_col(SumoIdsConf('Route', xmltag = 'id')) - - self.add_col(am.IdsArrayConf('ids_trip', trips, - groupnames=['state'], - name='Trip ID', - info='Route for this trip ID.', - )) - - self.add_col(am.IdlistsArrayConf('ids_edges', net.edges, - name='Edge IDs', - info='List of edge IDs constituting the route.', - xmltag='edges', - )) - - self.add_col(am.ArrayConf('costs', 0.0, - dtype=np.float32, - perm='r', - name='Costs', - info="Route costs.", - xmltag='cost', - )) - - self.add_col(am.ArrayConf('probabilities', 1.0, - dtype=np.float32, - perm='r', - name='Probab.', - info="Route route choice probability.", - xmltag='probability', - )) - - self.add_col(am.ArrayConf('colors', np.ones(4, np.float32), - dtype=np.float32, - metatype='color', - perm='rw', - name='Color', - info="Route color. Color as RGBA tuple with values from 0.0 to 1.0", - xmltag='color', - )) - - def clear_routes(self): - self.clear() - - -class Trips(am.ArrayObjman): - def __init__(self, demand, net, **kwargs): - # print 'Trips.__init__' - self._init_objman(ident='trips', - parent=demand, - name='Trips', - info='Table with trip and route info.', - xmltag=('trips', 'trip', 'ids_sumo'), - **kwargs) - - self.add_col(SumoIdsConf('Trip', xmltag='id')) - - self.add_col(am.IdsArrayConf('ids_vtype', demand.vtypes, - groupnames=['state'], - name='Type', - info='Vehicle type.', - xmltag='type', - )) - - self.add_col(am.ArrayConf('times_depart', 0, - dtype=np.int32, - perm='rw', - name='Depart time', - info="Departure time of vehicle in seconds. Must be an integer!", - xmltag='depart', - )) - - self.add_col(am.IdsArrayConf('ids_edge_depart', net.edges, - groupnames=['state'], - name='ID from-edge', - info='ID of network edge where trip starts.', - xmltag='from', - )) - - self.add_col(am.IdsArrayConf('ids_edge_arrival', net.edges, - groupnames=['state'], - name='ID to-edge', - info='ID of network edge where trip ends.', - xmltag='to', - )) - - self.add_col(am.ArrayConf('inds_lane_depart', OPTIONMAP_LANE_DEPART["free"], - dtype=np.int32, - #choices = OPTIONMAP_LANE_DEPART, - perm='r', - name='Depart lane', - info="Departure lane index. 0 is rightmost lane or sidewalk, if existant.", - xmltag='departLane', - xmlmap=get_inversemap(OPTIONMAP_LANE_DEPART), - )) - - self.add_col(am.ArrayConf('positions_depart', OPTIONMAP_POS_DEPARTURE["random_free"], - dtype=np.float32, - #choices = OPTIONMAP_POS_DEPARTURE, - perm='r', - name='Depart pos', - unit='m', - info="Position on edge at the moment of departure.", - xmltag='departPos', - xmlmap=get_inversemap(OPTIONMAP_POS_DEPARTURE), - )) - - self.add_col(am.ArrayConf('speeds_depart', 0.0, - dtype=np.float32, - #choices = OPTIONMAP_SPEED_DEPARTURE, - perm='r', - name='Depart speed', - unit='m/s', - info="Speed at the moment of departure.", - xmltag='departSpeed', - xmlmap=get_inversemap(OPTIONMAP_SPEED_DEPARTURE), - )) - self.add_col(am.ArrayConf('inds_lane_arrival', OPTIONMAP_LANE_ARRIVAL["current"], - dtype=np.int32, - #choices = OPTIONMAP_LANE_ARRIVAL, - perm='r', - name='Arrival lane', - info="Arrival lane index. 0 is rightmost lane or sidewalk, if existant.", - xmltag='arrivalLane', - xmlmap=get_inversemap(OPTIONMAP_LANE_ARRIVAL), - )) - - self.add_col(am.ArrayConf('positions_arrival', OPTIONMAP_POS_ARRIVAL["random"], - dtype=np.float32, - #choices = OPTIONMAP_POS_ARRIVAL, - perm='r', - name='Arrival pos', - unit='m', - info="Position on edge at the moment of arrival.", - xmltag='arrivalPos', - xmlmap=get_inversemap(OPTIONMAP_POS_ARRIVAL), - )) - - self.add_col(am.ArrayConf('speeds_arrival', 0.0, - dtype=np.float32, - #choices = OPTIONMAP_SPEED_ARRIVAL, - perm='r', - name='Arrival speed', - unit='m/s', - info="Arrival at the moment of departure.", - xmltag='arrivalSpeed', - xmlmap=get_inversemap(OPTIONMAP_SPEED_ARRIVAL), - )) - - self.add(cm.ObjConf(Routes('routes', self, net))) - - # print ' self.routes.get_value()',self.routes.get_value() - self.add_col(am.IdlistsArrayConf('ids_routes', self.routes.get_value(), - name='Route IDs', - info='List of edge IDs constituting the route.', - )) - - def clear_trips(self): - self.routes.get_value().clear_routes() - self.clear() - - def clear_routes(self): - self.routes.get_value().clear_routes() - self.ids_routes.reset() - - def get_net(self): - return self.parent.get_scenario().net - - def get_scenario(self): - return self.parent.get_scenario() - - def get_time_depart_first(self): - if len(self) > 0: - return float(np.min(self.times_depart.get_value())) - else: - return 0.0 - - def get_time_depart_last(self): - if len(self) > 0: - return float(np.max(self.times_depart.get_value())) - else: - return 0.0 - - def get_tripfilepath(self): - return self.get_scenario().get_rootfilepath()+'.trip.xml' - - def get_routefilepath(self): - return self.get_scenario().get_rootfilepath()+'.rou.xml' - - def duaroute(self, is_export_net=False, is_export_trips=True, - routefilepath=None, **kwargs): - """ - Simple fastest path routing using duarouter. - """ - print 'duaroute' - exectime_start = time.clock() - - #routesattrname = self.get_routesattrname(routesindex) - vtypes = self.parent.vtypes - if (not os.path.isfile(self.get_tripfilepath())) | is_export_trips: - ids_vtype_pedestrian = vtypes.select_by_mode(mode='pedestrian', is_sumoid=False) - self.export_trips_xml(ids_vtype_exclude=ids_vtype_pedestrian) - - if (not os.path.isfile(self.get_net().get_filepath())) | is_export_net: - self.get_net().export_netxml() - - if routefilepath is None: - routefilepath = self.get_routefilepath() - - if routing.duaroute(self.get_tripfilepath(), self.get_net().get_filepath(), - routefilepath, **kwargs): - - self.import_routes_xml(routefilepath, is_clear_trips=False, - is_generate_ids=False, - is_add=True) - - print ' exectime', time.clock()-exectime_start - return routefilepath - - else: - return None - - def get_trips_for_vtype(self, id_vtype): - return self.select_ids(self.ids_vtype.get_value() == id_vtype) - - def get_vtypes(self): - return set(self.ids_vtype.get_value()) - - def route(self, is_check_lanes=True): - """ - Fastest path python router. - """ - print 'route' - # TODO: if too mant vtypes, better go through id_modes - exectime_start = time.clock() - - net = self.get_scenario().net - edges = net.edges - vtypes = self.parent.vtypes - - ids_edges = [] - ids_trip = [] - costs = [] - for id_vtype in self.get_vtypes(): - id_mode = vtypes.ids_mode[id_vtype] - - # no routing for pedestrians - if id_mode != net.modes.get_id_mode('pedestrian'): - weights = edges.get_times(id_mode=id_mode, - speed_max=vtypes.speeds_max[id_vtype], - is_check_lanes=is_check_lanes) - - ids_trip_vtype = self.get_trips_for_vtype(id_vtype) - # print ' id_vtype,id_mode',id_vtype,id_mode#,ids_trip_vtype - # print ' weights',weights - ids_edge_depart = self.ids_edge_depart[ids_trip_vtype] - ids_edge_arrival = self.ids_edge_arrival[ids_trip_vtype] - - for id_trip, id_edge_depart, id_edge_arrival in zip(ids_trip_vtype, ids_edge_depart, ids_edge_arrival): - cost, route = routing.get_mincostroute_edge2edge(id_edge_depart, - id_edge_arrival, - edges=edges, - weights=weights) - if len(route) > 0: - ids_edges.append(route) - ids_trip.append(id_trip) - costs.append(cost) - - ids_route = self.routes.get_value().add_rows(ids_trip=ids_trip, - ids_edges=ids_edges, - costs=costs, - ) - self.add_routes(ids_trip, ids_route) - print ' exectime', time.clock()-exectime_start - return ids_trip, ids_route - - def estimate_entered(self, method_routechoice=None): - """ - Estimates the entered number of vehicles for each edge. - returns ids_edge and entered_vec - """ - # TODO: we could specify a mode - if method_routechoice is None: - method_routechoice = self.get_route_first - - ids_edges = self.routes.get_value().ids_edges - counts = np.zeros(np.max(self.get_net().edges.get_ids())+1, int) - - for id_trip in self.get_ids(): - id_route = method_routechoice(id_trip) - if id_route >= 0: - # here the [1:] eliminates first edge as it is not entered - counts[ids_edges[id_route][1:]] += 1 - - ids_edge = np.flatnonzero(counts) - entered_vec = counts[ids_edge].copy() - return ids_edge, entered_vec - - def make_trip(self, is_generate_ids=True, **kwargs): - id_trip = self.add_row(ids_vtype=kwargs.get('id_vtype', None), - times_depart=kwargs.get('time_depart', None), - ids_edge_depart=kwargs.get('id_edge_depart', None), - ids_edge_arrival=kwargs.get('id_edge_arrival', None), - inds_lane_depart=kwargs.get('ind_lane_depart', None), - positions_depart=kwargs.get('position_depart', None), - speeds_depart=kwargs.get('speed_depart', None), - inds_lane_arrival=kwargs.get('ind_lane_arrival', None), - positions_arrival=kwargs.get('position_arrival', None), - speeds_arrival=kwargs.get('speed_arrival', None), - ids_routes=[], - ) - - if is_generate_ids: - self.ids_sumo[id_trip] = str(id_trip) - else: - self.ids_sumo[id_trip] = kwargs.get('id_sumo', str(id_trip)) # id - - if kwargs.has_key('route'): - id_route = self.routes.get_value().add_row(ids_trip=id_trip, - ids_edges=kwargs['route'] - ) - self.ids_routes[id_trip] = [id_route] - - return id_trip - - def make_trips(self, ids_vtype, is_generate_ids=True, **kwargs): - # print 'make_trips ids_vtype =',ids_vtype - # print ' kwargs=',kwargs - ids_trip = self.add_rows( - ids_vtype=ids_vtype, - times_depart=kwargs.get('times_depart', None), - ids_edge_depart=kwargs.get('ids_edge_depart', None), - ids_edge_arrival=kwargs.get('ids_edge_arrival', None), - inds_lane_depart=kwargs.get('inds_lane_depart', None), - positions_depart=kwargs.get('positions_depart', None), - speeds_depart=kwargs.get('speeds_depart', None), - inds_lane_arrival=kwargs.get('inds_lane_arrival', None), - positions_arrival=kwargs.get('positions_arrival', None), - speeds_arrival=kwargs.get('speeds_arrival', None), - #ids_routes = len(ids_vtype)*[[]], - ) - - if is_generate_ids: - self.ids_sumo[ids_trip] = np.array(ids_trip, np.str) - else: - self.ids_sumo[ids_trip] = kwargs.get('ids_sumo', np.array(ids_trip, np.str)) - return ids_trip - - def make_routes(self, ids_vtype, is_generate_ids=True, routes=None, ids_trip=None, **kwargs): - # print 'make_routes',is_generate_ids - - if ids_trip is None: # is_generate_ids = is_generate_ids, - # print ' generate new trips' - ids_trip = self.make_trips(ids_vtype, is_generate_ids=is_generate_ids, **kwargs) - - # print ' ids_trip =',ids_trip - ids_routes = self.routes.get_value().add_rows(ids_trip=ids_trip, - ids_edges=routes, - ) - self.add_routes(ids_trip, ids_routes) - - # no!:self.ids_routes[ids_trip] = ids_routes.reshape((-1,1)).tolist()# this makes an array of lists - # print ' self.ids_routes.get_value()',self.ids_routes[ids_trip] - # print ' ids_routes.reshape((-1,1)).tolist()',ids_routes.reshape((-1,1)).tolist() - # print ' make_routes DONE' - return ids_routes, ids_trip - - def add_routes(self, ids_trip, ids_routes): - for id_trip, id_route in zip(ids_trip, ids_routes): - # no!: self.ids_routes[id_trip].append(id_route) - # print ' self.ids_routes[id_trip]',self.ids_routes[id_trip],id_route - if self.ids_routes[id_trip] is None: - self.ids_routes[id_trip] = [id_route] # this works! - else: - self.ids_routes[id_trip].append(id_route) - - def export_trips_xml(self, filepath=None, encoding='UTF-8', - ids_vtype_exclude=[]): - """ - Export trips to SUMO xml file. - Method takes care of sorting trips by departure time. - """ - if filepath is None: - filepath = self.get_tripfilepath() - print 'export_trips_xml', filepath - try: - fd = open(filepath, 'w') - except: - print 'WARNING in write_obj_to_xml: could not open', filepath - return False - - xmltag, xmltag_item, attrname_id = self.xmltag - fd.write('\n' % encoding) - fd.write(xm.begin(xmltag)) - indent = 2 - - ids_trip = self.times_depart.get_ids_sorted() - ids_vtype = self.ids_vtype[ids_trip] - #ids_vtypes_exclude = self.ids_vtype.get_ids_from_indices(vtypes_exclude) - - inds_selected = np.ones(len(ids_vtype), np.bool) - for id_vtype in ids_vtype_exclude: - inds_selected[ids_vtype == id_vtype] = False - ids_trip_selected = ids_trip[inds_selected] - ids_vtype_selected = set(ids_vtype[inds_selected]) - #ids_vtypes_selected = set(ids_vtypes).difference(ids_vtypes_exclude) - - self.parent.vtypes.write_xml(fd, indent=indent, - ids=ids_vtype_selected, - is_print_begin_end=False) - - self.write_xml(fd, indent=indent, - ids=ids_trip_selected, - attrconfigs_excluded=[self.routes, self.ids_routes], - is_print_begin_end=False) - - fd.write(xm.end(xmltag)) - fd.close() - return filepath - - def export_routes_xml(self, filepath=None, method_routechoice=None, encoding='UTF-8'): - """ - Export routes to SUMO xml file. - Method takes care of sorting trips by departure time. - """ - if method_routechoice is None: - method_routechoice = self.get_route_first - - if filepath is None: - filepath = self.get_routefilepath() - print 'export_routes_xml', filepath - try: - fd = open(filepath, 'w') - except: - print 'WARNING in write_obj_to_xml: could not open', filepath - return False - - xmltag_routes, xmltag_veh, attrname_id = ("routes", "vehicle", "ids_sumo") - xmltag_trip = "trip" - xmltag_rou = "route" - - fd.write('\n' % encoding) - fd.write(xm.begin(xmltag_routes)) - indent = 2 - - #ids_modes_used = set(self.parent.vtypes.ids_mode[self.ids_vtype.get_value()]) - self.parent.vtypes.write_xml(fd, indent=indent, - ids=set(self.ids_vtype.get_value()), - is_print_begin_end=False - ) - - ids_mode = self.parent.vtypes.ids_mode - id_pedestrian = MODES['pedestrian'] - routes = self.routes.get_value() - - # here we could write the route info - # but we do write it inside each trip so that it can be parsed - # in the same way as duarouter output - # routes.write_xml( fd, indent=indent, - # attrconfigs_excluded = [routes.costs, routes.probabilities], - # is_print_begin_end = False) - - # let's write trip info manually - tripconfigs = [self.ids_vtype, - self.times_depart, - self.ids_edge_depart, - self.ids_edge_arrival, - self.inds_lane_depart, - self.positions_depart, - self.speeds_depart, - self.inds_lane_arrival, - self.positions_arrival, - self.speeds_arrival, - ] - - routeconfigs = [routes.ids_edges, - routes.colors, - ] - - attrconfig_id = getattr(self.get_attrsman(), attrname_id) - xmltag_id = attrconfig_id.xmltag - - for id_trip in self.times_depart.get_ids_sorted(): - - if ids_mode[self.ids_vtype[id_trip]] == id_pedestrian: - self.write_persontrip_xml(fd, id_trip, - method_routechoice=method_routechoice, - indent=indent+2) - - else: - id_route = method_routechoice(id_trip) - if id_route >= 0: # a valid route has been found - # init vehicle route only if valid route exists - fd.write(xm.start(xmltag_veh, indent+2)) - else: - # init trip instead of route - fd.write(xm.start(xmltag_trip, indent+2)) - - # print ' make tag and id',_id - fd.write(xm.num(xmltag_id, attrconfig_id[id_trip])) - - # print ' write columns',len(scalarcolconfigs)>0,len(idcolconfig_include_tab)>0,len(objcolconfigs)>0 - for attrconfig in tripconfigs: - # print ' attrconfig',attrconfig.attrname - attrconfig.write_xml(fd, id_trip) - - if id_route >= 0: # a valid route has been found - # write route id - #fd.write(xm.num('route', id_route )) - - # instead of route id we write entire route here - fd.write(xm.stop()) - fd.write(xm.start(xmltag_rou, indent+4)) - for attrconfig in routeconfigs: - # print ' attrconfig',attrconfig.attrname - attrconfig.write_xml(fd, id_route) - - # end route and vehicle - fd.write(xm.stopit()) - fd.write(xm.end(xmltag_veh, indent+2)) - - else: - # end trip without route - fd.write(xm.stopit()) - - fd.write(xm.end(xmltag_routes)) - fd.close() - return filepath - - def write_persontrip_xml(self, fd, id_trip, indent=2, method_routechoice=None): - # currently no routes are exported, only origin and destination edges - # if method_routechoice is None: - # method_routechoice = self.get_route_first - xmltag_person = 'person' - id_route = method_routechoice(id_trip) - - fd.write(xm.start(xmltag_person, indent)) - - self.ids_sumo.write_xml(fd, id_trip) - self.times_depart.write_xml(fd, id_trip) - self.ids_vtype.write_xml(fd, id_trip) - fd.write(xm.stop()) - - fd.write(xm.start('walk', indent=indent+2)) - # print 'write walk',id_trip,self.positions_depart[id_trip],self.positions_arrival[id_trip] - self.ids_edge_depart.write_xml(fd, id_trip) - if self.positions_depart[id_trip] > 0: - self.positions_depart.write_xml(fd, id_trip) - - self.ids_edge_arrival.write_xml(fd, id_trip) - if self.positions_arrival[id_trip] > 0: - self.positions_arrival.write_xml(fd, id_trip) - - fd.write(xm.stopit()) # ends walk - fd.write(xm.end(xmltag_person, indent=indent)) - - def get_route_first(self, id_trip): - ids_route = self.ids_routes[id_trip] - if ids_route is None: - return -1 - elif len(ids_route) > 0: - return ids_route[0] - else: - return -1 # no route found - - def import_routes_xml(self, filepath, is_clear_trips=False, - is_generate_ids=True, is_add=False): - print 'import_routes_xml from %s generate own trip ' % (filepath) - if is_clear_trips: - self.clear_trips() - - counter = RouteCounter() - parse(filepath, counter) - reader = RouteReader(self, counter) - try: - parse(filepath, reader) - # print ' call make_routes',is_generate_ids,is_add - reader.insert_routes(is_generate_ids=is_generate_ids, - is_add=is_add) - except KeyError: - print >> sys.stderr, "Error: Problems with reading routes!" - raise - - def import_trips_xml(self, filepath, is_clear_trips=False, is_generate_ids=True): - print 'import_trips_xml from %s generate own trip ' % (filepath) - if is_clear_trips: - self.clear_trips() - - counter = TripCounter() - parse(filepath, counter) - reader = TripReader(self, counter.n_trip) - print ' n_trip=', counter.n_trip - - try: - parse(filepath, reader) - reader.insert_trips(is_generate_ids=is_generate_ids) - except KeyError: - print >> sys.stderr, "Error: Problems with reading trips!" - raise - - -class TripCounter(handler.ContentHandler): - """Parses a SUMO route XML file and counts trips.""" - - def __init__(self): - self.n_trip = 0 - - def startElement(self, name, attrs): - # print 'startElement',name,self.n_trip - if name == 'trip': - self.n_trip += 1 - - -class TripReader(handler.ContentHandler): - """Reads trips from trip or route file into trip table""" - - def __init__(self, trips, n_trip): - # print 'RouteReader.__init__',demand.ident - self._trips = trips - demand = trips.parent - - net = demand.get_scenario().net - - self._ids_vtype_sumo = demand.vtypes.ids_sumo - self._ids_edge_sumo = net.edges.ids_sumo - - self.ids_sumo = np.zeros(n_trip, np.object) - self.ids_vtype = np.zeros(n_trip, np.int32) - self.times_depart = np.zeros(n_trip, np.int32) - self.ids_edge_depart = np.zeros(n_trip, np.int32) - self.ids_edge_arrival = np.zeros(n_trip, np.int32) - self.inds_lane_depart = np.zeros(n_trip, np.int32) - self.positions_depart = np.zeros(n_trip, np.float32) - self.speeds_depart = np.zeros(n_trip, np.float32) - self.inds_lane_arrival = np.zeros(n_trip, np.int32) - self.positions_arrival = np.zeros(n_trip, np.float32) - self.speeds_arrival = np.zeros(n_trip, np.float32) - self.routes = np.zeros(n_trip, np.object) - - self._ind_trip = -1 - - self._has_routes = False - self._ids_sumoedge_current = [] - self._id_sumoveh_current = None - #self._time_depart = 0 - #self._attrs = {} - #self._is_generate_ids = is_generate_ids - self._intervals_current = '' - - def startElement(self, name, attrs): - # - # - # - # print 'startElement',name - if name == 'trip': - # print ' startElement',attrs['id'],attrs['depart'] - self._ind_trip += 1 - - self._id_sumoveh_current = attrs['id'] - self.ids_sumo[self._ind_trip] = self._id_sumoveh_current - print 'startElement ids_vtype', attrs['type'], self._ids_vtype_sumo.get_id_from_index(str(attrs['type'])) - self.ids_vtype[self._ind_trip] = self._ids_vtype_sumo.get_id_from_index(str(attrs['type'])) - self.times_depart[self._ind_trip] = int(float(attrs['depart'])) - - if attrs.has_key('from'): - self.ids_edge_depart[self._ind_trip] = self._ids_edge_sumo.get_id_from_index(str(attrs['from'])) - if attrs.has_key('to'): - self.ids_edge_arrival[self._ind_trip] = self._ids_edge_sumo.get_id_from_index(str(attrs['to'])) - - ind_lane_depart_raw = attrs.get('departLane', 'free') - if OPTIONMAP_LANE_DEPART.has_key(ind_lane_depart_raw): - self.inds_lane_depart[self._ind_trip] = OPTIONMAP_LANE_DEPART[ind_lane_depart_raw] - else: - self.inds_lane_depart[self._ind_trip] = int(ind_lane_depart_raw) - - positions_depart_raw = attrs.get('departPos', 'base') - if OPTIONMAP_POS_DEPARTURE.has_key(positions_depart_raw): - self.positions_depart[self._ind_trip] = OPTIONMAP_POS_DEPARTURE[positions_depart_raw] - else: - self.positions_depart[self._ind_trip] = float(positions_depart_raw) - - self.speeds_depart[self._ind_trip] = attrs.get('departSpeed', 0.0) - - ind_lane_arrival_raw = attrs.get('arrivalLane', 'current') - if OPTIONMAP_LANE_ARRIVAL.has_key(ind_lane_arrival_raw): - self.inds_lane_arrival[self._ind_trip] = OPTIONMAP_LANE_ARRIVAL[ind_lane_arrival_raw] - else: - self.inds_lane_arrival[self._ind_trip] = int(ind_lane_arrival_raw) - - positions_arrival_raw = attrs.get('arrivalPos', 'max') - if OPTIONMAP_POS_ARRIVAL.has_key(positions_arrival_raw): - self.positions_arrival[self._ind_trip] = OPTIONMAP_POS_ARRIVAL[positions_arrival_raw] - else: - self.positions_arrival[self._ind_trip] = float(positions_arrival_raw) - - self.speeds_arrival[self._ind_trip] = attrs.get('arrivalSpeed', 0.0) - - def _get_kwargs(self): - return {'ids_sumo': self.ids_sumo, - 'times_depart': self.times_depart, - 'ids_edge_depart': self.ids_edge_depart, - 'ids_edge_arrival': self.ids_edge_arrival, - 'inds_lane_depart': self.inds_lane_depart, - 'positions_depart': self.positions_depart, - 'speeds_depart': self.speeds_depart, - 'inds_lane_arrival': self.inds_lane_arrival, - 'positions_arrival': self.positions_arrival, - 'speeds_arrival': self.speeds_arrival, - } - - def insert_trips(self, is_generate_ids=True): - - # print 'TripReader.insert_trips self.ids_vtype',self.ids_vtype - kwargs = self._get_kwargs() - ids_trips = self._trips.make_trips(self.ids_vtype, - is_generate_ids=is_generate_ids, - **kwargs) - - return ids_trips - - -class RouteCounter(handler.ContentHandler): - """Parses a SUMO route XML file and counts trips.""" - - def __init__(self): - self.n_veh = 0 - self.n_pers = 0 - #self.n_rou = 0 - - def startElement(self, name, attrs): - # print 'startElement',name,self.n_trip - if name == 'vehicle': - self.n_veh += 1 - elif name == 'person': - self.n_pers += 1 - # elif name == 'route': - # if attrs.has_key('id'): - # self.n_rou += 1 - - -class RouteReader(TripReader): - """Reads trips from trip or route file into trip table""" - - def __init__(self, trips, counter): - # print 'RouteReader.__init__',demand.ident - self._trips = trips - n_veh = counter.n_veh - n_per = counter.n_pers - #n_rou = counter.n_rou - n_trip = n_veh+n_per - demand = trips.parent - - net = demand.get_scenario().net - - self._ids_vtype_sumo = demand.vtypes.ids_sumo - self._ids_edge_sumo = net.edges.ids_sumo - - self.ids_sumo = np.zeros(n_trip, np.object) - self.ids_vtype = np.zeros(n_trip, np.int32) - self.times_depart = np.zeros(n_trip, np.int32) - self.ids_edge_depart = np.zeros(n_trip, np.int32) - self.ids_edge_arrival = np.zeros(n_trip, np.int32) - self.inds_lane_depart = np.zeros(n_trip, np.int32) - self.positions_depart = np.zeros(n_trip, np.float32) - self.speeds_depart = np.zeros(n_trip, np.float32) - self.inds_lane_arrival = np.zeros(n_trip, np.int32) - self.positions_arrival = np.zeros(n_trip, np.float32) - self.speeds_arrival = np.zeros(n_trip, np.float32) - self.routes = np.zeros(n_trip, np.object) - - self._ind_trip = -1 - - self._has_routes = False - self._ids_sumoedge_current = [] - self._id_sumoveh_current = None - #self._time_depart = 0 - #self._attrs = {} - #self._is_generate_ids = is_generate_ids - self._intervals_current = '' - - def startElement(self, name, attrs): - # - # - # - # print 'startElement',name - if name == 'vehicle': - # print ' startElement',attrs['id'],attrs['depart'] - self._ind_trip += 1 - - self._id_sumoveh_current = attrs['id'] - self.ids_sumo[self._ind_trip] = self._id_sumoveh_current - # print 'startElement ids_vtype',attrs['type'], self._ids_vtype_sumo.get_id_from_index(str(attrs['type'])) - self.ids_vtype[self._ind_trip] = self._ids_vtype_sumo.get_id_from_index(str(attrs['type'])) - self.times_depart[self._ind_trip] = int(float(attrs['depart'])) - - if attrs.has_key('from'): - self.ids_edge_depart[self._ind_trip] = self._ids_edge_sumo.get_id_from_index(str(attrs['from'])) - if attrs.has_key('to'): - self.ids_edge_arrival[self._ind_trip] = self._ids_edge_sumo.get_id_from_index(str(attrs['to'])) - - ind_lane_depart_raw = attrs.get('departLane', 'free') - if OPTIONMAP_LANE_DEPART.has_key(ind_lane_depart_raw): - self.inds_lane_depart[self._ind_trip] = OPTIONMAP_LANE_DEPART[ind_lane_depart_raw] - else: - self.inds_lane_depart[self._ind_trip] = int(ind_lane_depart_raw) - - positions_depart_raw = attrs.get('departPos', 'base') - if OPTIONMAP_POS_DEPARTURE.has_key(positions_depart_raw): - self.positions_depart[self._ind_trip] = OPTIONMAP_POS_DEPARTURE[positions_depart_raw] - else: - self.positions_depart[self._ind_trip] = float(positions_depart_raw) - - self.speeds_depart[self._ind_trip] = attrs.get('departSpeed', 0.0) - - ind_lane_arrival_raw = attrs.get('arrivalLane', 'current') - if OPTIONMAP_LANE_ARRIVAL.has_key(ind_lane_arrival_raw): - self.inds_lane_arrival[self._ind_trip] = OPTIONMAP_LANE_ARRIVAL[ind_lane_arrival_raw] - else: - self.inds_lane_arrival[self._ind_trip] = int(ind_lane_arrival_raw) - - positions_arrival_raw = attrs.get('arrivalPos', 'max') - if OPTIONMAP_POS_ARRIVAL.has_key(positions_arrival_raw): - self.positions_arrival[self._ind_trip] = OPTIONMAP_POS_ARRIVAL[positions_arrival_raw] - else: - self.positions_arrival[self._ind_trip] = float(positions_arrival_raw) - - self.speeds_arrival[self._ind_trip] = attrs.get('arrivalSpeed', 0.0) - - if name == 'route': - self._has_routes = True - # print ' ',attrs.get('edges', '') - self._ids_sumoedge_current = attrs.get('edges', '') - self._intervals_current = attrs.get('intervals', '') - - # def characters(self, content): - # if (len(self._route_current)>0)&(self._intervals_current!=''): - # self._intervals_current = self._intervals_current + content - - def endElement(self, name): - - if name == 'vehicle': - # print 'endElement',name,self._id_current,len(self._intervals_current) - if (self._id_sumoveh_current is not None): - ids_edge = [] - for id_sumoedge in self._ids_sumoedge_current.split(' '): - if not id_sumoedge in ('', ' ', ','): - if self._ids_edge_sumo.has_index(id_sumoedge): - ids_edge.append(self._ids_edge_sumo.get_id_from_index(id_sumoedge.strip())) - self.routes[self._ind_trip] = ids_edge - - if len(ids_edge) >= 1: - self.ids_edge_depart[self._ind_trip] = ids_edge[0] - self.ids_edge_arrival[self._ind_trip] = ids_edge[-1] - - self._id_sumoveh_current = None - #self._attrs = {} - self._ids_sumoedge_current = [] - - # elif name in ['routes','trips']: - # self.make_trips() - - def process_intervals(self): - interval = [] - es = self._intervals_current.rstrip().split(" ") - for e in es: - p = e.split(",") - interval.append((float(p[0]), float(p[1]))) - self._intervals_current = '' - return interval - - def _get_kwargs(self): - return {'ids_sumo': self.ids_sumo, - 'times_depart': self.times_depart, - 'ids_edge_depart': self.ids_edge_depart, - 'ids_edge_arrival': self.ids_edge_arrival, - 'inds_lane_depart': self.inds_lane_depart, - 'positions_depart': self.positions_depart, - 'speeds_depart': self.speeds_depart, - 'inds_lane_arrival': self.inds_lane_arrival, - 'positions_arrival': self.positions_arrival, - 'speeds_arrival': self.speeds_arrival, - } - - def insert_routes(self, is_generate_ids=True, is_add=False): - # print 'TripReader.make_routes',is_generate_ids, is_add - ids_trip = None - if is_add: - is_generate_ids = False - # get trip ids from xml file - ids_trip = self._trips.ids_sumo.get_ids_from_indices(self.ids_sumo) - - # print ' ids_trip',ids_trip - ids_routes, ids_trips = self._trips.make_routes(self.ids_vtype, - is_generate_ids=is_generate_ids, - routes=self.routes, - ids_trip=ids_trip, - **self._get_kwargs()) - - return ids_routes, ids_trips - - -if __name__ == '__main__': - ############################################################################### - # print 'sys.path',sys.path - from agilepy.lib_wx.objpanel import objbrowser - from agilepy.lib_base.logger import Logger - #from coremodules.scenario import scenario - from coremodules.network import network - logger = Logger() - NETPATH = os.path.join(SUMOPYDIR, 'coremodules', 'network', 'testnet') - net = network.Network(logger=logger) - rootname = 'facsp2' - net.import_xml(rootname, NETPATH) - # net.read_sumonodes(os.path.join(NETPATH,'facsp2.nod.xml')) - # net.read_sumoedges(os.path.join(NETPATH,'facsp2.edg.xml')) - demand = Demand(net=net, logger=logger) - # demand.set_net(net) - # landuse.facilities.import_poly(os.path.join(NETPATH,'facsp2.poly.xml')) - #landuse.import_xml(rootname, NETPATH) - objbrowser(demand) diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/demand.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/demand.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/demand.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/demand.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,12 +14,29 @@ # @file demand.py # @author Joerg Schweizer -# @date +# @date 2012 +import detectorflows +import turnflows +import virtualpop +import origin_to_destination +import vehicles +from coremodules.network.network import SumoIdsConf, MODES +from demandbase import * +import publictransportservices as pt +from coremodules.simulation import results as res +from coremodules.network import routing +from agilepy.lib_base.processes import Process +from agilepy.lib_base.misc import get_inversemap +import agilepy.lib_base.xmlman as xm +import agilepy.lib_base.arrayman as am +import agilepy.lib_base.classman as cm +import numpy as np +from coremodules.modules_common import * import os import sys import time -from xml.sax import saxutils, parse, handler + if __name__ == '__main__': try: @@ -34,26 +51,9 @@ # http://www.sumo.dlr.de/userdoc/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html#A_Vehicle.27s_depart_and_arrival_parameter -from coremodules.modules_common import * -import numpy as np -import agilepy.lib_base.classman as cm -import agilepy.lib_base.arrayman as am -import agilepy.lib_base.xmlman as xm -from agilepy.lib_base.misc import get_inversemap - #from agilepy.lib_base.geometry import find_area #from agilepy.lib_base.processes import Process,CmlMixin,ff,call -from coremodules.network.network import SumoIdsConf, MODES -from coremodules.network import routing -from coremodules.simulation import results as res - -import vehicles -import origin_to_destination -import virtualpop -import turnflows -import publictransportservices as pt -from demandbase import * try: try: @@ -101,6 +101,9 @@ print 'Demand._init_attributes', scenario if scenario is not None: + self.detectorflows = attrsman.add(cm.ObjConf(detectorflows.Detectorflows('detectorflows', self), + )) + self.ptlines = attrsman.add(cm.ObjConf(pt.PtLines('ptlines', self), groupnames=['demand objects']) ) @@ -163,15 +166,18 @@ # ident = obj.get_ident() obj = DemandClass(ident, self, **kwargs) is_child = True + #is_save = True else: # link to simobject, which must be a child of another object - is_child = False + is_child = False # will not be saved but linked + #is_save = False attrsman = self.get_attrsman() attrsman.add(cm.ObjConf(obj, groupnames=['demand objects'], is_child=is_child, + #is_save = is_save, )) setattr(self, ident, obj) @@ -182,7 +188,14 @@ #demandobjects = set([]) # for ident, conf in self.get_group_attrs('').iteritems(): # demandobjects.add(conf.get_value()) - return self.get_attrsman().get_group_attrs('demand objects').values() + demandobjects_clean = [] + for attrname, demandobject in self.get_attrsman().get_group_attrs('demand objects').iteritems(): + if demandobject is not None: + demandobjects_clean.append(demandobject) + else: + print 'WARNING in get_demandobjects: found None as object', attrname + self.get_attrsman().delete(attrname) + return demandobjects_clean def get_time_depart_first(self): # print 'get_time_depart_first' @@ -202,8 +215,38 @@ # self._demandobjects.discard(demandobject) self.get_attrsman().delete(demandobject.ident) + def import_routes_xml(self, filepath=None, demandobjects=None, + is_clear_trips=False, is_generate_ids=False, + is_overwrite_only=True): + + if demandobjects is None: + demandobjects = self.get_demandobjects() + + # is_route = True # add edge ids, if available + + if filepath is None: + filepath = self.get_routefilepath() + print 'import_routes_xml', filepath, demandobjects + try: + fd = open(filepath, 'r') + except: + print 'WARNING in import_routes_xml: could not open', filepath + return False + + for demandobj in demandobjects: + print ' try to import routes from demandobj', demandobj + demandobj.import_routes_xml(filepath, + is_clear_trips=is_clear_trips, + is_generate_ids=is_generate_ids, + is_overwrite_only=is_overwrite_only) + + return True + def export_routes_xml(self, filepath=None, encoding='UTF-8', - demandobjects=None, is_route=True): + demandobjects=None, is_route=True, + vtypeattrs_excluded=[], + is_plain=False, + is_exclude_pedestrians=False,): """ Export routes available from the demand to SUMO xml file. Method takes care of sorting trips by departure time. @@ -220,7 +263,7 @@ try: fd = open(filepath, 'w') except: - print 'WARNING in write_obj_to_xml: could not open', filepath + print 'WARNING in export_routes_xml: could not open', filepath return False fd.write('\n' % encoding) @@ -229,21 +272,36 @@ times_begin = np.zeros((0), dtype=np.int32) writefuncs = np.zeros((0), dtype=np.object) - ids_trip = np.zeros((0), dtype=np.int32) + ids_trip = [] # use list here to accomodate different id stuctures + #ids_trip =np.zeros((0),dtype = np.int32) ids_vtype = set() for exportobj in demandobjects: - times, funcs, ids = exportobj.get_writexmlinfo(is_route=is_route) - print ' exportobj', exportobj, len(times) + print ' exportobj', exportobj + times, funcs, ids = exportobj.get_writexmlinfo(is_route=is_route, + is_plain=is_plain, + is_exclude_pedestrians=is_exclude_pedestrians) + print ' n_trips', len(times), 'has vtypes', hasattr(exportobj, 'get_vtypes') if len(times) > 0: - ids_vtype.update(exportobj.get_vtypes()) times_begin = np.concatenate((times_begin, times), 0) writefuncs = np.concatenate((writefuncs, funcs), 0) - ids_trip = np.concatenate((ids_trip, ids), 0) + #ids_trip = np.concatenate((ids_trip, ids),0) + ids_trip = ids_trip + list(ids) + if hasattr(exportobj, 'get_vtypes'): + # TODO:all export objects have get_vtypes except mapmatching + ids_vtype.update(exportobj.get_vtypes()) + + # convert back to array to allow proper indexing + ids_trip = np.array(ids_trip, dtype=np.object) + + attrconfigs_excluded = [] + for attrname in vtypeattrs_excluded: + attrconfigs_excluded.append(self.vtypes.get_config(attrname)) self.vtypes.write_xml(fd, indent=indent, ids=ids_vtype, - is_print_begin_end=False + is_print_begin_end=False, + attrconfigs_excluded=attrconfigs_excluded, ) # sort trips @@ -374,7 +432,7 @@ name='Trips', info='Table with trip and route info.', xmltag=('trips', 'trip', 'ids_sumo'), - version=0.1, + version=0.2, **kwargs) self._init_attributes() @@ -420,8 +478,8 @@ perm='r', name='Depart lane', info="Departure lane index. 0 is rightmost lane or sidewalk, if existant.", - #xmltag = 'departLane', - #xmlmap = get_inversemap(OPTIONMAP_LANE_DEPART), + xmltag='departLane', + xmlmap=get_inversemap(OPTIONMAP_LANE_DEPART), )) self.add_col(am.ArrayConf('positions_depart', OPTIONMAP_POS_DEPARTURE["random_free"], @@ -451,8 +509,8 @@ perm='r', name='Arrival lane', info="Arrival lane index. 0 is rightmost lane or sidewalk, if existant.", - #xmltag = 'arrivalLane', - #xmlmap = get_inversemap(OPTIONMAP_LANE_ARRIVAL), + xmltag='arrivalLane', + xmlmap=get_inversemap(OPTIONMAP_LANE_ARRIVAL), )) self.add_col(am.ArrayConf('positions_arrival', OPTIONMAP_POS_ARRIVAL["random"], @@ -491,10 +549,13 @@ info='IDs of route alternatives for this trip.', )) - if self.get_version() < 0.1: - self.inds_lane_depart.set_xmltag(None) - self.inds_lane_arrival.set_xmltag(None) - self.set_version(0.1) + if 1: # self.get_version()<0.2: + # self.inds_lane_depart.set_xmltag(None) + # self.inds_lane_arrival.set_xmltag(None) + self.inds_lane_depart.set_xmltag('departLane', xmlmap=get_inversemap(OPTIONMAP_LANE_DEPART)) + self.inds_lane_arrival.set_xmltag('arrivalLane', xmlmap=get_inversemap(OPTIONMAP_LANE_ARRIVAL)) + + self.set_version(0.2) def _init_constants(self): #self._method_routechoice = self.get_route_first @@ -515,7 +576,20 @@ self.ids_route_current.reset() self.ids_routes.reset() + def clear_route_alternatves(self): + ids_route_del = [] + ids_trip = self.get_ids() + #ids_routes = self.ids_routes[self.get_ids()] + for id_trip, id_route_current in zip(ids_trip, self.ids_route_current[ids_trip]): + if self.ids_routes[id_trip] is not None: + ids_route = set(self.ids_routes[id_trip]) + ids_route_del += list(ids_route.difference([id_route_current])) + self.ids_routes[id_trip] = [id_route_current] + + self.routes.get_value().del_rows(ids_route_del) + def get_id_from_id_sumo(self, id_veh_sumo): + # print 'get_id_from_id_sumo',id_veh_sumo,len(id_veh_sumo.split('.')) == 1 if len(id_veh_sumo.split('.')) == 1: return int(id_veh_sumo) return -1 @@ -551,7 +625,8 @@ return self.parent.get_routefilepath() def duaroute(self, is_export_net=False, is_export_trips=True, - routefilepath=None, **kwargs): + routefilepath=None, weights=None, weightfilepath=None, + **kwargs): """ Simple fastest path routing using duarouter. """ @@ -570,12 +645,21 @@ if routefilepath is None: routefilepath = self.get_routefilepath() + if weights is not None: + weightfilepath = self.get_net().edges.export_edgeweights_xml( + filepath=weightfilepath, + weights=weights, + time_begin=self.get_time_depart_first(), + time_end=self.get_time_depart_last()) + if routing.duaroute(self.get_tripfilepath(), self.get_net().get_filepath(), - routefilepath, **kwargs): + routefilepath, weightfilepath=weightfilepath, **kwargs): - self.import_routes_xml(routefilepath, is_clear_trips=False, + self.import_routes_xml(routefilepath, + is_clear_trips=False, is_generate_ids=False, - is_add=True) + is_overwrite_only=True, + is_add=False) print ' exectime', time.clock()-exectime_start return routefilepath @@ -589,11 +673,11 @@ def get_vtypes(self): return set(self.ids_vtype.get_value()) - def route(self, is_check_lanes=True, is_del_disconnected=False): + def route(self, is_check_lanes=True, is_del_disconnected=False, is_set_current=False): """ Fastest path python router. """ - print 'route' + print 'route is_check_lanes', is_check_lanes # TODO: if too mant vtypes, better go through id_modes exectime_start = time.clock() @@ -607,29 +691,39 @@ ids_trip_disconnected = [] - fstar = edges.get_fstar() for id_vtype in self.get_vtypes(): id_mode = vtypes.ids_mode[id_vtype] # no routing for pedestrians if id_mode != net.modes.get_id_mode('pedestrian'): + ids_trip_vtype = self.get_trips_for_vtype(id_vtype) + print ' id_vtype, id_mode', id_vtype, id_mode # ,ids_trip_vtype + weights = edges.get_times(id_mode=id_mode, speed_max=vtypes.speeds_max[id_vtype], is_check_lanes=is_check_lanes, modeconst_excl=-10.0, modeconst_mix=-5.0, ) - ids_trip_vtype = self.get_trips_for_vtype(id_vtype) - # print ' id_vtype,id_mode',id_vtype,id_mode#,ids_trip_vtype - # print ' weights',weights + fstar = edges.get_fstar(id_mode=id_mode) + + ids_alledges = edges.get_ids() + # for id_edge,id_edge_sumo, weight in zip(ids_alledges,edges.ids_sumo[ids_alledges],weights[ids_alledges]): + # print ' id_edge',id_edge,id_edge_sumo,'weight',weights[id_edge_sumo] ids_edge_depart = self.ids_edge_depart[ids_trip_vtype] ids_edge_arrival = self.ids_edge_arrival[ids_trip_vtype] for id_trip, id_edge_depart, id_edge_arrival in zip(ids_trip_vtype, ids_edge_depart, ids_edge_arrival): + cost, route = routing.get_mincostroute_edge2edge(id_edge_depart, id_edge_arrival, weights=weights, fstar=fstar) + + # if id_trip == 1: + # print ' id_trip',id_trip,'id_edge_depart',id_edge_depart,'id_edge_arrival',id_edge_arrival + # print ' route',route + # print ' ids_sumo',edges.ids_sumo[route] if len(route) > 0: ids_edges.append(route) ids_trip.append(id_trip) @@ -642,7 +736,11 @@ ids_edges=ids_edges, costs=costs, ) - self.add_routes(ids_trip, ids_route) + if is_set_current: + self.ids_route_current[ids_trip] = ids_route + else: + self.add_routes(ids_trip, ids_route) + print ' exectime', time.clock()-exectime_start if is_del_disconnected: @@ -871,21 +969,21 @@ return id_trip def make_trips(self, ids_vtype, is_generate_ids=True, **kwargs): - # print 'make_trips ids_vtype =',ids_vtype + print 'make_trips len(ids_vtype) =', len(ids_vtype) # print ' kwargs=',kwargs - ids_trip = self.add_rows( - ids_vtype=ids_vtype, - times_depart=kwargs.get('times_depart', None), - ids_edge_depart=kwargs.get('ids_edge_depart', None), - ids_edge_arrival=kwargs.get('ids_edge_arrival', None), - inds_lane_depart=kwargs.get('inds_lane_depart', None), - positions_depart=kwargs.get('positions_depart', None), - speeds_depart=kwargs.get('speeds_depart', None), - inds_lane_arrival=kwargs.get('inds_lane_arrival', None), - positions_arrival=kwargs.get('positions_arrival', None), - speeds_arrival=kwargs.get('speeds_arrival', None), - #ids_routes = len(ids_vtype)*[[]], - ) + ids_trip = self.add_rows(n=len(ids_vtype), + ids_vtype=ids_vtype, + times_depart=kwargs.get('times_depart', None), + ids_edge_depart=kwargs.get('ids_edge_depart', None), + ids_edge_arrival=kwargs.get('ids_edge_arrival', None), + inds_lane_depart=kwargs.get('inds_lane_depart', None), + positions_depart=kwargs.get('positions_depart', None), + speeds_depart=kwargs.get('speeds_depart', None), + inds_lane_arrival=kwargs.get('inds_lane_arrival', None), + positions_arrival=kwargs.get('positions_arrival', None), + speeds_arrival=kwargs.get('speeds_arrival', None), + #ids_routes = len(ids_vtype)*[[]], + ) if is_generate_ids: self.ids_sumo[ids_trip] = np.array(ids_trip, np.str) @@ -893,18 +991,76 @@ self.ids_sumo[ids_trip] = kwargs.get('ids_sumo', np.array(ids_trip, np.str)) return ids_trip - def make_routes(self, ids_vtype, is_generate_ids=True, routes=None, ids_trip=None, **kwargs): - # print 'make_routes',is_generate_ids + def make_routes(self, ids_vtype, is_generate_ids=True, routes=None, ids_trip=None, is_add=True, **kwargs): + """Generates or sets routes of trips, generates also trips if necessary + ids_trip: trip IDs, + if None then trip ID and route ID will be generated for each given route + if a list then routes will be associated with these trip IDs and routes will be replaced + but generated if route ID does not exist for given trip ID + is_add: if True then routes are added to the alternative route list + if False then current routes will be set + + is_generate_ids: depricated, fully controlled by ids_trip + """ + print 'make_routes is_generate_ids', ids_trip is None, 'is_add', is_add + # print ' ids_trip',ids_trip if ids_trip is None: # is_generate_ids = is_generate_ids, - # print ' generate new trips' + print ' generate new trip IDs' ids_trip = self.make_trips(ids_vtype, is_generate_ids=is_generate_ids, **kwargs) + is_generate_ids = True + else: + if not is_add: + print ' replace current route and create if not existent' + ids_routes = self.ids_route_current[ids_trip] + inds_new = np.flatnonzero(ids_routes == -1) + # print ' inds_new',inds_new + if len(inds_new) > 0: + print ' complete %d non pre-existant route ids of %d trips' % (len(inds_new), len(ids_trip)) + # create new routes + ids_routes[inds_new] = self.routes.get_value().add_rows(n=len(inds_new), + ids_trip=ids_trip[inds_new], + #ids_edges = routes[inds_new], + ) + else: + print ' all new routes have pre-existing routes' + else: + # make new route IDs + ids_routes = self.routes.get_value().add_rows(n=len(ids_trip), + ids_trip=ids_trip, + # ids_edges = routes[inds_new],# later!! + ) + + is_generate_ids = False + print ' set new routes to routes database', len(ids_routes), 'routes set' + self.routes.get_value().ids_edges[ids_routes] = routes + + if not is_add: + print ' replace current route IDs', len(inds_new), 'routes replaced' + self.ids_route_current[ids_trip[inds_new]] = ids_routes[inds_new] + else: + print ' add new route IDs to alternatives', len(ids_trip), 'routes added' + self.add_routes(ids_trip, ids_routes) + + # if np.any(ids_routes == -1): + # is_generate_ids = True # print ' ids_trip =',ids_trip - ids_routes = self.routes.get_value().add_rows(ids_trip=ids_trip, - ids_edges=routes, - ) - self.add_routes(ids_trip, ids_routes) + if is_generate_ids: + print ' generate new route IDs' + ids_routes = self.routes.get_value().add_rows(n=len(ids_trip), + ids_trip=ids_trip, + #ids_edges = routes, + ) + self.routes.get_value().ids_edges[ids_routes] = routes + + # print ' ids_routes',ids_routes + if not is_add: + print ' set new current routes' + self.ids_route_current[ids_trip] = ids_routes + else: + print ' add new route IDs to alternatives' + self.add_routes(ids_trip, ids_routes) # no!:self.ids_routes[ids_trip] = ids_routes.reshape((-1,1)).tolist()# this makes an array of lists # print ' self.ids_routes.get_value()',self.ids_routes[ids_trip] @@ -922,14 +1078,15 @@ else: self.ids_routes[id_trip].append(id_route) - if self.ids_route_current[id_trip] == -1: - self.ids_route_current[id_trip] = id_route + # if self.ids_route_current[id_trip] == -1: + # self.ids_route_current[id_trip] = id_route def prepare_sim(self, process): return [] # [(steptime1,func1),(steptime2,func2),...] def export_trips_xml(self, filepath=None, encoding='UTF-8', - ids_vtype_exclude=[]): + ids_vtype_exclude=[], ids_vtype_include=[], + vtypeattrs_excluded=[]): """ Export trips to SUMO xml file. Method takes care of sorting trips by departure time. @@ -957,19 +1114,26 @@ inds_selected[ids_vtype == id_vtype] = False ids_trip_selected = ids_trip[inds_selected] ids_vtype_selected = set(ids_vtype[inds_selected]) + ids_vtype_selected.union(ids_vtype_include) #ids_vtypes_selected = set(ids_vtypes).difference(ids_vtypes_exclude) + attrconfigs_excluded = [] + for attrname in vtypeattrs_excluded: + attrconfigs_excluded.append(self.parent.vtypes.get_config(attrname)) + self.parent.vtypes.write_xml(fd, indent=indent, ids=ids_vtype_selected, - is_print_begin_end=False) + is_print_begin_end=False, + attrconfigs_excluded=attrconfigs_excluded) self.write_xml(fd, indent=indent, ids=ids_trip_selected, attrconfigs_excluded=[self.routes, self.ids_routes, self.ids_route_current, - self.inds_lane_depart, - self.inds_lane_arrival], + # self.inds_lane_depart, + # self.inds_lane_arrival + ], is_print_begin_end=False) fd.write(xm.end(xmltag)) @@ -983,7 +1147,7 @@ # returns trip object, method common to all demand objects return self - def get_writexmlinfo(self, is_route=False): + def get_writexmlinfo(self, is_route=False, is_exclude_pedestrians=False, **kwargs): """ Returns three array where the first array is the begin time of the first vehicle and the second array is the @@ -992,23 +1156,49 @@ Method used to sort trips when exporting to route or trip xml file """ - n = len(self) + ids = self.get_ids() - # define different route write functions for pedestriand and vehicles - writefuncs = np.zeros(n, dtype=np.object) - inds_ped = self.parent.vtypes.ids_mode[self.ids_vtype[ids]] == MODES['pedestrian'] - writefuncs[inds_ped] = self.write_persontrip_xml - if is_route: - writefuncs[np.logical_not(inds_ped) & (self.ids_route_current[ids] > -1)] = self.write_vehroute_xml - writefuncs[np.logical_not(inds_ped) & (self.ids_route_current[ids] == -1)] = self.write_noroute_xml + if not is_exclude_pedestrians: + # define different route write functions for pedestriand and vehicles + n = len(ids) + writefuncs = np.zeros(n, dtype=np.object) + inds_ped = self.parent.vtypes.ids_mode[self.ids_vtype[ids]] == MODES['pedestrian'] + writefuncs[inds_ped] = self.write_persontrip_xml + if is_route: + writefuncs[np.logical_not(inds_ped) & (self.ids_route_current[ids] > -1)] = self.write_vehroute_xml + + # vehicles must have a route, this makes sure that OD are connected + writefuncs[np.logical_not(inds_ped) & (self.ids_route_current[ids] == -1)] = self.write_missingroute_xml + else: + # here we write vehicle trip, without explicit route export + # routing will be performed during simulation + writefuncs[np.logical_not(inds_ped) & (self.ids_route_current[ids] > -1)] = self.write_vehtrip_xml + + # vehicles must have a route, this makes sure that OD are connected + writefuncs[np.logical_not(inds_ped) & (self.ids_route_current[ids] == -1)] = self.write_missingroute_xml else: - # TODO: here we should write just origin and destination edge - writefuncs[np.logical_not(inds_ped)] = self.write_vehroute_xml + # only vehicle types without peds + inds_noped = self.parent.vtypes.ids_mode[self.ids_vtype[ids]] != MODES['pedestrian'] + ids = ids[inds_noped] + n = len(ids) + writefuncs = np.zeros(n, dtype=np.object) + if is_route: + writefuncs[self.ids_route_current[ids] > -1] = self.write_vehroute_xml + + # vehicles must have a route, this makes sure that OD are connected + writefuncs[self.ids_route_current[ids] == -1] = self.write_missingroute_xml + else: + # here we write vehicle trip, without explicit route export + # routing will be performed during simulation + writefuncs[self.ids_route_current[ids] > -1] = self.write_vehtrip_xml + + # vehicles must have a route, this makes sure that OD are connected + writefuncs[self.ids_route_current[ids] == -1] = self.write_missingroute_xml return self.times_depart[ids], writefuncs, ids - def write_noroute_xml(self, fd, id_trip, time_begin, indent=2): + def write_missingroute_xml(self, fd, id_trip, time_begin, indent=2): """ Function called when respective vehicle has an invalid route """ @@ -1113,18 +1303,19 @@ fd.write(xm.stopit()) # ends walk fd.write(xm.end(self._xmltag_person, indent=indent)) - # def get_route_first(self, id_trip): - # ids_route = self.ids_routes[id_trip] - # if ids_route is None: - # return -1 - # elif len(ids_route)>0: - # return ids_route[0] - # else: - # return -1 # no route found + def get_route_first(self, id_trip): + ids_route = self.ids_routes[id_trip] + if ids_route is None: + return -1 + elif len(ids_route) > 0: + return ids_route[0] + else: + return -1 # no route found def import_routes_xml(self, filepath, is_clear_trips=False, - is_generate_ids=True, is_add=False): - print 'import_routes_xml from %s generate own trip ' % (filepath) + is_generate_ids=True, is_add=False, + is_overwrite_only=False): + print 'import_routes_xml from %s generate new routes %s, clear trips %s add trips %s' % (filepath, is_generate_ids, is_clear_trips, is_add) if is_clear_trips: self.clear_trips() @@ -1133,9 +1324,9 @@ reader = RouteReader(self, counter) try: parse(filepath, reader) - # print ' call make_routes',is_generate_ids,is_add + print ' call insert_routes', is_generate_ids, 'is_add', is_add, 'is_overwrite_only', is_overwrite_only reader.insert_routes(is_generate_ids=is_generate_ids, - is_add=is_add) + is_add=is_add, is_overwrite_only=is_overwrite_only) except KeyError: print >> sys.stderr, "Error: Problems with reading routes!" raise @@ -1170,341 +1361,256 @@ pass -class TripCounter(handler.ContentHandler): - """Parses a SUMO route XML file and counts trips.""" - - def __init__(self): - self.n_trip = 0 +class TaxiGenerator(Process): + def __init__(self, demand, logger=None, **kwargs): - def startElement(self, name, attrs): - # print 'startElement',name,self.n_trip - if name == 'trip': - self.n_trip += 1 + self._init_common('taxigenerator', name='Taxi generator', + parent=demand, + logger=logger, + info='Generates taxi trips on specific zones.', + ) + attrsman = self.get_attrsman() + scenario = self.parent.get_scenario() + zones = scenario.landuse.zones -class TripReader(handler.ContentHandler): - """Reads trips from trip or route file into trip table""" + self.n_taxi = attrsman.add(cm.AttrConf('n_taxi', 100, + groupnames=['options'], + name='Number of taxi', + info="Number of taxis to be generated.", + )) + + self.priority_max = attrsman.add(cm.AttrConf('priority_max', 8, + groupnames=['options'], + name='Max. edge priority', + perm='rw', + info="Maximum edge priority for which edges in a zone are considered departure or arrival edges.", + )) + + self.speed_max = attrsman.add(cm.AttrConf('speed_max', 14.0, + groupnames=['options'], + name='Max. edge speed', + perm='rw', + unit='m/s', + info="Maximum edge speed for which edges in a zone are considered departure or arrival edges.", + )) + + time_start = self.parent.get_time_depart_first() + + self.time_start = attrsman.add(cm.AttrConf('time_start', kwargs.get('time_start', time_start), + groupnames=['options', 'timing'], + name='Start time', + perm='rw', + info='Start time when first taxi appears, in seconds after midnight.', + unit='s', + )) + + # default is to insert all taxis within the first 60s + self.time_end = attrsman.add(cm.AttrConf('time_end', kwargs.get('time_end', time_start+60.0), + groupnames=['options', 'timing'], + name='End time', + perm='rw', + info='Time when last taxi appears in seconds after midnight.', + unit='s', + )) - def __init__(self, trips, n_trip, vtype_default=None): - # print 'RouteReader.__init__',demand.ident - self._trips = trips - demand = trips.parent + self.n_edges_min_length = attrsman.add(cm.AttrConf('n_edges_min_length', 1, + groupnames=['options'], + name='Min. edge number length prob.', + perm='rw', + info="Minimum number of edges for with the departure/arrival probability is proportional to the edge length.", + )) + + self.n_edges_max_length = attrsman.add(cm.AttrConf('n_edges_max_length', 500, + groupnames=['options'], + name='Max. edge number length prob.', + perm='rw', + info="Maximum number of edges for with the departure/arrival probability is proportional to the edge length.", + )) + + self.is_selected_zones = attrsman.add(cm.AttrConf('is_selected_zones', False, + groupnames=['options'], + name='Selected zones', + info="Place taxis only on edges of specified zone list.", + )) + + ids_zone = zones.get_ids() + zonechoices = {} + for id_zone, name_zone in zip(ids_zone, zones.ids_sumo[ids_zone]): + zonechoices[name_zone] = id_zone + # print ' zonechoices',zonechoices + # make for each possible pattern a field for prob + # if len(zonechoices) > 0: + self.ids_zone = attrsman.add(cm.ListConf('ids_zone', [], + groupnames=['options'], + choices=zonechoices, + name='Zones', + info="""Zones where to place taxis. Taxis are distributed proportional to road lengths in zones.""", + )) - net = demand.get_scenario().net + # self.is_refresh_zoneedges = attrsman.add(am.AttrConf( 'is_refresh_zoneedges', True, + # groupnames = ['options'], + # perm='rw', + # name = 'Refresh zone edges', + # info = """Identify all edges in all zones before generating the trips. + # Dependent on the will take some time.""", + # )) - self._ids_vtype_sumo = demand.vtypes.ids_sumo - self._modemap = net.modes.names.get_indexmap() - self._get_vtype_for_mode = demand.vtypes.get_vtype_for_mode + def generate_taxi(self): + """ + Generate taxis as trips in the trip database. + """ + tripnumber = self.n_taxi + time_start = self.time_start + time_end = self.time_end + id_mode_ped = MODES['pedestrian'] + id_mode_taxi = MODES['taxi'] + scenario = self.parent.get_scenario() + zones = scenario.landuse.zones + trips = scenario.demand.trips + edges = scenario.net.edges + edgelengths = edges.lengths + + # define taxi and secondary mode, if appropriate + ids_vtype_mode_taxi, prob_vtype_mode_taxi = scenario.demand.vtypes.select_by_mode( + id_mode_taxi, is_share=True) + + # print ' ids_vtype_mode', ids_vtype_mode + n_vtypes_taxi = len(ids_vtype_mode_taxi) + + # update edge probabilities with suitable parameters + # edge departure probabilities of all edges in all zones + edgeprops_all = {} - if id_vtype_default is None: - self._id_vtype_default = self.get_ids()[0] + if self.is_selected_zones: + ids_zone = self.ids_zone else: - self._id_vtype_default = id_vtype_default - - self._ids_edge_sumo = net.edges.ids_sumo - - self.ids_sumo = np.zeros(n_trip, np.object) - self.ids_vtype = np.zeros(n_trip, np.int32) - self.times_depart = np.zeros(n_trip, np.int32) - self.ids_edge_depart = np.zeros(n_trip, np.int32) - self.ids_edge_arrival = np.zeros(n_trip, np.int32) - self.inds_lane_depart = np.zeros(n_trip, np.int32) - self.positions_depart = np.zeros(n_trip, np.float32) - self.speeds_depart = np.zeros(n_trip, np.float32) - self.inds_lane_arrival = np.zeros(n_trip, np.int32) - self.positions_arrival = np.zeros(n_trip, np.float32) - self.speeds_arrival = np.zeros(n_trip, np.float32) - self.routes = np.zeros(n_trip, np.object) - - self._ind_trip = -1 - - self._has_routes = False - self._ids_sumoedge_current = [] - self._id_sumoveh_current = None - #self._time_depart = 0 - #self._attrs = {} - #self._is_generate_ids = is_generate_ids - self._intervals_current = '' - - # def _init_reader(self): - - def _get_id_vtype(self, attrs): - vtype = str(attrs['type']) - if self._ids_vtype_sumo.has_index(vtype): - # vtype is known - return self._ids_vtype_sumo.get_id_from_index(vtype) - - # vtype is not known, so check out whether vtype - # is actually a mode - elif vtype in self._modemap: - # pick id_vtype according to its probability with - # all vtypes of this mode - id_vtype = self._get_vtype_for_mode(self._modemap[vtype]) - - if id_vtype >= 0: - return id_vtype - else: - return self._id_vtype_default - + ids_zone = zones.get_ids() + for id_zone in ids_zone: + edgeprops_all.update(zones.get_egdeprobs(id_zone, self.n_edges_min_length, self.n_edges_max_length, + self.priority_max, self.speed_max, is_normalize=False, is_dict=True)) + + fstar = edges.get_fstar(is_ignor_connections=False) + times_taxi = edges.get_times(id_mode=id_mode_taxi, is_check_lanes=True) + + n_trips_generated = 0 + n_trips_failed = 0 + + if self.is_selected_zones: + # tale selected zones + ids_zone = self.ids_zone else: - # no valid vtype, get a default - return self._id_vtype_default - - def startElement(self, name, attrs): - # - # - # - # print 'startElement',name - if name == 'trip': - # print ' startElement',attrs['id'],attrs['depart'] - self._ind_trip += 1 - - self._id_sumoveh_current = attrs['id'] - self.ids_sumo[self._ind_trip] = self._id_sumoveh_current - print 'startElement ids_vtype', attrs['type'], self._ids_vtype_sumo.get_id_from_index(str(attrs['type'])) - - self.ids_vtype[self._ind_trip] = self._get_id_vtype(attrs) - self.times_depart[self._ind_trip] = int(float(attrs['depart'])) - - if attrs.has_key('from'): - self.ids_edge_depart[self._ind_trip] = self._ids_edge_sumo.get_id_from_index(str(attrs['from'])) - if attrs.has_key('to'): - self.ids_edge_arrival[self._ind_trip] = self._ids_edge_sumo.get_id_from_index(str(attrs['to'])) - - ind_lane_depart_raw = attrs.get('departLane', 'free') - if OPTIONMAP_LANE_DEPART.has_key(ind_lane_depart_raw): - self.inds_lane_depart[self._ind_trip] = OPTIONMAP_LANE_DEPART[ind_lane_depart_raw] - else: - self.inds_lane_depart[self._ind_trip] = int(ind_lane_depart_raw) - - positions_depart_raw = attrs.get('departPos', 'base') - if OPTIONMAP_POS_DEPARTURE.has_key(positions_depart_raw): - self.positions_depart[self._ind_trip] = OPTIONMAP_POS_DEPARTURE[positions_depart_raw] - else: - self.positions_depart[self._ind_trip] = float(positions_depart_raw) - - self.speeds_depart[self._ind_trip] = attrs.get('departSpeed', 0.0) - - ind_lane_arrival_raw = attrs.get('arrivalLane', 'current') - if OPTIONMAP_LANE_ARRIVAL.has_key(ind_lane_arrival_raw): - self.inds_lane_arrival[self._ind_trip] = OPTIONMAP_LANE_ARRIVAL[ind_lane_arrival_raw] - else: - self.inds_lane_arrival[self._ind_trip] = int(ind_lane_arrival_raw) + # take all zones + ids_zone = zones.get_ids() - positions_arrival_raw = attrs.get('arrivalPos', 'max') - if OPTIONMAP_POS_ARRIVAL.has_key(positions_arrival_raw): - self.positions_arrival[self._ind_trip] = OPTIONMAP_POS_ARRIVAL[positions_arrival_raw] - else: - self.positions_arrival[self._ind_trip] = float(positions_arrival_raw) - - self.speeds_arrival[self._ind_trip] = attrs.get('arrivalSpeed', 0.0) - - def _get_kwargs(self): - return {'ids_sumo': self.ids_sumo, - 'times_depart': self.times_depart, - 'ids_edge_depart': self.ids_edge_depart, - 'ids_edge_arrival': self.ids_edge_arrival, - 'inds_lane_depart': self.inds_lane_depart, - 'positions_depart': self.positions_depart, - 'speeds_depart': self.speeds_depart, - 'inds_lane_arrival': self.inds_lane_arrival, - 'positions_arrival': self.positions_arrival, - 'speeds_arrival': self.speeds_arrival, - } - - def insert_trips(self, is_generate_ids=True): - - # print 'TripReader.insert_trips self.ids_vtype',self.ids_vtype - kwargs = self._get_kwargs() - ids_trips = self._trips.make_trips(self.ids_vtype, - is_generate_ids=is_generate_ids, - **kwargs) - - return ids_trips - - -class RouteCounter(handler.ContentHandler): - """Parses a SUMO route XML file and counts trips.""" - - def __init__(self): - self.n_veh = 0 - self.n_pers = 0 - #self.n_rou = 0 - - def startElement(self, name, attrs): - # print 'startElement',name,self.n_trip - if name == 'vehicle': - self.n_veh += 1 - elif name == 'person': - self.n_pers += 1 - # elif name == 'route': - # if attrs.has_key('id'): - # self.n_rou += 1 - - -class RouteReader(TripReader): - """Reads trips from trip or route file into trip table""" - - def __init__(self, trips, counter): - # print 'RouteReader.__init__',demand.ident - self._trips = trips - n_veh = counter.n_veh - n_per = counter.n_pers - #n_rou = counter.n_rou - n_trip = n_veh+n_per - demand = trips.parent - - net = demand.get_scenario().net - self._modemap = net.modes.names.get_indexmap() - self._get_vtype_for_mode = demand.vtypes.get_vtype_for_mode - - self._ids_vtype_sumo = demand.vtypes.ids_sumo - self._ids_edge_sumo = net.edges.ids_sumo - - self.ids_sumo = np.zeros(n_trip, np.object) - self.ids_vtype = np.zeros(n_trip, np.int32) - self.times_depart = np.zeros(n_trip, np.int32) - self.ids_edge_depart = np.zeros(n_trip, np.int32) - self.ids_edge_arrival = np.zeros(n_trip, np.int32) - self.inds_lane_depart = np.zeros(n_trip, np.int32) - self.positions_depart = np.zeros(n_trip, np.float32) - self.speeds_depart = np.zeros(n_trip, np.float32) - self.inds_lane_arrival = np.zeros(n_trip, np.int32) - self.positions_arrival = np.zeros(n_trip, np.float32) - self.speeds_arrival = np.zeros(n_trip, np.float32) - self.routes = np.zeros(n_trip, np.object) - - self._ind_trip = -1 - - self._has_routes = False - self._ids_sumoedge_current = [] - self._id_sumoveh_current = None - #self._time_depart = 0 - #self._attrs = {} - #self._is_generate_ids = is_generate_ids - self._intervals_current = '' - - def startElement(self, name, attrs): - # - # - # - # print 'startElement',name - if name == 'vehicle': - # print ' startElement',attrs['id'],attrs['depart'] - self._ind_trip += 1 - - self._id_sumoveh_current = attrs['id'] - self.ids_sumo[self._ind_trip] = self._id_sumoveh_current - # print 'startElement ids_vtype',attrs['type'], self._ids_vtype_sumo.get_id_from_index(str(attrs['type'])) - - self.ids_vtype[self._ind_trip] = self.ids_vtype[self._ind_trip] = self._get_id_vtype(attrs) - - self.times_depart[self._ind_trip] = int(float(attrs['depart'])) - - if attrs.has_key('from'): - self.ids_edge_depart[self._ind_trip] = self._ids_edge_sumo.get_id_from_index(str(attrs['from'])) - if attrs.has_key('to'): - self.ids_edge_arrival[self._ind_trip] = self._ids_edge_sumo.get_id_from_index(str(attrs['to'])) - - ind_lane_depart_raw = attrs.get('departLane', 'free') - if OPTIONMAP_LANE_DEPART.has_key(ind_lane_depart_raw): - self.inds_lane_depart[self._ind_trip] = OPTIONMAP_LANE_DEPART[ind_lane_depart_raw] - else: - self.inds_lane_depart[self._ind_trip] = int(ind_lane_depart_raw) - - positions_depart_raw = attrs.get('departPos', 'base') - if OPTIONMAP_POS_DEPARTURE.has_key(positions_depart_raw): - self.positions_depart[self._ind_trip] = OPTIONMAP_POS_DEPARTURE[positions_depart_raw] - else: - self.positions_depart[self._ind_trip] = float(positions_depart_raw) - - self.speeds_depart[self._ind_trip] = attrs.get('departSpeed', 0.0) - - ind_lane_arrival_raw = attrs.get('arrivalLane', 'current') - if OPTIONMAP_LANE_ARRIVAL.has_key(ind_lane_arrival_raw): - self.inds_lane_arrival[self._ind_trip] = OPTIONMAP_LANE_ARRIVAL[ind_lane_arrival_raw] - else: - self.inds_lane_arrival[self._ind_trip] = int(ind_lane_arrival_raw) + ids_edges_orig = [] # all accessible edges in all zones + n_edges_orig = 0 + for id_zone in ids_zone: + #id_orig = self.ids_orig[id_od] + #id_dest = self.ids_dest[id_od] + + print ' check id_zone', id_zone + ids_edges_orig_raw = zones.ids_edges_orig[id_zone] + + #prob_edges_orig_raw = zones.probs_edges_orig[id_orig] + + # check accessibility of origin edges + + #prob_edges_orig = [] + #inds_lane_orig = [] + + for i in xrange(len(ids_edges_orig_raw)): + id_edge = ids_edges_orig_raw[i] + # if check accessibility... + ind_lane_depart_taxi = edges.get_laneindex_allowed(id_edge, id_mode_taxi) + ind_lane_depart_ped = edges.get_laneindex_allowed(id_edge, id_mode_ped) + + # print ' O get_laneindex_allowed id_mode_taxi',id_mode_taxi,id_edge,edges.ids_sumo[id_edge],'ind_lane',ind_lane_depart + if (ind_lane_depart_taxi >= 0) & (ind_lane_depart_ped >= 0): + ids_edges_orig.append(id_edge) + # prob_edges_orig.append(prob_edges_orig_raw[i]) + # are_fallback_orig.append(False) + # inds_lane_orig.append(ind_lane_depart) + + n_edges_orig = len(ids_edges_orig) + + print '\n found', n_edges_orig, 'valid zone edges' + + # now create taxi trips + if (n_edges_orig > 0) & (tripnumber > 0): + # normalize weights + edgeprops = np.zeros(n_edges_orig, dtype=np.float32) + + for i, id_edge in zip(xrange(n_edges_orig), ids_edges_orig): + edgeprops[i] = edgeprops_all[id_edge] + + edgeprops = edgeprops/np.sum(edgeprops) + + # debug + if 0: + for id_edge, prob in zip(ids_edges_orig, edgeprops): + print ' orig id_edge', id_edge, 'has prob', prob + + for d in xrange(int(tripnumber+0.5)): + # print ' ------------' + # print ' generte trip',d + time_depart = np.random.uniform(time_start, time_end) + + i_orig = np.argmax(np.random.rand(n_edges_orig)*edgeprops) + id_edge_orig = ids_edges_orig[i_orig] + + # destination edge is origin edge + # this is no problem as taxis will never leave the sim + id_edge_dest = id_edge_orig + route = [id_edge_orig] + + # Destination is next edge + # + #is_accessible = False + # for id_edge_dest in fstar[id_edge_orig]: + # # if check accessibility... + # ind_lane_depart_taxi = edges.get_laneindex_allowed(id_edge_dest, id_mode_taxi) + # ind_lane_depart_ped = edges.get_laneindex_allowed(id_edge_dest, id_mode_ped) + # if (ind_lane_depart_taxi >= 0)&(ind_lane_depart_ped >= 0): + # is_accessible = True + # break + # if not is_accessible: + # id_edge_dest = id_edge_orig + # route = [id_edge_orig] + # else: + # route = [id_edge_orig,id_edge_dest] + + id_vtype = ids_vtype_mode_taxi[np.argmax( + np.random.rand(n_vtypes_taxi)*prob_vtype_mode_taxi)] + + # trip is from beginning to end of edge + # however, taxi will not be eliminated at the + # end of edge but continue to next client + id_trip = trips.make_trip(id_vtype=id_vtype, + time_depart=time_depart, + id_edge_depart=id_edge_orig, + id_edge_arrival=id_edge_dest, + ind_lane_depart=-5, # "first": + ind_lane_arrival=-1, # "current", + position_depart=-4, # "base", + position_arrival=-2, # "max", + speed_depart=0.0, + speed_arrival=0.0, + route=route, + ) - positions_arrival_raw = attrs.get('arrivalPos', 'max') - if OPTIONMAP_POS_ARRIVAL.has_key(positions_arrival_raw): - self.positions_arrival[self._ind_trip] = OPTIONMAP_POS_ARRIVAL[positions_arrival_raw] - else: - self.positions_arrival[self._ind_trip] = float(positions_arrival_raw) + n_trips_generated += 1 - self.speeds_arrival[self._ind_trip] = attrs.get('arrivalSpeed', 0.0) + print ' n_trips_generated', n_trips_generated, 'of', self.n_taxi + return True - if name == 'route': - self._has_routes = True - # print ' ',attrs.get('edges', '') - self._ids_sumoedge_current = attrs.get('edges', '') - self._intervals_current = attrs.get('intervals', '') - - # def characters(self, content): - # if (len(self._route_current)>0)&(self._intervals_current!=''): - # self._intervals_current = self._intervals_current + content - - def endElement(self, name): - - if name == 'vehicle': - # print 'endElement',name,self._id_current,len(self._intervals_current) - if (self._id_sumoveh_current is not None): - ids_edge = [] - for id_sumoedge in self._ids_sumoedge_current.split(' '): - if not id_sumoedge in ('', ' ', ','): - if self._ids_edge_sumo.has_index(id_sumoedge): - ids_edge.append(self._ids_edge_sumo.get_id_from_index(id_sumoedge.strip())) - self.routes[self._ind_trip] = ids_edge - - if len(ids_edge) >= 1: - self.ids_edge_depart[self._ind_trip] = ids_edge[0] - self.ids_edge_arrival[self._ind_trip] = ids_edge[-1] - - self._id_sumoveh_current = None - #self._attrs = {} - self._ids_sumoedge_current = [] - - # elif name in ['routes','trips']: - # self.make_trips() - - def process_intervals(self): - interval = [] - es = self._intervals_current.rstrip().split(" ") - for e in es: - p = e.split(",") - interval.append((float(p[0]), float(p[1]))) - self._intervals_current = '' - return interval - - def _get_kwargs(self): - return {'ids_sumo': self.ids_sumo, - 'times_depart': self.times_depart, - 'ids_edge_depart': self.ids_edge_depart, - 'ids_edge_arrival': self.ids_edge_arrival, - 'inds_lane_depart': self.inds_lane_depart, - 'positions_depart': self.positions_depart, - 'speeds_depart': self.speeds_depart, - 'inds_lane_arrival': self.inds_lane_arrival, - 'positions_arrival': self.positions_arrival, - 'speeds_arrival': self.speeds_arrival, - } - - def insert_routes(self, is_generate_ids=True, is_add=False): - # print 'TripReader.make_routes',is_generate_ids, is_add - ids_trip = None - if is_add: - is_generate_ids = False - # get trip ids from xml file - ids_trip = self._trips.ids_sumo.get_ids_from_indices(self.ids_sumo) + else: + print ' no taxi created n_edges_orig', n_edges_orig, 'tripnumber', tripnumber + return False - # print ' ids_trip',ids_trip - ids_routes, ids_trips = self._trips.make_routes(self.ids_vtype, - is_generate_ids=is_generate_ids, - routes=self.routes, - ids_trip=ids_trip, - **self._get_kwargs()) + def do(self): - return ids_routes, ids_trips + return self.generate_taxi() if __name__ == '__main__': diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/detectorflows.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/detectorflows.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/detectorflows.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/detectorflows.py 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,1072 @@ +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. +# SUMOPy module +# Copyright (C) 2012-2021 University of Bologna - DICAM +# 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 detectorflows.py +# @author Joerg Schweizer +# @date 2012 + +import os +import string +from collections import OrderedDict +import numpy as np +from numpy import random +import agilepy.lib_base.classman as cm +import agilepy.lib_base.arrayman as am +import agilepy.lib_base.xmlman as xm +from agilepy.lib_base.geometry import * +#from coremodules.modules_common import * +from coremodules.network.network import SumoIdsConf, MODES +from agilepy.lib_base.processes import Process, P, call, CmlMixin +from coremodules.misc.shapeformat import ShapefileImporter + + +class Detectorflows(cm.BaseObjman): + def __init__(self, ident='detectorflows', demand=None, name='Detector flows', + info='Flows measured by detectors, which can be used to generate vehicle routes using the DFRouter.', + **kwargs): + print 'Detectorflows.__init__', name, kwargs + + self._init_objman(ident=ident, + parent=demand, + name=name, + info=info, + **kwargs) + + attrsman = self.set_attrsman(cm.Attrsman(self)) + self._init_attributes() + self._init_constants() + + def _init_attributes(self): + attrsman = self.get_attrsman() + + self.detectors = attrsman.add(cm.ObjConf(Detectors('detectors', self), + groupnames=['parameters']) + ) + + self.flowmeasurements = attrsman.add(cm.ObjConf(Flowmeasurements('flowmeasurements', self), + groupnames=['parameters']) + ) + + def get_scenario(self): + return self.parent.get_scenario() + + def add_flows_to_edgeresults(self, edgeresults): + if not edgeresults.has_attrname('detectorflows'): + # add detector result attributes + + attrinfos = OrderedDict([ + ('detectorflows', {'name': 'Detector flows', + # 'symbol':'F_{MA}', + 'unit': None, + 'default': 0, + 'info': 'Flows measured by detectors.', + 'xmltag': 'detectorFlows', + 'groupnames': ['detectorflows'] + }), + # more result attributes can be added ex. heavy duty flows + ]) + + for attrname, kwargs in attrinfos.iteritems(): + edgeresults.add_resultattr(attrname, **kwargs) + + # reset Detector flow attributes + for attrconf in edgeresults.get_group('Detector flows'): + attrconf.detectorflows.reset() + + # add flow measurements + detectors = self.detectors + flowmeasurements = self.flowmeasurements + net = self.get_scenario().net + ids_flow = flowmeasurements.get_ids() + for id_detector, period, flow_pax, flow_heavyduty in zip( + flowmeasurements.ids_detector[ids_flow], + flowmeasurements.timeperiods[ids_flow], + flowmeasurements.flows_passenger[ids_flow], + flowmeasurements.flows_heavyduty[ids_flow],): + + if detectors.reliabilities[id_detector] > 0.8: + if (flow_pax > 0) | (flow_heavyduty > 0): + flow = 0.0 + if (flow_pax > 0): + flow += flow_pax + if (flow_heavyduty > 0): + flow += flow_heavyduty + + ids_lane = detectors.ids_lanes[id_detector] + if ids_lane is not None: # happens if no lenes could be matched + if len(ids_lane) > 0: + id_edge = net.lanes.ids_edge[ids_lane[0]] + if edgeresults.ids_edge.has_index(id_edge): + id_edgeres = edgeresults.ids_edge.get_id_from_index(id_edge) + edgeresults.detectorflows[id_edgeres] += flow + + else: + edgeresults.add_row(ids_edge=id_edge, + detectorflows=flow + ) + + +class Detectors(am.ArrayObjman): + def __init__(self, ident, detectorflows, **kwargs): + self._init_objman(ident, parent=detectorflows, + name='Detectors', + info='Contains detector data.', + xmltag=('detectors', 'detectorDefinition', 'ids_sumo'), + **kwargs) + + self._init_attributes() + self._init_constants() + + def _init_attributes(self): + self.add_col(SumoIdsConf('Detector', xmltag='id')) + + self.add_col(am.IdlistsArrayConf('ids_lanes', self.get_scenario().net.lanes, + name='IDs Lane', + info="""Lane IDs where detector is located. + Single or multiple lanes must be from the same egde. + In case of multiple lanes the measured flows are distributed on the lanes using some heuristics.""", + )) + + if hasattr(self, 'ids_lane'): + self.delete('ids_lane') + + self.add_col(am.ArrayConf('names', "", + dtype=np.object, + perm='rw', + name='Name', + info='Human readable detector name. Can be used to indicate detector location.', + )) + + self.add_col(am.ArrayConf('positions', 0.0, + perm='r', + name='Position', + unit='m', + xmltag='pos', + info='Position on edge where detector is located.', + )) + + self.add_col(am.ArrayConf('directions', 0.0, + perm='rw', + name='direction', + unit='DEG', + info='Direction of detector in degrees. North is zero degree. ', + )) + + self.add_col(am.ArrayConf('coords', np.zeros(3, dtype=np.float32), + groupnames=['state'], + perm='r', + name='Coords', + unit='m', + info='Dedector coordinate.', + is_plugin=True, + )) + + self.add_col(am.ArrayConf('reliabilities', 1.0, + perm='rw', + name='Reliability', + info='Reliability of detector: 0 = broken, 1 = fully reliable. Some detectors provide this information which can help to eliminate unreliable flow measurements.', + )) + + def get_scenario(self): + return self.parent.parent.get_scenario() + + def match_detectors_to_lane(self, modename='passenger', + is_edgedetectors=True, is_check_direction=True, + n_targetedge=5, d_max=50.0, + phidelta_max=np.pi/180*10): + net = self.get_scenario().net + lanes = net.lanes + edges = net.edges + id_mode = net.modes.get_id_mode(modename) + accesslevels = edges.get_accesslevels(net.modes.get_id_mode(modename=modename)) + + get_ids_edge_from_inds_seg = edges.get_ids_edge_from_inds_seg + get_dist_point_to_edge = edges.get_dist_point_to_edge + get_closest_edge = edges.get_closest_edge + + ids = self.get_ids() + for id_detect, point, phi in zip(ids, self.coords[ids], self.directions[ids]/180.0*np.pi+np.pi/2.0): + print ' Detector id_detect', id_detect, 'point', point + ids_edge_target, dists = get_closest_edge(point, n_best=n_targetedge, + d_max=d_max, + is_ending=True, + is_detect_initial=False, + is_detect_final=False, + accesslevels=accesslevels + ) + + print ' ids_edge_target', ids_edge_target + print ' dists', dists + + if is_check_direction: + id_edge_found = -1 + i = 0 + n = len(ids_edge_target) + while (id_edge_found < 0) & (i < n): + print ' check ids_edge', ids_edge_target[i], dists[i] + dist_point_edge, segment = get_dist_point_to_edge(point, ids_edge_target[i], + is_ending=True, + is_detect_initial=False, + is_detect_final=True, + is_return_segment=True, + ) + x1, y1, x2, y2 = segment + phi_seg = np.arctan2(y2-y1, x2-x1) + phi_delta = np.abs(anglediff(phi, phi_seg)) + if phi_delta < phidelta_max: + id_edge_found = ids_edge_target[i] + i += 1 + elif len(ids_edge_target) > 0: + id_edge_found = ids_edge_target[0] + else: + id_edge_found = -1 + + if id_edge_found >= 0: + # select lane + ids_lane = edges.ids_lanes[id_edge_found] + print ' id_edge_found', id_edge_found, 'ids_lane', edges.ids_lanes[id_edge_found] + ids_lane_access = ids_lane[lanes.get_laneindexes_allowed(ids_lane, id_mode)] + print ' ids_lane_access', ids_lane_access + + if len(ids_lane_access) > 0: + if is_edgedetectors: + # associate all lanes with detector + self.ids_lanes[id_detect] = ids_lane_access + + else: + # coose closest lane....TODO + self.ids_lanes[id_detect] = ids_lane_access + + def write_xml(self, fd=None, indent=0): + # + # + # ... further detectors ... + # + print 'Detectors.write_xml' + fd.write(xm.begin('detectors', indent)) + + ids = self.get_ids() + scenario = self.get_scenario() + get_sumoinfo_from_id_lane = scenario.net.lanes.get_sumoinfo_from_id_lane + for id_detector, ids_lane, pos in zip( + ids, + self.ids_lanes[ids], + self.positions[ids], + ): + + print ' write id_detector', id_detector, 'ids_lane', ids_lane + if ids_lane is not None: + ind_lane = 0 + for id_lane in ids_lane: + fd.write(xm.start('detectorDefinition', indent=indent+2)) + fd.write(xm.num('id', self.get_id_xml_detector(id_detector, ind_lane))) + fd.write(xm.num('lane', get_sumoinfo_from_id_lane(id_lane))) + fd.write(xm.num('pos', pos)) + + fd.write(xm.stopit()) # ends detector defs + ind_lane += 1 + fd.write(xm.end('detectors', indent)) + + def get_id_xml_detector(self, id_detector, ind_lane): + return self.ids_sumo[id_detector]+'/'+str(ind_lane) + + def get_id_detector_ind_lane(self, id_xml): + if id_xml.count('/') > 0: + elements = id_xml.split('/') + id_sumo = string.join(elements[:-1], '/') + return self.ids_sumo.get_index(id_sumo), int(elements[-1]) + else: + return self.ids_sumo.get_index(id_xml), 0 + + def export_sumoxml(self, filepath): + xm.write_obj_to_xml(self, filepath) + + +class Flowmeasurements(am.ArrayObjman): + def __init__(self, ident, detectorflows, **kwargs): + self._init_objman(ident, parent=detectorflows, + name='Flow measurements', + info='Flow measurements at detectors.', + #xmltag = ('detectors','detectorDefinition','ids_sumo'), + **kwargs) + + self._init_attributes() + self._init_constants() + + def _init_attributes(self): + """ + Detector;Time;qPKW;qLKW;vPKW;vLKW + myDet1;0;10;2;100;80 + ... further entries ... + + This means the first time has to name the entries (columns). Their order is not of importance, but at least the following columns must be included: + + Detector: A string holding the id of the detector this line describes; should be one of the ids used in + Time: The time period begin that this entry describes (in minutes) + qPKW: The number of passenger cars that drove over the detector within this time period + vPKW: The average speed of passenger cars that drove over the detector within this time period in km/h + + The following columns may optionally be included: + + qLKW: The number of transport vehicles that drove over the detector within this time period + vLKW: The average speed of transport vehicles that drove over the detector within this time period in km/h + """ + + self.add_col(am.IdsArrayConf('ids_detector', self.parent.detectors, + name='ID Detector', + info='Detector ID which measured this flow.', + )) + + self.add_col(am.ArrayConf('timeperiods', 0.0, + perm='rw', + name='Time period', + unit='s', + info='Time period of flow measurement.', + )) + self.add_col(am.ArrayConf('flows_passenger', 0.0, + perm='rw', + name='Passenger car flow', + info='Number of passenger cars detected during the corrisponding time period.', + )) + + self.add_col(am.ArrayConf('flows_heavyduty', 0.0, + perm='rw', + name='Heavy duty vehicle flow', + info='Number of heavy duty vehicles detected during the corrisponding time period.', + )) + + self.add_col(am.ArrayConf('speeds_passenger', 0.0, + perm='rw', + name='Passenger car speed', + unit='m/s', + info='Average velocity of passenger cars, detected during the corrisponding time period.', + )) + + self.add_col(am.ArrayConf('speeds_heavyduty', 0.0, + perm='rw', + name='Heavy duty vehicle speed', + unit='m/s', + info='Average velocity of heavy duty vehicles, detected during the corrisponding time period.', + )) + + # self.add_col(am.ArrayConf( 'types', '', + # perm='rw', + # choices = ["source", "sink", "between", "discarded", ""] + # name = 'Type', + # xmltag = 'type', + # info = 'Detector type.', + # )) + + def get_demand(self): + return self.parent.parent + + def add_flow(self, id_detector, timeperiod, flow_passenger, + flow_heavyduty=0.0, speed_passenger=-1.0, speed_heavyduty=-1.0): + + if id_detector in self.parent.ids_sumo.get_value(): + id_flow = self.add_row(ids_detector=id_detector, + timeperiods=timeperiod, + flows_passenger=flow_passenger, + flows_heavyduty=flow_heavyduty, + speeds_passenger=speed_passenger, + speeds_heavyduty=speed_heavyduty, + ) + else: + id_flow = -1 + + return id_flow + + def export_csv(self, filepath, t_offset=0, sep=";"): + net = self.parent.parent.get_net() + detectors = self.parent.detectors + ids_sumo_detector = detectors.ids_sumo + get_id_xml_detector = detectors.get_id_xml_detector + + f = open(filepath, 'w') + + f.write('Detector'+sep+'Time'+sep+'qPKW'+sep+'qLKW'+sep+'vPKW'+sep+'vLKW'+'\n') + #ids_flow = self.select_ids(self.flows_passenger.get_value()>=0) + print ' flows_passenger', self.flows_passenger.get_value() + ids_flow = self.get_ids() + for id_detector, t, flow_passenger, flow_heavyduty, speed_passenger, speed_heavyduty in \ + zip( + self.ids_detector[ids_flow], + self.timeperiods[ids_flow], + self.flows_passenger[ids_flow], + self.flows_heavyduty[ids_flow], + self.speeds_passenger[ids_flow], + self.speeds_heavyduty[ids_flow]): + + ids_lane = detectors.ids_lanes[id_detector] + if (ids_lane is not None) & (flow_passenger >= 0): + print ' id_detector', id_detector, 't', t, 'flow_passenger', flow_passenger, len(ids_lane) + + n_lane = len(ids_lane) + for ind_lane, passengerflow_lane, heavyflow_lane in\ + zip(xrange(n_lane), + self.distribute_passengerflow_over_lanes(ids_lane, flow_passenger), + self.distribute_heavyflow_over_lanes(ids_lane, flow_heavyduty) + ): + + f.write(get_id_xml_detector(id_detector, ind_lane)) + f.write(sep+str(t)) + f.write(sep+str(passengerflow_lane)) + + if flow_heavyduty >= 0: + f.write(sep+str(heavyflow_lane)) + + if speed_passenger >= 0: + f.write(sep+str(speed_passenger)) + + if speed_heavyduty >= 0: + f.write(sep+str(speed_heavyduty)) + + f.write("\n") + + # format from + # https://sumo.dlr.de/wiki/Demand/Routes_from_Observation_Points + # Detector;Time;qPKW;qLKW;vPKW;vLKW + # myDet1;0;10;2;100;80 + # ... further entries ... + f.close() + + def distribute_heavyflow_over_lanes(self, ids_lane, flow, flow_max=600): + """ + Distribute measured edge traffic flow of lorries over the given lanes. + """ + n_lane = len(ids_lane) + flows_lane = np.zeros(n_lane, dtype=np.float32) + + if n_lane <= 2: + flows_lane[0] = flow + + else: + flows_lane[0:2] = [0.95*flow, 0.05*flow] + return np.array(flows_lane+0.5, dtype=np.int32) + + def distribute_passengerflow_over_lanes(self, ids_lane, flow, flow_max=600): + """ + Distribute measured edge traffic flow of passenger cars over the given lanes. + """ + n_lane = len(ids_lane) + flows_lane = np.zeros(n_lane, dtype=np.float32) + + if n_lane == 1: + flows_lane[0] = flow + + elif n_lane == 2: + if flow/2 > flow_max: + flows_lane[0:2] = flow/2 + + elif flow > flow_max: + flows_lane[0:2] = [flow_max, flow-flow_max] + + else: + flows_lane[0:2] = [0.8*flow, 0.2*flow] + + elif n_lane == 3: + if flow/3 > flow_max: + flows_lane[0:3] = flow/3 + + elif flow/2 > flow_max: + flows_lane[0:3] = [flow_max, flow_max, flow-2*flow_max] + + elif flow > flow_max: + flows_lane[0:3] = [0.5*(flow-flow_max), flow_max, 0.5*(flow-flow_max)] + + else: + flows_lane[0:3] = [0.2*flow, 0.7*flow, 0.1*flow] + + elif n_lane == 4: + if flow/4 > flow_max: + flows_lane[0:4] = flow/4 + + elif flow/3 > flow_max: + flows_lane[0:4] = [flow_max, flow_max, flow_max, flow-3*flow_max] + + elif flow/2 > flow_max: + flows_lane[0:4] = [0.5*(flow-2*flow_max), flow_max, flow_max, 0.5*(flow-2*flow_max)] + + elif flow > flow_max: + flows_lane[0:4] = [1.0/3.0*(flow-flow_max), flow_max, 1.0/3.0*(flow-flow_max), 1.0/3.0*(flow-flow_max)] + + else: + flows_lane[0:4] = [0.2*flow, 0.5*flow, 0.2*flow, 0.1*flow] + + else: + flows_lane[0:4] = 1.0*flow/n_lane + + return np.array(flows_lane+0.5, dtype=np.int32) + + def import_csv(self, filepath, t_offset=0, t_start=0, t_end=24*3600, sep=";"): + net = self.parent.parent.get_net() + detectors = self.parent.detectors + ids_sumo = detectors.ids_sumo + + ids_detector = [] + times = [] + flows_passenger = [] + flows_heavyduty = [] + speeds_passenger = [] + speeds_heavyduty = [] + + f = open(filepath, 'r') + + # format from + # https://sumo.dlr.de/wiki/Demand/Routes_from_Observation_Points + # Detector;Time;qPKW;qLKW;vPKW;vLKW + # myDet1;0;10;2;100;80 + # ... further entries ... + + print 'import_csv', filepath + ind_col = 0 + cols = f.readline().strip() + ind_col = 0 + ind_detector = -1 + ind_time = -1 + ind_flow_passenger = -1 + ind_flow_heavyduty = -1 + ind_speed_passenger = -1 + ind_speed_heavyduty = -1 + if len(cols) >= 3: + for col in cols.split(sep): + if col == 'Detector': + ind_detector = ind_col + elif col == 'Time': + ind_time = ind_col + elif col == 'qPKW': + ind_flow_passenger = ind_col + elif col == 'qLKW': + ind_flow_heavyduty = ind_col + elif col == 'vPKW': + ind_speed_passenger = ind_col + elif col == 'vLKW': + ind_speed_heavyduty = ind_col + ind_col += 1 + else: + return False + + for line in f.readlines(): + cols = line.split(sep) + # print ' cols=',cols + if len(cols) >= 3: + ind_col = 0 + is_valid = True + t = 0.0 + flow_passenger = -1 + flow_heavyduty = -1 + speed_passenger = -1 + speed_heavyduty = -1 + + for col_raw in cols: + col = col_raw.strip() + if ind_col == ind_detector: + if ids_sumo.has_index(col): + id_sumo_detector = col + else: + is_valid = False + + elif col.isdigit() & is_valid: + num = int(col) + if ind_col == ind_time: + t = num + + elif ind_col == ind_flow_passenger: + flow_passenger = num + + elif ind_col == ind_flow_heavyduty: + flow_heavyduty = num + + elif ind_col == ind_speed_passenger: + speed_passenger = num + + elif ind_col == ind_speed_heavyduty: + speed_heavyduty = num + else: + # invalid value + is_valid = False + + ind_col += 1 + + if is_valid: + # print ' t',t,t_start,t_end,t+t_offset>=t_start,t+t_offset= t_start) & (t+t_offset < t_end): + ids_detector.append(ids_sumo.get_id_from_index(id_sumo_detector)) + times.append(t) + flows_passenger.append(flow_passenger) + flows_heavyduty.append(flow_heavyduty) + speeds_passenger.append(speed_passenger) + speeds_heavyduty.append(speed_heavyduty) + + # insert in database + ids_measure = self.add_rows( + ids_detector=ids_detector, + timeperiods=times, + flows_passenger=flows_passenger, + flows_heavyduty=flows_heavyduty, + speeds_passenger=speeds_passenger, + speeds_heavyduty=speeds_heavyduty, + ) + + f.close() + + return ids_measure + + def turnflows_to_routes(self, is_clear_trips=True, is_export_network=True, + is_make_probabilities=True, cmloptions=None,): + # jtrrouter --flow-files= + # --turn-ratio-files= --net-file= \ + # --output-file=MySUMORoutes.rou.xml --begin --end + + if is_make_probabilities: + self.normalize_turnprobabilities() + + scenario = self.parent.get_scenario() + if cmloptions is None: + cmloptions = '-v --max-edges-factor 1 --seed 23423 --repair --ignore-vclasses false --ignore-errors --turn-defaults 5,90,5' + + trips = scenario.demand.trips + if is_clear_trips: + # clear all current trips = routes + trips.clear_trips() + + rootfilepath = scenario.get_rootfilepath() + netfilepath = scenario.net.get_filepath() + flowfilepath = rootfilepath+'.flow.xml' + turnfilepath = rootfilepath+'.turn.xml' + + routefilepath = trips.get_routefilepath() + + # first generate xml for net + scenario.net.export_netxml() + + ids_mode = self.get_modes() + print 'turnflows_to_routes', ids_mode # scenario.net.modes.get_ids() + print ' cmloptions', cmloptions + + # route for all modes and read in routes + for id_mode in ids_mode: + # write flow and turns xml file for this mode + time_start, time_end = self.export_flows_and_turns(flowfilepath, turnfilepath, id_mode) + print ' time_start, time_end =', time_start, time_end + if time_end > time_start: # means there exist some flows for this mode + cmd = 'jtrrouter --route-files=%s --turn-ratio-files=%s --net-file=%s --output-file=%s --begin %s --end %s %s'\ + % (P+flowfilepath+P, + P+turnfilepath+P, + P+netfilepath+P, + P+routefilepath+P, + time_start, + time_end, + cmloptions, + ) + # print '\n Starting command:',cmd + if call(cmd): + if os.path.isfile(routefilepath): + trips.import_routes_xml(routefilepath, is_generate_ids=True) + os.remove(routefilepath) + + else: + print 'jtrroute: no flows generated for id_mode', id_mode + + # self.simfiles.set_modified_data('rou',True) + # self.simfiles.set_modified_data('trip',True) + # trips and routes are not yet saved!! + + +class DetectorMatcher(Process): + def __init__(self, ident, detectors, logger=None, **kwargs): + print 'DetectorMatcher.__init__' + + # TODO: let this be independent, link to it or child?? + + self._init_common(ident, + parent=detectors, + name='Detector Matcher', + logger=logger, + info='Match detectors to lanes.', + ) + + attrsman = self.set_attrsman(cm.Attrsman(self)) + + net = detectors.get_scenario().net + + self.modename = attrsman.add(cm.AttrConf('modename', kwargs.get('modename', 'passenger'), + groupnames=['options'], + choices=net.modes.names.get_indexmap().keys(), + name='Mode name', + info='Matched lanes must be accessible at least for this mode.', + )) + + print 'net.modes.names.get_indexmap().keys()', net.modes.names.get_indexmap().keys(), self.modename + + self.is_edgedetectors = attrsman.add(cm.AttrConf('is_edgedetectors', kwargs.get('is_edgedetectors', False), + groupnames=['options'], + name='One detector per edge', + info="""If True, it is assumed that there is only one detector per edge + and detected edge flows will be distributed accross accessible lanes according to some heuristics. + If False then each detector is matched to one lane. This is somewhat risky and requires a good + geometrical coincidence between detector position and lane. + """, + )) + + self.is_check_direction = attrsman.add(cm.AttrConf('is_check_direction', kwargs.get('is_check_direction', False), + groupnames=['options'], + name='Use detector direction', + info="""If True, use director direction information to improve matching. + """, + )) + self.phidelta_max = attrsman.add(cm.AttrConf('phidelta_max', kwargs.get('phidelta_max', 10.0), + groupnames=['options'], + name='Max. angle diff.', + unit='deg', + info="""Maximum difference of angels between detector and nearest edge segment. + To be used in conjunction with "Use detector direction" """, + )) + + self.d_max = attrsman.add(cm.AttrConf('d_max', kwargs.get('d_max', 20.0), + groupnames=['options'], + name='Maximum search dist.', + unit='m', + info="""Maximum search distance around detectors.""", + )) + + self.n_targetedge = attrsman.add(cm.AttrConf('n_targetedge', kwargs.get('n_targetedge', 5), + groupnames=['options'], + name='Number of target edges', + info="""Maximum number of considered target edges when searching for the nearest edge. + """, + )) + + self.d_max = attrsman.add(cm.AttrConf('d_max', kwargs.get('d_max', 20.0), + groupnames=['options'], + name='Maximum search dist.', + unit='m', + info="""Maximum search distance around detectors.""", + )) + + def do(self): + print 'DetectorMatcher.do' + self.parent.match_detectors_to_lane(modename=self.modename, + is_edgedetectors=self.is_edgedetectors, + is_check_direction=self.is_check_direction, + n_targetedge=self.n_targetedge, + d_max=self.d_max, + phidelta_max=self.phidelta_max) + return True + + +class DFRouter(CmlMixin, Process): + def __init__(self, detectorflows, logger=None, **kwargs): + + self._init_common('detectorflowrouter', name='Detectorflow Router', + parent=detectorflows, + logger=logger, + info='Generates routes from measured flows at detectors using the DFrouter.', + ) + + self.init_cml('dfrouter') # pass no commad to generate options only + + attrsman = self.get_attrsman() + + self.add_option('timestep', kwargs.get('timestep', 3600), + groupnames=['options', 'processing'], + cml='--time-step', + name='Time step', + info='Expected distance between two successive data sets.', + untit='s', + ) + + self.add_option('is_respect_concurrent_inflows', kwargs.get('is_respect_concurrent_inflows', False), + groupnames=['options', 'processing'], + cml='--respect-concurrent-inflows', + name='Respect concurrent inflows', + info='Try to determine further inflows to an inbetween detector when computing split probabilities.', + #is_enabled = lambda self: self.width_sublanes > 0, + ) + + self.add_option('is_routes_for_all', kwargs.get('is_routes_for_all', False), + groupnames=['options', 'processing'], + cml='--routes-for-all', + name='Routes for inbetween detectors', + info='Forces DFROUTER to compute routes for in-between detectors.', + #is_enabled = lambda self: self.width_sublanes > 0, + ) + + # self.add_option('is_guess_empty_flows', kwargs.get('is_guess_empty_flows',False), + # groupnames = ['processing'],# + # cml = '--guess-empty-flows', + # name = 'Guess empty flows', + # info = 'Derive missing flow values from upstream or downstream (not working!)', + # #is_enabled = lambda self: self.width_sublanes > 0, + # ) + + # self.add_option('is_ignore_invalid_detectors', kwargs.get('is_ignore_invalid_detectors',False), + # groupnames = ['processing',],# + # cml = '--ignore-invalid-detectors', + # name = 'Ignore invalid detectors', + # info = 'Only warn about unparseable detectors.', + # #is_enabled = lambda self: self.width_sublanes > 0, + # ) + + self.add_option('is_keep_unfinished_routes', kwargs.get('is_keep_unfinished_routes', False), + groupnames=['options', 'processing'], + cml='--keep-unfinished-routes', + name='Keep unfinished routes', + info='Keeps routes even if they have exhausted max-search-depth.', + #is_enabled = lambda self: self.width_sublanes > 0, + ) + + self.add_option('is_keep_longer_routes', kwargs.get('is_keep_longer_routes', False), + groupnames=['options', 'processing'], + cml='--keep-longer-routes', + name='Keep longer routes', + info='eeps routes even if a shorter one exists.', + #is_enabled = lambda self: self.width_sublanes > 0, + ) + + self.add_option('n_max_search_depth', kwargs.get('n_max_search_depth', 30), + groupnames=['options', 'processing'], + cml='--max-search-depth', + name='Max. search depth', + info='Number of edges to follow a route without passing a detector.', + #is_enabled = lambda self: self.width_sublanes > 0, + ) + + self.add_option('is_keep_turnarounds', kwargs.get('is_keep_turnarounds', False), + groupnames=['options', 'processing'], + cml='--keep-turnarounds', + name='keep turnarounds', + info='Allow turnarounds as route continuations.', + #is_enabled = lambda self: self.width_sublanes > 0, + ) + + self.add_option('length_min_route', kwargs.get('length_min_route', 500.0), + groupnames=['options', 'processing'], + cml='--min-route-length', + name='Min route length', + info='Minimum distance in meters between start and end node of every route.', + unit='m', + #is_enabled = lambda self: self.width_sublanes > 0, + ) + + self.add_option('is_randomize_flows', kwargs.get('is_randomize_flows', False), + groupnames=['options', 'processing'], + cml='--randomize-flows', + name='Randomize flows', + info='Generate random departure times for emitted vehicles.', + #is_enabled = lambda self: self.width_sublanes > 0, + ) + + self.add_option('c_flows', kwargs.get('c_flows', 1.0), + groupnames=['options', 'processing'], + cml='--scale', + name='Flow scale factor', + info='Scale factor for flows.', + #is_enabled = lambda self: self.width_sublanes > 0, + ) + + self.add_option('c_time', kwargs.get('c_time', 1.0), + groupnames=['options', 'processing'], + cml='--time-factor', + name='Time factor', + info='Multiply flow times with TIME to get seconds.', + #is_enabled = lambda self: self.width_sublanes > 0, + ) + + self.add_option('time_offset', kwargs.get('time_offset', 0), + groupnames=['options', 'processing'], + cml='--time-offset', + name='Time offset', + info='Multiply flow times with TIME to get seconds.', + #is_enabled = lambda self: self.width_sublanes > 0, + ) + + self.add_option('seed', 1234, + groupnames=['options', 'processing'], + cml='--seed', + name='Random seed', + info='Initialises the random number generator with the given value.', + ) + + self.is_export_network = attrsman.add(am.AttrConf('is_export_network', True, + groupnames=['options', ], + perm='rw', + name='Export network', + info='Export network before routing.', + )) + + self.is_clear_trips = attrsman.add(am.AttrConf('is_clear_trips', True, + groupnames=['options'], + perm='rw', + name='Clear trips', + info='Clear all trips in current trips database before routing.', + )) + + # self.add_option('turnratiofilepath', turnratiofilepath, + # groupnames = ['_private'],# + # cml = '--turn-ratio-files', + # perm='r', + # name = 'Net file', + # wildcards = 'Net XML files (*.net.xml)|*.net.xml', + # metatype = 'filepath', + # info = 'SUMO Net file in XML format.', + # ) + + def do(self): + cmloptions = self.get_cml() + scenario = self.parent.get_scenario() + trips = scenario.demand.trips + if self.is_clear_trips: + # clear all current trips = routes + trips.clear_trips() + + rootfilepath = scenario.get_rootfilepath() + netfilepath = scenario.net.get_filepath() + measuresfilepath = rootfilepath+'.measure.csv' + detectorsfilepath = rootfilepath+'.detect.xml' + emittersfilepath = rootfilepath+'.emitter.xml' + + self.parent.flowmeasurements.export_csv(measuresfilepath) + self.parent.detectors.export_sumoxml(detectorsfilepath) + + routefilepath = trips.get_routefilepath() + + # first generate xml for net + if self.is_export_network: + scenario.net.export_netxml() + + print 'DFRouter.do' + print ' cmloptions', cmloptions + + # dfrouter --net-file bonet190614_ms_dflows.net --routes-output bonet190614_ms_dflows.rou.xml --emitters-output vehicles.xml --detector-files detectors.xml --measure-files bonet190614_ms_dflows.dflows2.csv + cmd = cmloptions + ' --net-file %s --detector-files %s --measure-files %s --routes-output %s --emitters-output %s'\ + % (P+netfilepath+P, + P+detectorsfilepath+P, + P+measuresfilepath+P, + P+routefilepath+P, + P+emittersfilepath+P, + ) + # print '\n Starting command:',cmd + if call(cmd): + if os.path.isfile(routefilepath): + scenario.demand.trips.import_routes_xml(routefilepath) + os.remove(routefilepath) + return True + else: + return False + else: + return False + + +class FlowsImporter(Process): + def __init__(self, ident='flowsimporter', flows=None, + name='Flows Importer', + info='Reads and imports flow measurements from detectors.', + filepath='', logger=None, **kwargs): + demand = flows.parent.parent + + self._init_common(ident, name=name, + parent=flows, + logger=logger, + info=info, + ) + + attrsman = self.get_attrsman() + + self.t_start = attrsman.add(am.AttrConf('t_start', 0, + groupnames=['options'], + perm='rw', + name='Start time', + unit='s', + info='Start reading detector data at this time.', + )) + + self.t_end = attrsman.add(am.AttrConf('t_end', 24*3600, + groupnames=['options'], + perm='rw', + name='End time', + unit='s', + info='Stop reading detector data at this time.', + )) + + self.t_offset = attrsman.add(am.AttrConf('t_offset', 0, + groupnames=['options'], + perm='rw', + name='Time offset', + unit='s', + info='Time offset added to the time of the measurement values prior to the verification of the time window.', + )) + + # here we get currently available vehicle classes not vehicle type + # specific vehicle type within a class will be generated later + self.id_mode = attrsman.add(am.AttrConf('id_mode', MODES['passenger'], + groupnames=['options'], + choices=demand.vtypes.get_modechoices(), + name='ID mode', + info='ID of transport mode.', + )) + + self.filepath = attrsman.add(am.AttrConf('filepath', filepath, + groupnames=['options'], # this will make it show up in the dialog + perm='rw', + name='Flow file', + wildcards="Flow CSV files (*.csv)|*.csv|CSV files (*.txt)|*.txt|All files (*.*)|*.*", + metatype='filepath', + info='CSV file with flow measurements from detectors for the specific mode and time interval.', + )) + + def update_params(self): + """ + Make all parameters consistent. + example: used by import OSM to calculate/update number of tiles + from process dialog + """ + pass + #self.workdirpath = os.path.dirname(self.netfilepath) + #bn = os.path.basename(self.netfilepath).split('.') + # if len(bn)>0: + # self.rootname = bn[0] + + def do(self): + # self.update_params() + if os.path.isfile(self.filepath): + ids_measure = self.parent.import_csv(self.filepath, + t_offset=self.t_offset, + t_start=self.t_start, + t_end=self.t_end, + sep=";") + return True + else: + return False + + +class DetectorsFromShapeImporter(ShapefileImporter): + def __init__(self, ident='detectorsfromshapeimporter', detectors=None, + name='Detectors from Shapefile importer', + filepath='', logger=None, **kwargs): + + net = detectors.parent.parent.get_net() + ShapefileImporter.__init__(self, ident, detectors, + name=name, + filepath=filepath, + coordsattr='coords', + attrnames_to_shapeattrs={'ids_sumo': 'ID', + 'directions': '', + 'names': '', + }, + projparams_target=net.get_projparams(), + offset=net.get_offset(), + boundaries=net.get_boundaries(is_netboundaries=True), + logger=logger, + **kwargs) diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/detectorflows_wxgui.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/detectorflows_wxgui.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/detectorflows_wxgui.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/detectorflows_wxgui.py 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,530 @@ +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. +# SUMOPy module +# Copyright (C) 2012-2021 University of Bologna - DICAM +# 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 detectorflows_wxgui.py +# @author Joerg Schweizer +# @date 2012 + +import wx +import agilepy.lib_base.classman as cm +import agilepy.lib_base.arrayman as am +from agilepy.lib_wx.ogleditor import * +from agilepy.lib_wx.objpanel import ObjPanel +from agilepy.lib_base.processes import Process +from agilepy.lib_wx.processdialog import ProcessDialog +from coremodules.network.network import SumoIdsConf, MODES +import detectorflows + + +class DetectorflowsWxGuiMixin: + """Contains Detector flow spacific functions that communicate between the widgets of the main wx gui + and the functions of the plugin. + """ + + def refresh_detectorflow(self, is_refresh): + if is_refresh: + neteditor = self.get_neteditor() + # neteditor.add_toolclass(AddTurnflowTool) + + def add_menu_detectorflow(self, menubar): + menubar.append_menu('demand/detector flows', + bitmap=self.get_icon("fig_detectorflows_24px.png"), + ) + + menubar.append_item('demand/detector flows/import detectors from shape...', + self.on_import_detectors_from_shape, + bitmap=self.get_agileicon("Document_Import_24px.png"), + ) + + menubar.append_item('demand/detector flows/match detectors to lanes...', + self.on_match_detectors, + bitmap=self.get_icon("fig_detectorflows_24px.png"), + ) + + menubar.append_item('demand/detector flows/import measurements from csv...', + self.on_import_measurements_from_csv, + bitmap=self.get_agileicon("Document_Import_24px.png"), + ) + + menubar.append_item('demand/detector flows/Detector flows to routes...', + self.on_detectorflows_to_routes, + ) + + menubar.append_item('demand/detector flows/clear detectors and flows', + self.on_clear_detectorflows, + bitmap=wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_MENU), + ) + + menubar.append_item('demand/detector flows/clear flows', + self.on_clear_flows, + bitmap=wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_MENU), + ) + + def on_import_detectors_from_shape(self, event=None): + """Import detectors from shapefile""" + importer = detectorflows.DetectorsFromShapeImporter('detectorsfromshapeimporter', self._demand.detectorflows.detectors, + logger=self._mainframe.get_logger() + ) + dlg = ProcessDialog(self._mainframe, importer) + + dlg.CenterOnScreen() + + # this does not return until the dialog is closed. + val = dlg.ShowModal() + # print ' val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL + # print ' status =',dlg.get_status() + if dlg.get_status() != 'success': # val == wx.ID_CANCEL: + # print ">>>>>>>>>Unsuccessful\n" + dlg.Destroy() + + if dlg.get_status() == 'success': + # print ">>>>>>>>>successful\n" + # apply current widget values to scenario instance + dlg.apply() + dlg.Destroy() + self._mainframe.browse_obj(self._demand.detectorflows.detectors) + + def on_match_detectors(self, event=None): + """Match current detectors to networl lanes""" + p = detectorflows.DetectorMatcher('detectormatcher', self._demand.detectorflows.detectors, + logger=self._mainframe.get_logger() + ) + dlg = ProcessDialog(self._mainframe, p) + + dlg.CenterOnScreen() + + # this does not return until the dialog is closed. + val = dlg.ShowModal() + # print ' val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL + # print ' status =',dlg.get_status() + if dlg.get_status() != 'success': # val == wx.ID_CANCEL: + # print ">>>>>>>>>Unsuccessful\n" + dlg.Destroy() + + if dlg.get_status() == 'success': + # print ">>>>>>>>>successful\n" + # apply current widget values to scenario instance + dlg.apply() + dlg.Destroy() + self._mainframe.browse_obj(self._demand.detectorflows.detectors) + + def on_import_measurements_from_csv(self, event=None): + """Import detector flow measurements from CSV file.""" + p = detectorflows.FlowsImporter('flowmeasurementimporter', self._demand.detectorflows.flowmeasurements, + logger=self._mainframe.get_logger() + ) + dlg = ProcessDialog(self._mainframe, p) + + dlg.CenterOnScreen() + + # this does not return until the dialog is closed. + val = dlg.ShowModal() + # print ' val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL + # print ' status =',dlg.get_status() + if dlg.get_status() != 'success': # val == wx.ID_CANCEL: + # print ">>>>>>>>>Unsuccessful\n" + dlg.Destroy() + + if dlg.get_status() == 'success': + # print ">>>>>>>>>successful\n" + # apply current widget values to scenario instance + dlg.apply() + dlg.Destroy() + self._mainframe.browse_obj(self._demand.detectorflows.flowmeasurements) + + def on_clear_flows(self, event=None): + """Clear all detectors and slows. + """ + self._demand.detectorflows.flowmeasurements.clear() + self._mainframe.browse_obj(self._demand.detectorflows) + + def on_clear_detectorflows(self, event=None): + """Clear all detectors and slows. + """ + self._demand.detectorflows.clear() + self._mainframe.browse_obj(self._demand.detectorflows) + # if event: + # event.Skip() + + def on_detectorflows_to_routes(self, event=None): + """Generates trips with routes, based on detector flow measurements using DFRouter. + """ + + dfrouter = detectorflows.DFRouter(self._demand.detectorflows, + logger=self._mainframe.get_logger() + ) + dlg = ProcessDialog(self._mainframe, dfrouter) + + dlg.CenterOnScreen() + + # this does not return until the dialog is closed. + val = dlg.ShowModal() + if dlg.get_status() != 'success': # val == wx.ID_CANCEL: + # print ">>>>>>>>>Unsuccessful\n" + dlg.Destroy() + + if dlg.get_status() == 'success': + # print ">>>>>>>>>successful\n" + # apply current widget values to scenario instance + dlg.apply() + dlg.Destroy() + self._mainframe.browse_obj(self._demand.trips) + + +class DetectorflowCommonMixin: + def add_options_common(self, turnflows=None): + self.add(am.AttrConf('t_start', 0, + groupnames=['options'], + perm='rw', + name='Start time', + unit='s', + info='Start time of interval', + )) + + self.add(am.AttrConf('t_end', 3600, + groupnames=['options'], + perm='rw', + name='End time', + unit='s', + info='End time of interval', + )) + + if turnflows is not None: + modechoices = turnflows.parent.vtypes.get_modechoices() + id_mode = modechoices.get('passenger', 0) + else: + modechoices = {'': -1} + id_mode = -1 + + # here we ged classes not vehicle type + # specific vehicle type within a class will be generated later + self.add(am.AttrConf('id_mode', id_mode, + groupnames=['options'], + choices=modechoices, + name='Mode', + info='Transport mode.', + )) + + +class AddDetectorflowTool(DetectorflowCommonMixin, SelectTool): + """ + TODO,NOT IN USE + OD flow toolfor OGL canvas. + """ + + def __init__(self, parent, mainframe=None): + """ + To be overridden by specific tool. + """ + self.init_common('turnflowadder', parent, 'Add turn-flow', + info="""Tool to at generated flows and turn flows at intersections: + Select an edge with on the Network editor to specify a . + Optionally enter the number of vehicles to be generated on and press button "Add flow". + Cycle through the possible adjacent edges by +. + when the desired is highlighted. + Enter the number of vehicles turning from to and press button "Add turns". + Continue cycling by + and adding more turnflows. + Or press "Clear" button to clear all edges and start defining flows for a new intersection. + """, + is_textbutton=False, + ) + + self._init_select(is_show_selected=False) + + self.add_options_common() + # make options + + self.add(cm.AttrConf('id_fromedge', -1, + groupnames=['options'], + name='From edge ID', + perm='r', + info='This is the reference edge for the generated flows as well as turn-flows into adjason edges.', + )) + + self.add(cm.AttrConf('flow_generated', 0, + groupnames=['options'], + perm='rw', + name='Gen. flow', + info='Absolute number of vehicles which are generated on "from edge" during the specified time interval.', + xmltag='number', + )) + + self.add(cm.AttrConf('id_toedge', -1, + groupnames=['options'], + name='To edge ID', + perm='r', + info='Target Edge ID for the specified turnflows. Click on edge to specify.', + )) + + self.add(cm.AttrConf('turnflow', 0, + groupnames=['options'], + perm='rw', + name='Turn flow', + info='Number of trips from edge of origin to edge of destination during the specified time interval. + to cycle through all possible edges. to select.', + )) + + def set_button_info(self, bsize=(32, 32)): + # print 'set_button_info select tool' self.get_icon("icon_sumo_24px.png") + iconpath = os.path.join(os.path.dirname(__file__), 'images') + self._bitmap = wx.Bitmap(os.path.join(iconpath, 'fig_turnflow_32px.png'), wx.BITMAP_TYPE_PNG) + self._bitmap_sel = self._bitmap + + def set_cursor(self): + # http://www.wxpython.org/docs/api/wx.Cursor-class.html + if self._canvas is not None: + self._canvas.SetCursor(wx.StockCursor(wx.CURSOR_RIGHT_ARROW)) + + def activate(self, canvas=None): + """ + This call by metacanvas??TooldsPallet signals that the tool has been + activated and can now interact with metacanvas. + """ + # print 'activate' + SelectTool.activate(self, canvas) + + # make lanes invisible, because they disturb + lanedraws = self.get_drawobj_by_ident('lanedraws') + self._is_lane_visible_before = None + if lanedraws: + self._is_lane_visible_before = lanedraws.is_visible() + lanedraws.set_visible(False) + + modechoices = self.get_scenario().demand.vtypes.get_modechoices() + self.id_mode.set_value(modechoices.get('passenger', 0)) + self.id_mode.choices = modechoices + canvas.draw() + + def deactivate(self): + """ + This call by metacanvas signals that the tool has been + deactivated and can now interact with metacanvas. + """ + + self._is_active = False + # self.unhighlight() + + # reset lane visibility + if self._is_lane_visible_before is not None: + lanedraws = self.get_drawobj_by_ident('lanedraws') + if lanedraws: + lanedraws.set_visible(self._is_lane_visible_before) + self._canvas.draw() + + self.deactivate_select() + + def on_left_down_select(self, event): + # same as on select tool but avoid deselection after execution + + # print 'on_left_down_select' + is_draw = False + + if len(self) > 0: + if event.ShiftDown(): + + self.iterate_selection() + self.on_change_selection(event) + is_draw = True + else: + # print ' on_execute_selection 1' + is_draw |= self.on_execute_selection(event) + # attention: on_execute_selection must take care of selected + # objects in list with self.unselect_all() + #is_draw |= self.unselect_all() + + if self.is_show_selected: + self.parent.refresh_optionspanel(self) + + else: + is_draw |= self.pick_all(event) + self.highlight_current() + + if not event.ShiftDown(): + if self.is_preselected(): + self.coord_last = self._canvas.unproject(event.GetPosition()) + # print ' on_execute_selection 2' + is_draw |= self.on_execute_selection(event) + # attention: on_execute_selection must take care of selected + # objects in list with self.unselect_all() + + else: + self.coord_last = self._canvas.unproject(event.GetPosition()) + + if self.is_show_selected: + self.parent.refresh_optionspanel(self) + + return is_draw + + def on_execute_selection(self, event): + """ + Definively execute operation on currently selected drawobjects. + """ + # print 'AddTurnflowTool.on_execute_selection',self.get_netelement_current(),len(self) + # self.set_objbrowser() + # self.highlight_current() + self.unhighlight_current() + # self.unhighlight() + netelement_current = self.get_netelement_current() + if netelement_current is not None: + (edges, id_elem) = netelement_current + if edges.get_ident() == 'edges': + # print ' check',self.name_orig.get_value(),'*',self.name_orig.get_value() is '' + if self.id_fromedge.get_value() < 0: + # print ' set name_orig',zones.ids_sumo[id_zone] + self.id_fromedge.set_value(id_elem) + + else: + # print ' set name_dest',zones.ids_sumo[id_zone] + self.id_toedge.set_value(id_elem) + + # add potential to-edges to selection + edgedraws = self.get_drawobj_by_ident('edgedraws') + self.unselect_all() + for id_edge in edges.get_outgoing(self.id_fromedge.value): + self.add_selection(edgedraws, id_edge) + + # self.unselect_all()# includes unhighlight + self.highlight() + self.parent.refresh_optionspanel(self) + + else: + self.unselect_all() + + return True + + def highlight(self): + edges = self.get_edges() + drawing = self.get_drawing() + if self.id_fromedge.value >= 0: + drawing.highlight_element(edges, self.id_fromedge.value, is_update=True) + if self.id_toedge.value >= 0: + drawing.highlight_element(edges, self.id_toedge.value, is_update=True) + + def unhighlight(self): + edges = self.get_edges() + drawing = self.get_drawing() + if self.id_fromedge.value >= 0: + drawing.unhighlight_element(edges, self.id_fromedge.value, is_update=True) + if self.id_toedge.value >= 0: + drawing.unhighlight_element(edges, self.id_toedge.value, is_update=True) + + def on_change_selection(self, event): + """ + Called after selection has been changed with SHIFT-click + Do operation on currently selected drawobjects. + """ + # self.set_objbrowser() + # self.parent.refresh_optionspanel(self) + return False + + def get_netelement_current(self): + mainframe = self.parent.get_mainframe() + if mainframe is not None: + drawobj, _id = self.get_current_selection() + if drawobj is not None: + obj = drawobj.get_netelement() + return obj, _id + else: + return None + else: + return None + + def get_scenario(self): + # get net and scenario via netdrawing + return self.get_drawing().get_net().parent + + def get_turnflows(self): + return self.get_scenario().demand.turnflows + + def get_edges(self): + return self.get_scenario().net.edges + + def on_add_flow(self, event=None): + self._optionspanel.apply() + edges = self.get_edges().ids_sumo + + flows = self.get_turnflows().add_flow(self.t_start.value, self.t_end.value, + self.id_mode.value, + self.id_fromedge.value, + self.flow_generated.value) + + # self.unselect_all() + # self.unhighlight() + mainframe = self.parent.get_mainframe() + if mainframe is not None: + mainframe.browse_obj(flows) + + self.flow_generated.set_value(0) # set flow to zero + # self.highlight() + self.parent.refresh_optionspanel(self) + # self._canvas.draw() + + def on_add_turn(self, event=None): + self._optionspanel.apply() + edges = self.get_edges().ids_sumo + + turns = self.get_turnflows().add_turn(self.t_start.value, self.t_end.value, + self.id_mode.value, + self.id_fromedge.value, + self.id_toedge.value, + self.turnflow.value) + + # self.unselect_all() + # self.unhighlight() + + mainframe = self.parent.get_mainframe() + if mainframe is not None: + mainframe.browse_obj(turns) + + self.turnflow.set_value(0) # set flow to zero + self.id_toedge.set_value(-1) + self.unhighlight_current() + # self.highlight() + self.parent.refresh_optionspanel(self) + + # self.on_clear_edges() + + def on_clear_edges(self, event=None): + self.unhighlight() + self.id_fromedge.set_value(-1) # set empty + self.id_toedge.set_value(-1) # set empty + self.unselect_all() + + self.parent.refresh_optionspanel(self) + self._canvas.draw() + + def get_optionspanel(self, parent, size=wx.DefaultSize): + """ + Return tool option widgets on given parent + """ + size = (200, -1) + buttons = [('Add flow', self.on_add_flow, 'Add flow generation on from-edge to demand.'), + ('Add turns', self.on_add_turn, 'Add turn flow from from-edge to to-edge to demand.'), + ('Clear', self.on_clear_edges, 'Clear edge selection.'), + #('Save flows', self.on_add, 'Save OD flows to current demand.'), + #('Cancel', self.on_close, 'Close wizzard without adding flows.'), + ] + defaultbuttontext = 'Add flow' + self._optionspanel = ObjPanel(parent, obj=self, + attrconfigs=None, + groupnames=['options'], + func_change_obj=None, + show_groupnames=False, show_title=True, is_modal=False, + mainframe=self.parent.get_mainframe(), + pos=wx.DefaultPosition, size=size, style=wx.MAXIMIZE_BOX | wx.RESIZE_BORDER, + immediate_apply=True, panelstyle='default', # 'instrumental' + buttons=buttons, defaultbutton=defaultbuttontext, + standartbuttons=[], # standartbuttons=['restore'] + ) + + return self._optionspanel Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/images/fig_detectorflows_24px.png and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/images/fig_detectorflows_24px.png differ Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/images/icon_mpl.png and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/images/icon_mpl.png differ diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/__init__.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/__init__.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/__init__.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/__init__.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file __init__.py # @author Joerg Schweizer -# @date +# @date 2012 __version__ = "0.0" diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination_mpl.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination_mpl.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination_mpl.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination_mpl.py 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,358 @@ +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. +# SUMOPy module +# Copyright (C) 2012-2021 University of Bologna - DICAM +# 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 origin_to_destination_mpl.py +# @author Joerg Schweizer +# @date 2012 + +import os +import numpy as np +import agilepy.lib_base.classman as cm +import agilepy.lib_base.arrayman as am +import matplotlib.pyplot as plt +from matplotlib.path import Path +import matplotlib.patches as patche +from coremodules import demand +#from coremodules.demand.origin_to_destination import OdIntervals +from coremodules.misc.matplottools import * +import agilepy.lib_base.xmlman as xm + +from agilepy.lib_base.processes import Process + + +class OdPlots(PlotoptionsMixin, Process): + def __init__(self, ident, demand, logger=None, **kwargs): + print 'OdPlots.__init__' + self._init_common(ident, + parent=demand, + name='OD plots', + logger=logger, + info='Plot of OD data.', + ) + attrsman = self.set_attrsman(cm.Attrsman(self)) + modes = demand.parent.net.modes + self.od_table = demand.odintervals.generate_odflows() + + self.zonefillmode = attrsman.add(cm.AttrConf('zonefillmode', kwargs.get('zonefillmode', 'zone color'), + choices=['zone color', 'flows in - flows out', + 'flows in + flows out', 'flows in', 'flows out'], + groupnames=['options'], + name='Zone fill mode', + info='Defines how each zone is filled.', + )) + + ids_mode = list(set(self.od_table.ids_mode.get_value())) + modechoices = {} + for id_mode, modename in zip(ids_mode, modes.names[ids_mode]): + modechoices[modename] = id_mode + + self.ids_mode = attrsman.add(cm.ListConf('ids_mode', 1*ids_mode, + groupnames=['options'], + choices=modechoices, + name='Modes', + info="""Modes to be visualized""", + )) + + ids_inter = demand.odintervals.get_ids() + intervalchoices = {} + for id_int, time_start, time_end in zip(ids_inter, demand.odintervals.times_start[ids_inter], demand.odintervals.times_end[ids_inter]): + intervalchoices[str(int(time_start/60.0))+'min-'+str(int(time_end/60.0)) + + 'min'] = (int(time_start), int(time_end)) + + self.intervals = attrsman.add(cm.ListConf('intervals', intervalchoices.values(), + groupnames=['options'], + choices=intervalchoices, + name='Intervals', + info="""Time intervals that get visualized""", + )) + + self.color_zones = attrsman.add(cm.AttrConf('color_zones', kwargs.get('color_zones', np.array([0.9, 0.9, 0.9, 1.0], dtype=np.float32)), + groupnames=['options', 'zones'], + perm='wr', + metatype='color', + name='Zone color', + info='Fill color of Zone, in case the "zone color" is set to "color"', + )) + + self.alpha_zones = attrsman.add(cm.AttrConf('alpha_zones', kwargs.get('alpha_zones', 0.3), + groupnames=['options', 'zones'], + name='Zone transparency', + info='Transparency of fill color of zones.', + )) + + self.color_zoneborders = attrsman.add(cm.AttrConf('color_zoneborders', kwargs.get('color_zoneborders', np.array([0.0, 0.7, 0.0, 1.0], dtype=np.float32)), + groupnames=['options', 'zones'], + perm='wr', + metatype='color', + name='Zone border color', + info='Color of zone border.', + )) + self.linewidth_zoneborders = attrsman.add(cm.AttrConf('linewidth_zoneborders', kwargs.get('linewidth_zoneborders', 3), + groupnames=['options', 'zones'], + name='Zone border line widtg', + info='Transparency of fill color of zones.', + )) + + self.is_show_id_zone = attrsman.add(cm.AttrConf('is_show_id_zone', kwargs.get('is_show_id_zone', True), + groupnames=['options'], + name='Show zone IDs', + info='Show ID of each zone.', + )) + + self.is_show_zonevalues = attrsman.add(cm.AttrConf('is_show_zonevalues', kwargs.get('is_show_zonevalues', False), + groupnames=['options'], + name='Show zone values', + info='Show values of each zone. Values depend on the choise of "zonefillmode"', + )) + + self.is_show_flows = attrsman.add(cm.AttrConf('is_show_flows', kwargs.get('is_show_flows', True), + groupnames=['options'], + name='Show OD flows', + info='Show OD flows as arrows between the zone, these are sometimes called the "desired lines".', + )) + + self.color_flows = attrsman.add(cm.AttrConf('color_flows', kwargs.get('color_flows', np.array([0.3, 0.9, 0.3, 1.0], dtype=np.float32)), + groupnames=['options', 'zones'], + perm='wr', + metatype='color', + name='Flow color', + info='Flow color if color does not vary with flow value.', + )) + + self.is_show_flow_colorvalues = attrsman.add(cm.AttrConf('is_show_flow_colorvalues', kwargs.get('is_show_flow_colorvalues', False), + groupnames=['options'], + name='Show OD flows colors', + info='Show OD flows as colored arrows, where color varies with flow value.', + )) + + self.width_flows_max = attrsman.add(cm.AttrConf('width_flows_max', kwargs.get('width_flows_max', 100.0), + groupnames=['options'], + name='Max. OD flow width', + info='Max. OD flow width on map.', + )) + # self.is_show_flowvalues = attrsman.add(cm.AttrConf( 'is_show_flowvalues', kwargs.get('is_show_flowvalues', False), + # groupnames = ['options'], + # name = 'Show flow values', + # info = 'Label flows with flow values.', + # )) + + self.add_networkoptions(**kwargs) + self.add_facilityoptions(**kwargs) + # self.add_zoneoptions(**kwargs) + self.add_plotoptions_mapbase(**kwargs) + self.add_plotoptions_base(**kwargs) + self.add_save_options(**kwargs) + + def show(self): + print 'OdPlots.show' + # if self.axis is None: + scenario = self.parent.get_scenario() + zones = scenario.landuse.zones + ids_zone = zones.get_ids() + n_zones = len(ids_zone) + + ids = self.od_table.get_ids() + + #outflows = np.zeros(n_zones, dtype = np.int32) + #inflows = np.zeros(n_zones, dtype = np.int32) + outflows = {} + inflows = {} + balance = {} + totals = {} + odflows = {} + for id_zone in ids_zone: + outflows[id_zone] = 0 + inflows[id_zone] = 0 + balance[id_zone] = 0 + totals[id_zone] = 0 + + for id_zone_orig, id_zone_dest, id_mode, time_start, time_end, n_trips\ + in zip(self.od_table.ids_orig[ids], + self.od_table.ids_dest[ids], + self.od_table.ids_mode[ids], + self.od_table.times_start[ids], + self.od_table.times_end[ids], + self.od_table.tripnumbers[ids], + ): + inter = (int(time_start), int(time_end)) + # print ' id_zone_orig',id_zone_orig,'id_zone_dest',id_zone_dest,'inter',inter,inter in self.intervals + if (inter in self.intervals)\ + & (id_mode in list(self.ids_mode)): + outflows[id_zone_orig] += n_trips + inflows[id_zone_dest] += n_trips + od = (id_zone_orig, id_zone_dest) + if odflows.has_key(od): + odflows[od] += n_trips + else: + odflows[od] = n_trips + + for id_zone in ids_zone: + balance[id_zone] = inflows[id_zone] - outflows[id_zone] + totals[id_zone] = inflows[id_zone] + outflows[id_zone] + # debug + print ' id_zone', id_zone, 'in', inflows[id_zone], 'out', outflows[id_zone], 'balance', balance[id_zone], 'totals', totals[id_zone] + + unit = self.unit_mapscale + mapscale = self.get_attrsman().get_config('unit_mapscale').mapscales[unit] + ax = init_plot(tight_layout=True) + + self.plot_net(ax, mapscale=mapscale, unit=unit, is_configure=False) + + #self.zonefillmode = ['zone color','flows in - flows out','flows in + flows out','flows in','flows out'], + if self.zonefillmode == 'flows in - flows out': + ids_zone = balance.keys() + values = balance.values() + elif self.zonefillmode == 'flows in + flows out': + ids_zone = totals.keys() + values = totals.values() + elif self.zonefillmode == 'flows in': + ids_zone = inflows.keys() + values = inflows.values() + elif self.zonefillmode == 'flows out': + ids_zone = outflows.keys() + values = outflows.values() + else: + # dummy + ids_zone = balance.keys() + values = balance.values() + ppatches = [] + for id_zone, shape, value in zip(ids_zone, zones.shapes[ids_zone], values): + + poly = mpl.patches.Polygon(np.array(shape)[:, :2]*mapscale, + linewidth=self.linewidth_zoneborders, + edgecolor=self.color_zoneborders, + facecolor=self.color_zones, + fill='true', + alpha=self.alpha_zones, + zorder=0) + ppatches.append(poly) + if self.is_show_zonevalues & (self.zonefillmode != 'zone color'): + if self.is_show_id_zone: + text = "ID:%d, val: %d" % (id_zone, value) + else: + text = "%d" % (value) + + ax.text(zones.coords[id_zone][0], zones.coords[id_zone][1], + text, + ha='left', va='bottom', + fontsize=int(0.8*self.size_labelfont), + #backgroundcolor = 'w', + bbox=dict(edgecolor='k', facecolor='w', alpha=0.8), + zorder=1000, + ) + + elif self.is_show_id_zone: + ax.text(zones.coords[id_zone][0], zones.coords[id_zone][1], + "ID:%d" % (id_zone), + ha='left', va='bottom', + fontsize=int(0.8*self.size_labelfont), + #backgroundcolor = 'w', + bbox=dict(edgecolor='k', facecolor='w', alpha=0.8), + zorder=1000, + ) + + if (self.zonefillmode != 'zone color') & (not self.is_show_flow_colorvalues): + if self.zonefillmode == 'flows in - flows out': + cmap = mpl.cm.seismic + else: + cmap = mpl.cm.jet + patchcollection = PatchCollection(ppatches, cmap=cmap, alpha=self.alpha_zones) + print ' values', values + patchcollection.set_array(np.array(values, dtype=np.float32)) + + ax.add_collection(patchcollection) + + cbar = plt.colorbar(patchcollection) + + cbar.ax.set_ylabel(self.zonefillmode) + for l in cbar.ax.yaxis.get_ticklabels(): + # l.set_weight("bold") + l.set_fontsize(self.size_labelfont) + else: + for patch in ppatches: + ax.add_patch(patch) + + if self.is_show_flows: + values_raw = np.array(odflows.values(), dtype=np.float32) + widthcoeff = self.width_flows_max/np.max(values_raw) + + apatches = [] + for od, flow in odflows.iteritems(): + id_zone_orig, id_zone_dest = od + x1, y1 = zones.coords[id_zone_orig][:2] + x2, y2 = zones.coords[id_zone_dest][:2] + width = widthcoeff*flow + + # if self.is_show_flowvalues & self.is_show_flow_colorvalues: + # text = str(int(flow)) + # else: + # text = '' + print ' x1, y1', x1, y1, 'x2, y2', x2, y2 + if id_zone_orig != id_zone_dest: + patch = FancyArrow(x1*mapscale, y1*mapscale, (x2-x1)*mapscale, (y2-y1)*mapscale, + width=width, + antialiased=True, + edgecolor='black', facecolor=self.color_flows, + head_width=1.5*width, head_length=1.2*width, + # label = text,# not putting number on arrow but on legend + length_includes_head=True, + # overhang = 1.2,# ugly, not working properly + fill=True, + shape='right', # right,full #show only right half + zorder=2) + + else: + patch = Circle((x1*mapscale, y1*mapscale,), + width, + antialiased=True, + edgecolor='black', + facecolor=self.color_flows, + fill=True, + zorder=30, + ) + + apatches.append(patch) + + if self.is_show_flow_colorvalues: + cmap = mpl.cm.jet + apatchcollection = PatchCollection(apatches, cmap=cmap, alpha=1.0) + # print ' values_raw',values_raw + apatchcollection.set_array(values_raw) + + ax.add_collection(apatchcollection) + + cbar = plt.colorbar(apatchcollection) + + cbar.ax.set_ylabel(self.zonefillmode) + for l in cbar.ax.yaxis.get_ticklabels(): + # l.set_weight("bold") + l.set_fontsize(self.size_labelfont) + else: + for patch in apatches: + ax.add_patch(patch) + + # if self.is_show_flows & self.is_show_flow_colorvalues: + # #plt.legend(apatches, fontsize=self.size_labelfont) + # plt.legend(fontsize=self.size_labelfont) + + self.configure_map(ax, title='Zone to Zone flows', unit=unit) + + if self.is_save: + plt.subplots_adjust(left=0.12, bottom=0.1, right=0.86, top=0.9, wspace=0.2, hspace=0.2) + self.save_fig('odflows') + + if not self.is_save: + show_plot() + + return True diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file origin_to_destination.py # @author Joerg Schweizer -# @date +# @date 2012 import numpy as np @@ -26,99 +26,10 @@ from coremodules.network.network import SumoIdsConf, MODES from coremodules.network import routing from agilepy.lib_base.processes import Process, CmlMixin -#import coremodules.demand.demand as dm + import demand as dm import demandbase as db -# print 'dir(dm)',dir(dm) -#from demand import OPTIONMAP_POS_DEPARTURE -# OPTIONMAP_POS_ARRIVAL -# OPTIONMAP_SPEED_DEPARTURE -# OPTIONMAP_SPEED_ARRIVAL -# OPTIONMAP_LANE_DEPART -# OPTIONMAP_LANE_ARRIVAL - - -class OdTripgenerator(Process): - def __init__(self, odintervals, trips, logger=None, **kwargs): - """ - CURRENTLY NOT IN USE!! - """ - self._init_common('odtripgenerator', name='OD tripgenerator', - logger=logger, - info='Generates trips from OD demand .', - ) - self._odintervals = odintervals - - attrsman = self.get_attrsman() - self.add_option('netfilepath', netfilepath, - # this will make it show up in the dialog - groupnames=['options'], - cml='--sumo-net-file', - perm='rw', - name='Net file', - wildcards='Net XML files (*.net.xml)|*.net.xml', - metatype='filepath', - info='SUMO Net file in XML format.', - ) - - self.workdirpath = attrsman.add(cm.AttrConf('workdirpath', rootdirpath, - # ['options'],#['_private'], - groupnames=['_private'], - perm='r', - name='Workdir', - metatype='dirpath', - info='Working directory for this scenario.', - )) - - self.rootname = attrsman.add(cm.AttrConf('rootname', rootname, - groupnames=['_private'], - perm='r', - name='Scenario shortname', - info='Scenario shortname is also rootname of converted files.', - )) - - self.is_clean_nodes = attrsman.add(cm.AttrConf('is_clean_nodes', is_clean_nodes, - groupnames=['options'], - perm='rw', - name='Clean Nodes', - info='If set, then shapes around nodes are cleaned up.', - )) - - def update_params(self): - """ - Make all parameters consistent. - example: used by import OSM to calculate/update number of tiles - from process dialog - """ - pass - #self.workdirpath = os.path.dirname(self.netfilepath) - #bn = os.path.basename(self.netfilepath).split('.') - # if len(bn)>0: - # self.rootname = bn[0] - - def do(self): - self.update_params() - cml = self.get_cml()+' --plain-output-prefix ' + \ - filepathlist_to_filepathstring( - os.path.join(self.workdirpath, self.rootname)) - # print 'SumonetImporter.do',cml - #import_xml(self, rootname, dirname, is_clean_nodes = True) - self.run_cml(cml) - if self.status == 'success': - self._net.import_xml( - self.rootname, self.workdirpath, is_clean_nodes=self.is_clean_nodes) - return True - else: - return False - # print 'do',self.newident - # self._scenario = Scenario( self.newident, - # parent = None, - # workdirpath = self.workdirpath, - # logger = self.get_logger(), - # ) - - def get_net(self): - return self._net +from agilepy.lib_base.geometry import is_polyline_intersect_polygon class OdFlowTable(am.ArrayObjman): @@ -233,6 +144,7 @@ xmltag=('odtrips', 'odtrip', None), **kwargs) self._init_attributes(zones) + self._init_constants() def _init_attributes(self, zones=None): # print '_init_attributes',self.ident @@ -297,9 +209,67 @@ # print ' _init_attributes done',self.ident def _init_constants(self): + # print 'OdTrips._init_constants!!' #self.edgeweights_orig = None #self.edgeweights_dest = None - pass + self._mode_to_edgeinfo = {} + self._fstars = {} + self._times = {} + attrsman = self.get_attrsman() + attrsman.do_not_save_attrs(['_mode_to_edgeinfo', '_fstars', '_times']) + + def _get_fstar(self, id_mode, is_return_arrays=True, is_ignor_connections=False): + + if not self._fstars.has_key(id_mode): + self._fstars[id_mode] = self.get_edges().get_fstar(id_mode, + is_ignor_connections=is_ignor_connections, + is_return_arrays=is_return_arrays,) + return self._fstars[id_mode] + + def _get_times(self, id_mode, is_check_lanes=False): + + if not self._times.has_key(id_mode): + self._times[id_mode] = self.get_edges().get_times(id_mode=id_mode, + is_check_lanes=is_check_lanes, + ) + return self._times[id_mode] + + def get_zone_edgeinfo(self, id_mode, id_zone, + n_edges_min_length, n_edges_max_length, + priority_max, speed_max, + id_mode_fallback=None): + + if not self._mode_to_edgeinfo.has_key(id_mode): + self._mode_to_edgeinfo[id_mode] = {} + + if not self._mode_to_edgeinfo[id_mode].has_key(id_zone): + zones = self.get_zones() + ids_edge = zones.get_zoneedges_by_mode_fast(id_zone, id_mode, + weights=self._get_times(id_mode), + fstar=self._get_fstar(id_mode), + ) + n_edges = len(ids_edge) + if n_edges > 0: + #weights = self._get_edgeweights(ids_edge, n_edges_min_length, n_edges_max_length, priority_max, speed_max) + #self._mode_to_edgeinfo[id_mode][id_zone] = (ids_edge, weights / np.sum(weights)) + # store un-normlized weights + self._mode_to_edgeinfo[id_mode][id_zone] = (ids_edge, + self._get_edgeweights( + ids_edge, n_edges_min_length, n_edges_max_length, priority_max, speed_max), + ) + else: + self._mode_to_edgeinfo[id_mode][id_zone] = ([], []) + + return self._mode_to_edgeinfo[id_mode][id_zone] + + def _get_edgeweights(self, ids_edge, n_edges_min_length, n_edges_max_length, priority_max, speed_max): + # print 'get_edgeweights ids_edge',ids_edge + edges = self.get_edges() + n_edges = len(ids_edge) + if (n_edges > n_edges_min_length) & (n_edges < n_edges_max_length): + return edges.lengths[ids_edge]*((edges.priorities[ids_edge] < priority_max) & (edges.speeds_max[ids_edge] < speed_max)) + else: + return np.ones(n_edges, dtype=np.float32)*((edges.priorities[ids_edge] < priority_max) & (edges.speeds_max[ids_edge] < speed_max)) def on_del_row(self, id_row=None): if id_row is not None: @@ -333,7 +303,8 @@ **kwargs ) - def generate_trips(self, demand, time_start, time_end, id_mode, + def generate_trips(self, demand, time_start, time_end, id_mode_primary, + id_mode_fallback=-1, pos_depart_default=db.OPTIONMAP_POS_DEPARTURE['random_free'], #pos_arrival_default = db.OPTIONMAP_POS_ARRIVAL['max'], pos_arrival_default=db.OPTIONMAP_POS_ARRIVAL['random'], @@ -345,12 +316,31 @@ ind_lane_arrival_default=db.OPTIONMAP_LANE_ARRIVAL['current'], n_trials_connect=5, is_make_route=True, + priority_max=10, + speed_max=14.0, + n_edges_min_length=1, + n_edges_max_length=500, ): """ Generates trips in demand.trip table. """ - print 'generate_trips', time_start, time_end, id_mode + print 'generate_trips', time_start, time_end, 'id_mode_primary', id_mode_primary, 'id_mode_fallback', id_mode_fallback id_mode_ped = MODES['pedestrian'] + zones = self.get_zones() + edges = self.get_edges() + # TODO: a bid crazy to pass demand as an argument here + trips = demand.trips + + # How to deal with fallback mode? calculate both wights separately, normalize commonly and assign separately + + # for id_zone in zones.get_ids(): + # print ' calculate edgeprops for id_zone',id_zone + # ids_edge, edgeprobs = self.get_zone_edgeinfo(id_mode_primary, id_zone, n_edges_min_length, n_edges_max_length, priority_max, speed_max) + # for id_edge, edgeprob in zip(ids_edge, edgeprobs): + # print ' id_edge',id_edge,'edgeprob',edgeprob + + # return True + #OPTIONMAP_POS_DEPARTURE = { -1:"random",-2:"free",-3:"random_free",-4:"base"} #OPTIONMAP_POS_ARRIVAL = { -1:"random",-2:"max"} #OPTIONMAP_SPEED_DEPARTURE = { -1:"random",-2:"max"} @@ -358,191 +348,154 @@ #OPTIONMAP_LANE_DEPART = {-1:"random",-2:"free",-3:"departlane"} #OPTIONMAP_LANE_ARRIVAL = { -1:"current"} - trips = demand.trips - #ids_vtype_mode = demand.vtypes.select_by_mode(id_mode) - ids_vtype_mode, prob_vtype_mode = demand.vtypes.select_by_mode( - id_mode, is_share=True) - # print ' ids_vtype_mode', ids_vtype_mode - n_vtypes = len(ids_vtype_mode) - zones = self.zones.get_value() - edges = zones.ids_edges_orig.get_linktab() - edgelengths = edges.lengths - - if n_trials_connect > 0: - # initialize routing to verify connection - fstar = edges.get_fstar(is_ignor_connections=False) - times = edges.get_times(id_mode=id_mode, is_check_lanes=True) + # define primary and secondary mode, if appropriate + # in case there is a secondary mode, the secondary mode is chosen + ids_vtype_mode_primary, prob_vtype_mode_primary = demand.vtypes.select_by_mode( + id_mode_primary, is_share=True) + print ' ids_vtype_mode_primary', ids_vtype_mode_primary, prob_vtype_mode_primary + n_vtypes_primary = len(ids_vtype_mode_primary) + + n_vtypes_fallback = 0 + if (id_mode_primary == MODES['passenger']) & (id_mode_fallback not in [-1, MODES['passenger']]): + ids_vtype_mode_fallback, prob_vtype_mode_fallback = demand.vtypes.select_by_mode( + id_mode_fallback, is_share=True) + # print ' ids_vtype_mode_fallback', ids_vtype_mode_fallback + n_vtypes_fallback = len(ids_vtype_mode_fallback) + is_fallback = True + else: + ids_vtype_mode_fallback = [] + id_mode_fallback = -1 + is_fallback = False + # print ' n_vtypes_primary',n_vtypes_primary,'n_vtypes_fallback',n_vtypes_fallback,'is_fallback',is_fallback + if n_vtypes_primary == 0: + print 'WARNING: no vehicle types for this mode with ID', id_mode_primary + return False + ids_od = self.get_ids() n_trips_generated = 0 - n_trips_failed = 0 + for id_od, id_orig, id_dest, tripnumber in \ + zip(ids_od, self.ids_orig[ids_od], self.ids_dest[ids_od], + np.array(self.tripnumbers[ids_od]+random.rand(len(ids_od)), dtype=np.int32), + ): + + print ' generate', tripnumber, ' trips from id_orig', id_orig, 'to id_dest', id_dest + + ids_edge_orig, weights_orig = self.get_zone_edgeinfo( + id_mode_primary, id_orig, n_edges_min_length, n_edges_max_length, priority_max, speed_max) + ids_edge_dest, weights_dest = self.get_zone_edgeinfo( + id_mode_primary, id_dest, n_edges_min_length, n_edges_max_length, priority_max, speed_max) + + n_edges_orig = len(ids_edge_orig) + n_edges_dest = len(ids_edge_dest) + # print ' n_edges_orig',n_edges_orig,len(weights_orig),'n_edges_dest',n_edges_dest,len(weights_dest) - is_nocon = False - route = [] - for id_od in self.get_ids(): - id_orig = self.ids_orig[id_od] - id_dest = self.ids_dest[id_od] - tripnumber = self.tripnumbers[id_od] - - ids_edges_orig_raw = zones.ids_edges_orig[id_orig] - ids_edges_dest_raw = zones.ids_edges_dest[id_dest] - - prob_edges_orig_raw = zones.probs_edges_orig[id_orig] - prob_edges_dest_raw = zones.probs_edges_dest[id_dest] - - # check accessibility of origin edges - ids_edges_orig = [] - prob_edges_orig = [] - inds_lane_orig = [] - for i in xrange(len(ids_edges_orig_raw)): - id_edge = ids_edges_orig_raw[i] - # if check accessibility... - ind_lane_depart = edges.get_laneindex_allowed(id_edge, id_mode) - # print ' get_laneindex_allowed',id_mode,id_edge,edges.ids_sumo[id_edge],ind_lane_depart - if ind_lane_depart >= 0: - ids_edges_orig.append(id_edge) - prob_edges_orig.append(prob_edges_orig_raw[i]) - inds_lane_orig.append(ind_lane_depart) - - # check accessibility of destination edges - ids_edges_dest = [] - prob_edges_dest = [] - inds_lane_dest = [] - for i in xrange(len(ids_edges_dest_raw)): - id_edge = ids_edges_dest_raw[i] - # if check accessibility... - ind_lane_arrival = edges.get_laneindex_allowed( - id_edge, id_mode) - if ind_lane_arrival >= 0: - ids_edges_dest.append(id_edge) - prob_edges_dest.append(prob_edges_dest_raw[i]) - inds_lane_dest.append(ind_lane_arrival) - - n_edges_orig = len(ids_edges_orig) - n_edges_dest = len(ids_edges_dest) - - if (n_edges_orig > 0) & (n_edges_dest > 0) & (tripnumber > 0): - # renormalize weights - prob_edges_orig = np.array(prob_edges_orig, np.float) - prob_edges_orig = prob_edges_orig/np.sum(prob_edges_orig) - prob_edges_dest = np.array(prob_edges_dest, np.float) - prob_edges_dest = prob_edges_dest/np.sum(prob_edges_dest) + if 1: # (n_edges_orig > 0) & (n_edges_dest > 0): + for i_trip in xrange(tripnumber): - for d in xrange(int(tripnumber+0.5)): time_depart = random.uniform(time_start, time_end) - if (n_trials_connect > 0) & (id_mode != id_mode_ped): - # check if origin and destination edges are connected - n = n_trials_connect - is_nocon = True - while (n > 0) & is_nocon: - # this algorithm can be improved by calculating - # the minimum cost tree and chacking all destinations - i_orig = np.argmax(random.rand( - n_edges_orig)*prob_edges_orig) - id_edge_orig = ids_edges_orig[i_orig] - i_dest = np.argmax(random.rand( - n_edges_dest)*prob_edges_dest) - id_edge_dest = ids_edges_dest[i_dest] - - cost, route = routing.get_mincostroute_edge2edge(id_edge_orig, - id_edge_dest, - weights=times, - fstar=fstar - ) - is_nocon = len(route) == 0 - n -= 1 - # print ' found route',len(route),n_trials_connect-n - if not is_make_route: - route = [] - else: - # no check if origin and destination edges are connected - i_orig = np.argmax(random.rand( - n_edges_orig)*prob_edges_orig) - id_edge_orig = ids_edges_orig[i_orig] - - i_dest = np.argmax(random.rand( - n_edges_dest)*prob_edges_dest) - id_edge_dest = ids_edges_dest[i_dest] - - if not is_nocon: - ind_lane_orig = inds_lane_orig[i_orig] - ind_lane_dest = inds_lane_dest[i_dest] - - pos_depart = pos_depart_default - pos_arrival = pos_arrival_default - # print ' bef:pos_depart,pos_arrival,id_mode,id_mode_ped', pos_depart,pos_arrival,id_mode,id_mode_ped - if id_mode_ped == id_mode: - # persons do not understand "random", "max" etc - # so produce a random number here - - #{ -1:"random",-2:"free",-3:"random_free",-4:"base"} - edgelength = edgelengths[id_edge_orig] - if pos_depart in (-1, -2, -3): - pos_depart = random.uniform( - 0.1*edgelength, 0.9*edgelength, 1)[0] - else: - pos_depart = 0.1*edgelength - - # { -1:"random",-2:"max"} - edgelength = edgelengths[id_edge_dest] - if pos_arrival == -1: - pos_arrival = random.uniform( - 0.1*edgelength, 0.9*edgelength, 1)[0] - else: - pos_arrival = 0.9*edgelength - # print ' af:pos_depart,pos_arrival,id_mode,id_mode_ped', pos_depart,pos_arrival,id_mode,id_mode_ped - # print ' n_vtypes',n_vtypes - # print ' random.randint(n_vtypes)',random.randint(n_vtypes) - #id_vtype = ids_vtype_mode[random.randint(n_vtypes)] - id_vtype = ids_vtype_mode[np.argmax( - random.rand(n_vtypes)*prob_vtype_mode)] - id_trip = trips.make_trip(id_vtype=id_vtype, - time_depart=time_depart, - id_edge_depart=id_edge_orig, - id_edge_arrival=id_edge_dest, - ind_lane_depart=ind_lane_orig, - ind_lane_arrival=ind_lane_dest, - position_depart=pos_depart, - position_arrival=pos_arrival, - speed_depart=speed_depart_default, - speed_arrival=speed_arrival_default, - route=route, - ) - # print ' ',id_trip,id_edge_orig,edges.ids_sumo[id_edge_orig],ind_lane_depart - # print ' ',id_trip,self.position_depart[id_trip], - n_trips_generated += 1 - else: - n_trips_failed += tripnumber - else: - n_trips_failed += tripnumber + id_vtype_primary = ids_vtype_mode_primary[np.argmax( + random.rand(n_vtypes_primary)*prob_vtype_mode_primary)] + id_trip = trips.make_trip(id_vtype=id_vtype_primary, + time_depart=time_depart, + id_edge_depart=ids_edge_orig[np.argmax( + random.rand(n_edges_orig)*weights_orig)], + id_edge_arrival=ids_edge_dest[np.argmax( + random.rand(n_edges_dest)*weights_dest)], + ind_lane_depart=ind_lane_depart_default, + ind_lane_arrival=ind_lane_arrival_default, + position_depart=pos_depart_default, + position_arrival=pos_arrival_default, + speed_depart=speed_depart_default, + speed_arrival=speed_arrival_default, + # route=route, + ) + + n_trips_generated += 1 + + print ' -----' print ' n_trips_generated', n_trips_generated - print ' n_trips_failed', n_trips_failed + print ' n_trips_failed', np.sum(self.tripnumbers[ids_od])-n_trips_generated + return True - def add_od_trips(self, scale, names_orig, names_dest, tripnumbers): - print 'OdTrips.add_od_trips' + def add_od_trips(self, scale, names_orig, names_dest, tripnumbers, + ids_zone_orig_filter=[], ids_zone_dest_filter=[], ids_zone_cross_filter=[], + dist_min=-1.0, dist_max=-1.0): + + is_filter_orig = len(ids_zone_orig_filter) > 0 + is_filter_dest = len(ids_zone_dest_filter) > 0 + is_filter_cross = len(ids_zone_cross_filter) > 0 + is_dist_min = dist_min > 0 + is_dist_max = dist_max > 0 + print 'OdTrips.add_od_trips', is_filter_orig, is_filter_dest, is_filter_cross + # print ' filter',ids_zone_orig_filter,ids_zone_dest_filter # print ' scale, names_orig, names_dest, tripnumbers',scale, names_orig, names_dest, tripnumbers,len(tripnumbers) zones = self.get_zones() for name_orig, name_dest, tripnumber in zip(names_orig, names_dest, tripnumbers): - # print ' check',name_orig, name_dest, tripnumbers,zones.ids_sumo.has_index(name_orig),zones.ids_sumo.has_index(name_dest) - if (zones.ids_sumo.has_index(name_orig)) & (zones.ids_sumo.has_index(name_dest)): - print ' add', zones.ids_sumo.get_id_from_index( - name_orig), zones.ids_sumo.get_id_from_index(name_dest) - self.add_row(ids_orig=zones.ids_sumo.get_id_from_index(name_orig), - ids_dest=zones.ids_sumo.get_id_from_index( - name_dest), - tripnumbers=scale * tripnumber) + is_add = (zones.ids_sumo.has_index(name_orig)) & (zones.ids_sumo.has_index(name_dest)) + # print ' check',name_orig, name_dest, tripnumber,is_add + + if is_add: + + id_zone_orig = zones.ids_sumo.get_id_from_index(name_orig) + id_zone_dest = zones.ids_sumo.get_id_from_index(name_dest) + # print ' id_zone_orig',id_zone_orig, id_zone_orig in ids_zone_orig_filter,'id_zone_dest',id_zone_dest, id_zone_dest in ids_zone_dest_filter + + if is_filter_orig: + is_add = (id_zone_orig in ids_zone_orig_filter) + + if is_add & is_filter_dest: + is_add = (id_zone_dest in ids_zone_dest_filter) + + if is_add & is_filter_cross: + is_add = False + line = (zones.coords[id_zone_orig], zones.coords[id_zone_dest]) + # print ' line',line + for shape in zones.shapes[ids_zone_cross_filter]: + # print ' intersect',shape,is_polyline_intersect_polygon(line, shape, is_lineinterpolate = True) + if is_polyline_intersect_polygon(line, shape, is_lineinterpolate=True): + is_add = True + break + + if is_add & is_dist_max: + is_add = np.sqrt(np.sum((zones.coords[id_zone_orig] - zones.coords[id_zone_dest])**2)) < dist_max + + if is_add & is_dist_min: + is_add = np.sqrt(np.sum((zones.coords[id_zone_orig] - zones.coords[id_zone_dest])**2)) > dist_min + + if is_add: + + # ----- + n_trips_scale = float(scale * tripnumber) + n_trips_scale_int = int(n_trips_scale) + n_trips_scale_dec = float(n_trips_scale - n_trips_scale_int) + n_random = random.random() + if n_random > n_trips_scale_dec: + n_trips_scale_fin = int(n_trips_scale_int) + else: + n_trips_scale_fin = int(n_trips_scale_int + 1) + # ----- + print ' add from', name_orig, 'to', name_dest, 'tripnumber', n_trips_scale_fin + + self.add_row(ids_orig=id_zone_orig, + ids_dest=id_zone_dest, + tripnumbers=n_trips_scale_fin) # prima c'era (tripnumbers = scale*tripnumber) else: - print ' WARNING: zone named %s or %s not known' % ( - name_orig, names_dest) - print ' zones indexmap', zones.get_indexmap() - print ' ids_sumo', zones.ids_sumo.get_value() - print ' ids_sumo._index_to_id', zones.ids_sumo._index_to_id + if not ((zones.ids_sumo.has_index(name_orig)) & (zones.ids_sumo.has_index(name_dest))): + print ' WARNING: zone named %s or %s not known' % ( + name_orig, name_dest) + # print ' zones indexmap', zones.get_indexmap() + # print ' ids_sumo', zones.ids_sumo.get_value() + # print ' ids_sumo._index_to_id', zones.ids_sumo._index_to_id def get_zones(self): return self.ids_dest.get_linktab() + def get_edges(self): + return self.get_zones().parent.parent.net.edges + class OdModes(am.ArrayObjman): def __init__(self, ident, parent, modes, zones, **kwargs): @@ -578,7 +531,7 @@ self.odtrips[id_od_mode].generate_odflows( odflowtab, time_start, time_end, self.ids_mode[id_od_mode], **kwargs) - def add_od_trips(self, id_mode, scale, names_orig, names_dest, tripnumbers): + def add_od_trips(self, id_mode, scale, names_orig, names_dest, tripnumbers, **kwargs): # print 'OdModes.add_od_trips',id_mode, scale, names_orig, names_dest, tripnumbers ids_mode = self.select_ids(self.ids_mode.get_value() == id_mode) if len(ids_mode) == 0: @@ -587,13 +540,13 @@ odtrips = OdTrips((self.odtrips.attrname, id_od_modes), self, self.zones.get_value()) self.odtrips[id_od_modes] = odtrips - odtrips.add_od_trips(scale, names_orig, names_dest, tripnumbers) + odtrips.add_od_trips(scale, names_orig, names_dest, tripnumbers, **kwargs) return odtrips else: id_od_modes = ids_mode[0] # modes are unique # print ' use',id_od_modes self.odtrips[id_od_modes].add_od_trips( - scale, names_orig, names_dest, tripnumbers) + scale, names_orig, names_dest, tripnumbers, **kwargs) return self.odtrips[id_od_modes] @@ -655,12 +608,13 @@ self.add(cm.ObjConf(zones, is_child=False, groups=['_private'])) # print 'OdIntervals.__init__',self,dir(self) - def generate_trips(self, **kwargs): + def generate_trips(self, is_refresh_zoneedges=True, **kwargs): """ Generates trips in trip table. """ - # make sure zone edges are up to date - self.get_zones().refresh_zoneedges() + if is_refresh_zoneedges: + # make sure zone edges are up to date + self.get_zones().refresh_zoneedges() demand = self.parent for id_inter in self.get_ids(): self.odmodes[id_inter].generate_trips(demand, self.times_start[id_inter], @@ -682,12 +636,146 @@ **kwargs) return odflowtab + def write_xml(self, fd=None, indent=0): + ft = self.generate_odflows() + scenario = self.parent.parent + ids_zone_sumo = scenario.landuse.zones.ids_sumo + get_vtype_for_mode = scenario.demand.vtypes.get_vtype_for_mode + ids = ft.get_ids() + fd.write(xm.begin('trips', indent)) + self.parent.vtypes.write_xml(fd, indent=indent, + #ids = ids_vtype_selected, + is_print_begin_end=False) + + for id_flow, time_start, time_end, id_mode, id_orig_sumo, id_dest_sumo, tripnumber in zip( + ids, ft.times_start[ids], ft.times_end[ids], ft.ids_mode[ids], + ids_zone_sumo[ft.ids_orig[ids]], ids_zone_sumo[ft.ids_dest[ids]], + ft.tripnumbers[ids]): + + # + + fd.write(xm.start('flow', indent + 2)) + fd.write(xm.num('id', id_flow)) + fd.write(xm.num('begin', time_start)) + fd.write(xm.num('end', time_end)) + fd.write(xm.num('number', tripnumber)) + + fd.write(xm.num('fromTaz', id_orig_sumo)) + fd.write(xm.num('toTaz', id_dest_sumo)) + fd.write(xm.num('type', get_vtype_for_mode(id_mode=id_mode, is_sumoid=True))) + + fd.write(xm.stopit()) + + fd.write(xm.end('trips', indent)) + + def get_flowfilepath(self): + return self.parent.parent.get_rootfilepath()+'.flow.xml' + + def get_amitranfilepath(self): + return self.parent.parent.get_rootfilepath()+'.ami.xml' + + def export_amitranxml(self, filepath=None, encoding='UTF-8'): + """ + Export flows to Amitran format that defines the demand per OD pair in time slices for every vehicle type. + """ + print 'export_amitranxml', filepath, len(self) + + if len(self) == 0: + return None + + if filepath is None: + filepath = self.get_amitranfilepath() + + try: + fd = open(filepath, 'w') + except: + print 'WARNING in export_sumoxml: could not open', filepath + return False + + indent = 0 + + ft = self.generate_odflows() + scenario = self.parent.parent + ids_zone_sumo = scenario.landuse.zones.ids_sumo + get_vtype_for_mode = scenario.demand.vtypes.get_vtype_for_mode + ids = ft.get_ids() + fd.write(xm.begin('demand', indent)) + # self.parent.vtypes.write_xml( fd, indent=indent, + # #ids = ids_vtype_selected, + # is_print_begin_end = False) + + # + # + # + # + # + # + # + + for id_flow, time_start, time_end, id_mode, id_orig_sumo, id_dest_sumo, tripnumber in zip( + ids, ft.times_start[ids], ft.times_end[ids], ft.ids_mode[ids], + ids_zone_sumo[ft.ids_orig[ids]], ids_zone_sumo[ft.ids_dest[ids]], + ft.tripnumbers[ids]): + + fd.write(xm.start('actorConfig', indent + 2)) + fd.write(xm.num('id', get_vtype_for_mode(id_mode=id_mode, is_sumoid=True))) + fd.write(xm.stop()) + + fd.write(xm.start('timeSlice', indent + 4)) + fd.write(xm.num('duration', int(time_end-time_start))) + fd.write(xm.num('startTime', int(time_start))) + fd.write(xm.stop()) + + fd.write(xm.start('odPair', indent + 6)) + fd.write(xm.num('origin', id_orig_sumo)) + fd.write(xm.num('destination', id_dest_sumo)) + fd.write(xm.num('amount', int(tripnumber))) + fd.write(xm.stopit()) + + fd.write(xm.end('timeSlice', indent + 4)) + + fd.write(xm.end('actorConfig', indent + 2)) + + fd.write(xm.end('demand', indent)) + + fd.close() + return filepath + + def export_sumoxml(self, filepath=None, encoding='UTF-8'): + """ + Export flows to SUMO xml file formate. + """ + print 'export_sumoxml', filepath, len(self) + if len(self) == 0: + return None + + if filepath is None: + filepath = self.get_flowfilepath() + + try: + fd = open(filepath, 'w') + except: + print 'WARNING in export_sumoxml: could not open', filepath + return False + #xmltag, xmltag_item, attrname_id = self.xmltag + #fd.write('\n'%encoding) + #fd.write('\n') + indent = 0 + #fd.write(xm.begin('routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.sf.net/xsd/routes_file.xsd"',indent)) + + self.write_xml(fd, indent=0) + + fd.close() + return filepath + def clear_od_trips(self): self.clear() def add_od_flows(self, t_start, t_end, id_mode, id_activitytype_orig, id_activitytype_dest, - scale, names_orig, names_dest, tripnumbers): + scale, names_orig, names_dest, tripnumbers, + ids_zone_orig_filter=[], ids_zone_dest_filter=[], ids_zone_cross_filter=[], + dist_min=-1.0, dist_max=-1.0): # print 'OdIntervals.add_od_flows',t_start, t_end, id_mode, scale ids_inter = self.select_ids( @@ -711,7 +799,10 @@ self.odmodes[id_inter] = odmodes odtrips = odmodes.add_od_trips( - id_mode, scale, names_orig, names_dest, tripnumbers) + id_mode, scale, names_orig, names_dest, tripnumbers, + ids_zone_orig_filter=ids_zone_orig_filter, ids_zone_dest_filter=ids_zone_dest_filter, + ids_zone_cross_filter=ids_zone_cross_filter, + dist_min=dist_min, dist_max=dist_max) return odtrips else: @@ -719,7 +810,10 @@ id_inter = ids_inter[0] # print ' use',id_inter odtrips = self.odmodes[id_inter].add_od_trips( - id_mode, scale, names_orig, names_dest, tripnumbers) + id_mode, scale, names_orig, names_dest, tripnumbers, + ids_zone_orig_filter=ids_zone_orig_filter, ids_zone_dest_filter=ids_zone_dest_filter, + ids_zone_cross_filter=ids_zone_cross_filter, + dist_min=dist_min, dist_max=dist_max) return odtrips def add_od_flow(self, t_start, t_end, id_mode, @@ -741,8 +835,156 @@ def get_zones(self): return self.zones.get_value() + def get_edges(self): + return self.get_zones().ids_edges_inside.get_linktab() + + def get_od_matrix(self, id_interval, id_odmode, ids_zone): + od_matrix = np.zeros((len(ids_zone), len(ids_zone))) +## id_odmode = self.odmodes[id_interval].ids_mode.get_id_from_index(odmode) + od_matrix_ids = self.odmodes[id_interval].odtrips[id_odmode].get_ids() + i = 0 + j = 0 + for id_zonei in ids_zone: + for id_zonej in ids_zone: + for od_matrix_id in od_matrix_ids: + od_trip = self.odmodes[id_interval].odtrips[id_odmode].get_row(od_matrix_id) + id_dest = od_trip['ids_dest'] + id_orig = od_trip['ids_orig'] + + if id_orig == id_zonei and id_dest == id_zonej: + tripnumber = od_trip['tripnumbers'] + od_matrix[i, j] += tripnumber + break + j += 1 + # print 'j', j + j = 0 + i += 1 + # print 'i', i + ## od_matrix = self.odmodes[id_interval].odtrips[id_odmode] + # print od_matrix + return od_matrix + def get_modes(self): return self.net.get_value().modes def get_activitytypes(self): return self.parent.activitytypes + + +class OdTripgenerator(db.TripoptionMixin, CmlMixin, Process): + def __init__(self, odintervals, logger=None, **kwargs): + + self._init_common('odtripgenerator', name='OD Trip generator', + parent=odintervals, + logger=logger, + info='Generates trips from OD flows.', + ) + + self.init_cml(' ') # pass no commad to generate options only + + attrsman = self.get_attrsman() + + self.is_clear_trips = attrsman.add(am.AttrConf('is_clear_trips', True, + groupnames=['options'], + perm='rw', + name='Clear trips', + info='Clear all trips in current trips database before routing.', + )) + + self.is_refresh_zoneedges = attrsman.add(am.AttrConf('is_refresh_zoneedges', True, + groupnames=['options'], + perm='rw', + name='Refresh zone edges', + info="""Identify all edges in all zones before generating the trips. + Dependent on the will take some time.""", + )) + + self.is_make_route = attrsman.add(am.AttrConf('is_make_route', True, + groupnames=['options'], + perm='rw', + name='Make also routes', + info="""Perform also a shortes distance routing between edge of origin and edge of destination.""", + )) + + self.n_trials_connect = attrsman.add(am.AttrConf('n_trials_connect', 5, + groupnames=['options'], + perm='rw', + name='Connect trials', + info="""Number of triels to connect randomly chosen + origin- and destination edges with valid routes.""", + )) + + modechoices = odintervals.parent.parent.net.modes.names.get_indexmap() + modechoices['No fallback'] = -1 + # print ' modechoices',modechoices + self.id_mode_fallback = attrsman.add(am.AttrConf('id_mode_fallback', modechoices['No fallback'], + groupnames=['options'], + choices=modechoices, + name='Fallback Mode', + info="""Transport mode to be used instead of "passenger" mode + in case the origin and destination cannot be connected by a route. + This is typically the case with origins or destinations + in traffic restricted zones. + Coose for example "taxi" to get access to traffic restricted Zones. + """, + )) + + # priority_max.get_value()) & (edges.speeds_max[ids_edge] < self.speed_max.get_value())) + self.priority_max = attrsman.add(cm.AttrConf('priority_max', 8, + groupnames=['options'], + name='Max. edge priority', + perm='rw', + info="Maximum edge priority for which edges in a zone are considered departure or arrival edges.", + )) + + self.speed_max = attrsman.add(cm.AttrConf('speed_max', 14.0, + groupnames=['options'], + name='Max. edge speed', + perm='rw', + unit='m/s', + info="Maximum edge speed for which edges in a zone are considered departure or arrival edges.", + )) + + self.n_edges_min_length = attrsman.add(cm.AttrConf('n_edges_min_length', 1, + groupnames=['options'], + name='Min. edge number length prob.', + perm='rw', + info="Edge arrival/departure probability is proportional to the edge length if the number of zone edges is above this minimum number zone edges. Otherwise probability is proportional to the number of zone edges.", + )) + + self.n_edges_max_length = attrsman.add(cm.AttrConf('n_edges_max_length', 500, + groupnames=['options'], + name='Max. edge number length prob.', + perm='rw', + info="Edge arrival/departure probability is proportional to the edge length if the number of zone edges is below this maximum number zone edges. Otherwise probability is proportional to the number of zone edges.", + )) + + self.add_posoptions() + self.add_laneoptions() + self.add_speedoptions() + + def do(self): + + if self.is_clear_trips: + self.parent.parent.trips.clear_trips() + + cml = self.get_cml() + + self.parent.generate_trips( + id_mode_fallback=self.id_mode_fallback, + is_refresh_zoneedges=self.is_refresh_zoneedges, + pos_depart_default=self.pos_depart, + pos_arrival_default=self.pos_arrival, + speed_depart_default=self.speed_depart, + speed_arrival_default=self.speed_arrival, + ind_lane_depart_default=self.ind_lane_depart, + ind_lane_arrival_default=self.ind_lane_arrival, + n_trials_connect=self.n_trials_connect, + is_make_route=self.is_make_route, + priority_max=self.priority_max, + speed_max=self.speed_max, + n_edges_min_length=self.n_edges_min_length, + n_edges_max_length=self.n_edges_max_length, + ) + + return True diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination_wxgui-01.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination_wxgui-01.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination_wxgui-01.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination_wxgui-01.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,567 +0,0 @@ -# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. -# SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM -# 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 origin_to_destination_wxgui-01.py -# @author Joerg Schweizer -# @date - -import wx - - -import agilepy.lib_base.classman as cm -import agilepy.lib_base.arrayman as am -from agilepy.lib_wx.ogleditor import * -from agilepy.lib_wx.objpanel import ObjPanel -from coremodules.network.network import SumoIdsConf, MODES - - -class OdCommonMixin: - def add_odoptions_common(self, odintervals): - self.add(am.AttrConf('t_start', 0, - groupnames=['options'], - perm='rw', - name='Start time', - unit='s', - info='Start time of interval', - )) - - self.add(am.AttrConf('t_end', 3600, - groupnames=['options'], - perm='rw', - name='End time', - unit='s', - info='End time of interval', - )) - - # here we ged classes not vehicle type - # specific vehicle type within a class will be generated later - self.add(am.AttrConf('id_mode', MODES['passenger'], - groupnames=['options'], - choices=odintervals.parent.vtypes.get_modechoices(), - name='Mode', - info='Transport mode.', - )) - - self.add(cm.AttrConf('scale', 1.0, - groupnames=['options'], - perm='rw', - name='Scale', - info='Scale demand by this factor before adding. Value od 1.0 means no scaling.' - )) - - -class OdFlowsWxGuiMixin: - """Contains OdFlow spacific functions that communicate between the widgets of the main wx gui - and the functions of the plugin. - """ - - def add_menu_odflows(self, menubar): - menubar.append_menu('demand/Zone-to-zone demand', - bitmap=self.get_icon("icon_odm.png"), - ) - menubar.append_item('demand/Zone-to-zone demand/add zone-to-zone flows...', - self.on_add_odtrips, - info='Add or import trips between origin and destination zones, with a certain mode during a certain time interval.', - bitmap=self.get_icon("Document_Import_24px.png"), - ) - - menubar.append_item('demand/Zone-to-zone demand/generate trips from flows', - self.on_generate_odtrips, - info=self.on_generate_odtrips.__doc__.strip(), - #bitmap = wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE_AS,wx.ART_MENU), - ) - - menubar.append_item('demand/Zone-to-zone demand/clear zone-to-zone flows', - self.on_clear_odtrips, - info='Clear all zone to zone trips.', - bitmap=wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_MENU), - ) - - def on_add_odtrips(self, event=None): - """ - Opend odm wizzard - """ - dlg = AddOdDialog(self._mainframe, self._demand.odintervals) - dlg.Show() - dlg.MakeModal(True) - self._mainframe.browse_obj(self._demand.odintervals) - # self.scenariopanel.refresh_panel(self.scenario) - - def on_generate_odtrips(self, event=None): - """ - Generates trips from origin to destination zone from current OD matrices. - """ - self._demand.odintervals.generate_trips() - self._mainframe.browse_obj(self._demand.trips) - event.Skip() - - def on_clear_odtrips(self, event=None): - """ - Generates trips from origin to destination zone from current OD matrices. - """ - self._demand.odintervals.clear_od_trips() - self._mainframe.browse_obj(self._demand.odintervals) - event.Skip() - - -class AddODflowTool(OdCommonMixin, SelectTool): - """ - OD flow toolfor OGL canvas. - """ - - def __init__(self, parent, odintervals=None, mainframe=None): - """ - To be overridden by specific tool. - """ - self.init_common('odflow', parent, 'Add OD flow', - info='Click on the respective borderlines of zone of origin, and zone of destination, enter time interval, mode and the number of trips as options an press "add OD flows', - is_textbutton=False, - ) - - self._init_select(is_show_selected=False) - self.odintervals = odintervals - - #self.drawobj_zone_orig = None - #self.drawobj_zone_dest = None - self.add_odoptions_common(odintervals) - # make options - self.add(cm.AttrConf('name_orig', '', - groupnames=['options'], - choices=[''], - name='Orig zone', - info='Name of traffic assignment zone of origin of trip.', - )) - - self.add(cm.AttrConf('name_dest', '', - dtype='object', - groupnames=['options'], - choices=[''], - name='Dest zone', - info='Name of traffic assignment zone of destination of trip.', - )) - - self.add(cm.AttrConf('tripnumber', 0, - groupnames=['options'], - perm='rw', - name='Trips', - info='Number of trips from zone of origin to zone of destination.', - )) - - def set_button_info(self, bsize=(32, 32)): - # print 'set_button_info select tool' self.get_icon("icon_sumo_24px.png") - iconpath = os.path.join(os.path.dirname(__file__), 'images') - self._bitmap = wx.Bitmap(os.path.join(iconpath, 'icon_odm.png'), wx.BITMAP_TYPE_PNG) - self._bitmap_sel = self._bitmap - - def activate(self, canvas=None): - """ - This call by metacanvas??TooldsPallet signals that the tool has been - activated and can now interact with metacanvas. - """ - - SelectTool.activate(self, canvas) - zonenames = list(self.odintervals.get_zones().ids_sumo.get_value()) - zonenames.append('') # append choice for empty, otherwise error - # print 'AddODflowTool.activate',zonenames - self.name_orig.choices = zonenames - self.name_dest.choices = zonenames - - def on_execute_selection(self, event): - """ - Definively execute operation on currently selected drawobjects. - """ - # print 'AddODflowTool.on_execute_selection',self.get_netelement_current() - # self.set_objbrowser() - # self.highlight_current() - # self.unhighlight_current() - - netelement_current = self.get_netelement_current() - if netelement_current is not None: - (zones, id_zone) = netelement_current - if zones.get_ident() == 'zones': - # print ' check',self.name_orig.get_value(),'*',self.name_orig.get_value() is '' - if self.name_orig.get_value() is '': - # print ' set name_orig',zones.ids_sumo[id_zone] - self.name_orig.set_value(zones.ids_sumo[id_zone]) - - else: - # print ' set name_dest',zones.ids_sumo[id_zone] - self.name_dest.set_value(zones.ids_sumo[id_zone]) - - self.unselect_all() # includes unhighlight - self.get_drawing().highlight_element(zones, id_zone, is_update=True) - self.parent.refresh_optionspanel(self) - return True - - def on_change_selection(self, event): - """ - Called after selection has been changed with SHIFT-click - Do operation on currently selected drawobjects. - """ - # self.set_objbrowser() - return False - - def get_netelement_current(self): - mainframe = self.parent.get_mainframe() - if mainframe is not None: - drawobj, _id = self.get_current_selection() - if drawobj is not None: - obj = drawobj.get_netelement() - return obj, _id - else: - return None - else: - return None - - def on_add_new(self, event=None): - self._optionspanel.apply() - odtrips = self.odintervals.add_od_flow(self.t_start.value, self.t_end.value, - self.id_mode.value, self.scale.value, - self.name_orig.value, self.name_dest.value, - self.tripnumber.value - ) - mainframe = self.parent.get_mainframe() - if mainframe is not None: - mainframe.browse_obj(odtrips) - self.name_dest.set_value("") # set empty zone - self.unselect_all() - self.parent.refresh_optionspanel(self) - - def on_clear_zones(self, event=None): - self.name_orig.set_value("") # set empty zone - self.name_dest.set_value("") # set empty zone - self.unselect_all() - self.parent.refresh_optionspanel(self) - - def get_optionspanel(self, parent, size=wx.DefaultSize): - """ - Return tool option widgets on given parent - """ - size = (200, -1) - buttons = [('Add flow', self.on_add_new, 'Add a new OD flow to demand.'), - ('Clear Zones', self.on_clear_zones, 'Clear the fields with zones of origin and destination.'), - #('Save flows', self.on_add, 'Save OD flows to current demand.'), - #('Cancel', self.on_close, 'Close wizzard without adding flows.'), - ] - defaultbuttontext = 'Add flow' - self._optionspanel = ObjPanel(parent, obj=self, - attrconfigs=None, - groupnames=['options'], - func_change_obj=None, - show_groupnames=False, show_title=True, is_modal=False, - mainframe=self.parent.get_mainframe(), - pos=wx.DefaultPosition, size=size, style=wx.MAXIMIZE_BOX | wx.RESIZE_BORDER, - immediate_apply=True, panelstyle='default', # 'instrumental' - buttons=buttons, defaultbutton=defaultbuttontext, - standartbuttons=[], # standartbuttons=['restore'] - ) - - return self._optionspanel - - -class AddOdWizzard(OdCommonMixin, am.ArrayObjman): - """Contains information and methods to add an od matrix for - a certain mode and for a certain time interval to the scenario. - """ - - def __init__(self, odintervals): - # print 'AddOdWizzard',odintervals#,odintervals.times_start - # print ' ',dir(odintervals) - zones = odintervals.get_zones() - - self._init_objman('odm_adder', parent=odintervals, - name='ODM Wizzard', - info='Wizzard to add origin zone to destination zone demand informations.', - ) - - self.add_odoptions_common(odintervals) - - self.add_col(am.ArrayConf('names_orig', '', - dtype='object', - groupnames=['state'], - choices=list(zones.ids_sumo.get_value()), - name='Orig zone', - info='Name of traffic assignment zone of origin of trip.', - )) - - self.add_col(am.ArrayConf('names_dest', '', - dtype='object', - groupnames=['state'], - choices=list(zones.ids_sumo.get_value()), - name='Dest zone', - info='Name of traffic assignment zone of destination of trip.', - )) - - self.add_col(am.ArrayConf('tripnumbers', 0, - groupnames=['state'], - perm='rw', - name='Trips', - info='Number of trips from zone of origin to zone of destination.', - xmltag='tripnumber', - )) - - self.add(cm.FuncConf('func_make_row', 'on_add_row', None, - groupnames=['rowfunctions', '_private'], - name='New OD flow.', - info='Add a new OD flow.', - )) - - self.add(cm.FuncConf('func_delete_row', 'on_del_row', None, - groupnames=['rowfunctions', '_private'], - name='Del OD flow', - info='Delete OD flow.', - )) - - # self.attrs.print_attrs() - - def on_del_row(self, id_row): - # print 'on_del_row', id_row - if id_row is not None: - self.del_row(id_row) - - def on_add_row(self, id=None): - if len(self) > 0: - # copy previous - od_last = self.get_row(self.get_ids()[-1]) - #id_orig = self.odtab.ids_orig.get(id_last) - #id_dest = self.odtab.ids_dest.get(id_last) - #id = self.suggest_id() - self.add_row(**od_last) - else: - # create empty - self.add_row() - - def add_demand(self): - """ - Add demand to scenario. - """ - # print 'AddOdm.add_demand' - odintervals = self.parent - #demand = self._scenario.demand - # odm={} # create a temporary dict with (o,d) as key and trips as value - ids = self.get_ids() - odintervals.add_od_flows(self.t_start.value, self.t_end.value, - self.id_mode.value, self.scale.value, - self.names_orig[ids], self.names_dest[ids], self.tripnumbers[ids] - ) - - def import_csv(self, filepath, sep=",", n_firstline=1): - names_zone = self.parent.get_zones().ids_sumo - f = open(filepath, 'r') - # print ' open',filepath - i_line = n_firstline - for line in f.readlines(): - # print ' ',line, - cols = line.split(sep) - if len(cols) == 3: - name_orig, name_dest, tripnumbers_str = cols - - name_orig = name_orig.strip() - name_dest = name_dest.strip() - if names_zone.has_index(name_orig) & names_zone.has_index(name_dest): - id_new = self.suggest_id() - self.add_row(id_new, - names_orig=name_orig, - names_dest=name_dest, - tripnumbers=int(tripnumbers_str) - ) - else: - print 'WARNING: unknown zonename in line %d of file %s' % (i_line, filepath) - - else: - if len(cols) != 0: - print 'WARNING: inconsistent o,d,trips info in line %d of file %s' % (i_line, filepath) - i_line += 1 - # self.odtab.print_rows() - f.close() - - -class AddOdDialog(wx.Frame): - - """ - A frame used for the ObjBrowser Demo - - """ - - def __init__(self, parent, odintervals): - wx.Frame.__init__(self, parent, -1, title='Add OD flow Wizzard', pos=wx.DefaultPosition, size=wx.DefaultSize) - self.wizzard = AddOdWizzard(odintervals) - self.parent = parent - # Set up the MenuBar - MenuBar = wx.MenuBar() - - file_menu = wx.Menu() - item = file_menu.Append(-1, "&Import CSV...", - "Import OD data from a CSV text file with format , ,") - self.Bind(wx.EVT_MENU, self.on_import_csv, item) - #item = file_menu.Append(-1, "&Import Exel...","Import OD data from an Exel file.") - #self.Bind(wx.EVT_MENU, self.on_import_exel, item) - - item = file_menu.Append(-1, "&Save flows and close", "Add OD flows to scenario and close wizzard") - self.Bind(wx.EVT_MENU, self.on_add, item) - - item = file_menu.Append(-1, "&Close", "Close wizzard withot saving") - self.Bind(wx.EVT_MENU, self.on_close, item) - - MenuBar.Append(file_menu, "&File") - - edit_menu = wx.Menu() - item = edit_menu.Append(-1, "&Add OD flow to table", - "Add a new flow by defining zones of origin, destination and number of trips in table") - self.Bind(wx.EVT_MENU, self.on_add_new, item) - MenuBar.Append(edit_menu, "&Edit") - - if odintervals.get_net().parent is not None: - self.dirpath = odintervals.get_net().parent.get_workdirpath() - else: - self.dirpath = os.getcwd() - - #help_menu = wx.Menu() - # item = help_menu.Append(-1, "&About", - # "More information About this program") - #self.Bind(wx.EVT_MENU, self.on_menu, item) - #MenuBar.Append(help_menu, "&Help") - - self.SetMenuBar(MenuBar) - - self.CreateStatusBar() - - self.browser = self.make_browser() - - # Create a sizer to manage the Canvas and message window - MainSizer = wx.BoxSizer(wx.VERTICAL) - MainSizer.Add(self.browser, 4, wx.EXPAND) - - self.SetSizer(MainSizer) - self.Bind(wx.EVT_CLOSE, self.on_close) - - self.EventsAreBound = False - - # getting all the colors for random objects - # wxlib.colourdb.updateColourDB() - #self.colors = wxlib.colourdb.getColourList() - - return None - - def make_browser(self): - # Create Browser widget here - buttons = [ # ('Add new OD flow', self.on_add_new, 'Add a new flow by defining zones of origin, destination and number of trips in table.'), - ('Save flows', self.on_add, 'Save OD flows to current demand.'), - ('Cancel', self.on_close, 'Close wizzard without adding flows.'), - ] - defaultbuttontext = 'Save flows' - # standartbuttons=['cancel','apply','ok']# apply does not show - standartbuttons = ['apply'] - - browser = ObjPanel(self, self.wizzard, - attrconfigs=None, - id=None, ids=None, - groupnames=None, - func_change_obj=None, - show_groupnames=False, show_title=False, - is_modal=True, - mainframe=None, - pos=wx.DefaultPosition, - size=wx.DefaultSize, - style=wx.MAXIMIZE_BOX | wx.RESIZE_BORDER, - immediate_apply=False, # True, - panelstyle='default', - buttons=buttons, - standartbuttons=standartbuttons, - defaultbutton=defaultbuttontext, - ) - return browser - - def on_import_csv(self, event=None): - # print 'on_import_csv' - self.browser.apply() - wizzard = self.browser.obj - - wildcards_all = "CSV files (*.csv)|*.csv|CSV files (*.txt)|*.txt|All files (*.*)|*.*" # +"|"+otherwildcards - dlg = wx.FileDialog(self.parent, message="Import CSV file", - defaultDir=self.dirpath, - defaultFile="", - wildcard=wildcards_all, - style=wx.OPEN | wx.MULTIPLE | wx.CHANGE_DIR - ) - - # Show the dialog and retrieve the user response. If it is the OK response, - # process the data. - if dlg.ShowModal() == wx.ID_OK: - # This returns a Python list of files that were selected. - paths = dlg.GetPaths() - # print 'You selected %d files:' % len(paths) - if len(paths) > 0: - filepath = paths[0] - else: - filepath = '' - dlg.Destroy() - else: - return - ### - wizzard.import_csv(filepath) - ## - - self.refresh_browser() - # event.Skip() - self.Raise() - # self.SetFocus() - # self.MakeModal(False) - # self.MakeModal(True) - # self.browser.restore() - - def on_add_new(self, event=None): - # print 'on_add,AddOdm',self.browser.obj - self.browser.apply() # important to transfer widget values to obj! - wizzard = self.browser.obj - wizzard.on_add_row() - self.refresh_browser() - - def on_add(self, event=None): - # print 'on_add,AddOdm',self.browser.obj - self.browser.apply() # important to transfer widget values to obj! - wizzard = self.browser.obj - wizzard.add_demand() - - self.on_close(event) - - def on_close(self, event=None): - self.MakeModal(False) - self.Destroy() - pass - - def on_add_close(self, event=None): - self.on_add() - self.on_close() - - def refresh_browser(self): - """ - Deletes previous conents - Builds panel for obj - Updates path window and history - """ - # print 'Wizzard.refresh_panel with',obj.ident - # remove previous obj panel - sizer = self.GetSizer() - sizer.Remove(0) - self.browser.Destroy() - #del self.browser - self.browser = self.make_browser() - - sizer.Add(self.browser, 1, wx.GROW) - - self.Refresh() - # sizer.Fit(self) - sizer.Layout() - # add to history diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination_wxgui.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination_wxgui.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination_wxgui.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/origin_to_destination_wxgui.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,23 +14,25 @@ # @file origin_to_destination_wxgui.py # @author Joerg Schweizer -# @date +# @date 2012 import wx - - +from agilepy.lib_wx.processdialog import ProcessDialog, ProcessDialogInteractive +from coremodules.demand import origin_to_destination_mpl +from coremodules.misc.matplottools import ResultDialog import agilepy.lib_base.classman as cm import agilepy.lib_base.arrayman as am from agilepy.lib_base.misc import get_inversemap from agilepy.lib_wx.ogleditor import * from agilepy.lib_wx.objpanel import ObjPanel from coremodules.network.network import SumoIdsConf, MODES +import origin_to_destination as od class OdCommonMixin: - def add_odoptions_common(self, modes=None, activitytypes=None): - # print 'add_odoptions_common',modes - self.add(am.AttrConf('t_start', 0, + def add_odoptions_common(self, modes=None, activitytypes=None, **kwargs): + print 'add_odoptions_common', modes + self.add(am.AttrConf('t_start', kwargs.get('t_start', 0), groupnames=['options'], perm='rw', name='Start time', @@ -38,7 +40,7 @@ info='Start time of interval', )) - self.add(am.AttrConf('t_end', 3600, + self.add(am.AttrConf('t_end', kwargs.get('t_end', 3600), groupnames=['options'], perm='rw', name='End time', @@ -52,15 +54,17 @@ modechoices = {'': -1} else: modechoices = modes.names.get_indexmap() - # print ' modechoices',modechoices - self.add(am.AttrConf('id_mode', -1, + # not in use updated in activate tool + # print ' modechoices',modechoices + # print ' modes.names.get_value()',modes.names.get_value() + self.add(am.AttrConf('id_mode', kwargs.get('id_mode', -1), groupnames=['options'], choices=modechoices, name='Mode', info='Transport mode.', )) - self.add(cm.AttrConf('scale', 1.0, + self.add(cm.AttrConf('scale', kwargs.get('scale', 1.0), groupnames=['options'], perm='rw', name='Scale', @@ -73,8 +77,8 @@ id_act_dest = -1 else: activitytypechoices = activitytypes.names.get_indexmap() - id_act_orig = activitytypes.names.get_id_from_index('home') - id_act_dest = activitytypes.names.get_id_from_index('work') + id_act_orig = activitytypes.names.get_id_from_index(kwargs.get('act_orig', 'home')) + id_act_dest = activitytypes.names.get_id_from_index(kwargs.get('act_dest', 'work')) self.add(cm.AttrConf('id_activitytype_orig', id_act_orig, groupnames=['options'], @@ -108,22 +112,31 @@ menubar.append_menu('demand/Zone-to-zone demand', bitmap=self.get_icon("fig_od_24px.png"), ) + menubar.append_item('demand/Zone-to-zone demand/add zone-to-zone flows...', self.on_add_odtrips, info='Add or import trips between origin and destination zones, with a certain mode during a certain time interval.', bitmap=self.get_agileicon("Document_Import_24px.png"), ) - menubar.append_item('demand/Zone-to-zone demand/generate trips from flows', + menubar.append_item('demand/Zone-to-zone demand/generate trips from flows...', self.on_generate_odtrips, - # info=self.on_generate_odtrips.__doc__.strip(), #bitmap = wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE_AS,wx.ART_MENU), ) - menubar.append_item('demand/Zone-to-zone demand/generate routes from flows, if connected', - self.on_generate_odroutes, - # info=self.on_generate_odtrips.__doc__.strip(), - #bitmap = wx.ArtProvider.GetBitmap(wx.ART_FILE_SAVE_AS,wx.ART_MENU), + menubar.append_item('demand/Zone-to-zone demand/export flows to SUMO XML...', + self.on_export_odflows_xml, + bitmap=self.get_agileicon("Document_Export_24px.png"), + ) + + menubar.append_item('demand/Zone-to-zone demand/export flows to Amitran XML...', + self.on_export_odflows_amitranxml, + bitmap=self.get_agileicon("Document_Export_24px.png"), + ) + + menubar.append_item('demand/Zone-to-zone demand/OD plots...', + self.on_od_plots, + bitmap=self.get_icon('icon_mpl.png'), ) menubar.append_item('demand/Zone-to-zone demand/clear zone-to-zone flows', @@ -142,21 +155,115 @@ self._mainframe.browse_obj(self._demand.odintervals) # self.scenariopanel.refresh_panel(self.scenario) - def on_generate_odtrips(self, event=None): + def on_od_plots(self, event=None): """ - Generates trips from origin to destination zone from current OD matrices. + Plot OD data with matplotlib. """ - self._demand.odintervals.generate_trips(n_trials_connect=-1, - is_make_route=False,) - self._mainframe.browse_obj(self._demand.trips) + p = origin_to_destination_mpl.OdPlots('odplots', self._demand, logger=self._mainframe.get_logger(),) + dlg = ResultDialog(self._mainframe, + p, + title='Od Plot') + + dlg.CenterOnScreen() + + # this does not return until the dialog is closed. + val = dlg.ShowModal() + # print ' val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL + # print ' status =',dlg.get_status() + if dlg.get_status() != 'success': # val == wx.ID_CANCEL: + # print ">>>>>>>>>Unsuccessful\n" + dlg.Destroy() + + if dlg.get_status() == 'success': + # print ">>>>>>>>>successful\n" + # apply current widget values to scenario instance + dlg.apply() + dlg.Destroy() +# p.plot_reallocation_needs() + + def on_export_odflows_xml(self, event=None): + """Export flows in SUMO trip XML format""", + + scenario = self.get_scenario() + wildcards_all = "All files (*.*)|*.*" + wildcards_xml = "SUMO xml files (*.flow.xml)|*.flow.xml|XML files (*.xml)|*.xml" + wildcards = wildcards_xml+"|"+wildcards_all + + # Finally, if the directory is changed in the process of getting files, this + # dialog is set up to change the current working directory to the path chosen. + dlg = wx.FileDialog( + self._mainframe, message="Choose xml file", + defaultDir=scenario.get_workdirpath(), + # defaultFile = scenario.get_rootfilepath()+'.poly.xml', + wildcard=wildcards, + style=wx.SAVE | wx.CHANGE_DIR + ) + + # Show the dialog and retrieve the user response. If it is the OK response, + # process the data. + if dlg.ShowModal() == wx.ID_OK: + # This returns a Python list of files that were selected. + path = dlg.GetPath() + # print 'You selected %d files:' % len(paths) + if path is not "": + self._demand.odintervals.export_sumoxml(path) + + dlg.Destroy() + + def on_export_odflows_amitranxml(self, event=None): + """Export flows in Amitran format that defines the demand per OD pair in time slices for every vehicle type""", + + scenario = self.get_scenario() + wildcards_all = "All files (*.*)|*.*" + wildcards_xml = "Amitran xml files (*.ami.xml)|*.ami.xml|XML files (*.xml)|*.xml" + wildcards = wildcards_xml+"|"+wildcards_all + + # Finally, if the directory is changed in the process of getting files, this + # dialog is set up to change the current working directory to the path chosen. + dlg = wx.FileDialog( + self._mainframe, message="Choose xml file", + defaultDir=scenario.get_workdirpath(), + # defaultFile = scenario.get_rootfilepath()+'.poly.xml', + wildcard=wildcards, + style=wx.SAVE | wx.CHANGE_DIR + ) + + # Show the dialog and retrieve the user response. If it is the OK response, + # process the data. + if dlg.ShowModal() == wx.ID_OK: + # This returns a Python list of files that were selected. + path = dlg.GetPath() + # print 'You selected %d files:' % len(paths) + if path is not "": + self._demand.odintervals.export_amitranxml(path) - def on_generate_odroutes(self, event=None): - """ - Generates routes from origin to destination zone from current OD matrices, if connected. + dlg.Destroy() + + def on_generate_odtrips(self, event=None): + """Generates trips and routes from origin to destination zone from current OD matrices. """ - self._demand.odintervals.generate_trips(n_trials_connect=5, - is_make_route=True,) - self._mainframe.browse_obj(self._demand.trips) + + p = od.OdTripgenerator(self._demand.odintervals, + logger=self._mainframe.get_logger() + ) + dlg = ProcessDialog(self._mainframe, p) + + dlg.CenterOnScreen() + + # this does not return until the dialog is closed. + val = dlg.ShowModal() + # print ' val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL + # print ' status =',dlg.get_status() + if dlg.get_status() != 'success': # val == wx.ID_CANCEL: + # print ">>>>>>>>>Unsuccessful\n" + dlg.Destroy() + + if dlg.get_status() == 'success': + # print ">>>>>>>>>successful\n" + # apply current widget values to scenario instance + dlg.apply() + dlg.Destroy() + self._mainframe.browse_obj(self._demand.trips) def on_clear_odtrips(self, event=None): """ @@ -241,7 +348,12 @@ self.id_orig.choices = zonenames self.id_dest.choices = zonenames + # these are the mode choices which have a defined vehicle type modechoices = self.get_scenario().demand.vtypes.get_modechoices() + + # these are all modes + #modechoices = self.get_scenario().net.modes.names.get_indexmap() + self.id_mode.set_value(modechoices['passenger']) self.id_mode.choices = modechoices @@ -379,7 +491,7 @@ """ size = (200, -1) buttons = [('Add flow', self.on_add_new, 'Add a new OD flow to demand.'), - ('Rest Zones', self.on_clear_zones, 'Clear the fields with zones of origin and destination.'), + ('Clear Zones', self.on_clear_zones, 'Clear the fields with zones of origin and destination.'), #('Save flows', self.on_add, 'Save OD flows to current demand.'), #('Cancel', self.on_close, 'Close wizzard without adding flows.'), ] @@ -404,7 +516,7 @@ a certain mode and for a certain time interval to the scenario. """ - def __init__(self, odintervals): + def __init__(self, odintervals, **kwargs): # print 'AddOdWizzard',odintervals#,odintervals.times_start # print ' dir(odintervals)',dir(odintervals) zones = odintervals.get_zones() @@ -414,7 +526,50 @@ info='Wizzard to add origin zone to destination zone demand informations.', ) - self.add_odoptions_common(odintervals.parent.get_scenario().net.modes, odintervals.parent.activitytypes) + self.add_odoptions_common(odintervals.parent.get_scenario().net.modes, + odintervals.parent.activitytypes, **kwargs) + + ids_zone = zones.get_ids() + zonechoices = {} + for id_zone, name_zone in zip(ids_zone, zones.ids_sumo[ids_zone]): + zonechoices[name_zone] = id_zone + # print ' zonechoices',zonechoices + # make for each possible pattern a field for prob + # if len(zonechoices) > 0: + self.add(cm.ListConf('ids_zone_orig_filter', kwargs.get('ids_zone_orig_filter', []), + groupnames=['options'], + choices=zonechoices, + name='Filter zones of origin', + info="""Filters flows if its origin is in one of these zones. If no zone is given, then no filtering takes place.""", + )) + + self.add(cm.ListConf('ids_zone_dest_filter', kwargs.get('ids_zone_dest_filter', []), + groupnames=['options'], + choices=zonechoices, + name='Filter zones of destination', + info="""Filters flows if its destination is in one of these zones. If no zone is given, then no filtering takes place.""", + )) + + self.add(cm.ListConf('ids_zone_cross_filter', kwargs.get('ids_zone_cross_filter', []), + groupnames=['options'], + choices=zonechoices, + name='Filter zones to cross', + info="""Filters flows if a straight line between origin and destination crosses at least one of these zones. If no zone is given, then no filtering takes place.""", + )) + + self.add(cm.AttrConf('dist_min', kwargs.get('dist_min', -1.0), + groupnames=['options'], + name='Filter zones with min. dist.', + unit='m', + info="""Filters flows if the straight line between origin and destination is greater than the given minimum distance. If negative, then no filtering takes place.""", + )) + + self.add(cm.AttrConf('dist_max', kwargs.get('dist_max', -1.0), + groupnames=['options'], + name='Filter zones with max. dist.', + unit='m', + info="""Filters flows if the straight line between origin and destination is less than the given minimum distance. If negative, then no filtering takes place.""", + )) self.add_col(am.ArrayConf('names_orig', '', dtype='object', @@ -475,17 +630,24 @@ """ Add demand to scenario. """ - # print 'AddOdm.add_demand' + print 'AddOdm.add_demand' + # print ' ids_zone_orig_filter',self.ids_zone_orig_filter.get_value() + # print ' ids_zone_dest_filter',self.ids_zone_dest_filter.get_value() odintervals = self.parent #demand = self._scenario.demand # odm={} # create a temporary dict with (o,d) as key and trips as value ids = self.get_ids() - odintervals.add_od_flows(self.t_start.value, self.t_end.value, - self.id_mode.value, - self.id_activitytype_orig.value, self.id_activitytype_dest.value, - self.scale.value, + odintervals.add_od_flows(self.t_start.value, self.t_end.get_value(), + self.id_mode.get_value(), + self.id_activitytype_orig.get_value(), self.id_activitytype_dest.get_value(), + self.scale.get_value(), self.names_orig[ids], self.names_dest[ids], - self.tripnumbers[ids] + self.tripnumbers[ids], + ids_zone_orig_filter=self.ids_zone_orig_filter.get_value(), + ids_zone_dest_filter=self.ids_zone_dest_filter.get_value(), + ids_zone_cross_filter=self.ids_zone_cross_filter.get_value(), + dist_min=self.dist_min.get_value(), + dist_max=self.dist_max.get_value(), ) #t_start, t_end, id_mode, @@ -629,7 +791,7 @@ wildcards_all = "CSV files (*.csv)|*.csv|CSV files (*.txt)|*.txt|All files (*.*)|*.*" # +"|"+otherwildcards dlg = wx.FileDialog(self.parent, message="Import CSV file", defaultDir=self.dirpath, - defaultFile="", + # defaultFile="", wildcard=wildcards_all, style=wx.OPEN | wx.MULTIPLE | wx.CHANGE_DIR ) diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/publictransportservices.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/publictransportservices.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/publictransportservices.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/publictransportservices.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file publictransportservices.py # @author Joerg Schweizer -# @date +# @date 2012 import os import sys @@ -23,6 +23,7 @@ import numpy as np +from numpy import random from collections import OrderedDict from coremodules.modules_common import * from coremodules.network.routing import get_mincostroute_edge2edge @@ -143,6 +144,54 @@ self.times_end.set_xmltag('end') self.times_begin.set_xmltag('begin') + def check_initial_stops(self): + """ + Check whether the initial stop of each line is on the first + edge of the route. If not, connect the berth edge with the + first edge of the route. This method is used as work around for a bug + in the PT line creation from GTFS. + """ + stops = self.get_ptstops() + net = self.get_net() + # get edge travel times for each PT mode + get_times = net.edges.get_times + map_mode_to_times = {} + fstar = net.edges.get_fstar() + + vtypes = self.parent.vtypes + + ids_line = self.get_ids() + + for id_line, ids_stop, id_mode in zip(ids_line, + self.ids_stops[ids_line], + vtypes.ids_mode[self.ids_vtype[ids_line]]): + + if len(ids_stop) >= 2: + id_stopedge = net.lanes.ids_edge[stops.ids_lane[ids_stop[0]]] + ids_edge = self.ids_edges[id_line] + + if ids_edge is not None: + if len(ids_edge) > 0: + if id_stopedge not in ids_edge: + id_edge = ids_edge[0] + print ' initial stop edge %d of line %d disconnected from route edge %d' % (id_stopedge, id_line, id_edge) + # print ' before:',ids_edge + if id_mode not in map_mode_to_times: + map_mode_to_times[id_mode] = get_times(id_mode=id_mode, + is_check_lanes=True) + + time, ids_edges_connect = get_mincostroute_edge2edge( + id_stopedge, + id_edge, + weights=map_mode_to_times[id_mode], + fstar=fstar) + + if len(ids_edges_connect) > 0: + if ids_edges_connect[-1] == id_edge: + print ' prepend connection', ids_edges_connect + self.ids_edges[id_line] = ids_edges_connect[:-1] + ids_edge + # print ' after:',self.ids_edges[id_line] + def format_ids(self, ids): return ','.join(self.linenames[ids]) @@ -162,15 +211,15 @@ return self.ptlinks.get_value() def make(self, **kwargs): - ids_stop = self.add_row(linenames=kwargs.get('linename', None), - times_begin=kwargs.get('time_begin', None), - times_end=kwargs.get('time_end', None), - periods=kwargs.get('period', None), - times_dwell=kwargs.get('time_dwell', None), - ids_stops=kwargs.get('ids_stop', None), - ids_edges=kwargs.get('ids_edge', None), - ids_vtype=kwargs.get('id_vtype', None), - ) + return self.add_row(linenames=kwargs.get('linename', None), + times_begin=kwargs.get('time_begin', None), + times_end=kwargs.get('time_end', None), + periods=kwargs.get('period', None), + times_dwell=kwargs.get('time_dwell', None), + ids_stops=kwargs.get('ids_stop', None), + ids_edges=kwargs.get('ids_edge', None), + ids_vtype=kwargs.get('id_vtype', None), + ) def on_del_row(self, id_row=None): if id_row is not None: @@ -189,13 +238,14 @@ else: return 0.0 - def guess_routes(self, is_keep_existing=False): + def guess_routes(self, is_keep_existing=False, ids_line=None): """ Guess sequence of edges between stops if not previously specified using shortest path routing. """ # print 'guess_routes' - ids_line = self.get_ids() + if ids_line is None: + ids_line = self.get_ids() vtypes = self.ids_vtype.get_linktab() ptstops = self.get_ptstops() net = self.get_net() @@ -258,7 +308,7 @@ def get_vtypes(self): return set(self.ids_vtype.get_value()) - def get_writexmlinfo(self, is_route=False): + def get_writexmlinfo(self, is_route=False, is_plain=False, **kwargs): """ Returns three array where the first array is the begin time of the first vehicle and the second array is the @@ -267,9 +317,30 @@ Method used to sort trips when exporting to route or trip xml file """ + # print 'PtLines.get_writexmlinfo is_route, is_plain',is_route, is_plain,len(self) n = len(self) ids = self.get_ids() - return self.times_begin[ids], n*[self.write_flow_xml], ids + # + if is_plain: + ids_run = [] + times_begin_run = [] + # print ' ids',ids, + # print ' times_begin',self.times_begin[ids] + # print ' times_end',self.times_end[ids] + # print ' periods',self.periods[ids] + for id_line, time_begin, time_end, period in zip(ids, self.times_begin[ids], self.times_end[ids], self.periods[ids]): + # print ' id_line, time_begin,time_end, period',id_line, time_begin,time_end, period + i_run = 0 + for t_begin in np.arange(time_begin, time_end, period): + # print ' append (id_line,i_run)',(id_line,i_run),'t_begin',t_begin + ids_run.append((id_line, i_run)) + times_begin_run.append(t_begin) + i_run += 1 + + return times_begin_run, len(ids_run)*[self.write_run_xml], ids_run + + else: + return self.times_begin[ids], n*[self.write_flow_xml], ids def get_trips(self): # returns trip object, method common to all demand objects @@ -329,6 +400,34 @@ fd.write(xm.stopit()) fd.write(xm.end('flow', indent)) + def write_run_xml(self, fd, id_run, time_begin, indent=0): + """ + Writes PT runs to xml instead of flows + """ + id_line, i_run = id_run + #_idents = self.get_keys() + #_inds = self.get_inds_from_keys(_idents) + #_ids_egdes = self.cols.ids_edge[_inds] + + # for _ind, _id_line, _ids_egde in zip(_inds, _idents, _ids_egdes): + #vtype = self.cols.vtype[id_line] + + ids_edge_sumo = self.ids_edges.get_linktab().ids_sumo + ids_edge = self.ids_edges[id_line] + if len(ids_edge) > 0: + + # write vehicle flow data + fd.write(xm.start('trip id="ptline.%s.%d"' % (id_line, i_run), indent)) + + fd.write(xm.num('depart', '%d' % time_begin)) + self.ids_vtype.write_xml(fd, id_line) + fd.write(xm.num('from', ids_edge_sumo[ids_edge[0]])) + fd.write(xm.num('to', ids_edge_sumo[ids_edge[-1]])) + fd.write(xm.stop()) + + fd.write(xm.end('trip', indent)) + i_run += 1 + # def prepare_sim(self, process): # return [] @@ -411,19 +510,8 @@ groupnames=['state'], name='Line ID', info='ID of public transport line. -1 means no line, in case of walking.', - xmltag='to', )) - # self.add_col(am.NumArrayConf('speeds_line', 30.0/3.6, - # dtype = np.float32, - # groupnames = ['state'], - # perm = 'rw', - # name = 'line speed', - # unit = 'm/s', - # info = 'Line speed on public transport link.', - # #xmltag = 'speed', - # )) - self.add_col(am.NumArrayConf('lengths', 0.0, dtype=np.float32, groupnames=['state'], @@ -431,7 +519,6 @@ name='Length', unit='m', info='Edge length.', - #xmltag = 'length ', )) self.add_col(am.NumArrayConf('durations', 0.0, @@ -441,7 +528,6 @@ name='Duration', unit='s', info='Time duration of link, including dwell time.', - #xmltag = 'speed', )) self.add_col(am.IdlistsArrayConf('ids_links_forward', self, @@ -453,7 +539,67 @@ self.types.choices = LINKTYPES self.delete('speeds_line') - def build(self, dist_walk_los=150.0, speed_walk_los=0.5): + def print_link(self, id_link, ident=2, is_edges=True, is_link_forward=False): + linktype = get_inversemap(self.types.choices)[self.types[id_link]] + if linktype == 'transit': + id_line = self.ids_line[id_link] + time_interval = self.parent.periods[id_line] + + print ident*' ', 'PtLink:', id_link, 'line', id_line, '(%s)' % (self.parent.linenames[id_line]), 'from stop', self.ids_fromstop[id_link], 'to stop', self.ids_tostop[id_link], 'T=%ds I=%ds' % (self.durations[id_link], time_interval) + #id_link_board = self.get_link_board(id_link) + # print ident*' ', 'check interval: I=%d, I_board=%d, id_link_board=%d'%(time_interval, self.durations[id_link_board], id_link_board),'ids_link_forward',self.ids_links_forward[id_link_board] + + if is_edges: + print ident*' ', ' ids_edge=', self.get_ids_edge(id_link) + + elif linktype == 'board': + id_line = self.ids_line[id_link] + print ident*' ', 'PtLink:', id_link, 'type', linktype, 'T=%ds' % (self.durations[id_link]), 'line', id_line, '(%s)' % (self.parent.linenames[id_line]), 'at stop', self.ids_fromstop[id_link] + + elif linktype == 'walk': + print ident*' ', 'PtLink:', id_link, 'type', linktype, 'T=%ds' % (self.durations[id_link]), 'from stop', self.ids_fromstop[id_link], 'to stop', self.ids_tostop[id_link] + + else: + + print ident*' ', 'PtLink:', id_link, 'type', linktype, 'T=%ds' % (self.durations[id_link]), 'at stop', self.ids_fromstop[id_link] + + if is_link_forward: + # print ident*' ',' ids_link_forward=',self.ids_links_forward[id_link] + for id_link_forward in self.ids_links_forward[id_link]: + self.print_link(id_link_forward, ident+4, is_edges=False, is_link_forward=False) + + def get_ids_edge(self, id_link): + """ + Returns the network edge ids used by id_link in case of a transit link. + Otherwirse returns an empty list. + """ + if self.types.choices['transit'] == self.types[id_link]: + id_line = self.ids_line[id_link] + ptlines = self.parent + lanes = ptlines.get_net().lanes + ptstops = ptlines.get_ptstops() + id_edge_from = lanes.ids_edge[ptstops.ids_lane[self.ids_fromstop[id_link]]] + id_edge_to = lanes.ids_edge[ptstops.ids_lane[self.ids_tostop[id_link]]] + ids_edge = ptlines.ids_edges[self.ids_line[id_link]] + if id_edge_from in ids_edge: + ind_from = ids_edge.index(id_edge_from) + else: + return [] + if id_edge_to in ids_edge: + ind_to = ids_edge.index(id_edge_to) + return ids_edge[ind_from:ind_to] # this excludes last edge + else: + return [] + else: + return [] + + def get_ptstops(self): + + ids_stop = ptlines.ids_stop + + def build(self, dist_walk_los=150.0, speed_walk_los=0.5, + duration_transfer=10, duration_alight=10, + duration_exit=5, duration_enter=5): """ Bulid PT links from PT lines and PT stops. @@ -464,6 +610,9 @@ between two stops """ print 'build', self.ident, dist_walk_los, speed_walk_los + + id_stop_debug = 459 + self.clear() ptlines = self.parent net = self.parent.get_net() @@ -500,73 +649,123 @@ } # first create links between stops of each line - for id_line, id_vtype, ids_stop, ids_edge in zip( + ids_ptlines_failed = [] + for id_line, id_vtype, ids_stop, ids_edge, linename in zip( ids_line, ptlines.ids_vtype[ids_line], ptlines.ids_stops[ids_line], - ptlines.ids_edges[ids_line] + ptlines.ids_edges[ids_line], + ptlines.linenames[ids_line], ): - - print ' id_line,ids_edge', id_line, ids_edge + n_edge = len(ids_edge) + n_stop = len(ids_stop) + print 79*'-' + print 'Build links of line', linename, 'id_line', id_line, 'n_edge', n_edge, 'n_stop', n_stop if (len(ids_edge) > 1) & (len(ids_stop) > 2): + + # check if all stop edges are on route and in the correct order: ind_edge = 0 - length = edgelengths[ids_edge[0]] - stoppositions[ids_stop[0]] - duration = length/edgespeeds[ids_edge[0]] - #length_laststop = length_current id_stopedge_next = ids_laneedge[ids_stoplane[ids_stop[1]]] - - ids_link = [] - for ind_stop in xrange(1, len(ids_stop)): + for ind_stop in xrange(1, n_stop): id_fromstop = ids_stop[ind_stop-1] id_tostop = ids_stop[ind_stop] + if id_fromstop != id_tostop: + is_cont = True + is_mismatch = False + while is_cont: + if id_stopedge_next == ids_edge[ind_edge]: + is_cont = False + + elif ind_edge == n_edge-1: + is_mismatch = True + is_cont = False + else: + ind_edge += 1 + + # print ' ind_edge,id_stopedge_next,ids_edge[ind_edge]',ind_edge,id_stopedge_next,ids_edge[ind_edge],len(ids_edge) + + #is_mismatch = (ind_edge == (n_edge-1)) & (ind_stop != (n_stop-1)) + print ' ind_stop', ind_stop, 'ind_edge', ind_edge, is_mismatch + if is_mismatch: + break - print ' id_fromstop,id_tostop', id_fromstop, id_tostop + if id_tostop != ids_stop[-1]: + id_stopedge_next = ids_laneedge[ids_stoplane[ids_stop[ind_stop+1]]] - # this prevents error in case two successive stops have - # (by editing error) the same ID - if id_fromstop != id_tostop: + # if set(ids_edge).issuperset(ids_laneedge[ids_stoplane[ids_stop[1:]]]): + if not is_mismatch: - # compute length and time between fromstop and tostop - while id_stopedge_next != ids_edge[ind_edge]: - print ' ind_edge,id_stopedge_next,ids_edge[ind_edge]', ind_edge, id_stopedge_next, ids_edge[ind_edge], len( - ids_edge) - ind_edge += 1 - length_edge = edgelengths[ids_edge[ind_edge]] - length += length_edge - duration += length_edge/edgespeeds[ids_edge[ind_edge]] - - # adjust length and time measurement on last edge - length_delta = edgelengths[id_stopedge_next] - stoppositions[id_tostop] - length -= length_delta - duration -= length_delta/edgespeeds[id_stopedge_next] - - # add dwell time - duration += ptlines.times_dwell[id_line] - - id_link = self.add_row(types=type_transit, - ids_fromstop=id_fromstop, - ids_tostop=id_tostop, - ids_line=id_line, - lengths=length, - durations=duration, - ) - ids_link.append(id_link) - - stoplinks[id_fromstop]['ids_transit_out'].append(id_link) - stoplinks[id_tostop]['ids_transit_in'].append(id_link) - # is id_tostop the last stop? - if id_tostop != ids_stop[-1]: - # prepare lengthe and duration mesurement - id_stopedge_next = ids_laneedge[ids_stoplane[ids_stop[ind_stop+1]]] - length = length_delta - duration = 0.0 - - # create forward links for this line - for i in xrange(1, len(ids_link)): - self.ids_links_forward[ids_link[i-1]] = [ids_link[i]] - # put empty link list to line end-stop - self.ids_links_forward[ids_link[i]] = [] + length = edgelengths[ids_edge[0]] - stoppositions[ids_stop[0]] + + # TODO: limit speed by vtype + duration = length/edgespeeds[ids_edge[0]] + #length_laststop = length_current + id_stopedge_next = ids_laneedge[ids_stoplane[ids_stop[1]]] + + ids_link = [] + ind_edge = 0 + for ind_stop in xrange(1, len(ids_stop)): + id_fromstop = ids_stop[ind_stop-1] + id_tostop = ids_stop[ind_stop] + + # if id_fromstop == id_stop_debug: + print ' ind_stop', ind_stop, 'id_fromstop,id_tostop', id_fromstop, id_tostop, 'ind_edge', ind_edge + + # this prevents error in case two successive stops have + # (by editing error) the same ID + if id_fromstop != id_tostop: + + # compute length and time between fromstop and tostop + while id_stopedge_next != ids_edge[ind_edge]: + # if id_fromstop == id_stop_debug: + print ' ind_edge', ind_edge, ',id_stopedge_next,ids_edge[ind_edge]', id_stopedge_next, ids_edge[ind_edge] + ind_edge += 1 + length_edge = edgelengths[ids_edge[ind_edge]] + length += length_edge + # TODO: limit speed by vtype + duration += length_edge/edgespeeds[ids_edge[ind_edge]] + + # adjust length and time measurement on last edge + length_delta = edgelengths[id_stopedge_next] - stoppositions[id_tostop] + length -= length_delta + duration -= length_delta/edgespeeds[id_stopedge_next] + + # add dwell time + duration += ptlines.times_dwell[id_line] + + id_link = self.add_row(types=type_transit, + ids_fromstop=id_fromstop, + ids_tostop=id_tostop, + ids_line=id_line, + lengths=length, + durations=duration, + ) + ids_link.append(id_link) + + # debugging + if id_fromstop == id_stop_debug: + print ' append transit link', id_link + + stoplinks[id_fromstop]['ids_transit_out'].append(id_link) + stoplinks[id_tostop]['ids_transit_in'].append(id_link) + # is id_tostop the last stop? + if id_tostop != ids_stop[-1]: + # prepare lengthe and duration mesurement + id_stopedge_next = ids_laneedge[ids_stoplane[ids_stop[ind_stop+1]]] + length = length_delta + duration = 0.0 + + # create forward links for this line + for i in xrange(1, len(ids_link)): + self.ids_links_forward[ids_link[i-1]] = [ids_link[i]] + # put empty link list to line end-stop + self.ids_links_forward[ids_link[i]] = [] + + else: + print 'WARNING in line', linename, 'id_line', id_line + print ' stop edges not on route, line will not build.' + ids_ptlines_failed.append(id_line) # complete stoplink database @@ -579,7 +778,7 @@ # get for each stop a list of close stops with distances ids_stops_prox = net.ptstops.get_stops_proximity(dist_walk_los=dist_walk_los) - print ' ids_stops_prox', ids_stops_prox + # print ' ids_stops_prox', ids_stops_prox for id_stop in net.ptstops.get_ids(): @@ -597,13 +796,33 @@ stoplinks[id_stop]['ids_walk'] = ids_walk + # boarding links + # print ' ids_transit_out',stoplinks[id_stop]['ids_transit_out'] + ids_transit = np.array(stoplinks[id_stop]['ids_transit_out'], dtype=np.int32) + # print ' ids_transit',ids_transit + n_transit = len(ids_transit) + unitvec = np.ones(n_transit, dtype=np.int32) + # print ' type_board*unitvec',type_board*unitvec + ids_board = self.add_rows(n=n_transit, + types=type_board*unitvec, # access + ids_fromstop=id_stop*unitvec, + ids_tostop=id_stop*unitvec, + ids_line=self.ids_line[ids_transit], + lengths=1.0*unitvec, + durations=0.5*periods[self.ids_line[ids_transit]], + ids_links_forward=ids_transit.reshape(-1, 1).tolist(), + ) + + stoplinks[id_stop]['ids_board'] = ids_board + # transfer link id_transfer = self.add_row(types=type_transfer, # access ids_fromstop=id_stop, ids_tostop=id_stop, lengths=1.0, speeds_line=1.0, - ids_links_forward=ids_walk.tolist(), # completed below + durations=duration_transfer, + ids_links_forward=ids_board.tolist()+ids_walk.tolist(), # completed below ) stoplinks[id_stop]['id_transfer'] = id_transfer @@ -613,37 +832,18 @@ ids_fromstop=id_stop, ids_tostop=id_stop, lengths=0.0, - durations=0.0, + durations=duration_exit, ids_links_forward=[], # dead end ) - stoplinks[id_stop]['id_exit'] = id_exit - # boarding links - # print ' ids_transit_out',stoplinks[id_stop]['ids_transit_out'] - ids_transit = np.array(stoplinks[id_stop]['ids_transit_out'], dtype=np.int32) - # print ' ids_transit',ids_transit - n_transit = len(ids_transit) - unitvec = np.ones(n_transit, dtype=np.int32) - # print ' type_board*unitvec',type_board*unitvec - ids_board = self.add_rows(n=n_transit, - types=type_board*unitvec, # access - ids_fromstop=id_stop*unitvec, - ids_tostop=id_stop*unitvec, - lengths=1.0*unitvec, - durations=0.5*periods[self.ids_line[ids_transit]], - ids_links_forward=ids_transit.reshape(-1, 1).tolist(), - ) - - stoplinks[id_stop]['ids_board'] = ids_board - # enter link id_enter = self.add_row(types=type_enter, # access ids_fromstop=id_stop, ids_tostop=id_stop, lengths=0.0, - durations=0.0, - ids_links_forward=ids_board.tolist()+[id_transfer, id_exit], + durations=duration_enter, + ids_links_forward=[id_transfer, id_exit], ) stoplinks[id_stop]['id_enter'] = id_enter @@ -656,8 +856,9 @@ types=type_alight*unitvec, # access ids_fromstop=id_stop*unitvec, ids_tostop=id_stop*unitvec, + ids_line=self.ids_line[ids_transit], lengths=0.0*unitvec, - durations=0.0*unitvec, + durations=duration_alight*unitvec, ids_links_forward=[[id_transfer, id_exit, ]]*n_transit, ) # print ' ids_links_forward[ids_transit]',self.ids_links_forward[ids_transit] @@ -667,11 +868,106 @@ stoplinks[id_stop]['ids_alight'] = ids_alight + # debugging + if id_stop == id_stop_debug: + print ' Parameters of id_stop', id_stop + for key, val in stoplinks[id_stop].iteritems(): + if key in ['ids_transit_out', 'ids_transit_in', 'ids_board', 'ids_alight']: + print ' ', key, ':' + for id_link in val: + self.print_link(id_link, ident=6) + + else: + print ' ', key, ':', val + # connect walk links from one stop to board and transfer for id_stop in net.ptstops.get_ids(): ids_walk = stoplinks[id_stop]['ids_walk'] for id_walk, id_tostop in zip(ids_walk, self.ids_tostop[ids_walk]): self.ids_links_forward[id_walk] = [stoplinks[id_tostop]['id_enter']] + if 0: + # debugging + print 79*'=' + ids_link = self.get_ids() + for id_link, linktype, id_fromstop, id_tostop, id_line, duration, ids_link_forward in zip( + ids_link, self.types[ids_link], self.ids_fromstop[ids_link], self.ids_tostop[ids_link], self.ids_line[ids_link], self.durations[ids_link], self.ids_links_forward[ids_link]): + if id_fromstop == id_stop_debug: + print ' FROM', id_stop_debug, 'TO', id_tostop + self.print_link(id_link, ident=4) + print ' ids_link_forward=', ids_link_forward + + print 79*'=' + for id_link, linktype, id_fromstop, id_tostop, id_line, duration, ids_link_forward in zip( + ids_link, self.types[ids_link], self.ids_fromstop[ids_link], self.ids_tostop[ids_link], self.ids_line[ids_link], self.durations[ids_link], self.ids_links_forward[ids_link]): + + if id_tostop == id_stop_debug: + print ' FROM', id_fromstop, 'TO', id_stop_debug + self.print_link(id_link, ident=4) + print ' ids_link_forward=', ids_link_forward + + # debug + print 'Number of failed Ptlines', len(ids_ptlines_failed), 'of', len(ptlines) + for id_line, linename, period in zip( + ids_ptlines_failed, + ptlines.linenames[ids_ptlines_failed], + ptlines.periods[ids_ptlines_failed], + ): + print ' Failed to build line', linename, 'id_line', id_line, 'period', period, 's' + + return ids_ptlines_failed + + def get_map_stop_to_ptlinks(self, is_fromstop=True, is_tostop=False, linktype=2): + """ + Returns a dictionary, mapping id stop to a list of PT links, where + is_fromstop and is_tostop indicates whether the stop should be + at the start or at the end of the link. + + linktype specifies the link type ID , default is 2 ("transit") + """ + # print 'get_map_stop_to_link' + ptlines = self.parent + #net = self.parent.get_net() + + #ptlinktypes = self.types.choices + #type_transit = ptlinktypes['transit'] + #type_transfer = ptlinktypes['transfer'] + #type_transfer = ptlinktypes['transfer'] + map_id_stop_to_ids_link = {} + ids = self.get_ids() + if is_fromstop: + for id_link, linktype_stop, id_stop in zip(ids, self.types[ids], self.ids_fromstop[ids]): + if linktype == linktype_stop: + if map_id_stop_to_ids_link.has_key(id_stop): + # print ' append id_transitlink',id_link,linktype,'to id_stop',id_stop + map_id_stop_to_ids_link[id_stop].append(id_link) + else: + map_id_stop_to_ids_link[id_stop] = [id_link] + # print ' add id_transitlink',id_link,linktype,'to id_stop',id_stop + if is_tostop: + for id_link, linktype_stop, id_stop in zip(ids, self.types[ids], self.ids_tostop[ids]): + if linktype == linktype_stop: + if map_id_stop_to_ids_link.has_key(id_stop): + # print ' append id_transitlink',id_link,linktype,'to id_stop',id_stop + map_id_stop_to_ids_link[id_stop].append(id_link) + else: + map_id_stop_to_ids_link[id_stop] = [id_link] + # print ' add id_transitlink',id_link,linktype,'to id_stop',id_stop + return map_id_stop_to_ids_link + + def get_link_board(self, id_link): + """ + Returns boarding link for given transit type link. + """ + ptlines = self.parent + #net = self.parent.get_net() + + type_board = self.types.choices['board'] + + ids = self.select_ids(self.types.get_value() == type_board) + for id_link_board, id_link_forward in zip(ids, self.ids_links_forward[ids]): + if id_link_forward == id_link: + break + return id_link_board def get_fstar(self, is_array=False): """ @@ -681,6 +977,12 @@ ids_link = self.get_ids() n = len(ids_link) + if n == 0: + # no links built + if is_array: + return [] + else: + return {} # algo with dictionnary #fstar = {} # for id_link, ids_link_forward in zip(ids_link, self.link_forward[ids_link]): @@ -694,15 +996,13 @@ else: return dict(np.concatenate((ids_link.reshape((-1, 1)), fstar[ids_link].reshape((-1, 1))), 1)) - def get_times(self, id_mode=0, speed_max=None): + def get_times(self, id_mode=0, is_randomwait=False): """ - Returns freeflow travel times for all edges. + Returns freeflow travel times for all PT links. The returned array represents the speed and the index corresponds to - edge IDs. + PT link IDs. - If is_check_lanes is True, then the lane speeds are considered where - the respective mode is allowed. If not allowed on a particular edge, - then the respective edge travel time is negative. + TODO: mode selection """ # print 'get_times id_mode,is_check_lanes,speed_max',id_mode,is_check_lanes,speed_max @@ -710,6 +1010,13 @@ times = np.array(np.zeros(np.max(ids_link)+1, np.float32)) times[ids_link] = self.durations[ids_link] + if is_randomwait: + ids_link_board = self.select_ids(self.types.get_value() == self.types.choices['board']) + + for id_link, time_board_max in\ + zip(ids_link_board, 2*self.durations[ids_link_board]): + times[id_link] = random.uniform(0.0, time_board_max) + return times def get_stops_to_enter_exit(self): @@ -746,14 +1053,14 @@ times=None, fstar=None): """ Routes public transit from fromstop to tostop. - Reurned are the following arrays, one entry per stage: + Returned are the following arrays, one entry per stage: ids_line : line IDs , with negative id for walking linktypes : type of link ids_fromstop : IDs of stops where each stage starts - ids_tostop : IDs of stops where each stage engs + ids_tostop : IDs of stops where each stage ends durations : Duration of each stage in secs """ - # print 'route id_fromstop, id_tostop',id_fromstop,id_tostop + print 'route id_fromstop, id_tostop', id_fromstop, id_tostop if times is None: times = self.get_times() @@ -766,8 +1073,8 @@ ptlinktypes = self.types.choices #type_enter = ptlinktypes['enter'] type_transit = ptlinktypes['transit'] - #type_board = ptlinktypes['board'] - #type_alight = ptlinktypes['alight'] + type_board = ptlinktypes['board'] + type_alight = ptlinktypes['alight'] #type_transfer = ptlinktypes['transfer'] type_walk = ptlinktypes['walk'] #type_exit = ptlinktypes['exit'] @@ -779,8 +1086,8 @@ id_fromlink = stops_to_enter[id_fromstop] id_tolink = stops_to_exit[id_tostop] - print ' route id_fromstop, id_tostop', id_fromstop, id_tostop - print ' route id_fromlink, id_tolink', id_fromlink, id_tolink + # print ' route id_fromstop, id_tostop',id_fromstop, id_tostop + # print ' route id_fromlink, id_tolink',id_fromlink, id_tolink routeduration, route = get_mincostroute_edge2edge( id_fromlink, id_tolink, @@ -815,7 +1122,7 @@ self.durations[route], self.ids_fromstop[route], self.ids_tostop[route]): - # print ' linktype',linktype,'id_line',id_line,'duration',duration + # print ' check linktype',linktype,'id_line',id_line,'duration',duration if linktype == type_transit: # check if this link is yet another stop of te same line if id_line_last == -1: @@ -846,6 +1153,7 @@ # for all other link types simply accumulate duration # which will be added to a successive walk or transit stage duration_accum += duration + id_line_last = -1 # print ' ids_line',ids_line # print ' linktypes',linktypes @@ -856,6 +1164,150 @@ return durations, linktypes, ids_line, ids_fromstop, ids_tostop +class PtLinefilter(Process): + def __init__(self, ident='ptlinefilter', ptlines=None, logger=None, **kwargs): + print 'PtLinefilter.__init__' + + # TODO: let this be independent, link to it or child?? + + self._init_common(ident, + parent=ptlines, + name='Public Transport line filter', + logger=logger, + info='Removes undesired PT lines with specific characteristics.', + ) + + attrsman = self.set_attrsman(cm.Attrsman(self)) + + self.period_max = attrsman.add(cm.AttrConf('period_max', kwargs.get('period_max', 1200), + groupnames=['options'], + perm='rw', + name='Max. duration of period', + info="""Max. duration of period""", + )) + + self.n_stops_min = attrsman.add(cm.AttrConf('n_stops_min', kwargs.get('n_stops_min', 5), + groupnames=['options'], + perm='rw', + name='Min. number of stops', + info="""Min. number of stops.""", + )) + + def do(self): + print 'PtLinefilter.do' + # links + ptlines = self.parent + + stops = ptlines.get_ptstops() + #net = ptlines.get_net() + #vtypes = ptlines.parent.vtypes + + ids_line = ptlines.get_ids() + + ids_remove = [] + for id_line, ids_stop, period in zip(ids_line, + ptlines.ids_stops[ids_line], + ptlines.periods[ids_line] + ): + if len(ids_stop) < self.n_stops_min: + ids_remove.append(id_line) + + elif period > self.period_max: + ids_remove.append(id_line) + + print ' Eliminated %d lines:' % (len(ids_remove)) + + for id_line, name, ids_stop, period in zip(ids_remove, + ptlines.linenames[ids_remove], + ptlines.ids_stops[ids_remove], + ptlines.periods[ids_remove] + ): + print ' id_line', id_line, 'name', name, 'period', period, 'n_stops', len(ids_stop) + + ptlines.del_rows(ids_remove) + + return True + + +class PtNetbuilder(Process): + def __init__(self, ident='ptnetbuilder', ptlinks=None, logger=None, **kwargs): + print 'PtNetbuilder.__init__' + + # TODO: let this be independent, link to it or child?? + + self._init_common(ident, + parent=ptlinks, + name='Public Transport Net builder', + logger=logger, + info='Builds Ptlinks of the Public Transport Net.', + ) + + attrsman = self.set_attrsman(cm.Attrsman(self)) + + # make for each possible pattern a field for prob + + self.dist_walk_los = attrsman.add(cm.AttrConf('dist_walk_los', kwargs.get('dist_walk_los', 150), + groupnames=['options'], + perm='rw', + name='Max. station internal walk dist.', + info="""Maximum station internal walking diststance specifies the maximum line of sight distance + between 2 stops such that a transfers between the stops can be considered. + """, + )) + + self.speed_walk_los = attrsman.add(cm.AttrConf('speed_walk_los', kwargs.get('speed_walk_los', 0.5), + groupnames=['options'], + perm='rw', + name='Walk speed between stops', + info="""The line of sight walk speed between stops is used to estimate the walking time between stops.""", + )) + + self.duration_transfer = attrsman.add(cm.AttrConf('duration_transfer', kwargs.get('duration_transfer', 10), + groupnames=['options'], + perm='rw', + name='Duration of transfer', + info="""Duration of transfer accounts for the time spend on the platform of the same stop during a transfer. + More specifically, this is the time after alighting and before exiting or walking to another stop. + """, + )) + + self.duration_alight = attrsman.add(cm.AttrConf('duration_alight', kwargs.get('duration_alight', 10), + groupnames=['options'], + perm='rw', + name='Duration of alighing', + info="""Duration of alighing accounts for the assumed alighing process from a PT vehicle. This is only a logistic duration, no change in position takes place. + """, + )) + self.duration_enter = attrsman.add(cm.AttrConf('duration_enter', kwargs.get('duration_enter', 5), + groupnames=['options'], + perm='rw', + name='Duration of stop entering', + info="""Duration of entering a stop or station. This is only a logistic duration, no change in position takes place. + """, + )) + self.duration_exit = attrsman.add(cm.AttrConf('duration_exit', kwargs.get('duration_exit', 5), + groupnames=['options'], + perm='rw', + name='Duration of stop exiting', + info="""Duration of exiting a stop or station. This is only a logistic duration, no change in position takes place. + """, + )) + + def do(self): + print 'VehicleProvider.do' + # links + + #virtualpop = self.parent + logger = self.get_logger() + logger.w('Build PT network...') + + ids_ptlines_failed = self.parent.build(dist_walk_los=self.dist_walk_los, speed_walk_los=self.speed_walk_los, + duration_transfer=self.duration_transfer, duration_alight=self.duration_alight, + duration_exit=self.duration_exit, duration_enter=self.duration_enter) + + return True + + class LineReader(handler.ContentHandler): """Reads pt lines from xml file into ptlines structure""" diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/publictransportservices_wxgui.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/publictransportservices_wxgui.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/publictransportservices_wxgui.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/publictransportservices_wxgui.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file publictransportservices_wxgui.py # @author Joerg Schweizer -# @date +# @date 2012 import wx import agilepy.lib_base.classman as cm @@ -24,7 +24,7 @@ from agilepy.lib_base.processes import Process from agilepy.lib_wx.processdialog import ProcessDialog from coremodules.network.network import SumoIdsConf, MODES -#import publictransportservices as pt +import publictransportservices as pt class PublicTransportWxGuiMixin: @@ -59,23 +59,80 @@ bitmap=self.get_icon("route3_24px.png"), ) - menubar.append_item('demand/public transport/build links', + menubar.append_item('demand/public transport/build links...', self.on_build_links, - info='Build servive links of public transport network.', + info='Build public transport links of public transport network.', bitmap=self.get_icon("route3_24px.png"), ) + menubar.append_item('demand/public transport/filter lines...', + self.on_filter_lines, + ) + + menubar.append_item('demand/public transport/check initial stops', + self.on_check_initial_stops, + ) + def on_build_links(self, event=None): - self._demand.ptlines.ptlinks.get_value().build() - self._mainframe.browse_obj(self._demand.ptlines.ptlinks.get_value()) - if event: - event.Skip() + ptlinks = self._demand.ptlines.ptlinks.get_value() + p = pt.PtNetbuilder('ptnetbuilder', ptlinks, logger=self._mainframe.get_logger()) + # self._demand.ptlines.ptlinks.get_value().build() + + dlg = ProcessDialog(self._mainframe, p, immediate_apply=True) + + dlg.CenterOnScreen() + + # this does not return until the dialog is closed. + val = dlg.ShowModal() + # print ' val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL + # print ' status =',dlg.get_status() + if dlg.get_status() != 'success': # val == wx.ID_CANCEL: + # print ">>>>>>>>>Unsuccessful\n" + dlg.Destroy() + + if dlg.get_status() == 'success': + # print ">>>>>>>>>successful\n" + # apply current widget values to scenario instance + dlg.apply() + dlg.Destroy() + + self._mainframe.browse_obj(ptlinks) + + def on_filter_lines(self, event=None): + p = pt.PtLinefilter('ptlinefilter', self._demand.ptlines, logger=self._mainframe.get_logger()) + # self._demand.ptlines.ptlinks.get_value().build() + + dlg = ProcessDialog(self._mainframe, p, immediate_apply=True) + + dlg.CenterOnScreen() + + # this does not return until the dialog is closed. + val = dlg.ShowModal() + # print ' val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL + # print ' status =',dlg.get_status() + if dlg.get_status() != 'success': # val == wx.ID_CANCEL: + # print ">>>>>>>>>Unsuccessful\n" + dlg.Destroy() + + if dlg.get_status() == 'success': + # print ">>>>>>>>>successful\n" + # apply current widget values to scenario instance + dlg.apply() + dlg.Destroy() + + self._mainframe.browse_obj(self._demand.ptlines) def on_guess_routes(self, event=None): self._demand.ptlines.guess_routes() self._mainframe.browse_obj(self._demand.ptlines) - if event: - event.Skip() + + def on_check_initial_stops(self, event=None): + """Check whether initial stops are connected with the route. + Rand reconnect if necessary. This method is used as work around for a bug + in the PT line creation from GTFS. + """ + self._demand.ptlines.check_initial_stops() + self._mainframe.browse_obj(self._demand.ptlines) def on_clear_ptlines(self, event=None): """ @@ -83,8 +140,6 @@ """ self._demand.ptlines.clear() self._mainframe.browse_obj(self._demand.ptlines) - if event: - event.Skip() class AddPtlineTool(SelectTool): diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/turnflows.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/turnflows.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/turnflows.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/turnflows.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file turnflows.py # @author Joerg Schweizer -# @date +# @date 2012 import os import string @@ -26,7 +26,8 @@ from agilepy.lib_base.geometry import * #from coremodules.modules_common import * from coremodules.network.network import SumoIdsConf, MODES -from agilepy.lib_base.processes import Process, P, call # ,CmlMixin +from agilepy.lib_base.processes import Process, P, call, CmlMixin +import demandbase as db class Flows(am.ArrayObjman): @@ -277,11 +278,19 @@ counter[self.ids_toedge[ids_turns]] += self.flows[ids_turns] def export_xml(self, fd, indent=0): - # - # - # - # - # + # + # + # + # + # + + # ... any other edges ... + + # + + # ... some further intervals ... + + # fromedge_to_turnprobs = {} for _id in self.get_ids(): @@ -292,13 +301,17 @@ ids_sumoeges = self.get_edges().ids_sumo + fd.write(xm.begin('edgeRelations', indent)) for id_fromedge in fromedge_to_turnprobs.keys(): - fd.write(xm.begin('fromEdge'+xm.num('id', ids_sumoeges[id_fromedge]), indent)) + for id_toedge, turnprob in fromedge_to_turnprobs[id_fromedge]: - fd.write(xm.start('toEdge', indent+2)) - fd.write(xm.num('id', ids_sumoeges[id_toedge])+xm.num('probability', turnprob)) + fd.write(xm.start('edgeRelation', indent+2)) + fd.write(xm.num('from', ids_sumoeges[id_fromedge])) + fd.write(xm.num('to', ids_sumoeges[id_toedge])) + fd.write(xm.num('probability', turnprob)) fd.write(xm.stopit()) - fd.write(xm.end('fromEdge', indent)) + + fd.write(xm.end('edgeRelations', indent)) class TurnflowModes(am.ArrayObjman): @@ -563,7 +576,7 @@ zones = self.parent.get_scenario().landuse.zones ids_sinkedges = set() ids_sinkzone = zones.select_ids(zones.ids_landusetype.get_value() == 7) - for ids_edge in zones.ids_edges_orig[ids_sinkzone]: + for ids_edge in zones.ids_edges_inside[ids_sinkzone]: ids_sinkedges.update(ids_edge) #sinkedges = zones.ids_edges_orig.get_value().tolist() # print 'get_sinkedges',sinkedges @@ -664,12 +677,18 @@ entered_vec = counter[ids_edge].copy() return ids_edge, entered_vec - def turnflows_to_routes(self, is_clear_trips=True, is_export_network=True): + def turnflows_to_routes(self, is_clear_trips=True, is_export_network=True, + is_make_probabilities=True, cmloptions=None,): # jtrrouter --flow-files= # --turn-ratio-files= --net-file= \ # --output-file=MySUMORoutes.rou.xml --begin --end + + if is_make_probabilities: + self.normalize_turnprobabilities() + scenario = self.parent.get_scenario() - cmloptions = '-v --max-edges-factor 1 --seed 23423 --repair --ignore-vclasses false --ignore-errors --turn-defaults 5,90,5' + if cmloptions is None: + cmloptions = '-v --max-edges-factor 1 --seed 23423 --repair --ignore-vclasses false --ignore-errors --turn-defaults 5,90,5' trips = scenario.demand.trips if is_clear_trips: @@ -677,26 +696,28 @@ trips.clear_trips() rootfilepath = scenario.get_rootfilepath() - netfilepath = rootfilepath+'.net.xml' + netfilepath = scenario.net.get_filepath() flowfilepath = rootfilepath+'.flow.xml' turnfilepath = rootfilepath+'.turn.xml' routefilepath = trips.get_routefilepath() + # first generate xml for net if is_export_network: - # first generate xml for net scenario.net.export_netxml() ids_mode = self.get_modes() print 'turnflows_to_routes', ids_mode # scenario.net.modes.get_ids() + print ' cmloptions', cmloptions # route for all modes and read in routes for id_mode in ids_mode: # write flow and turns xml file for this mode time_start, time_end = self.export_flows_and_turns(flowfilepath, turnfilepath, id_mode) print ' time_start, time_end =', time_start, time_end + if time_end > time_start: # means there exist some flows for this mode - cmd = 'jtrrouter --flow-files=%s --turn-ratio-files=%s --net-file=%s --output-file=%s --begin %s --end %s %s'\ + cmd = 'jtrrouter --route-files=%s --turn-ratio-files=%s --net-file=%s --output-file=%s --begin %s --end %s %s'\ % (P+flowfilepath+P, P+turnfilepath+P, P+netfilepath+P, @@ -719,6 +740,148 @@ # trips and routes are not yet saved!! +class TurnflowRouter(db.TripoptionMixin, CmlMixin, Process): + def __init__(self, turnflows, logger=None, **kwargs): + + self._init_common('turnflowrouter', name='Turnflow Router', + parent=turnflows, + logger=logger, + info='Generates routes from turnflow database using the JTR router.', + ) + + self.init_cml('') # pass no commad to generate options only + + attrsman = self.get_attrsman() + + self.add_option('turnratio_defaults', '30,50,20', + groupnames=['options'], + cml='--turn-defaults', + name='Default turn ratios', + info='Default turn definition. Comma separated string means: "percent right, percent straight, percent left".', + ) + + self.add_option('max-edges-factor', 2.0, + groupnames=['options'], + cml='--max-edges-factor', + name='Maximum edge factor', + info='Routes are cut off when the route edges to net edges ratio is larger than this factor.', + ) + + self.add_option('is_internal_links', False, + groupnames=['options'], + cml='--no-internal-links', + name='Disable internal links', + info='Disable (junction) internal links.', + ) + + self.add_option('is_randomize_flows', True, + groupnames=['options'], + cml='--randomize-flows', + name='Randomize flows', + info='generate random departure times for flow input.', + ) + + self.add_option('is_ignore_vclasses', False, + groupnames=['options'], + cml='--ignore-vclasses', + name='Ignore mode restrictions', + info='Ignore mode restrictions of network edges.', + ) + + self.add_option('is_remove_loops', True, + groupnames=['options'], + cml='--remove-loops', + name='Remove loops', + info='emove loops within the route; Remove turnarounds at start and end of the route.', + ) + + self.add_option('is_remove_loops', True, + groupnames=['options'], + cml='--remove-loops', + name='Remove loops', + info='Remove loops within the route; Remove turnarounds at start and end of the route.', + ) + + self.add_option('is_weights_interpolate', True, + groupnames=['options'], + cml='--weights.interpolate', + name='Interpolate edge weights', + info='Interpolate edge weights at interval boundaries.', + ) + + self.add_option('weights_minor_penalty', 1.5, + groupnames=['options'], + cml='--weights.minor-penalty', + name='Minor link panelty', + info='Apply the given time penalty when computing routing costs for minor-link internal lanes.', + ) + + self.add_option('n_routing_threads', 0, + groupnames=['options'], + cml='--routing-threads', + name='Number of parallel threads', + info='ATTENTION: Numbers greater than 0 may cause errors!. The number of parallel execution threads used for routing.', + ) + self.add_option('seed', 1, + groupnames=['options'], + cml='--seed', + name='Random seed', + info='Initialises the random number generator with the given value.', + ) + + self.add_option('is_repair', True, + groupnames=['options'], + cml='--repair', + name='Repair routes', + info='Tries to correct a false route.', + ) + + self.add_option('is_ignore_errors', True, + groupnames=['options'], + cml='--ignore-errors', + name='Ignore errors', + info="""Continue routing, even if errors occur. + This option is recommended to avoid abortion if no sink zones are.""", + ) + + self.is_export_network = attrsman.add(am.AttrConf('is_export_network', True, + groupnames=['options'], + perm='rw', + name='Export network', + info='Export network before routing.', + )) + + self.is_clear_trips = attrsman.add(am.AttrConf('is_clear_trips', True, + groupnames=['options'], + perm='rw', + name='Clear trips', + info='Clear all trips in current trips database before routing.', + )) + + self.add_posoptions() + self.add_laneoptions() + self.add_speedoptions() + # self.add_option('turnratiofilepath', turnratiofilepath, + # groupnames = ['_private'],# + # cml = '--turn-ratio-files', + # perm='r', + # name = 'Net file', + # wildcards = 'Net XML files (*.net.xml)|*.net.xml', + # metatype = 'filepath', + # info = 'SUMO Net file in XML format.', + # ) + + def do(self): + print 'do' + cml = self.get_cml(is_without_command=True) # only options, not the command # + print ' cml=', cml + self.parent.turnflows_to_routes(is_clear_trips=self.is_clear_trips, + is_export_network=self.is_export_network, + is_make_probabilities=True, + cmloptions=cml) + return True + + class TurnflowImporter(Process): def __init__(self, turnflows, rootname=None, rootdirpath=None, tffilepath=None, logger=None, **kwargs): @@ -795,7 +958,8 @@ def do(self): # self.update_params() if os.path.isfile(self.tffilepath): - self.import_pat_csv() + ids_sumoedge_notexist, pairs_sumoedge_unconnected = self.import_pat_csv() + return (len(ids_sumoedge_notexist) == 0) & (len(pairs_sumoedge_unconnected) == 0) def import_pat_csv(self, sep=","): @@ -849,7 +1013,5 @@ print 'WARNING: inexistant edge IDs:', ids_sumoedge_notexist if len(pairs_sumoedge_unconnected) > 0: print 'WARNING: unconnected edge pairs:', pairs_sumoedge_unconnected - return ids_sumoedge_notexist, pairs_sumoedge_unconnected - # def get_net(self): - # return self._net + return ids_sumoedge_notexist, pairs_sumoedge_unconnected diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/turnflows_wxgui.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/turnflows_wxgui.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/turnflows_wxgui.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/turnflows_wxgui.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file turnflows_wxgui.py # @author Joerg Schweizer -# @date +# @date 2012 import wx import agilepy.lib_base.classman as cm @@ -48,18 +48,22 @@ bitmap=self.get_agileicon("Document_Import_24px.png"), ) - menubar.append_item('demand/turnflows/normalize turn-probabilities', - self.on_normalize_turnprobabilities, - #info='Makes sure that sum of turn probabilities from an edge equals 1.', - #bitmap = self.get_icon("Document_Import_24px.png"), - ) + # menubar.append_item( 'demand/turnflows/normalize turn-probabilities', + # self.on_normalize_turnprobabilities, + # #info='Makes sure that sum of turn probabilities from an edge equals 1.', + # #bitmap = self.get_icon("Document_Import_24px.png"), + # ) - menubar.append_item('demand/turnflows/turnflows to routes', + menubar.append_item('demand/turnflows/turnflows to routes...', self.on_turnflows_to_routes, - #info='Makes sure that sum of turn probabilities from an edge equals 1.', - #bitmap = self.get_icon("Document_Import_24px.png"), ) + # menubar.append_item( 'demand/turnflows/turnflows to routes', + # self.on_turnflows_to_routes, + # #info='Makes sure that sum of turn probabilities from an edge equals 1.', + # #bitmap = self.get_icon("Document_Import_24px.png"), + # ) + menubar.append_item('demand/turnflows/clear all turnflows', self.on_clear_turnflows, info='Clear all turnflows.', @@ -89,14 +93,14 @@ dlg.Destroy() self._mainframe.browse_obj(self._demand.turnflows) - def on_normalize_turnprobabilities(self, event=None): - """ - Makes sure that sum of turn probabilities from an edge equals 1. - """ - self._demand.turnflows.normalize_turnprobabilities() - self._mainframe.browse_obj(self._demand.turnflows) - # if event: - # event.Skip() + # def on_normalize_turnprobabilities(self, event=None): + # """ + # Makes sure that sum of turn probabilities from an edge equals 1. + # """ + # self._demand.turnflows.normalize_turnprobabilities() + # self._mainframe.browse_obj(self._demand.turnflows) + # #if event: + # # event.Skip() def on_clear_turnflows(self, event=None): """Generates routes, based on flow information and turnflow probabilities. @@ -111,8 +115,31 @@ """Generates routes, based on flow information and turnflow probabilities. This function will apply the JTROUTER for each transport mode separately. """ - self._demand.turnflows.turnflows_to_routes(is_clear_trips=False) - self._mainframe.browse_obj(self._demand.trips) + # TODO: maka proper control-panel + #self._demand.turnflows.turnflows_to_routes(is_clear_trips = False, is_make_probabilities = True) + # self._mainframe.browse_obj(self._demand.trips) + + tfrouter = turnflows.TurnflowRouter(self._demand.turnflows, + logger=self._mainframe.get_logger() + ) + dlg = ProcessDialog(self._mainframe, tfrouter) + + dlg.CenterOnScreen() + + # this does not return until the dialog is closed. + val = dlg.ShowModal() + # print ' val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL + # print ' status =',dlg.get_status() + if dlg.get_status() != 'success': # val == wx.ID_CANCEL: + # print ">>>>>>>>>Unsuccessful\n" + dlg.Destroy() + + if dlg.get_status() == 'success': + # print ">>>>>>>>>successful\n" + # apply current widget values to scenario instance + dlg.apply() + dlg.Destroy() + self._mainframe.browse_obj(self._demand.trips) class TurnflowCommonMixin: diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/vehicles.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/vehicles.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/vehicles.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/vehicles.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file vehicles.py # @author Joerg Schweizer -# @date +# @date 2012 import os import sys @@ -32,7 +32,7 @@ LANECHANGEMODELS = ['LC2013', 'JE2013', 'DK2008', 'SL2015'] -# https://sumo.dlr.de/wiki/Models/Emissions/HBEFA3-based +# http://sumo.dlr.de/wiki/Models/Emissions/HBEFA3-based EMISSIONCLASSES = { 'HBEFA3/Bus': 'average urban bus (all fuel types)', 'HBEFA3/Coach': 'average long distance bus (all fuel types)', @@ -82,35 +82,111 @@ 'HBEFA3/PC_D_EU6': 'diesel driven passenger car Euro norm 6 ', } -GUISHAPES = ["pedestrian", - "bicycle", - "motorcycle", - "passenger", - "passenger/sedan", - "passenger/hatchback", - "passenger/wagon", - "passenger/van", - "delivery", - "transport", - "transport/semitrailer", - "transport/trailer", - "bus", - "bus/city", - "bus/flexible", - "bus/overland", - "rail", - "rail/light" - "rail/railcar", - "rail/city", - "rail/slow", - "rail/fast", - "rail/cargo", - "evehicle", - ] +GUISHAPES = [ + "pedestrian", + "bicycle", + "motorcycle", + "passenger", + "passenger/sedan", + "passenger/hatchback", + "passenger/wagon", + "passenger/van", + "delivery", + "truck", + "truck/semitrailer", + "truck/trailer", + "bus", + "bus/city", + "bus/flexible", # (length per carriage 8.25) + "bus/overland", # (length per carriage 8.25) + "rail", # (length per carriage 24.5) + "rail/light", # (length per carriage 16.85) + "rail/city", # (length per carriage 5.71) + "rail/slow", # (length per carriage 9.44) + "rail/fast", # (length per carriage 24.775) + "rail/cargo", # (length per carriage 13.86) + "evehicle", + "ship", +] + +CARFOLLOWMODELS = ['Krauss', 'KraussOrig1', 'PWagner2009', 'BKerner', 'IDM', 'IDMM', + 'KraussPS', 'KraussAB', 'SmartSK', 'Wiedemann', 'W99', 'Daniel1', 'ACC', 'CACC', 'Rail'] ALIGNMMENTS_LAT = ['center', 'left', 'right', 'compact', 'nice', 'arbitrary'] +class Electricalprofiles(am.ArrayObjman): + def __init__(self, ident, parent, **kwargs): + print 'Electricalprofiles.__init__' + self._init_objman(ident=ident, + parent=parent, + name='Electrical profiles', + info='Profiles of different electrical subsystems, including battery and energy recovery', + version=0.0, + **kwargs) + self._init_attributes() + if len(self) == 0: + self.add_profiles_default() + + def _init_attributes(self): + print 'Electricalprofiles._init_attributes' + self.add_col(SumoIdsConf('profilename', name='Electric profile', perm='rw')) + self.add_col(am.ArrayConf('capacities_battery', 0.8, + groupnames=['parameters', 'key'], + name='Maximum battery capacity', + unit='Wh', + info='Maximum battery capacity', + xmltag='maximumBatteryCapacity', + )) + + self.add_col(am.ArrayConf('efficiencies_reuperation', 0.8, + groupnames=['parameters', 'key'], + name='Recuperation efficiency', + info='Recuperation efficiency.', + xmltag='recuperationEfficiency', + )) + + self.add_col(am.ArrayConf('speeds_charging', 0.1, + groupnames=['parameters', 'key'], + name='Min. charging speed', + unit='km/h', + info='Minimum velocity to start charging', + xmltag='stoppingTreshold', + )) + + def add_profiles_default(self): + self.add_profile('evehicle', + capacity_battery=24000.0, + efficiency_reuperation=0.4, + speed_charging=0.03) + self.add_profile('ebus', + capacity_battery=80000.0, + efficiency_reuperation=0.4, + speed_charging=0.03) + self.add_profile('etram', + capacity_battery=100000.0, + efficiency_reuperation=0.6, + speed_charging=0.03) + # self.add_profile('prt', + # capacity_battery = 24000.0, + # efficiency_reuperation = 0.5, + # speed_charging = 0.03) + + def add_profile(self, profilename, **kwargs): + # print 'add_vtype',vtype,kwargs + if self.ids_sumo.has_index(profilename): + # vtype already exist + _id = self.ids_sumo.get_id_from_index(profilename) + else: + _id = self.add_row(ids_sumo=profilename) + + self.set_row(_id, + capacities_battery=kwargs.get("capacity_battery", None), + efficiencies_reuperation=kwargs.get("efficiency_reuperation", None), + speeds_charging=kwargs.get("speed_charging", None), + ) + + class VehicleTypes(am.ArrayObjman): def __init__(self, parent, net, is_add_default=True, **kwargs): print 'VehicleTypes.__init__ is_add_default', is_add_default @@ -119,19 +195,21 @@ name='Vehicle Types', info='Table of all available vehicle types, each with specific physical characteristics. Each vehicle can be used multiple times in the simulation', xmltag=('vTypes', 'vType', 'ids_sumo'), - # version = 0.1, set later + version=0.4, **kwargs) self._init_attributes() if is_add_default: + # self.eprofiles.get_value().add_profiles_default() self.add_vtypes_default() - self.set_version(0.2) + self.set_version(0.3) def _init_attributes(self): print 'VehicleTypes._init_attributes', len(self), self.get_ident_abs() net = self.parent.get_net() demand = self.parent + # scalar parameters # lanechange model is now centralized: all vehicle types have the same # lanechange model. if self.get_version() < 0.1: @@ -148,6 +226,53 @@ # xmltag = 'laneChangeModel', # exported manually )) + self.add(cm.AttrConf('pedestrian_model', 'striping', + groupnames=['parameters', 'pedestrian'], + name='Pedestrian Model', + choices=['striping', 'nonInteracting', 'None'], + perm='rw', + info='Type of Pedestrian model.', + #cml = optionprefix+'--pedestrian.model', + )) + + self.add(cm.AttrConf('width_pedestrian_striping', 0.35, + groupnames=['parameters', 'pedestrian'], + name='Ped. stripe width', + unit='m', + perm='rw', + info="Width of parallel stripes for segmenting a sidewalk (meters) for use with model 'striping'", + #cml = optionprefix+'--pedestrian.striping.stripe-width', + )) + + self.add(cm.AttrConf('slowdownfactor_pedestrian_striping', 0.2, + groupnames=['parameters', 'pedestrian'], + name='Ped. slowdown', + perm='rw', + info="Factor for random slow-downs [0,1] for use with model 'striping'", + #cml = optionprefix+'--pedestrian.striping.dawdling', + )) + + self.add(cm.AttrConf('jamtime_pedestrian_striping', 10, + groupnames=['parameters', 'pedestrian'], + name='Ped. jamtime', + unit='s', + perm='rw', + info="Time before pedestrian jams are resolved. For use with model 'striping'", + #cml = optionprefix+'--pedestrian.striping.jamtime', + )) + + self.add(cm.AttrConf('jamtime_pedestrian_crossing_striping', 10, + groupnames=['parameters', 'pedestrian'], + name='Ped. jamtime at crossing', + unit='s', + perm='rw', + info="Time before pedestrian jams are resolved at crossings. For use with model 'striping'", + #cml = optionprefix+'--pedestrian.striping.jamtime', + )) + + self.add(cm.ObjConf(Electricalprofiles('eprofiles', self))) + + # column parameters self.add_col(SumoIdsConf('vtype', name='Type name', perm='rw')) self.add_col(am.IdsArrayConf('ids_mode', net.modes, @@ -162,6 +287,7 @@ # for temporary upgrade if hasattr(self.ids_mode, 'choices'): del self.ids_mode.choices + self.ids_mode.set_perm('rw') # if self.get_version() < 0.2: @@ -170,14 +296,14 @@ # ids_mode.groupnames = ['parameters'] self.add_col(am.ArrayConf('shares_in_mode', 1.0, - groupnames=['parameters'], + groupnames=['parameters', 'planning'], name='Share in mode', info="Share of this vehicle type within the same transport mode", xmltag='probability', )) self.add_col(am.ArrayConf('lengths', 5.0, - groupnames=['parameters'], + groupnames=['parameters', 'geometry'], name='Length', unit='m', info="The vehicle's netto-length", @@ -185,7 +311,7 @@ )) self.add_col(am.ArrayConf('widths', 2.0, - groupnames=['parameters'], + groupnames=['parameters', 'geometry'], name='Width', unit='m', info="The vehicle's width.", @@ -193,7 +319,7 @@ )) self.add_col(am.ArrayConf('heights', 1.5, - groupnames=['parameters'], + groupnames=['parameters', 'geometry'], name='Height', unit='m', info="The vehicle's height.", @@ -201,28 +327,28 @@ )) self.add_col(am.ArrayConf('numbers_persons_initial', 1, - groupnames=['parameters'], + groupnames=['parameters', 'logistics'], name='Passengers', info="Initial number of persons in the vehicle.", xmltag='personNumber', )) self.add_col(am.ArrayConf('capacities_persons', 1, - groupnames=['parameters'], + groupnames=['parameters', 'logistics'], name='Capacity', info="Maximum number of persons that fit in a vehicle.", xmltag='personCapacity', )) self.add_col(am.ArrayConf('numbers_container', 0, - groupnames=['parameters'], + groupnames=['parameters', 'logistics'], name='Containers', info="Initial number of containers on the vehicle.", xmltag='containerNumber', )) self.add_col(am.ArrayConf('speeds_max', 70.0, - groupnames=['parameters'], + groupnames=['parameters', 'mechanics'], name='Max. speed', unit='m/s', info="The vehicle's maximum velocity", @@ -230,37 +356,128 @@ )) self.add_col(am.ArrayConf('factors_speed', 1.0, - groupnames=['parameters'], + groupnames=['parameters', 'mechanics'], name='Speed factor', info="The vehicle's expected multiplicator for lane speed limits.", xmltag='speedFactor', )) self.add_col(am.ArrayConf('deviations_speed', 0.0, - groupnames=['parameters'], + groupnames=['parameters', 'mechanics'], name='Speed dev.', info="The deviation of the speed factor.", xmltag='speedDev', )) self.add_col(am.ArrayConf('accels', 0.8, - groupnames=['parameters'], + groupnames=['parameters', 'mechanics'], name='Max. accel.', unit='m/s^2', - info='The acceleration ability of vehicles of this type', + info='The deceleration ability of vehicles of this type', xmltag='accel', )) - self.add_col(am.ArrayConf('decels', 4.5, - groupnames=['parameters'], - name='Max. decel.', + self.add_col(am.ArrayConf('decels', 3.0, + groupnames=['parameters', 'mechanics'], + name='Decel.', unit='m/s^2', - info='The acceleration ability of vehicles of this type', + info='The typical brake deceleration of vehicles of this type', xmltag='decel', )) + self.add_col(am.ArrayConf('decels_apparent', 4.5, + groupnames=['parameters', 'mechanics'], + name='Apparent. decel.', + unit='m/s^2', + info='The apparent deceleration of the vehicle as used by the standard model (in m/s^2). The follower uses this value as expected maximal deceleration of the leader', + xmltag='apparentDecel', + )) + + self.add_col(am.ArrayConf('decels_emergency', 4.5, + groupnames=['parameters', 'mechanics'], + name='Emergency. decel.', + unit='m/s^2', + info='The maximal physically possible deceleration for the vehicle', + xmltag='emergencyDecel', + )) + + self.add_col(am.ArrayConf('powers_max', 100000.0, + groupnames=['parameters', 'energy', 'key'], + name='Max. power', + unit='W', + info='The maximalum mechanical power that the vehicle can provide.', + xmltag='maximumPower', + )) + + self.add_col(am.ArrayConf('masses', 1000.0, + groupnames=['parameters', 'mechanics', 'key'], + name='Mass', + unit='Kg', + info='Total vehicle mass', + xmltag='vehicleMass', + )) + + self.add_col(am.ArrayConf('areas_front_surface', 4.0, + groupnames=['parameters', 'key'], + name='Front surface area', + unit='m^2', + info='Front surface area.', + xmltag='frontSurfaceArea', + )) + + self.add_col(am.ArrayConf('coefficients_drag_air', 0.4, + groupnames=['parameters', 'mechanics', 'key'], + name='Air drag coefficient', + info='Air drag coefficient.', + xmltag='airDragCoefficient', + )) + + self.add_col(am.ArrayConf('moments_inertia_internal', 0.01, + groupnames=['parameters', 'mechanics', 'key'], + name='Internal moment of inertia', + unit='Kg m^2', + info='Mom. of inertia of int. rot. elements.', + xmltag='internalMomentOfInertia', + )) + + self.add_col(am.ArrayConf('coefficients_drag_radial', 0.5, + groupnames=['parameters', 'mechanics', 'key'], + name='Radial drag coefficient', + info='Radial drag coefficient.', + xmltag='radialDragCoefficient', + )) + + self.add_col(am.ArrayConf('coefficients_drag_roll', 0.01, + groupnames=['parameters', 'mechanics', 'key'], + name='Rolling resistance coefficient', + info='Rolling resistance coefficient.', + xmltag='rollDragCoefficient', + )) + + self.add_col(am.ArrayConf('powers_aux', 100.0, + groupnames=['parameters', 'energy', 'key'], + name='Constant auxiliary power', + unit='W', + info='Average constant auxiliary power intake (for electronics, airconditioning, lights, etc).', + xmltag='constantPowerIntake', + )) + + self.add_col(am.ArrayConf('efficiencies propulsion', 0.9, + groupnames=['parameters', 'energy', 'key'], + name='Propulsion efficiency', + info='Drive efficiency, the ratio between mechanical energy and consumed tank energy (fuel or batteries).', + xmltag='propulsionEfficiency', + )) + eprofiles = self.eprofiles.get_value() + self.add_col(am.IdsArrayConf('ids_eprofile', eprofiles, + groupnames=['parameters', 'energy'], + choices=eprofiles.ids_sumo.get_indexmap(), + name='Electrical profile', + info='Defines battery, energy recovery and charging parameters.', + )) + self.add_col(am.ArrayConf('taus', 1.0, - groupnames=['parameters'], + groupnames=['parameters', 'driver'], name='Reaction', unit='s', info="The driver's reaction time in s (actually the minimum time gap)", @@ -268,14 +485,14 @@ )) self.add_col(am.ArrayConf('sigmas', 0.5, - groupnames=['parameters'], + groupnames=['parameters', 'driver'], name='Driver', info='The driver imperfection in driving (between 0 and 1). Used only in follower models SUMOKrauss, SKOrig', xmltag='sigma', )) self.add_col(am.ArrayConf('dists_min', 2.5, - groupnames=['parameters'], + groupnames=['parameters', 'driver'], name='Min. gap', unit='m', info="Minimum empty space after leader.", @@ -283,37 +500,51 @@ )) self.add_col(am.ArrayConf('times_boarding', 15.0, - groupnames=['parameters'], + groupnames=['parameters', 'driver'], name='boarding time', unit='s', info="The time required by a person to board the vehicle.", xmltag='boardingDuration', )) - self.add_col(am.ArrayConf('times_loading', 180.0, - groupnames=['parameters'], + self.add_col(am.ArrayConf('times_loading', 180.0, + groupnames=['parameters', 'driver'], name='loading time', unit='s', info="The time required to load the vehicle.", xmltag='loadingDuration', )) + self.add_col(am.ArrayConf('have_reroute_device', False, + groupnames=['parameters'], + name='has reroute device', + info="Has a reroute device, which allows rerouting during the simulation. See also rerouting options", + xmltag='reroute', + )) + + self.add_col(am.ArrayConf('have_taxi_device', False, + groupnames=['parameters'], + name='has taxi device', + info="Vehicles with taxi devices can act as taxis and pick up and drop people from the virtual population who are using the taxi strategy.", + # xmltag = '',# tag set explicitely + )) + emissionclasses_xml = {} for key in EMISSIONCLASSES.keys(): emissionclasses_xml[key] = key # yes, map onto itself, otherwise choice values are taken self.add_col(am.ArrayConf('emissionclasses', 'HBEFA3/HDV_D_EU4', dtype='object', - groupnames=['parameters'], + groupnames=['parameters', 'emissions'], choices=get_inversemap(EMISSIONCLASSES), name='Emission', - info="HBEFA3 emission class, see https://sumo.dlr.de/wiki/Models/Emissions/HBEFA3-based", + info="HBEFA3 emission class, see sourceforge.net/apps/mediawiki/sumo/index.php?title=Simulation/Models/Emissions/HBEFA-based", xmltag='emissionClass', xmlmap=emissionclasses_xml, )) self.add_col(am.ArrayConf('impatiences', -1000.0, - groupnames=['parameters'], + groupnames=['parameters', 'driver'], name='Impatience', info="Impatience offset between -1000.0 and 1.0 (-100 or less equals off). Impatience grows at 1/teleport. If 1.0 is reached driver will disrigard priorities.", xmltag='impatience', @@ -321,43 +552,51 @@ self.add_col(am.ArrayConf('shapes_gui', "passenger", dtype='object', - groupnames=['parameters'], + groupnames=['parameters', 'geometry'], name='GUI shape', choices=GUISHAPES, info="How this vehicle is rendered.", xmltag='guiShape', )) + if self.get_version() < 0.3: + ids = self.get_ids() + changemap = {} + for _id, guishape in zip(ids, self.shapes_gui[ids]): + if guishape.split('/')[0] == 'transport': + guishape = guishape.replace('transport', 'truck') + self.shapes_gui.choices = 1*GUISHAPES + self.add_col(am.ArrayConf('colors', np.array((1.0, 1.0, 1.0, 1.0), np.float32), metatype='color', - groupnames=['parameters'], + groupnames=['parameters', 'geometry'], name='Color', info="This vehicle type's color as RGBA tuple with values from 0 to 1.0", xmltag='color', )) self.add_col(am.ArrayConf('lanechange_strategies', 1.0, - groupnames=['parameters'], + groupnames=['parameters', 'lanechange'], name='Lane strategy', info="Lanechange model strategy factor. The eagerness for performing strategic lane changing. Higher values result in earlier lane-changing. default: 1.0, range [0-inf]", xmltag='lcStrategic', )) self.add_col(am.ArrayConf('lanechange_coops', 1.0, - groupnames=['parameters'], + groupnames=['parameters', 'lanechange'], name='Lane coop', info="Lanechange model cooperative factor.The willingness for performing cooperative lane changing. Lower values result in reduced cooperation. default: 1.0, range [0-1]", xmltag='lcCooperative', )) self.add_col(am.ArrayConf('lanechange_gains', 1.0, - groupnames=['parameters'], + groupnames=['parameters', 'lanechange'], name='Lane gain', info="Lanechange model gain factor.The eagerness for performing lane changing to gain speed. Higher values result in more lane-changing. default: 1.0, range [0-inf]", xmltag='lcSpeedGain', )) self.add_col(am.ArrayConf('lanechange_rightkeepings', 1.0, - groupnames=['parameters'], + groupnames=['parameters', 'lanechange'], name='Lane right', info="Lanechange model keep right factor.The eagerness for following the obligation to keep right. Higher values result in earlier lane-changing. default: 1.0, range [0-inf]", xmltag='lcKeepRight', @@ -365,7 +604,7 @@ self.add_col(am.ArrayConf('sublane_alignments_lat', ALIGNMMENTS_LAT[0], dtype='object', - groupnames=['parameters'], + groupnames=['parameters', 'sublane'], choices=ALIGNMMENTS_LAT, name='sublane alignment', info='Lateral alignment within a lane. For sublane model only.', @@ -373,15 +612,23 @@ )) self.add_col(am.ArrayConf('sublane_speeds_max_lat', 1.0, - groupnames=['parameters'], + groupnames=['parameters', 'sublane'], name='Sublane max. speed', unit='m/s', info="The vehicle's maximum velocity in lateral direction. For sublane model only.", xmltag='maxSpeedLat', )) + self.add_col(am.ArrayConf('sublane_accel_lat', 2.5, + groupnames=['parameters', 'sublane'], + name='Sublane accel', + unit='m/s^2', + info="The vehicle's acceleration in lateral direction. For sublane model only.", + xmltag='lcAccelLat', + )) + self.add_col(am.ArrayConf('sublane_gaps_min_lat', 0.12, - groupnames=['parameters'], + groupnames=['parameters', 'sublane'], name='Sublane min. gap', unit='m', info="The vehicle's minimum distance to other vehicles in lateral direction. For sublane model only.", @@ -389,18 +636,51 @@ )) self.add_col(am.ArrayConf('sublane_alignments_eager', 1.0, - groupnames=['parameters'], + groupnames=['parameters', 'sublane'], name='Sublane eager', info="The eagerness using the configured lateral alignment within the lane. Higher values result in increased willingness to sacrifice speed for alignment. default: 1.0, range [0-inf]. For sublane model only.", xmltag='lcSublane', )) + self.add_col(am.ArrayConf('sublane_assertive', 1.0, + groupnames=['parameters', 'sublane'], + name='Sublane assertive', + info="Willingness to accept lower front and rear gaps on the target lane. default: 0, range 0 to 1. For sublane model only.", + xmltag='lcAssertive', + )) + self.add_col(am.ArrayConf('sublane_pushyfactors', 0.0, - groupnames=['parameters'], + groupnames=['parameters', 'sublane'], name='Sublane pushy', info="Willingness to encroach laterally on other drivers. default: 0.0, range 0 or 1. For sublane model only.", xmltag='lcPushy', )) + self.add_col(am.ArrayConf('sublane_impatiences', 1.0, + groupnames=['parameters', 'sublane'], + name='Sublane impatience', + info="dynamic factor for modifying lcAssertive and lcPushy. default: 0 (no effect) range -1 to 1. Impatience acts as a multiplier. At -1 the multiplier is 0.5 and at 1 the multiplier is 1.5. For sublane model only.", + xmltag='lcImpatience', + )) + + self.add_col(am.ArrayConf('sublane_time_to_impatiences', 1, + groupnames=['parameters', 'sublane'], + name='Sublane time to impatience', + info="Time to reach maximum impatience (of 1). Impatience grows whenever a lane-change manoeuvre is blocked.. For sublane model only.", + unit='s', + xmltag='lcTimeToImpatience', + )) + + self.add_col(am.ArrayConf('carfollowermodels', CARFOLLOWMODELS[0], # Kraus + groupnames=['parameters', 'driver'], + choices=CARFOLLOWMODELS, + name='Carfollower model', + info="Carfollower model.", + xmltag='carFollowModel', + )) + + if hasattr(self, 'sublane_impatience'): + self.delete('sublane_impatience') + self.delete('sublane_time_to_impatience') # this provides a link from public transport to vtypes # demand.ptlines.set_vtypes(self) @@ -445,13 +725,43 @@ def on_add_row(self, id_row=None): # print 'on_add_row',id_row,len(self),(id_row is None)|(len(self)==0) if (id_row is None) | (len(self) == 0): - + # print ' first' _id = self.add_row() # print ' add id=',_id + elif id_row is not None: + + row_last = self.get_row(id_row) + id_sumo = row_last['ids_sumo'] + id_data = id_sumo.split('_') + # print ' clone',id_data,len(id_data) + i = 1 + if len(id_data) == 1: + row_last['ids_sumo'] = id_sumo+'_%03d' % i + else: + # print ' create new i',int(id_data[-1]) + try: + i = int(id_data[-1]) + i += 1 + id_sumo = id_data[0] + for s in id_data[1:-1]: + id_sumo += '_'+s + # print ' new i:',i,id_sumo+'_%03d'%i + row_last['ids_sumo'] = id_sumo+'_%03d' % i + except: + id_sumo = id_data[0] + for s in id_data[1:]: + id_sumo += '_'+s + + row_last['ids_sumo'] = id_sumo+'_%03d' % i + + # print ' row_last',row_last + _id = self.add_row(**row_last) + # print ' _id',_id else: - # print ' dublicate' + print ' clone last' + i = 1 row_last = self.get_row(self.get_ids()[-1]) - row_last['ids_sumo'] += '_NEW' # important for all indexed attrs!! + row_last['ids_sumo'] += '_%03d' % i # important for all indexed attrs!! # print ' row_last',row_last _id = self.add_row(**row_last) # print ' _id',_id @@ -470,7 +780,7 @@ return id_vtype def add_vtype(self, vtype, **kwargs): - # print 'add_vtype',vtype + print 'add_vtype', vtype, kwargs if self.ids_sumo.has_index(vtype): # vtype already exist _id = self.ids_sumo.get_id_from_index(vtype) @@ -488,10 +798,22 @@ #_id = self.add_row( ids_sumo = vtype, ids_mode = id_mode,**kwargs) + if kwargs.has_key('eprofile'): + eprofiles = self.eprofiles.get_value() + eprofile = kwargs['eprofile'] + eprofiles.add_profile(eprofile, **kwargs) + id_eprofile = eprofiles.ids_sumo.get_id_from_index(eprofile) + emissionclass = 'Energy/unknown' + else: + id_eprofile = -1 + emissionclass = kwargs.get("emissionclass", None), + self.set_row(_id, shares_in_mode=kwargs.get("share_in_mode", 1.0), accels=kwargs.get("accel", 2.9), - decels=kwargs.get("decel", 7.5), + decels=kwargs.get("decel", 4.5), + decels_apparent=kwargs.get("decel_apparent", 4.5), + decels_emergency=kwargs.get("decel_emergency", 4.5), taus=kwargs.get("tau", None), sigmas=kwargs.get("sigma", 0.5), lengths=kwargs.get("length", 4.3), @@ -507,7 +829,7 @@ shapes_gui=kwargs.get("shape_gui", 'passenger'), numbers_persons=kwargs.get("number_persons", None), capacities_persons=kwargs.get("capacity_persons", None), - emissionclasses=kwargs.get("emissionclass", None), + emissionclasses=emissionclass, lanechanges=kwargs.get("lanechange", None), lanechange_strategies=kwargs.get("lanechange_strategy", None), lanechange_coops=kwargs.get("lanechange_coop", None), @@ -518,6 +840,22 @@ sublane_gaps_min_lat=kwargs.get("sublane_gap_min_lat", None), sublane_alignments_eager=kwargs.get("sublane_alignment_eager", None), sublane_pushyfactors=kwargs.get("sublane_pushyfactor", None), + sublane_impatiences=kwargs.get("sublane_impatience", None), + sublane_time_to_impatiences=kwargs.get("sublane_time_to_impatience", None), + # + powers_max=kwargs.get("power_max", None), + masses=kwargs.get("mass", None), + areas_front_surface=kwargs.get("area_front_surface", kwargs.get( + "width", 1.8)*kwargs.get("height", 1.50)), + coefficients_drag_air=kwargs.get("coefficient_drag_air", None), + moments_inertia_internal=kwargs.get("moment_inertia_internal", None), + coefficients_drag_radial=kwargs.get("coefficient_drag_radial", None), + coefficients_drag_roll=kwargs.get("coefficient_drag_roll", None), + efficiencies_propulsion=kwargs.get("efficiency_propulsion", None), + ids_eprofile=id_eprofile, + have_taxi_device=kwargs.get("has_taxi_device", False), + have_reroute_device=kwargs.get("has_reroute_device", False), + carfollowermodel=kwargs.get("carfollowermodel", CARFOLLOWMODELS[0]), ) return _id @@ -528,6 +866,8 @@ self.add_vtype('pedestrian', accel=1.5, decel=2.0, + decel_apparent=3.0, + decel_emergency=3.0, sigma=0.5, length=0.25, width=0.44, @@ -549,11 +889,14 @@ sublane_gap_min_lat=0.5, sublane_alignment_eager=0.5, sublane_pushyfactor=0.5, + carfollowermodel=CARFOLLOWMODELS[0], ) self.add_vtype('passenger1', accel=2.9, - decel=7.5, + decel=3.0, + decel_apparent=8.0, + decel_emergency=8.0, sigma=0.5, length=4.3, height=1.50, @@ -573,11 +916,14 @@ sublane_alignment_lat='center', sublane_speed_max_lat=1.0, sublane_gap_min_lat=0.12, + carfollowermodels=CARFOLLOWMODELS[0], ) self.add_vtype('bicycle', accel=1.2, decel=3.0, + decel_apparent=8.0, + decel_emergency=8.0, sigma=0.7, length=1.6, width=0.9, @@ -607,7 +953,9 @@ self.add_vtype('vespa', accel=4.5, - decel=7.5, + decel=4.5, + decel_apparent=8.0, + decel_emergency=8.0, sigma=0.7, length=1.5, height=1.7, @@ -633,7 +981,9 @@ self.add_vtype('motorcycle', accel=4.5, - decel=7.5, + decel=4.5, + decel_apparent=8.0, + decel_emergency=8.0, sigma=0.7, length=1.5, height=1.7, @@ -659,7 +1009,9 @@ self.add_vtype('taxi1', accel=1.9, - decel=3.5, + decel=2.5, + decel_apparent=8.0, + decel_emergency=8.0, sigma=0.5, length=5.0, height=1.80, @@ -679,12 +1031,15 @@ sublane_alignment_lat='center', sublane_speed_max_lat=0.8, sublane_gap_min_lat=0.12, + has_taxi_device=True, ) self.add_vtype('bus', share_in_mode=0.5, accel=1.2, - decel=4.0, + decel=2.0, + decel_apparent=8.0, + decel_emergency=8.0, sigma=0.9, length=12.0, height=3.4, @@ -710,7 +1065,9 @@ self.add_vtype('bus_flexible', share_in_mode=0.5, accel=1.2, - decel=4.0, + decel=2.0, + decel_apparent=8.0, + decel_emergency=8.0, sigma=0.9, length=17.9, width=2.5, @@ -735,7 +1092,9 @@ self.add_vtype('tram1', accel=1.0, - decel=3.0, + decel=1.2, + decel_apparent=1.5, + decel_emergency=1.5, sigma=0.9, length=22.0, width=2.4, @@ -760,7 +1119,9 @@ self.add_vtype('rail_urban1', accel=1.0, - decel=3.0, + decel=1.2, + decel_apparent=1.5, + decel_emergency=1.5, sigma=0.9, length=36.0, width=3.0, @@ -785,6 +1146,8 @@ self.add_vtype('van1', accel=1.9, decel=3.5, + decel_apparent=5.5, + decel_emergency=5.0, sigma=0.5, length=5.0, height=2.50, @@ -810,6 +1173,8 @@ share_in_mode=1.0/3, accel=1.5, decel=2.5, + decel_apparent=5.0, + decel_emergency=5.0, sigma=0.5, length=8.0, height=3.50, @@ -835,6 +1200,8 @@ share_in_mode=1.0/3, accel=1.0, decel=2.0, + decel_apparent=4.0, + decel_emergency=4.0, sigma=0.5, length=10.0, height=4.50, @@ -860,6 +1227,8 @@ share_in_mode=1.0/3, accel=1.0, decel=2.0, + decel_apparent=4.0, + decel_emergency=4.0, sigma=0.5, length=12.0, height=3.50, @@ -883,7 +1252,9 @@ self.add_vtype('evehicle1', accel=2.5, - decel=2.5, + decel=3.5, + decel_apparent=8.0, + decel_emergency=8.0, sigma=1.0, length=3.5, width=1.6, @@ -893,7 +1264,7 @@ dist_min=0.5, speed_max=120.0/3.6, deviation_speed=0.1, - emissionclass='HBEFA3/zero', + eprofile='evehicle', mode='evehicle', # specifies mode for demand color=np.array((255, 240, 0, 255), np.float32)/255.0, shape_gui='evehicle', @@ -903,6 +1274,19 @@ sublane_speed_max_lat=0.5, sublane_gap_min_lat=0.24, sublane_alignment_eager=1000000.0, + # + power_max=50000.0, + mass=800.0, + area_front_surface=3.5*1.6, + coefficient_drag_air=0.4, + moment_inertia_internal=0.01, + coefficient_drag_radial=0.5, + coefficient_drag_roll=0.005, + efficiency_propulsion=0.9, + # + capacity_battery=2000.0, + efficiency_reuperation=0.4, + speed_charging=0.03, ) def normalize_shares(self): @@ -935,7 +1319,10 @@ # print ' ids_veh_mode',ids_veh_mode # print ' share_veh_mode',share_veh_mode ind = np.argmax(random.rand(len(share_veh_mode))*share_veh_mode) - return ids_veh_mode[ind] + if is_sumoid: + return self.ids_sumo[ids_veh_mode[ind]] + else: + return ids_veh_mode[ind] def select_by_mode(self, id_mode=None, mode=None, is_sumoid=False, is_share=False): @@ -949,9 +1336,10 @@ id_mode = MODES[mode] # print 'select_by_mode',id_mode, mode - # print ' ids_mode',self.ids_mode.get_value() + # print ' ids',self.get_ids() + # print ' ids_mode',self.ids_mode[self.get_ids()] ids = self.select_ids(self.ids_mode.get_value() == id_mode) - #print 'select_by_mode',id_mode,self.ids_sumo[ids]# + #print ' ids_type',self.ids_sumo[ids]# # print ' ids_mode',self.ids_mode.get_value() if is_sumoid: idval = self.ids_sumo[ids] @@ -1028,11 +1416,27 @@ mode_choice[mode] = id_mode return mode_choice + def get_vtypechoices(self): + """ + Returns a dictionary of vehicle types for which there are + currently vehicles in the database. + Key is vehicle type name and value is vehicle type ID + """ + ids = self.get_ids() + type_choices = OrderedDict() + for id_type, name_type in zip(self.ids_sumo[ids], ids): + type_choices[name_type] = id_type + + return type_choices + def _write_xml_body(self, fd, indent, objconfigs, idcolconfig_include_tab, colconfigs, objcolconfigs, xmltag_item, attrconfig_id, xmltag_id, ids, ids_xml): - # print '_write_xml_body ident,ids',self.ident,ids - # print ' xmltag_item,xmltag_id,attrconfig_id' , xmltag_item,xmltag_id ,attrconfig_id + # print 'Vtypes._write_xml_body ident,ids',self.ident,ids + # print ' xmltag_item %s,xmltag_id %s,attrconfig_id %s'%(xmltag_item,xmltag_id ,attrconfig_id) + + # !!!these attrs cause error in duaiterate and duaroute in version 1.0 + attrsnames_exclude = [] # ['times_boarding','times_loading'] # ids_xml not used here!! if ids is None: @@ -1052,7 +1456,7 @@ for _id in ids: fd.write(xm.start(xmltag_item, indent+2)) - # print ' make tag and id',_id + # print ' vtypes:make tag and id',_id if xmltag_id == '': # no id tag will be written pass @@ -1065,36 +1469,70 @@ attrconfig_id.write_xml(fd, _id) if self.ids_mode[_id] == 1: - # write pedestrian mode + # print ' write pedestrian mode' + attrconfigs_key = [] for attrconfigname in self.attrconfignames_pedestrian: getattr(self, attrconfigname).write_xml(fd, _id) else: - # write all other modes - + # print ' write all other modes' + attrconfigs_key = self.get_group('key') # print ' write columns',len(scalarcolconfigs)>0,len(idcolconfig_include_tab)>0,len(objcolconfigs)>0 for attrconfig in scalarcolconfigs: # print ' scalarcolconfig',attrconfig.attrname - attrconfig.write_xml(fd, _id) + if attrconfig.attrname not in attrsnames_exclude: + if attrconfig not in attrconfigs_key: + attrconfig.write_xml(fd, _id) # insert lanechange model here: fd.write(xm.num('laneChangeModel', self.lanechangemodel.get_value())) - if (len(idcolconfig_include_tab) > 0) | (len(objcolconfigs) > 0): - fd.write(xm.stop()) + if self.have_taxi_device[_id]: + fd.write(""" line="taxi" """) + # if len(attrconfigs_key)==0: + # # no keyword parameters + # fd.write(xm.stopit()) + # else: + fd.write(xm.stop()) + if self.ids_eprofile[_id] != -1: + # write electricity profile + eprofiles = self.eprofiles.get_value() + id_eprofile = self.ids_eprofile[_id] + fd.write((indent+4)*' '+"""\n""") + + for attrconf in eprofiles.get_group('key'): + # print ' eprofile',attrconf.attrname,attrconf.xmltag,'value',attrconf[id_eprofile] + fd.write((indent+4)*' '+"""\n""" % + (attrconf.xmltag, attrconf[id_eprofile])) + + for attrconf in attrconfigs_key: + # print ' param',attrconf.attrname,attrconf.xmltag,'value',attrconf[id_eprofile] + fd.write((indent+4)*' '+"""\n""" % (attrconf.xmltag, attrconf[_id])) - for attrconfig in idcolconfig_include_tab: - # print ' include_tab',attrconfig.attrname - attrconfig.write_xml(fd, _id, indent+4) - - for attrconfig in objcolconfigs: - # print ' objcolconfig',attrconfig.attrname - attrconfig[_id].write_xml(fd, indent+4) - fd.write(xm.end(xmltag_item, indent+4)) - else: - fd.write(xm.stopit()) + if self.have_taxi_device[_id]: + fd.write((indent+4)*' '+"""\n""") + + fd.write(xm.end(xmltag_item, indent+4)) # print ' _write_xml_body: done' + def export_xml(self, filepath, encoding='UTF-8'): + print 'export_xml to %s' % (filepath) + + try: + fd = open(filepath, 'w') + except: + print 'WARNING in vtypes.export_xml: could not open', filepath + return False + + fd.write('\n' % encoding) + indent = 0 +## + + self.write_xml(fd, indent=indent, + #ids = ids_vtype_selected, + is_print_begin_end=True) + fd.close() + # def write_xml(self, fd, indent, xmltag_id = 'id', ids = None, # is_print_begin_end = True, attrconfigs_excluded = []): # @@ -1127,7 +1565,7 @@ if name == 'vType': params = {} - print 'startElement', attrs['id'], self._id_vclass_dist + # print 'startElement',attrs['id'],self._id_vclass_dist if attrs.has_key('laneChangeModel'): lanechangemodel = attrs['laneChangeModel'] if lanechangemodel in LANECHANGEMODELS: @@ -1145,7 +1583,7 @@ attrconfig = self._xmlattrmap[xmltag] params[attrconfig.attrname] = attrconfig.get_value_from_xmlattr(attrs) - print ' params', params + # print ' params',params self._add_vtype(attrs['id'], **params) elif name == 'vTypeDistribution': diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/virtualpop.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/virtualpop.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/virtualpop.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/virtualpop.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,8 +14,10 @@ # @file virtualpop.py # @author Joerg Schweizer -# @date +# @date 2012 +import os +import sys import numpy as np from numpy import random import agilepy.lib_base.classman as cm @@ -24,11 +26,11 @@ from agilepy.lib_base.misc import random_choice, get_inversemap from agilepy.lib_base.processes import Process -# from coremodules.modules_common import * +#from coremodules.modules_common import * from coremodules.network.network import SumoIdsConf, MODES from coremodules.network import routing from coremodules.simulation import results as res -from coremodules.demand.demandbase import * +from demandbase import * import virtualpop_results as res @@ -198,6 +200,39 @@ return times_begin + def add_activities(self, ids_activitytype, ids_facility, + hours_begin_earliest=None, + hours_begin_latest=None, + durations_min=None, + durations_max=None): + + n_pers = len(ids_activitytype) + activitytypes = self.ids_activitytype.get_linktab() + + if hours_begin_earliest is None: + # np.ones(n_pers, dtype = np.float32)* + hours_begin_earliest = activitytypes.hours_begin_earliest[ids_activitytype] + + if hours_begin_latest is None: + hours_begin_latest = activitytypes.hours_begin_latest[ids_activitytype] + + if durations_min is None: + durations_min = activitytypes.durations_min[ids_activitytype] + + if durations_max is None: + durations_max = activitytypes.durations_max[ids_activitytype] + + ids = self.add_rows(n=n_pers, + ids_activitytype=ids_activitytype, + ids_facility=ids_facility, + hours_begin_earliest=hours_begin_earliest, + hours_begin_latest=hours_begin_latest, + durations_min=durations_min, + durations_max=durations_max, + ) + + return ids + class IndividualAutos(am.ArrayObjman): @@ -333,13 +368,23 @@ return -1 return -1 + def get_info_from_id_sumo(self, id_veh_sumo): + if len(id_veh_sumo.split('.')) == 3: + prefix, id_veh, id_stage = id_veh_sumo.split('.') + if prefix == self.mode_prefix: + return int(id_veh), int(id_stage) + else: + return -1, -1 + return -1, -1 + # def append_ride(self, id_veh, id_ride): # ids_ride = self.ids_rides[id_veh] # if ids_ride is None: # self.ids_rides[id_veh] = [id_ride] # else: # ids_ride.append(id_ride) - def prepare_write_xml(self): + + def prepare_write_xml(self, is_route=True, is_plain=False): """ Prepare xml export. Must return export function. """ @@ -360,11 +405,89 @@ #self._time_veh_wait_after_stop = 3600 self._parking = virtualpop.get_landuse().parking self._time_after_unboarding = self.time_after_unboarding.get_value() - return self.write_xml + + # TODO: here we'd need also a case with is_plain and is_route + if is_plain: + return self.write_xml_no_line + + elif is_route: + return self.write_xml + else: + return self.write_xml_noroute def get_id_veh(self, id_stage): return self._rides.ids_iauto[id_stage] + def write_xml_no_line(self, fd, id_stage, time_begin, indent=2): + # same as write_xml, but without id_line, route and stops + + # TODO: actually this should go in individualvehicle + #time_veh_wait_after_stop = 3600 + #plans = self.get_plans() + #walkstages = plans.get_stagetable('walks') + #rides = plans.get_stagetable('autorides') + #activitystages = plans.get_stagetable('activities') + + rides = self._rides + #lanes = self._lanes + parking = self._parking + #net = self.get_net() + #lanes = net.lanes + #edges = net.edges + #ind_ride = rides.get_inds(id_stage) + id_veh = self.get_id_veh(id_stage) + #individualvehicle = self._iveh + id_vtype = self.ids_vtype[id_veh] + + # id_veh_ride, + # ids_vtypes_iveh[id_veh], + # ids_edges_rides_arr[ind_ride], + # ids_parking_from_rides_arr[ind_ride], + # ids_parking_to_rides_arr[ind_ride], + + id_parking_from = rides.ids_parking_from[id_stage] + id_lane_from = parking.ids_lane[id_parking_from] + #laneindex_from = self._lanes.indexes[id_lane_from] + pos_from = parking.positions[id_parking_from] + + id_parking_to = rides.ids_parking_to[id_stage] + id_lane_to = parking.ids_lane[id_parking_to] + #laneindex_to = self._lanes.indexes[id_lane_to] + pos_to = parking.positions[id_parking_to] + + # write unique veh ID to prevent confusion with other veh declarations + fd.write(xm.start('trip id="%s"' % self.get_id_veh_xml(id_veh, id_stage), indent+2)) + + # get start time of first stage of the plan + #id_plan = rides.ids_plan[id_stage] + #stages0, id_stage0 = self.get_plans().stagelists[id_plan][0] + + # this is the time when the vehicle appers in the scenario + fd.write(xm.num('depart', '%.d' % rides.times_init[id_stage])) + #fd.write(xm.num('depart', '%.d'%stages0.times_start[id_stage0])) + + fd.write(xm.num('type', self._ids_vtype_sumo[id_vtype])) + + # no line + #fd.write(xm.num('line', self.get_id_line_xml(id_veh) )) + + fd.write(xm.num('from', self._ids_edge_sumo[rides.ids_edges[id_stage]][0])) + fd.write(xm.num('to', self._ids_edge_sumo[rides.ids_edges[id_stage]][-1])) + + fd.write(xm.num('departPos', pos_from)) + fd.write(xm.num('departLane', self._lanes.indexes[id_lane_from])) + + fd.write(xm.stop()) + + # no route + # fd.write(xm.start('route',indent+4)) + # print ' edgeindex[ids_edge]',edgeindex[ids_edge] + # fd.write(xm.arr('edges',self._ids_edge_sumo[rides.ids_edges[id_stage]])) + + # no stops + + fd.write(xm.end('trip', indent+2)) + def write_xml(self, fd, id_stage, time_begin, indent=2): # TODO: actually this should go in individualvehicle @@ -459,6 +582,104 @@ fd.write(xm.end('vehicle', indent+2)) + def write_xml_noroute(self, fd, id_stage, time_begin, indent=2): + + # TODO: actually this should go in individualvehicle + #time_veh_wait_after_stop = 3600 + #plans = self.get_plans() + #walkstages = plans.get_stagetable('walks') + #rides = plans.get_stagetable('autorides') + #activitystages = plans.get_stagetable('activities') + + rides = self._rides + #lanes = self._lanes + parking = self._parking + #net = self.get_net() + #lanes = net.lanes + #edges = net.edges + #ind_ride = rides.get_inds(id_stage) + id_veh = self.get_id_veh(id_stage) + #individualvehicle = self._iveh + id_vtype = self.ids_vtype[id_veh] + + # id_veh_ride, + # ids_vtypes_iveh[id_veh], + # ids_edges_rides_arr[ind_ride], + # ids_parking_from_rides_arr[ind_ride], + # ids_parking_to_rides_arr[ind_ride], + + id_parking_from = rides.ids_parking_from[id_stage] + id_lane_from = parking.ids_lane[id_parking_from] + #laneindex_from = self._lanes.indexes[id_lane_from] + pos_from = parking.positions[id_parking_from] + + id_parking_to = rides.ids_parking_to[id_stage] + id_lane_to = parking.ids_lane[id_parking_to] + #laneindex_to = self._lanes.indexes[id_lane_to] + pos_to = parking.positions[id_parking_to] + + # write unique veh ID to prevent confusion with other veh declarations + fd.write(xm.start('trip id="%s"' % self.get_id_veh_xml(id_veh, id_stage), indent+2)) + + # get start time of first stage of the plan + #id_plan = rides.ids_plan[id_stage] + #stages0, id_stage0 = self.get_plans().stagelists[id_plan][0] + + # this is the time when the vehicle appers in the scenario + fd.write(xm.num('depart', '%.d' % rides.times_init[id_stage])) + #fd.write(xm.num('depart', '%.d'%stages0.times_start[id_stage0])) + + fd.write(xm.num('type', self._ids_vtype_sumo[id_vtype])) + fd.write(xm.num('line', self.get_id_line_xml(id_veh))) + + fd.write(xm.num('from', self._ids_edge_sumo[rides.ids_edges[id_stage]][0])) + fd.write(xm.num('to', self._ids_edge_sumo[rides.ids_edges[id_stage]][-1])) + + fd.write(xm.num('departPos', pos_from)) + fd.write(xm.num('departLane', self._lanes.indexes[id_lane_from])) + + fd.write(xm.stop()) + + # write route + # fd.write(xm.start('route',indent+4)) + # print ' edgeindex[ids_edge]',edgeindex[ids_edge] + # fd.write(xm.arr('edges',self._ids_edge_sumo[rides.ids_edges[id_stage]])) + + # does not seem to have an effect, always starts at base???? + #fd.write(xm.num('departPos', pos_from)) + #fd.write(xm.num('departLane', laneindex_from )) + # fd.write(xm.stopit()) + + # write depart stop + fd.write(xm.start('stop', indent+4)) + #id_lane = self._lanes.ids_edge[id_lane_from] + fd.write(xm.num('lane', self._get_sumoinfo_from_id_lane(id_lane_from))) + # in 0.31 the vehicle will wait until after this duration + # so it will be removed unless it will get a timeout function + #fd.write(xm.num('duration', time_veh_wait_after_stop)) + fd.write(xm.num('startPos', pos_from - parking.lengths[id_parking_from])) + fd.write(xm.num('endPos', pos_from)) + fd.write(xm.num('triggered', "True")) + + # chrashes with parking=True in 0.30! + # however if not parked the vhcle is blocking the traffic + # while waiting: workaround: delay departure to be shure that person already arrived + + fd.write(xm.num('parking', "True")) # in windows 0.30 parked vehicles do not depart!! + #fd.write(xm.num('parking', "False")) + fd.write(xm.stopit()) + + # write arrival stop + fd.write(xm.start('stop', indent+4)) + fd.write(xm.num('lane', self._get_sumoinfo_from_id_lane(id_lane_to))) + fd.write(xm.num('duration', self._time_after_unboarding)) # for unboarding only + fd.write(xm.num('startPos', pos_to - parking.lengths[id_parking_to])) + fd.write(xm.num('endPos', pos_to)) + #fd.write(xm.num('triggered', "True")) + fd.write(xm.stopit()) + + fd.write(xm.end('trip', indent+2)) + class IndividualBikes(IndividualAutos): @@ -500,7 +721,7 @@ def get_id_veh(self, id_stage): return self._rides.ids_ibike[id_stage] - def prepare_write_xml(self): + def prepare_write_xml(self, is_route=True, is_plain=False): """ Prepare xml export. Must return export function. """ @@ -516,10 +737,86 @@ self._get_laneid_allowed = self._edges.get_laneid_allowed self._get_sumoinfo_from_id_lane = scenario.net.lanes.get_sumoinfo_from_id_lane self._space_access = self.space_access.get_value() - return self.write_xml + if is_plain: + return self.write_xml_no_line + else: + return self.write_xml # def _limit_pos(self,pos,id_edge): + def write_xml_no_line(self, fd, id_stage, time_begin, indent=2): + rides = self._rides + id_veh = self.get_id_veh(id_stage) + # print 'write_xml',id_stage, time_begin,self.get_id_veh_xml(id_veh, id_stage) + # print ' ids_edge_from,ids_edge_to',rides.ids_edge_from[id_stage],rides.ids_edge_to[id_stage],self._get_laneid_allowed( rides.ids_edge_from[id_stage], self._id_mode),self._get_laneid_allowed( rides.ids_edge_to[id_stage], self._id_mode) + + # TODO: actually this should go in individualvehicle + #time_veh_wait_after_stop = 3600 + #plans = self.get_plans() + #walkstages = plans.get_stagetable('walks') + #rides = plans.get_stagetable('bikerides') + #activitystages = plans.get_stagetable('activities') + + # for debug only: + #virtualpop = self.get_virtualpop() + #ids_edge_sumo = virtualpop.get_net().edges.ids_sumo + + #parking = self.get_landuse().parking + #net = self.get_net() + #lanes = net.lanes + #edges = net.edges + + #ind_ride = rides.get_inds(id_stage) + + #individualvehicle = self.get_ibikes() + id_vtype = self.ids_vtype[id_veh] + + # id_veh_ride, + # ids_vtypes_iveh[id_veh], + # ids_edges_rides_arr[ind_ride], + # ids_parking_from_rides_arr[ind_ride], + # ids_parking_to_rides_arr[ind_ride], + + #id_parking_from = rides.ids_parking_from[id_stage] + #id_lane_from = parking.ids_lane[id_parking_from] + #laneindex_from = lanes.indexes[id_lane_from] + #pos_from = parking.positions[id_parking_from] + + #id_parking_to = rides.ids_parking_to[id_stage] + #id_lane_to = parking.ids_lane[id_parking_to] + #laneindex_to = lanes.indexes[id_lane_to] + #pos_to = parking.positions[id_parking_to] + + # write unique veh ID to prevent confusion with other veh declarations + fd.write(xm.start('trip id="%s"' % self.get_id_veh_xml(id_veh, id_stage), indent+2)) + + # get start time of first stage of the plan + #id_plan = rides.ids_plan[id_stage] + #stages0, id_stage0 = self.get_plans().stagelists[id_plan][0] + + # this is the time when the vehicle appers in the scenario + #fd.write(xm.num('depart', '%.d'%rides.times_init[id_stage])) + fd.write(xm.num('depart', '%.d' % time_begin)) + fd.write(xm.num('type', self._ids_vtype_sumo[id_vtype])) + #fd.write(xm.num('line', self.get_id_line_xml(id_veh) )) + #fd.write(xm.num('departPos', pos_from)) + #fd.write(xm.num('departLane', laneindex_from )) + fd.write(xm.num('from', self._ids_edge_sumo[rides.ids_edge_from[id_stage]])) + fd.write(xm.num('to', self._ids_edge_sumo[rides.ids_edge_to[id_stage]])) + pos_from = rides.positions_from[id_stage] + pos_to = rides.positions_to[id_stage] + fd.write(xm.num('departPos', pos_from)) + fd.write(xm.num('arrivalPos', pos_to)) + fd.write(xm.num('departLane', 'best')) + + fd.write(xm.stop()) + + # no route + + # no stops written here + + fd.write(xm.end('trip', indent+2)) + def write_xml(self, fd, id_stage, time_begin, indent=2): rides = self._rides id_veh = self.get_id_veh(id_stage) @@ -578,6 +875,7 @@ #fd.write(xm.num('departPos', pos_from)) #fd.write(xm.num('departLane', laneindex_from )) fd.write(xm.num('from', self._ids_edge_sumo[rides.ids_edge_from[id_stage]])) + fd.write(xm.num('to', self._ids_edge_sumo[rides.ids_edge_to[id_stage]])) pos_from = rides.positions_from[id_stage] pos_to = rides.positions_to[id_stage] fd.write(xm.num('departPos', pos_from)) @@ -658,7 +956,7 @@ IndividualBikes._init_constants(self) def def_mode(self): - self.mode = 'moped' + self.mode = 'motorcycle' self.mode_prefix = 'imoto' def get_ids_veh_pop(self): @@ -723,6 +1021,12 @@ unit='m', info='Minimum distance between starting position and node center.', )) + + def get_utility_specific(self, id_plan): + """Method returns a strategy specific Utility. Here simly a constant is returned. This constant needs to be defined as attribute of the specific strategy""" + + return 0.0 + # def _init_constants_strategy(self): # #print '_init_constants_strategy' # modes = self.get_virtualpop().get_scenario().net.modes @@ -762,7 +1066,7 @@ """ return zeros(len(ids_person), dtype=np.int32) - def plan(self, ids_person, logger=None): + def plan(self, ids_person, logger=None, **kwargs): """ Generates a plan for these person according to this strategie. Overriden by specific strategy. @@ -780,10 +1084,11 @@ attrsman = self.set_attrsman(cm.Attrsman(self)) -class TransitStrategy(StrategyMixin): +class WalkStrategy(StrategyMixin): def __init__(self, ident, parent=None, - name='Public Transport Strategy', - info='With this strategy, the person uses his private auto as main transport mode. He may accept passengers or public transport with P&R', + name='Walk Strategy', + info='With this strategy, the person walks to all destinations.', + version=0.1, **kwargs): self._init_objman(ident, parent, name=name, info=info, **kwargs) @@ -792,9 +1097,45 @@ self._init_attributes() self._init_constants() - def _init_attributes(self): + def _init_attributes(self, **kwargs): # print 'StrategyMixin._init_attributes' - pass + attrsman = self.get_attrsman() + + self.utility_constant = attrsman.add(cm.AttrConf('utility_constant', kwargs.get('utility_constant', -0.0556), + groupnames=['options'], + perm='rw', + name='Utility constant for walk strategy', + info='Constant to calculate utility: U = Const + value_of_time*time_exec', + )) + + self.is_walk_filter = attrsman.add(cm.AttrConf('is_walk_filter', kwargs.get('is_walk_filter', False), + groupnames=['options'], + name='Walk Filter', + info=""" Enable the Walk filter. + If it is True : Generate walk plans only for people who respect the max distance parameter. + If it is False: Generate walk plans for all virtual population. + """, + )) + + # if hasattr(self,'max_dist_fac'): + # dist_fac_max_default = self.max_dist_fac + # attrsman.delete('max_dist_fac') + # else: + # dist_fac_max_default = kwargs.get('dist_fac_max',500.0) + + self.dist_fac_max = attrsman.add(cm.AttrConf('dist_fac_max', kwargs.get('dist_fac_max', 500.0), + groupnames=['options'], + perm='rw', + name='Max distance facilities', + unit='m', + info="""Max distance between origin and destination facilities corrisponding to the first and second activity. + If the line of sight distance is greater than this distance, the walk plan will not be created. + Will be only applied to those who have not walking as preferred mode. + """, + )) + + # if self.get_version() < 0.1: + # self.set_version(0.1) def _init_constants(self): #virtualpop = self.get_virtualpop() @@ -815,10 +1156,15 @@ self._id_mode_auto = modes.get_id_mode('passenger') self._id_mode_moto = modes.get_id_mode('motorcycle') self._id_mode_bus = modes.get_id_mode('bus') + self._id_mode_ped = modes.get_id_mode('pedestrian') self.get_attrsman().do_not_save_attrs([ - '_id_mode_bike', '_id_mode_auto', '_id_mode_moto', '_id_mode_bus' + '_id_mode_bike', '_id_mode_auto', '_id_mode_moto', + '_id_mode_bus', '_id_mode_ped', ]) + def get_utility_specific(self, id_plan): + return self.utility_constant + def preevaluate(self, ids_person): """ Preevaluation strategies for person IDs in vector ids_person. @@ -837,37 +1183,60 @@ # TODO: here we could exclude by age or distance facilities-stops - # put 0 for persons whose preference is not public transport - preeval[persons.ids_mode_preferred[ids_person] != self._id_mode_bus] = 0 + # put 0 for persons whose preference is not walking, but can walk (everybody can walk) + preeval[persons.ids_mode_preferred[ids_person] != self._id_mode_ped] = 0 - # put 2 for persons with car access and who prefer cars - preeval[persons.ids_mode_preferred[ids_person] == self._id_mode_bus] = 2 + # put 2 for persons whose preference is walking + preeval[persons.ids_mode_preferred[ids_person] == self._id_mode_ped] = 2 - print ' TransitStrategy.preevaluate', len(np.flatnonzero(preeval)) + # in case + if self.is_walk_filter: + + max_dist_fac_sqr = self.dist_fac_max**2 + + vp = self.get_virtualpop() + scenario = vp.get_scenario() + + facilities = scenario.landuse.facilities + centroids = facilities.centroids + activities = vp.get_activities() + + ids_pers_filter = ids_person[persons.ids_mode_preferred[ids_person] != self._id_mode_ped] + for i, ids_activity in zip(xrange(len(ids_pers_filter)), vp.activitypatterns[ids_pers_filter]): + + id_act1 = ids_activity[0] + id_act2 = ids_activity[1] + id_fac_from = activities.ids_facility[id_act1] + id_fac_to = activities.ids_facility[id_act2] + dist_fac_sqr = np.sum((centroids[id_fac_from] - centroids[id_fac_to])**2) + if dist_fac_sqr > max_dist_fac_sqr: + preeval[i] = -1 + + print ' WalkStrategy.preevaluate', len(np.flatnonzero(preeval >= 0)) return preeval - def plan(self, ids_person, logger=None): + def plan(self, ids_person, logger=None, **kwargs): """ Generates a plan for these person according to this strategie. Overriden by specific strategy. """ - print 'TransitStrategy.pan', len(ids_person) + print 'WalkStrategy.pan', len(ids_person) #make_plans_private(self, ids_person = None, mode = 'passenger') # routing necessary? virtualpop = self.get_virtualpop() plans = virtualpop.get_plans() # self._plans demand = virtualpop.get_demand() - ptlines = demand.ptlines + #ptlines = demand.ptlines walkstages = plans.get_stagetable('walks') - transitstages = plans.get_stagetable('transits') + #transitstages = plans.get_stagetable('transits') activitystages = plans.get_stagetable('activities') activities = virtualpop.get_activities() activitytypes = demand.activitytypes landuse = virtualpop.get_landuse() facilities = landuse.facilities - parking = landuse.parking + #parking = landuse.parking scenario = virtualpop.get_scenario() net = scenario.net @@ -875,45 +1244,21 @@ lanes = net.lanes modes = net.modes - ptstops = net.ptstops - - # print ' demand',demand - # print ' demand.ptlines',demand.ptlines,dir(demand.ptlines) - # print ' demand.ptlines.get_ptlinks()',demand.ptlines.get_ptlinks() - # print ' demand.virtualpop',demand.virtualpop,dir(demand.virtualpop) - # print ' demand.trips',demand.trips,dir(demand.trips) - if len(ptlines) == 0: - print 'WARNING in TrasitStrategy.plan: no transit services available.' - return False - - ptlinks = ptlines.get_ptlinks() - ptlinktypes = ptlinks.types.choices - type_enter = ptlinktypes['enter'] - type_transit = ptlinktypes['transit'] - type_board = ptlinktypes['board'] - type_alight = ptlinktypes['alight'] - type_transfer = ptlinktypes['transfer'] - type_walk = ptlinktypes['walk'] - type_exit = ptlinktypes['exit'] - - ptfstar = ptlinks.get_fstar() - pttimes = ptlinks.get_times() - stops_to_enter, stops_to_exit = ptlinks.get_stops_to_enter_exit() + #ptstops = net.ptstops - ids_stoplane = ptstops.ids_lane ids_laneedge = net.lanes.ids_edge times_est_plan = plans.times_est # here we can determine edge weights for different modes # this could be centralized to avoid redundance - plans.prepare_stagetables(['walks', 'transits', 'activities']) + plans.prepare_stagetables(['walks', 'activities']) ids_person_act, ids_act_from, ids_act_to\ = virtualpop.get_activities_from_pattern(0, ids_person=ids_person) if len(ids_person_act) == 0: - print 'WARNING in TrasitStrategy.plan: no eligible persons found.' + print 'WARNING in WalkStrategy.plan: no eligible persons found.' return False # temporary maps from ids_person to other parameters @@ -997,22 +1342,22 @@ ids_edge_to = facilities.ids_roadedge_closest[ids_fac_to] poss_edge_to = facilities.positions_roadedge_closest[ids_fac_to] - ids_stop_from = ptstops.get_closest(centroids_from) - ids_stop_to = ptstops.get_closest(centroids_to) + #ids_stop_from = ptstops.get_closest(centroids_from) + #ids_stop_to = ptstops.get_closest(centroids_to) - ids_stopedge_from = ids_laneedge[ids_stoplane[ids_stop_from]] - ids_stopedge_to = ids_laneedge[ids_stoplane[ids_stop_to]] + #ids_stopedge_from = ids_laneedge[ids_stoplane[ids_stop_from]] + #ids_stopedge_to = ids_laneedge[ids_stoplane[ids_stop_to]] # do random pos here - poss_stop_from = 0.5*(ptstops.positions_from[ids_stop_from] - + ptstops.positions_to[ids_stop_from]) + # poss_stop_from = 0.5*( ptstops.positions_from[ids_stop_from]\ + # +ptstops.positions_to[ids_stop_from]) - poss_stop_to = 0.5*(ptstops.positions_from[ids_stop_to] - + ptstops.positions_to[ids_stop_to]) + # poss_stop_to = 0.5*( ptstops.positions_from[ids_stop_to]\ + # +ptstops.positions_to[ids_stop_to]) i = 0.0 - for id_person, id_plan, time_from, id_act_from, id_act_to, name_acttype_to, duration_act_to, id_edge_from, pos_edge_from, id_edge_to, pos_edge_to, id_stop_from, id_stopedge_from, pos_stop_from, id_stop_to, id_stopedge_to, pos_stop_to\ - in zip(ids_person_act, ids_plan, times_from, ids_act_from, ids_act_to, names_acttype_to, durations_act_to, ids_edge_from, poss_edge_from, ids_edge_to, poss_edge_to, ids_stop_from, ids_stopedge_from, poss_stop_from, ids_stop_to, ids_stopedge_to, poss_stop_to): + for id_person, id_plan, time_from, id_act_from, id_act_to, name_acttype_to, duration_act_to, id_edge_from, pos_edge_from, id_edge_to, pos_edge_to, \ + in zip(ids_person_act, ids_plan, times_from, ids_act_from, ids_act_to, names_acttype_to, durations_act_to, ids_edge_from, poss_edge_from, ids_edge_to, poss_edge_to): n_pers = len(ids_person_act) if logger: logger.progress(i/n_pers*100) @@ -1023,116 +1368,10 @@ id_stage_walk1, time = walkstages.append_stage(id_plan, time_from, id_edge_from=id_edge_from, position_edge_from=pos_edge_from, - id_edge_to=id_stopedge_from, - position_edge_to=pos_stop_from, # -7.0, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, # -7.0, ) - # print ' id_stopedge_from',id_stopedge_from - # print ' pos_stop_from',pos_stop_from - - # print - # print ' id_stopedge_to',id_stopedge_to - # print ' pos_stop_to',pos_stop_to - # print - # print ' id_stop_from',id_stop_from - # print ' id_stop_to',id_stop_to - - durations, linktypes, ids_line, ids_fromstop, ids_tostop =\ - ptlinks.route(id_stop_from, id_stop_to, - fstar=ptfstar, times=pttimes, - stops_to_enter=stops_to_enter, - stops_to_exit=stops_to_exit) - - # print ' routing done. make plan..' - - if len(linktypes) > 0: - if linktypes[-1] == type_walk: # is last stage a walk? - # remove it, because will go directly to destination - linktypes = linktypes[:-1] - ids_line = ids_line[:-1] - durations = durations[:-1] - ids_fromstop = ids_fromstop[:-1] - ids_tostop = ids_tostop[:-1] - - # print ' ids_line ',ids_line - # print ' ids_fromstop',ids_fromstop - # print ' ids_tostop ',ids_tostop - - if len(linktypes) > 0: # is there any public transport line to take? - - # go though PT links and generate transits and walks to trasfer - ids_stopedge_from = ids_laneedge[ids_stoplane[ids_fromstop]] - ids_stopedge_to = ids_laneedge[ids_stoplane[ids_tostop]] - poss_stop_from = 0.5*(ptstops.positions_from[ids_fromstop] - + ptstops.positions_to[ids_fromstop]) - poss_stop_to = 0.5*(ptstops.positions_from[ids_tostop] - + ptstops.positions_to[ids_tostop]) - - # this is wait time buffer to be added to the successive stage - # as waiting is currently not modelled as an extra stage - duration_wait = 0.0 - - # create stages for PT - for linktype, id_line, duration,\ - id_stopedge_from, pos_fromstop,\ - id_stopedge_to, pos_tostop in\ - zip(linktypes, - ids_line, - durations, - ids_stopedge_from, poss_stop_from, - ids_stopedge_to, poss_stop_to, - ): - print ' stage for linktype %2d fromedge %s toedge %s' % ( - linktype, edges.ids_sumo[id_stopedge_from], edges.ids_sumo[id_stopedge_to]) - - print ' id_stopedge_from,id_stopedge_to', id_stopedge_from, id_stopedge_to - if linktype == type_transit: # transit! - print ' add transit' - id_stage_transit, time = transitstages.append_stage( - id_plan, time, - id_line=id_line, - duration=duration+duration_wait, - id_fromedge=id_stopedge_from, - id_toedge=id_stopedge_to, - ) - duration_wait = 0.0 - - elif linktype == type_walk: # walk to transfer - print ' add transfer' - id_stage_transfer, time = walkstages.append_stage( - id_plan, time, - id_edge_from=id_stopedge_from, - position_edge_from=pos_fromstop, - id_edge_to=id_stopedge_to, - position_edge_to=pos_tostop, - duration=duration+duration_wait, - ) - duration_wait = 0.0 - - else: # all other link time are no modelld - # do not do anything , just add wait time to next stage - print ' add duration', duration - duration_wait += duration - - # walk from final stop to activity - # print ' Stage for linktype %2d fromedge %s toedge %s'%(linktype, edges.ids_sumo[id_stopedge_to],edges.ids_sumo[id_edge_to] ) - id_stage_walk2, time = walkstages.append_stage(id_plan, time, - id_edge_from=id_stopedge_to, - position_edge_from=pos_tostop, - id_edge_to=id_edge_to, - position_edge_to=pos_edge_to, - ) - - else: - # there is no public transport line linking these nodes. - # Modify walk directly from home to activity - time = walkstages.modify_stage(id_stage_walk1, time_from, - id_edge_from=id_edge_from, - position_edge_from=pos_edge_from, - id_edge_to=id_edge_to, - position_edge_to=pos_edge_to, - ) - # update time for trips estimation for this plan plans.times_est[id_plan] += time-time_from @@ -1158,10 +1397,10 @@ = virtualpop.get_activities_from_pattern(ind_act, ids_person=ids_person_act) -class WalkStrategy(StrategyMixin): +class AutoStrategy(StrategyMixin): def __init__(self, ident, parent=None, - name='Walk Strategy', - info='With this strategy, the person walks to all destinations.', + name='Auto strategy', + info='With this strategy, the person uses his private auto as main transport mode.', **kwargs): self._init_objman(ident, parent, name=name, info=info, **kwargs) @@ -1170,9 +1409,31 @@ self._init_attributes() self._init_constants() - def _init_attributes(self): + def _init_attributes(self, **kwargs): # print 'StrategyMixin._init_attributes' - pass + attrsman = self.get_attrsman() + + self.utility_constant = attrsman.add(cm.AttrConf('utility_constant', kwargs.get('utility_constant', 0.0), + groupnames=['options'], + perm='rw', + name='Utility constant for auto strategy', + info='Constant to calculate utility: U = Const + value_of_time*time_exec', + )) + + modechoices = self.get_virtualpop().get_scenario().net.modes.names.get_indexmap() + modechoices['No fallback'] = None + # print ' modechoices',modechoices + self.id_mode_fallback = attrsman.add(am.AttrConf('id_mode_fallback', modechoices['taxi'], + groupnames=['options'], + choices=modechoices, + name='Fallback Mode for Auto strategy', + info="""Transport mode to be used instead of "passenger" mode + in case the origin and destination cannot be connected by a route. + This is typically the case with origins or destinations + in traffic restricted zones. + Coose for example "taxi" to get access to traffic restricted Zones. + """, + )) def _init_constants(self): #virtualpop = self.get_virtualpop() @@ -1192,13 +1453,13 @@ self._id_mode_bike = modes.get_id_mode('bicycle') self._id_mode_auto = modes.get_id_mode('passenger') self._id_mode_moto = modes.get_id_mode('motorcycle') - self._id_mode_bus = modes.get_id_mode('bus') - self._id_mode_ped = modes.get_id_mode('pedestrian') self.get_attrsman().do_not_save_attrs([ '_id_mode_bike', '_id_mode_auto', '_id_mode_moto', - '_id_mode_bus', '_id_mode_ped', ]) + def get_utility_specific(self, id_plan): + return self.utility_constant + def preevaluate(self, ids_person): """ Preevaluation strategies for person IDs in vector ids_person. @@ -1212,72 +1473,95 @@ """ n_pers = len(ids_person) + print 'Autostrategy.preevaluate', n_pers, 'persons' persons = self.get_virtualpop() preeval = np.zeros(n_pers, dtype=np.int32) - # TODO: here we could exclude by age or distance facilities-stops + # put -1 for persons without car access + preeval[persons.ids_iauto[ids_person] == -1] = -1 + print ' persons having no auto', len(np.flatnonzero(persons.ids_iauto[ids_person] == -1)) - # put 0 for persons whose preference is not public transport - preeval[persons.ids_mode_preferred[ids_person] != self._id_mode_ped] = 0 + # put 0 for persons with car but with a different preferred mode + preeval[(persons.ids_iauto[ids_person] > -1) + & (persons.ids_mode_preferred[ids_person] != self._id_mode_auto)] = 0 - # put 2 for persons with car access and who prefer cars - preeval[persons.ids_mode_preferred[ids_person] == self._id_mode_ped] = 2 + print ' persons with car but with a different preferred mode', len(np.flatnonzero((persons.ids_iauto[ids_person] > -1) & (persons.ids_mode_preferred[ids_person] != self._id_mode_auto))) + + # put 2 for persons with car access and who prefer the car + preeval[(persons.ids_iauto[ids_person] > -1) + & (persons.ids_mode_preferred[ids_person] == self._id_mode_auto)] = 2 + print ' persons with car access and who prefer the car', len(np.flatnonzero((persons.ids_iauto[ids_person] > -1) & (persons.ids_mode_preferred[ids_person] == self._id_mode_auto))) - print ' WalkStrategy.preevaluate', len(np.flatnonzero(preeval)) return preeval - def plan(self, ids_person, logger=None): + # def are_feasible(self, ids_person): + # """ + # Returns a bool vector, with True values for + # persons where this strategy can be applied. + # """ + # persons = self.get_virtualpop() + # + # # check if person has a car + # # one may also check if there is parking available + # # at all desinations + # return persons.ids_iautos[ids_person] >= 0 + + def plan(self, ids_person, logger=None, **kwargs): """ Generates a plan for these person according to this strategie. Overriden by specific strategy. """ - print 'WalkStrategy.pan', len(ids_person) #make_plans_private(self, ids_person = None, mode = 'passenger') # routing necessary? virtualpop = self.get_virtualpop() plans = virtualpop.get_plans() # self._plans - demand = virtualpop.get_demand() - #ptlines = demand.ptlines - walkstages = plans.get_stagetable('walks') - #transitstages = plans.get_stagetable('transits') + ridestages = plans.get_stagetable('autorides') activitystages = plans.get_stagetable('activities') activities = virtualpop.get_activities() - activitytypes = demand.activitytypes + activitytypes = virtualpop.get_demand().activitytypes landuse = virtualpop.get_landuse() facilities = landuse.facilities - #parking = landuse.parking + parking = landuse.parking scenario = virtualpop.get_scenario() - net = scenario.net - edges = net.edges - lanes = net.lanes - modes = net.modes + edges = scenario.net.edges + lanes = scenario.net.lanes + modes = scenario.net.modes + demand = scenario.demand + vtyes = demand.vtypes - #ptstops = net.ptstops + ids_mode = scenario.demand.vtypes.ids_mode + iautos = virtualpop.get_iautos() - ids_laneedge = net.lanes.ids_edge + #times_est_plan = plans.times_est - times_est_plan = plans.times_est # here we can determine edge weights for different modes + plans.prepare_stagetables(['walks', 'autorides', 'activities']) - # this could be centralized to avoid redundance - plans.prepare_stagetables(['walks', 'activities']) + # get initial travel times for persons. + # initial travel times depend on the initial activity + + landuse.parking.clear_booking() ids_person_act, ids_act_from, ids_act_to\ = virtualpop.get_activities_from_pattern(0, ids_person=ids_person) if len(ids_person_act) == 0: - print 'WARNING in WalkStrategy.plan: no eligible persons found.' + print 'WARNING in Autostrategy.plan: no eligible persons found.' return False + # ok + # temporary maps from ids_person to other parameters + nm = np.max(ids_person_act)+1 map_ids_plan = np.zeros(nm, dtype=np.int32) #ids_plan_act = virtualpop.add_plans(ids_person_act, id_strategy = self.get_id_strategy()) map_ids_plan[ids_person_act] = virtualpop.add_plans(ids_person_act, id_strategy=self.get_id_strategy()) + # err map_times = np.zeros(nm, dtype=np.int32) map_times[ids_person_act] = activities.get_times_end(ids_act_from, pdf='unit') @@ -1287,8 +1571,35 @@ map_ids_fac_from = np.zeros(nm, dtype=np.int32) map_ids_fac_from[ids_person_act] = activities.ids_facility[ids_act_from] + # err + map_ids_parking_from = np.zeros(nm, dtype=np.int32) + map_are_fallback = np.zeros(nm, dtype=bool) + ids_parking_from, are_fallback = parking.get_closest_parkings(virtualpop.ids_iauto[ids_person_act], + ids_mode[iautos.ids_vtype[virtualpop.ids_iauto[ids_person_act]]], + facilities.centroids[activities.ids_facility[ids_act_from]], + dists_walk_max=virtualpop.dists_walk_max[ids_person_act], + id_mode_fallback=self.id_mode_fallback, + ) + #are_fallback = np.zeros(len(ids_person_act), dtype = bool) + + if len(ids_parking_from) == 0: + return False + + # err + + map_ids_parking_from[ids_person_act] = ids_parking_from + map_are_fallback[ids_person_act] = are_fallback + n_plans = len(ids_person_act) - print 'TrasitStrategy.plan n_plans=', n_plans + print 'AutoStrategy.plan n_plans=', n_plans + # print ' map_ids_parking_from[ids_person_act].shape',map_ids_parking_from[ids_person_act].shape + # set initial activity + # this is because the following steps start with travel + # and set the next activity + #names_acttype_from = activitytypes.names[activities.ids_activitytype[ids_act_from]] + # for id_plan + + ind_act = 0 # make initial activity stage ids_edge_from = facilities.ids_roadedge_closest[map_ids_fac_from[ids_person_act]] @@ -1317,7 +1628,8 @@ poss_edge_from): id_stage_act, time = activitystages.append_stage( - id_plan, time, + id_plan, + time, ids_activity=id_act_from, names_activitytype=name_acttype_from, durations=duration_act_from, @@ -1325,14 +1637,16 @@ positions=pos_edge_from, ) - ## - - ind_act = 0 - # main loop while there are persons performing # an activity at index ind_act while len(ids_person_act) > 0: ids_plan = map_ids_plan[ids_person_act] + ids_veh = virtualpop.ids_iauto[ids_person_act] + + #ids_mode = vtypes.ids_mode[iautos.ids_vtype[ids_veh]] + # print ids_veh + #inds_pers = virtualpop.get_inds(ids_person) + # self.persons.cols.mode_preferred[inds_pers]='private' times_from = map_times[ids_person_act] @@ -1342,52 +1656,135 @@ ids_fac_from = map_ids_fac_from[ids_person_act] ids_fac_to = activities.ids_facility[ids_act_to] - centroids_from = facilities.centroids[ids_fac_from] centroids_to = facilities.centroids[ids_fac_to] # origin edge and position ids_edge_from = facilities.ids_roadedge_closest[ids_fac_from] poss_edge_from = facilities.positions_roadedge_closest[ids_fac_from] - # destination edge and position - ids_edge_to = facilities.ids_roadedge_closest[ids_fac_to] - poss_edge_to = facilities.positions_roadedge_closest[ids_fac_to] + # this method will find and occupy parking space + ids_parking_from = map_ids_parking_from[ids_person_act] - #ids_stop_from = ptstops.get_closest(centroids_from) - #ids_stop_to = ptstops.get_closest(centroids_to) + # print ' ids_veh.shape',ids_veh.shape + # print ' centroids_to.shape',centroids_to.shape + ids_parking_to, are_fallback = parking.get_closest_parkings(ids_veh, + ids_mode[iautos.ids_vtype[ids_veh]], + centroids_to, + dists_walk_max=virtualpop.dists_walk_max[ids_person_act], + id_mode_fallback=self.id_mode_fallback, + ) - #ids_stopedge_from = ids_laneedge[ids_stoplane[ids_stop_from]] - #ids_stopedge_to = ids_laneedge[ids_stoplane[ids_stop_to]] + map_are_fallback[ids_person_act] |= are_fallback - # do random pos here - # poss_stop_from = 0.5*( ptstops.positions_from[ids_stop_from]\ - # +ptstops.positions_to[ids_stop_from]) + ids_lane_parking_from = parking.ids_lane[ids_parking_from] + ids_edge_parking_from = lanes.ids_edge[ids_lane_parking_from] + poss_edge_parking_from = parking.positions[ids_parking_from] - # poss_stop_to = 0.5*( ptstops.positions_from[ids_stop_to]\ - # +ptstops.positions_to[ids_stop_to]) + # print ' ids_parking_to.shape',ids_parking_to.shape + # print ' np.max(parking.get_ids()), np.max(ids_parking_to)',np.max(parking.get_ids()), np.max(ids_parking_to) + ids_lane_parking_to = parking.ids_lane[ids_parking_to] + ids_edge_parking_to = lanes.ids_edge[ids_lane_parking_to] + poss_edge_parking_to = parking.positions[ids_parking_to] + + # Fallback mode, if an auto can't run between origin and destination parkings, then the vehicle is changed with a taxy + # print ' prepare routing' + #fstar = edges.get_fstar(is_ignor_connections=False) + #times_primary = edges.get_times(id_mode= self._id_mode_auto, is_check_lanes=True) + + if self.id_mode_fallback is not None: + ids_vtype_fallback, share_fallback = demand.vtypes.select_by_mode(self.id_mode_fallback, is_share=True) + # print ' ids_vtype_fallback, share_fallback',ids_vtype_fallback, share_fallback + + # for id_edge_orig, id_edge_dest, id_veh, i in zip(ids_edge_parking_from, ids_edge_parking_to, ids_veh, range(len(ids_veh))): + # cost, route = routing.get_mincostroute_edge2edge(id_edge_orig, + # id_edge_dest, + # weights = times_primary,# mode dependent! + # fstar=fstar + # ) + # if route == []: + # if self.id_mode_fallback != 1: + # print 'fallback mode for vehicle %d of person %d'%(id_veh, virtualpop.get_iautos().ids_person[id_veh]) + # are_fallback[i] = True + # virtualpop.get_iautos().ids_vtype[id_veh] = np.random.choice(id_vtype_mode[0], p = id_vtype_mode[1]) + # print ids_veh + + # destination edge and position + ids_edge_to = facilities.ids_roadedge_closest[ids_fac_to] + poss_edge_to = facilities.positions_roadedge_closest[ids_fac_to] i = 0.0 - for id_person, id_plan, time_from, id_act_from, id_act_to, name_acttype_to, duration_act_to, id_edge_from, pos_edge_from, id_edge_to, pos_edge_to, \ - in zip(ids_person_act, ids_plan, times_from, ids_act_from, ids_act_to, names_acttype_to, durations_act_to, ids_edge_from, poss_edge_from, ids_edge_to, poss_edge_to): - n_pers = len(ids_person_act) + n_pers = len(ids_person_act) + for id_person, id_mode, is_fallback, id_plan, time_from, id_act_from, id_act_to, name_acttype_to, duration_act_to, id_veh, id_edge_from, pos_edge_from, id_edge_parking_from, pos_edge_parking_from, id_parking_from, id_parking_to, id_edge_parking_to, pos_edge_parking_to, id_edge_to, pos_edge_to\ + in zip(ids_person_act, ids_mode[iautos.ids_vtype[ids_veh]], map_are_fallback[ids_person_act], ids_plan, times_from, ids_act_from, ids_act_to, names_acttype_to, durations_act_to, ids_veh, ids_edge_from, poss_edge_from, ids_edge_parking_from, poss_edge_parking_from, ids_parking_from, ids_parking_to, ids_edge_parking_to, poss_edge_parking_to, ids_edge_to, poss_edge_to): if logger: logger.progress(i/n_pers*100) i += 1.0 - print 79*'_' - print ' id_plan=%d, id_person=%d, ' % (id_plan, id_person) - - id_stage_walk1, time = walkstages.append_stage(id_plan, time_from, - id_edge_from=id_edge_from, - position_edge_from=pos_edge_from, - id_edge_to=id_edge_to, - position_edge_to=pos_edge_to, # -7.0, - ) + #plans.set_row(id_plan, ids_person = id_person, ids_strategy = self.get_id_strategy()) - # update time for trips estimation for this plan - plans.times_est[id_plan] += time-time_from + # start creating stages for activity + id_stage_walk1, time = walkstages.append_stage( + id_plan, time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_parking_from, + position_edge_to=pos_edge_parking_from-1.5, # wait 1.5 m before nose of parked car + ) - # define current end time without last activity duration - plans.times_end[id_plan] = time + print ' id_person,id_veh', id_person, id_veh + # ride from car parking to road edge near activity + id_stage_car, time, is_fallback = ridestages.append_stage( + id_plan, + id_mode, + is_fallback, + self.id_mode_fallback, + time_start=time, + id_veh=id_veh, + # delay to be sure that person arrived!(workaround in combination with parking=False) + time_init=time+30, # time_from, + id_parking_from=id_parking_from, + id_parking_to=id_parking_to, + # TODO: here we could use id_edge_to as via edge to emulate search for parking + ) + + if is_fallback & (self.id_mode_fallback is not None): + # now we are sure fallback mode is needed + # set a fallback vtype for this id_veh + iautos.ids_vtype[id_veh] = np.random.choice(ids_vtype_fallback, p=share_fallback) + map_are_fallback[id_person] = True + + if id_stage_car > -1: + # print ' car ride successful' + id_stage_walk2, time = walkstages.append_stage( + id_plan, time, + id_edge_from=id_edge_parking_to, + position_edge_from=pos_edge_parking_to-1.5, # ecessary? + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + else: + # print ' parking not connected or distance too short, modify first walk and go directly to activity' + # print ' id_stage_walk1',id_stage_walk1,type(id_stage_walk1) + # print ' id_edge_from',id_edge_from + # print ' position_edge_from',position_edge_from + # print ' id_edge_to',id_edge_to + # print ' position_edge_to',position_edge_to + + time = walkstages.modify_stage( + id_stage_walk1, time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + + # store time estimation for this plan + # note that these are the travel times, no activity time + plans.times_est[id_plan] += time-time_from + + # define current end time without last activity duration + plans.times_end[id_plan] = time + + # finally add activity and respective duration id_stage_act, time = activitystages.append_stage( id_plan, time, @@ -1398,31 +1795,60 @@ positions=pos_edge_to, ) - # store time for next iteration in case other activities are - # following map_times[id_person] = time + # return time + ## + + # prepare next activity (not yet tested) + map_ids_parking_from[ids_person_act] = ids_parking_to # select persons and activities for next setp ind_act += 1 ids_person_act, ids_act_from, ids_act_to\ = virtualpop.get_activities_from_pattern(ind_act, ids_person=ids_person_act) + # update timing with (random) activity duration!! + return True -class AutoStrategy(StrategyMixin): + +class BikeStrategy(StrategyMixin): def __init__(self, ident, parent=None, - name='Auto strategy', - info='With this strategy, the person uses his private auto as main transport mode.', + name='Bike strategy', + info='With this strategy, the person uses his private bike as main transport mode.', **kwargs): self._init_objman(ident, parent, name=name, info=info, **kwargs) attrsman = self.set_attrsman(cm.Attrsman(self)) # specific init - self._init_attributes() + self._init_attributes(**kwargs) self._init_constants() - def _init_attributes(self): + def _init_attributes(self, **kwargs): # print 'StrategyMixin._init_attributes' - pass + attrsman = self.get_attrsman() + + self._init_attributes_strategy(**kwargs) + self.n_iter_bikeacces_max = attrsman.add(cm.AttrConf('n_iter_bikeacces_max', kwargs.get('n_iter_bikeacces_max', 5), + groupnames=['options'], + perm='rw', + name='Max. bike access search iterations', + info='Max. number of iterations while searching an edge with bike access.', + )) + + self.length_edge_min = attrsman.add(cm.AttrConf('length_edge_min', kwargs.get('length_edge_min', 20.0), + groupnames=['options'], + perm='rw', + name='Min. edge length search', + unit='m', + info='Min. edge length when searching an edge with bike access.', + )) + + self.utility_constant = attrsman.add(cm.AttrConf('utility_constant', kwargs.get('utility_constant', -0.5604), + groupnames=['options'], + perm='rw', + name='Utility constant for bike strategy', + info='Constant to calculate utility: U = Const + value_of_time*time_exec', + )) def _init_constants(self): #virtualpop = self.get_virtualpop() @@ -1439,12 +1865,18 @@ # self.get_attrsman().do_not_save_attrs(['_activitystages','_ridestages','_walkstages','_plans']) modes = self.get_virtualpop().get_scenario().net.modes + self._id_mode_ped = modes.get_id_mode('pedestrian') self._id_mode_bike = modes.get_id_mode('bicycle') self._id_mode_auto = modes.get_id_mode('passenger') self._id_mode_moto = modes.get_id_mode('motorcycle') + self._edges = self.get_virtualpop().get_scenario().net.edges self.get_attrsman().do_not_save_attrs([ '_id_mode_bike', '_id_mode_auto', '_id_mode_moto', - ]) + '_id_mode_ped', + '_edges']) + + def get_utility_specific(self, id_plan): + return self.utility_constant def preevaluate(self, ids_person): """ @@ -1459,139 +1891,352 @@ """ n_pers = len(ids_person) - print 'Autostrategy.preevaluate', n_pers, 'persons' + print 'BikeStrategy.preevaluate', n_pers, 'persons' persons = self.get_virtualpop() preeval = np.zeros(n_pers, dtype=np.int32) # put -1 for persons without car access - preeval[persons.ids_iauto[ids_person] == -1] = -1 - print ' persons having no auto', len(np.flatnonzero(persons.ids_iauto[ids_person] == -1)) + preeval[persons.ids_ibike[ids_person] == -1] = -1 + print ' persons having no bike', len(np.flatnonzero(persons.ids_ibike[ids_person] == -1)) - # put 0 for persons with car but with a different preferred mode - preeval[(persons.ids_iauto[ids_person] > -1) - & (persons.ids_mode_preferred[ids_person] != self._id_mode_auto)] = 0 + # put 0 for persons with bike but with a different preferred mode + preeval[(persons.ids_ibike[ids_person] > -1) + & (persons.ids_mode_preferred[ids_person] != self._id_mode_bike)] = 0 - print ' persons with car but with a different preferred mode', len(np.flatnonzero( - (persons.ids_iauto[ids_person] > -1) & (persons.ids_mode_preferred[ids_person] != self._id_mode_auto))) + print ' persons with bike but with a different preferred mode', len(np.flatnonzero((persons.ids_ibike[ids_person] > -1) & (persons.ids_mode_preferred[ids_person] != self._id_mode_bike))) - # put 2 for persons with car access and who prefer the car - preeval[(persons.ids_iauto[ids_person] > -1) - & (persons.ids_mode_preferred[ids_person] == self._id_mode_auto)] = 2 - print ' persons with car access and who prefer the car', len(np.flatnonzero( - (persons.ids_iauto[ids_person] > -1) & (persons.ids_mode_preferred[ids_person] == self._id_mode_auto))) + # put 2 for persons with bike access and who prefer the bike + preeval[(persons.ids_ibike[ids_person] > -1) + & (persons.ids_mode_preferred[ids_person] == self._id_mode_bike)] = 2 + print ' persons with car access and who prefer the car', len(np.flatnonzero((persons.ids_ibike[ids_person] > -1) & (persons.ids_mode_preferred[ids_person] == self._id_mode_bike))) return preeval - # def are_feasible(self, ids_person): - # """ - # Returns a bool vector, with True values for - # persons where this strategy can be applied. - # """ - # persons = self.get_virtualpop() - # - # # check if person has a car - # # one may also check if there is parking available - # # at all desinations - # return persons.ids_iautos[ids_person] >= 0 - - def plan(self, ids_person, logger=None): - """ - Generates a plan for these person according to this strategie. - Overriden by specific strategy. - """ - #make_plans_private(self, ids_person = None, mode = 'passenger') - # routing necessary? - virtualpop = self.get_virtualpop() - plans = virtualpop.get_plans() # self._plans - walkstages = plans.get_stagetable('walks') - ridestages = plans.get_stagetable('autorides') - activitystages = plans.get_stagetable('activities') + def get_edge_bikeaccess(self, id_edge, is_search_backward=False, is_get_route=False, is_star=False, bstar=0, fstar=0, n_iter_bikeacces_max=None): + # get firts edge allowing bikes and pedestrian, saving route, frontward or backward. You can include bstar or fstar: + # check only connected links. You can obtain also the route. + # print 'get_edge_bikeaccess',id_edge, is_search_backward,'id_sumo',self._edges.ids_sumo[id_edge] - activities = virtualpop.get_activities() - activitytypes = virtualpop.get_demand().activitytypes - landuse = virtualpop.get_landuse() - facilities = landuse.facilities - parking = landuse.parking + if n_iter_bikeacces_max is None: + n_iter_bikeacces_max = self.n_iter_bikeacces_max - scenario = virtualpop.get_scenario() - edges = scenario.net.edges - lanes = scenario.net.lanes - modes = scenario.net.modes + id_mode = self._id_mode_bike + id_mode_ped = self._id_mode_ped + get_accesslevel = self._edges.get_accesslevel + if is_star: + if is_search_backward: + get_next = bstar + else: + get_next = fstar + else: + if is_search_backward: + get_next = self._edges.get_incoming + else: + get_next = self._edges.get_outgoing - #times_est_plan = plans.times_est + edgelengths = self._edges.lengths + #ids_tried = set() + ids_current = [id_edge] + id_bikeedge = -1 + pos = 0.0 + n = 0 + ids = [id_edge] + coll_ids = [0] + route = [] + while (id_bikeedge < 0) & (n < n_iter_bikeacces_max): + n += 1 - # here we can determine edge weights for different modes - plans.prepare_stagetables(['walks', 'autorides', 'activities']) + ids_new = [] + for id_edge_test, is_long_enough in zip(ids_current, edgelengths[ids_current] > self.length_edge_min): + # print ' check id',id_edge_test, is_long_enough,get_accesslevel(id_edge_test, id_mode) + if is_long_enough & (get_accesslevel(id_edge_test, id_mode) >= 0) & (get_accesslevel(id_edge_test, id_mode_ped) >= 0): + id_bikeedge = id_edge_test - # get initial travel times for persons. - # initial travel times depend on the initial activity + if is_get_route: + if n == 1: + route = [] + else: + route.append(id_edge_test) + if n > 2: + route.append(coll_ids[ids.index(id_edge_test)]) + if n > 3: + for n in range(n-3): + route.append(coll_ids[ids.index(route[-1])]) - landuse.parking.clear_booking() + if is_search_backward is not True: + route.reverse() - ids_person_act, ids_act_from, ids_act_to\ - = virtualpop.get_activities_from_pattern(0, ids_person=ids_person) + # print ' found',id_bikeedge,self._edges.ids_sumo[id_bikeedge] + break + else: - if len(ids_person_act) == 0: - print 'WARNING in Autostrategy.plan: no eligible persons found.' - return False + if is_star: + ids_new += get_next[id_edge_test] + if is_get_route: + ids += get_next[id_edge_test] + for i in range(len(get_next[id_edge_test])): + coll_ids.append(id_edge_test) - # ok + else: + ids_new += get_next(id_edge_test) + if is_get_route: + ids += get_next(id_edge_test) + for i in range(len(get_next(id_edge_test))): + coll_ids += id_edge_test - # temporary maps from ids_person to other parameters - nm = np.max(ids_person_act)+1 - map_ids_plan = np.zeros(nm, dtype=np.int32) - #ids_plan_act = virtualpop.add_plans(ids_person_act, id_strategy = self.get_id_strategy()) - map_ids_plan[ids_person_act] = virtualpop.add_plans(ids_person_act, id_strategy=self.get_id_strategy()) + ids_current = ids_new - # err - map_times = np.zeros(nm, dtype=np.int32) - map_times[ids_person_act] = activities.get_times_end(ids_act_from, pdf='unit') + if id_bikeedge > -1: + if is_search_backward: + pos = edgelengths[id_bikeedge]-0.5*self.length_edge_min + else: + pos = 0.5*self.length_edge_min - # set start time to plans (important!) - plans.times_begin[map_ids_plan[ids_person_act]] = map_times[ids_person_act] + if id_bikeedge == -1: + print 'WARNING in get_edge_bikeaccess no access for', id_edge, self._edges.ids_sumo[id_edge] - map_ids_fac_from = np.zeros(nm, dtype=np.int32) - map_ids_fac_from[ids_person_act] = activities.ids_facility[ids_act_from] + if is_get_route: + return id_bikeedge, pos, route + else: + return id_bikeedge, pos - # err - map_ids_parking_from = np.zeros(nm, dtype=np.int32) - ids_parking_from, inds_vehparking = parking.get_closest_parkings(virtualpop.ids_iauto[ids_person_act], - facilities.centroids[activities.ids_facility[ids_act_from]]) - if len(ids_parking_from) == 0: - return False + def plan_bikeride(self, id_plan, time_from, id_veh, + id_edge_from, pos_edge_from, + id_edge_to, pos_edge_to, + dist_from_to, dist_walk_max, + walkstages, ridestages): - # err + # start creating stages + id_stage_walk1 = -1 + id_stage_bike = -1 - map_ids_parking_from[ids_person_act] = ids_parking_from + id_edge_from_bike, pos_from_bike = self.get_edge_bikeaccess(id_edge_from) + id_edge_to_bike, pos_to_bike = self.get_edge_bikeaccess(id_edge_to, is_search_backward=True) - n_plans = len(ids_person_act) - print 'AutoStrategy.plan n_plans=', n_plans - # print ' map_ids_parking_from[ids_person_act].shape',map_ids_parking_from[ids_person_act].shape - # set initial activity - # this is because the following steps start with travel - # and set the next activity - #names_acttype_from = activitytypes.names[activities.ids_activitytype[ids_act_from]] - # for id_plan + if (dist_from_to < dist_walk_max) | (id_edge_from_bike == -1) | (id_edge_to_bike == -1): + # print ' go by foot because distance is too short or no bike access',dist_from_to,id_edge_from_bike,id_edge_to_bike + id_stage_walk1, time = walkstages.append_stage( + id_plan, time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) - ind_act = 0 + else: + # print ' try to take the bike',id_veh + # print ' id_edge_from_bike',edges.ids_sumo[id_edge_from_bike],pos_from_bike + # print ' id_edge_to_bike',edges.ids_sumo[id_edge_to_bike],pos_to_bike - # make initial activity stage - ids_edge_from = facilities.ids_roadedge_closest[map_ids_fac_from[ids_person_act]] - poss_edge_from = facilities.positions_roadedge_closest[map_ids_fac_from[ids_person_act]] - # this is the time when first activity starts - # first activity is normally not simulated + if id_edge_from_bike != id_edge_from: + # print ' must walk from origin to bikerack',time_from - names_acttype_from = activitytypes.names[activities.ids_activitytype[ids_act_from]] - durations_act_from = activities.get_durations(ids_act_from) - times_from = map_times[ids_person_act]-durations_act_from - #times_from = activities.get_times_end(ids_act_from, pdf = 'unit') + id_stage_walk1, time = walkstages.append_stage( + id_plan, time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_from_bike, + position_edge_to=pos_from_bike, + ) - for id_plan,\ - time,\ - id_act_from,\ - name_acttype_from,\ - duration_act_from,\ - id_edge_from,\ + if id_edge_to_bike != id_edge_to: + # print ' must cycle from bikerack to dest bike rack',time + id_stage_bike, time = ridestages.append_stage( + id_plan, time, + id_veh=id_veh, + # delay to be sure that person arrived!(workaround in combination with parking=False) + time_init=time-10, # time_from, + id_edge_from=id_edge_from_bike, + position_edge_from=pos_from_bike, + id_edge_to=id_edge_to_bike, + position_edge_to=pos_to_bike, + ) + if id_stage_bike > -1: + # print ' must walk from dest bikerack to dest',time + id_stage_walk2, time = walkstages.append_stage( + id_plan, time, + id_edge_from=id_edge_to_bike, + position_edge_from=pos_to_bike, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + + else: + # print ' cycle from bikerack to destination',time + id_stage_bike, time = ridestages.append_stage( + id_plan, time, + id_veh=id_veh, + # delay to be sure that person arrived!(workaround in combination with parking=False) + time_init=time-10, # time_from, + id_edge_from=id_edge_from_bike, + position_edge_from=pos_from_bike, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + else: + # print ' cycle directly from orign edge',time_from + if id_edge_to_bike != id_edge_to: + # print ' must cycle from origin to bikerack',time_from + + #pos_to_bike = 0.1*edges.lengths[id_edge_to_bike] + id_stage_bike, time = ridestages.append_stage( + id_plan, time_from, + id_veh=id_veh, + # delay to be sure that person arrived!(workaround in combination with parking=False) + time_init=time_from-10, # time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_to_bike, + position_edge_to=pos_to_bike, + ) + if id_stage_bike > -1: + id_stage_walk2, time = walkstages.append_stage( + id_plan, time, + id_edge_from=id_edge_to_bike, + position_edge_from=pos_to_bike, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + else: + # print ' must cycle from origin to destination',time_from + id_stage_bike, time = ridestages.append_stage( + id_plan, time_from, + id_veh=id_veh, + # delay to be sure that person arrived!(workaround in combination with parking=False) + time_init=time_from-10, # time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + + # here we should have created a bike ride + # if not, for ehatever reason, + # we walk from origin to destination + if id_stage_bike == -1: + # print ' walk because no ride stage has been planned',time_from + if id_stage_walk1 == -1: + # no walk stage has been planned + id_stage_walk1, time = walkstages.append_stage( + id_plan, time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + + elif time_from == time: + # walking to bike has already been schedules, + # but cycling failed. So walk the whole way + time = walkstages.modify_stage( + id_stage_walk1, time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + return time + + def plan(self, ids_person, logger=None, **kwargs): + """ + Generates a plan for these person according to this strategie. + Overriden by specific strategy. + """ + #make_plans_private(self, ids_person = None, mode = 'passenger') + # routing necessary? + virtualpop = self.get_virtualpop() + plans = virtualpop.get_plans() # self._plans + walkstages = plans.get_stagetable('walks') + ridestages = plans.get_stagetable('bikerides') + activitystages = plans.get_stagetable('activities') + + activities = virtualpop.get_activities() + activitytypes = virtualpop.get_demand().activitytypes + landuse = virtualpop.get_landuse() + facilities = landuse.facilities + #parking = landuse.parking + + scenario = virtualpop.get_scenario() + edges = scenario.net.edges + lanes = scenario.net.lanes + modes = scenario.net.modes + + #times_est_plan = plans.times_est + + # here we can determine edge weights for different modes + plans.prepare_stagetables(['walks', 'bikerides', 'activities']) + + # get initial travel times for persons. + # initial travel times depend on the initial activity + + # landuse.parking.clear_booking() + + ids_person_act, ids_act_from, ids_act_to\ + = virtualpop.get_activities_from_pattern(0, ids_person=ids_person) + + if len(ids_person_act) == 0: + print 'WARNING in BikeStrategy.plan: no eligible persons found.' + return False + + # ok + + # temporary maps from ids_person to other parameters + nm = np.max(ids_person_act)+1 + map_ids_plan = np.zeros(nm, dtype=np.int32) + map_ids_plan[ids_person_act] = virtualpop.add_plans(ids_person_act, id_strategy=self.get_id_strategy()) + + map_times = np.zeros(nm, dtype=np.int32) + map_times[ids_person_act] = activities.get_times_end(ids_act_from, pdf='unit') + + # set start time to plans (important!) + plans.times_begin[map_ids_plan[ids_person_act]] = map_times[ids_person_act] + + map_ids_fac_from = np.zeros(nm, dtype=np.int32) + map_ids_fac_from[ids_person_act] = activities.ids_facility[ids_act_from] + + #map_ids_parking_from = np.zeros(nm, dtype = np.int32) + # ids_parking_from, inds_vehparking = parking.get_closest_parkings( virtualpop.ids_iauto[ids_person_act], + # facilities.centroids[activities.ids_facility[ids_act_from]]) + # if len(ids_parking_from)==0: + # return False + + # err + + #map_ids_parking_from[ids_person_act] = ids_parking_from + + n_plans = len(ids_person_act) + print 'BikeStrategy.plan n_plans=', n_plans + # print ' map_ids_parking_from[ids_person_act].shape',map_ids_parking_from[ids_person_act].shape + # set initial activity + # this is because the following steps start with travel + # and set the next activity + #names_acttype_from = activitytypes.names[activities.ids_activitytype[ids_act_from]] + # for id_plan + + ind_act = 0 + + # make initial activity stage + ids_edge_from = facilities.ids_roadedge_closest[map_ids_fac_from[ids_person_act]] + + poss_edge_from = facilities.positions_roadedge_closest[map_ids_fac_from[ids_person_act]] + poss_edge_from = self.clip_positions(poss_edge_from, ids_edge_from) + + # this is the time when first activity starts + # first activity is normally not simulated + + names_acttype_from = activitytypes.names[activities.ids_activitytype[ids_act_from]] + durations_act_from = activities.get_durations(ids_act_from) + times_from = map_times[ids_person_act]-durations_act_from + #times_from = activities.get_times_end(ids_act_from, pdf = 'unit') + + # do initial stage + # could be common to all strategies + for id_plan,\ + time,\ + id_act_from,\ + name_acttype_from,\ + duration_act_from,\ + id_edge_from,\ pos_edge_from \ in zip(map_ids_plan[ids_person_act], times_from, @@ -1614,10 +2259,8 @@ # an activity at index ind_act while len(ids_person_act) > 0: ids_plan = map_ids_plan[ids_person_act] - ids_veh = virtualpop.ids_iauto[ids_person_act] - #inds_pers = virtualpop.get_inds(ids_person) - # self.persons.cols.mode_preferred[inds_pers]='private' - + ids_veh = virtualpop.ids_ibike[ids_person_act] + dists_walk_max = virtualpop.dists_walk_max[ids_person_act] times_from = map_times[ids_person_act] names_acttype_to = activitytypes.names[activities.ids_activitytype[ids_act_to]] @@ -1626,96 +2269,61 @@ ids_fac_from = map_ids_fac_from[ids_person_act] ids_fac_to = activities.ids_facility[ids_act_to] - centroids_to = facilities.centroids[ids_fac_to] - # origin edge and position ids_edge_from = facilities.ids_roadedge_closest[ids_fac_from] poss_edge_from = facilities.positions_roadedge_closest[ids_fac_from] + poss_edge_from = self.clip_positions(poss_edge_from, ids_edge_from) + + centroids_from = facilities.centroids[ids_fac_from] # this method will find and occupy parking space - ids_parking_from = map_ids_parking_from[ids_person_act] + #ids_parking_from = map_ids_parking_from[ids_person_act] # print ' ids_veh.shape',ids_veh.shape # print ' centroids_to.shape',centroids_to.shape - ids_parking_to, inds_vehparking = parking.get_closest_parkings(ids_veh, centroids_to) + #ids_parking_to, inds_vehparking = parking.get_closest_parkings(ids_veh, centroids_to) - ids_lane_parking_from = parking.ids_lane[ids_parking_from] - ids_edge_parking_from = lanes.ids_edge[ids_lane_parking_from] - poss_edge_parking_from = parking.positions[ids_parking_from] + #ids_lane_parking_from = parking.ids_lane[ids_parking_from] + #ids_edge_parking_from = lanes.ids_edge[ids_lane_parking_from] + #poss_edge_parking_from = parking.positions[ids_parking_from] # print ' ids_parking_to.shape',ids_parking_to.shape # print ' np.max(parking.get_ids()), np.max(ids_parking_to)',np.max(parking.get_ids()), np.max(ids_parking_to) - ids_lane_parking_to = parking.ids_lane[ids_parking_to] - ids_edge_parking_to = lanes.ids_edge[ids_lane_parking_to] - poss_edge_parking_to = parking.positions[ids_parking_to] + #ids_lane_parking_to = parking.ids_lane[ids_parking_to] + #ids_edge_parking_to = lanes.ids_edge[ids_lane_parking_to] + #poss_edge_parking_to = parking.positions[ids_parking_to] # destination edge and position ids_edge_to = facilities.ids_roadedge_closest[ids_fac_to] - poss_edge_to = facilities.positions_roadedge_closest[ids_fac_to] + + poss_edge_to1 = facilities.positions_roadedge_closest[ids_fac_to] + poss_edge_to = self.clip_positions(poss_edge_to1, ids_edge_to) + centroids_to = facilities.centroids[ids_fac_to] + + # debug poscorrection..OK + # for id_edge, id_edge_sumo, length, pos_to1, pos in zip(ids_edge_to, edges.ids_sumo[ids_edge_to],edges.lengths[ids_edge_to],poss_edge_to1, poss_edge_to): + # print ' ',id_edge, 'IDe%s'%id_edge_sumo, 'L=%.2fm'%length, '%.2fm'%pos_to1, '%.2fm'%pos + + dists_from_to = np.sqrt(np.sum((centroids_to - centroids_from)**2, 1)) i = 0.0 n_pers = len(ids_person_act) - for id_person, id_plan, time_from, id_act_from, id_act_to, name_acttype_to, duration_act_to, id_veh, id_edge_from, pos_edge_from, id_edge_parking_from, pos_edge_parking_from, id_parking_from, id_parking_to, id_edge_parking_to, pos_edge_parking_to, id_edge_to, pos_edge_to\ - in zip(ids_person_act, ids_plan, times_from, ids_act_from, ids_act_to, names_acttype_to, durations_act_to, ids_veh, ids_edge_from, poss_edge_from, ids_edge_parking_from, poss_edge_parking_from, ids_parking_from, ids_parking_to, ids_edge_parking_to, poss_edge_parking_to, ids_edge_to, poss_edge_to): + for id_person, id_plan, time_from, id_act_from, id_act_to, name_acttype_to, duration_act_to, id_veh, id_edge_from, pos_edge_from, id_edge_to, pos_edge_to, dist_from_to, dist_walk_max\ + in zip(ids_person_act, ids_plan, times_from, ids_act_from, ids_act_to, names_acttype_to, durations_act_to, ids_veh, ids_edge_from, poss_edge_from, ids_edge_to, poss_edge_to, dists_from_to, dists_walk_max): if logger: logger.progress(i/n_pers*100) i += 1.0 - #plans.set_row(id_plan, ids_person = id_person, ids_strategy = self.get_id_strategy()) + print 79*'*' + print ' plan id_plan', id_plan, 'time_from', time_from, 'from', id_edge_from, pos_edge_from, 'to', id_edge_to, pos_edge_to + print ' id_edge_from', edges.ids_sumo[id_edge_from], 'id_edge_to', edges.ids_sumo[id_edge_to] - #times_est_plan[id_plan] = time-time_start - # map_times[id_person] = self.plan_activity(\ - # id_person, id_plan, time_from, - # id_act_from, id_act_to, - # name_acttype_to, duration_act_to, - # id_veh, - # id_edge_from, pos_edge_from, - # id_parking_from, id_edge_parking_from, pos_edge_parking_from, - # id_parking_to, id_edge_parking_to, pos_edge_parking_to, - # id_edge_to, pos_edge_to, edges.ids_lanes[id_edge_to][0]) + time = self.plan_bikeride(id_plan, time_from, id_veh, + id_edge_from, pos_edge_from, + id_edge_to, pos_edge_to, + dist_from_to, dist_walk_max, + walkstages, ridestages) - # start creating stages for activity - id_stage_walk1, time = walkstages.append_stage( - id_plan, time_from, - id_edge_from=id_edge_from, - position_edge_from=pos_edge_from, - id_edge_to=id_edge_parking_from, - position_edge_to=pos_edge_parking_from-1.5, # wait 1.5 m before nose of parked car - ) - - # ride from car parking to road edge near activity - id_stage_car, time = ridestages.append_stage( - id_plan, time, - id_veh=id_veh, - # delay to be sure that person arrived!(workaround in combination with parking=False) - time_init=time+30, # time_from, - id_parking_from=id_parking_from, - id_parking_to=id_parking_to, - # TODO: here we could use id_edge_to as via edge to emulate search for parking - ) - if id_stage_car >= 0: - # print ' car ride successful' - id_stage_walk2, time = walkstages.append_stage( - id_plan, time, - id_edge_from=id_edge_parking_to, - position_edge_from=pos_edge_parking_to-1.5, # ecessary? - id_edge_to=id_edge_to, - position_edge_to=pos_edge_to, - ) - else: - # print ' parking not connected or distance too short, modify first walk and go directly to activity' - # print ' id_stage_walk1',id_stage_walk1,type(id_stage_walk1) - # print ' id_edge_from',id_edge_from - # print ' position_edge_from',position_edge_from - # print ' id_edge_to',id_edge_to - # print ' position_edge_to',position_edge_to - - time = walkstages.modify_stage( - id_stage_walk1, time_from, - id_edge_from=id_edge_from, - position_edge_from=pos_edge_from, - id_edge_to=id_edge_to, - position_edge_to=pos_edge_to, - ) + ################ # store time estimation for this plan # note that these are the travel times, no activity time @@ -1747,90 +2355,11 @@ return True - def plan_activity(self, id_person, id_plan, time_start, - id_act_from, id_act_to, - name_acttype_to, duration_act_to, - id_veh, - id_edge_from, pos_edge_from, - id_parking_from, id_edge_parking_from, pos_edge_parking_from, - id_parking_to, id_edge_parking_to, pos_edge_parking_to, - id_edge_to, pos_edge_to, id_lane_to): - print 79*'_' - print ' id_plan=%d, id_person=%d, ids_veh=%d' % (id_plan, id_person, id_veh) - - plans = self.get_virtualpop().get_plans() - #stagetables = virtualpop.get_stagetables() - walkstages = plans.get_stagetable('walks') - ridestages = plans.get_stagetable('autorides') - activitystages = plans.get_stagetable('activities') - - id_stage_walk1, time = walkstages.append_stage( - id_plan, time_start, - id_edge_from=id_edge_from, - position_edge_from=pos_edge_from, - id_edge_to=id_edge_parking_from, - position_edge_to=pos_edge_parking_from-1.5, # wait 1.5 m before nose of parked car - ) - - # ride from car parking to road edge near activity - id_stage_car, time = ridestages.append_stage( - id_plan, time, - id_veh=id_veh, - # delay to be sure that person arrived!(workaround in combination with parking=False) - time_init=time+30, # time_start, - id_parking_from=id_parking_from, - id_parking_to=id_parking_to, - # TODO: here we could use id_edge_to as via edge to emulate search for parking - ) - if id_stage_car >= 0: - # print ' car ride successful' - id_stage_walk2, time = walkstages.append_stage( - id_plan, time, - id_edge_from=id_edge_parking_to, - position_edge_from=pos_edge_parking_to-1.5, # ecessary? - id_edge_to=id_edge_to, - position_edge_to=pos_edge_to, - ) - else: - # print ' parking not connected or distance too short, modify first walk and go directly to activity' - # print ' id_stage_walk1',id_stage_walk1,type(id_stage_walk1) - # print ' id_edge_from',id_edge_from - # print ' position_edge_from',position_edge_from - # print ' id_edge_to',id_edge_to - # print ' position_edge_to',position_edge_to - - time = walkstages.modify_stage( - id_stage_walk1, time_start, - id_edge_from=id_edge_from, - position_edge_from=pos_edge_from, - id_edge_to=id_edge_to, - position_edge_to=pos_edge_to, - ) - - # store time estimation for this plan - # note that these are the travel times, no activity time - plans.times_est[id_plan] += time-time_start - - # define current end time without last activity duration - plans.times_end[id_plan] = time - - # finally add activity and respective duration - id_stage_act, time = activitystages.append_stage( - id_plan, time, - ids_activity=id_act_to, - names_activitytype=name_acttype_to, - durations=duration_act_to, - ids_lane=id_lane_to, - positions=pos_edge_to, - ) - - return time - -class BikeStrategy(StrategyMixin): +class TaxiStrategy(StrategyMixin): def __init__(self, ident, parent=None, - name='Bike strategy', - info='With this strategy, the person uses his private bike as main transport mode.', + name='taxi strategy', + info='With this strategy, the person uses his private taxi as main transport mode.', **kwargs): self._init_objman(ident, parent, name=name, info=info, **kwargs) @@ -1844,21 +2373,28 @@ attrsman = self.get_attrsman() self._init_attributes_strategy(**kwargs) - self.n_iter_bikeacces_max = attrsman.add(cm.AttrConf('n_iter_bikeacces_max', kwargs.get('n_iter_bikeacces_max', 5), - groupnames=['options'], - perm='rw', - name='Max. bike access search iterations', - info='Max. number of iterations while searching an edge with bike access.', - )) + self.n_iter_acces_max = attrsman.add(cm.AttrConf('n_iter_acces_max', kwargs.get('n_iter_acces_max', 5), + groupnames=['options'], + perm='rw', + name='Max. access search iterations', + info='Max. number of iterations while searching an edge with taxi access.', + )) self.length_edge_min = attrsman.add(cm.AttrConf('length_edge_min', kwargs.get('length_edge_min', 20.0), groupnames=['options'], perm='rw', name='Min. edge length search', unit='m', - info='Min. edge length when searching an edge with bike access.', + info='Min. edge length when searching an edge with taxi access.', )) + self.utility_constant = attrsman.add(cm.AttrConf('utility_constant', kwargs.get('utility_constant', 0.0), + groupnames=['options'], + perm='rw', + name='Utility constant for taxi strategy', + info='Constant to calculate utility: U = Const + value_of_time*time_exec', + )) + def _init_constants(self): #virtualpop = self.get_virtualpop() #stagetables = virtualpop.get_stagetables() @@ -1875,15 +2411,17 @@ modes = self.get_virtualpop().get_scenario().net.modes self._id_mode_ped = modes.get_id_mode('pedestrian') - self._id_mode_bike = modes.get_id_mode('bicycle') - self._id_mode_auto = modes.get_id_mode('passenger') - self._id_mode_moto = modes.get_id_mode('motorcycle') + #self._id_mode_bike = modes.get_id_mode('bicycle') + #self._id_mode_auto = modes.get_id_mode('passenger') + self._id_mode_taxi = modes.get_id_mode('taxi') self._edges = self.get_virtualpop().get_scenario().net.edges self.get_attrsman().do_not_save_attrs([ - '_id_mode_bike', '_id_mode_auto', '_id_mode_moto', - '_id_mode_ped', + '_id_mode_ped', '_id_mode_taxi', '_edges']) + def get_utility_specific(self, id_plan): + return self.utility_constant + def preevaluate(self, ids_person): """ Preevaluation strategies for person IDs in vector ids_person. @@ -1897,72 +2435,111 @@ """ n_pers = len(ids_person) - print 'BikeStrategy.preevaluate', n_pers, 'persons' persons = self.get_virtualpop() preeval = np.zeros(n_pers, dtype=np.int32) - # put -1 for persons without car access - preeval[persons.ids_ibike[ids_person] == -1] = -1 - print ' persons having no bike', len(np.flatnonzero(persons.ids_ibike[ids_person] == -1)) - - # put 0 for persons with bike but with a different preferred mode - preeval[(persons.ids_ibike[ids_person] > -1) - & (persons.ids_mode_preferred[ids_person] != self._id_mode_bike)] = 0 + # TODO: here we could exclude by age or distance facilities-stops - print ' persons with bike but with a different preferred mode', len(np.flatnonzero( - (persons.ids_ibike[ids_person] > -1) & (persons.ids_mode_preferred[ids_person] != self._id_mode_bike))) + # put 0 for persons whose preference is not public transport + preeval[persons.ids_mode_preferred[ids_person] != self._id_mode_taxi] = 0 - # put 2 for persons with bike access and who prefer the bikr - preeval[(persons.ids_ibike[ids_person] > -1) - & (persons.ids_mode_preferred[ids_person] == self._id_mode_auto)] = 2 - print ' persons with car access and who prefer the car', len(np.flatnonzero( - (persons.ids_ibike[ids_person] > -1) & (persons.ids_mode_preferred[ids_person] == self._id_mode_bike))) + # put 2 for persons with car access and who prefer cars + preeval[persons.ids_mode_preferred[ids_person] == self._id_mode_taxi] = 2 + print ' TaxiStrategy.preevaluate', len(np.flatnonzero(preeval)) return preeval - def get_edge_bikeaccess(self, id_edge, is_search_backward=False): - + def get_edge_access(self, id_edge, is_search_backward=False, is_get_route=False, is_star=False, bstar=0, fstar=0, n_iter_acces_max=None): + # get firts edge allowing bikes and pedestrian, saving route, frontward or backward. You can include bstar or fstar: + # check only connected links. You can obtain also the route. # print 'get_edge_bikeaccess',id_edge, is_search_backward,'id_sumo',self._edges.ids_sumo[id_edge] - id_mode = self._id_mode_bike + print 'get_edge_access id_edge', id_edge, 'is_search_backward', is_search_backward, 'n_iter_acces_max', self.n_iter_acces_max + if n_iter_acces_max is None: + n_iter_acces_max = self.n_iter_acces_max + + id_mode = self._id_mode_taxi id_mode_ped = self._id_mode_ped get_accesslevel = self._edges.get_accesslevel - - if is_search_backward: - get_next = self._edges.get_incoming + if is_star: + if is_search_backward: + get_next = bstar + else: + get_next = fstar else: - get_next = self._edges.get_outgoing + if is_search_backward: + get_next = self._edges.get_incoming + else: + get_next = self._edges.get_outgoing edgelengths = self._edges.lengths #ids_tried = set() ids_current = [id_edge] - id_bikeedge = -1 + id_modeedge = -1 pos = 0.0 n = 0 - while (id_bikeedge < 0) & (n < self.n_iter_bikeacces_max): + ids = [id_edge] + coll_ids = [0] + route = [] + print 'start id_modeedge', id_modeedge, 'n', n, 'n_iter_acces_max', n_iter_acces_max, (id_modeedge < 0), (n < n_iter_acces_max) + + while (id_modeedge < 0) & (n < n_iter_acces_max): + print ' while id_modeedge', id_modeedge, 'n', n n += 1 + ids_new = [] for id_edge_test, is_long_enough in zip(ids_current, edgelengths[ids_current] > self.length_edge_min): - # print ' check id',id_edge_test, is_long_enough,get_accesslevel(id_edge_test, id_mode) + print ' check id', id_edge_test, is_long_enough, 'taxi access', get_accesslevel(id_edge_test, id_mode), 'ped access', get_accesslevel(id_edge_test, id_mode_ped) if is_long_enough & (get_accesslevel(id_edge_test, id_mode) >= 0) & (get_accesslevel(id_edge_test, id_mode_ped) >= 0): - id_bikeedge = id_edge_test - # print ' found',id_bikeedge,self._edges.ids_sumo[id_bikeedge] + id_modeedge = id_edge_test + + if is_get_route: + if n == 1: + route = [] + else: + route.append(id_edge_test) + if n > 2: + route.append(coll_ids[ids.index(id_edge_test)]) + if n > 3: + for n in range(n-3): + route.append(coll_ids[ids.index(route[-1])]) + if is_search_backward is not True: + route.reverse() + + print ' found', id_modeedge, self._edges.ids_sumo[id_modeedge] break else: - ids_new += get_next(id_edge_test) + + if is_star: + ids_new += get_next[id_edge_test] + if is_get_route: + ids += get_next[id_edge_test] + for i in range(len(get_next[id_edge_test])): + coll_ids.append(id_edge_test) + + else: + ids_new += get_next(id_edge_test) + if is_get_route: + ids += get_next(id_edge_test) + for i in range(len(get_next(id_edge_test))): + coll_ids += id_edge_test ids_current = ids_new - if id_bikeedge > -1: + if id_modeedge > -1: if is_search_backward: - pos = edgelengths[id_bikeedge]-0.5*self.length_edge_min + pos = edgelengths[id_modeedge]-0.5*self.length_edge_min else: pos = 0.5*self.length_edge_min - if id_bikeedge == -1: - print 'WARNING in get_edge_bikeaccess no access for', id_edge, self._edges.ids_sumo[id_edge] - return id_bikeedge, pos + if id_modeedge == -1: + print 'WARNING in TaxiStrategy.get_edge_access no access at id_edge', id_edge, self._edges.ids_sumo[id_edge] - def plan_bikeride(self, id_plan, time_from, id_veh, + if is_get_route: + return id_modeedge, pos, route + else: + return id_modeedge, pos + + def plan_taxiride(self, id_plan, time_from, id_veh, id_edge_from, pos_edge_from, id_edge_to, pos_edge_to, dist_from_to, dist_walk_max, @@ -1970,13 +2547,13 @@ # start creating stages id_stage_walk1 = -1 - id_stage_bike = -1 + id_stage_moto = -1 - id_edge_from_bike, pos_from_bike = self.get_edge_bikeaccess(id_edge_from) - id_edge_to_bike, pos_to_bike = self.get_edge_bikeaccess(id_edge_to, is_search_backward=True) + id_edge_from_taxi, pos_from_taxi = self.get_edge_access(id_edge_from) + id_edge_to_taxi, pos_to_taxi = self.get_edge_access(id_edge_to, is_search_backward=True) - if (dist_from_to < dist_walk_max) | (id_edge_from_bike == -1) | (id_edge_to_bike == -1): - # print ' go by foot because distance is too short or no bike access',dist_from_to,id_edge_from_bike,id_edge_to_bike + if (dist_from_to < dist_walk_max) | (id_edge_from_taxi == -1) | (id_edge_to_taxi == -1): + print ' go by foot because distance is too short or no taxi access', dist_from_to, id_edge_from_taxi, id_edge_to_taxi id_stage_walk1, time = walkstages.append_stage( id_plan, time_from, id_edge_from=id_edge_from, @@ -1986,97 +2563,98 @@ ) else: - # print ' try to take the bike',id_veh - # print ' id_edge_from_bike',edges.ids_sumo[id_edge_from_bike],pos_from_bike - # print ' id_edge_to_bike',edges.ids_sumo[id_edge_to_bike],pos_to_bike - - if id_edge_from_bike != id_edge_from: - # print ' must walk from origin to bikerack',time_from - + print ' try to take the taxi' + # print ' id_edge_from_taxi',edges.ids_sumo[id_edge_from_taxi],pos_from_taxi + # print ' id_edge_to_taxi',edges.ids_sumo[id_edge_to_taxi],pos_to_taxi + + if id_edge_from_taxi != id_edge_from: + print ' must walk from origin to taxi accessible edge, time_from', time_from + # walk to taxi edge id_stage_walk1, time = walkstages.append_stage( id_plan, time_from, id_edge_from=id_edge_from, position_edge_from=pos_edge_from, - id_edge_to=id_edge_from_bike, - position_edge_to=pos_from_bike, + id_edge_to=id_edge_from_taxi, + position_edge_to=pos_from_taxi, ) - if id_edge_to_bike != id_edge_to: - # print ' must cycle from bikerack to dest bike rack',time - id_stage_bike, time = ridestages.append_stage( + if id_edge_to_taxi != id_edge_to: + print ' must walk from taxi accessible edge to dest, time_from', time + # take taxi + id_stage_taxi, time = ridestages.append_stage( id_plan, time, id_veh=id_veh, - # delay to be sure that person arrived!(workaround in combination with parking=False) - time_init=time-10, # time_from, - id_edge_from=id_edge_from_bike, - position_edge_from=pos_from_bike, - id_edge_to=id_edge_to_bike, - position_edge_to=pos_to_bike, + # could book taxi here in advance? + time_init=time-10, # needed with taxi?? + id_edge_from=id_edge_from_taxi, + position_edge_from=pos_from_taxi, + id_edge_to=id_edge_to_taxi, + position_edge_to=pos_to_taxi, ) - if id_stage_bike > -1: - # print ' must walk from dest bikerack to dest',time + if id_stage_taxi > -1: + # walk to dest id_stage_walk2, time = walkstages.append_stage( id_plan, time, - id_edge_from=id_edge_to_bike, - position_edge_from=pos_to_bike, + id_edge_from=id_edge_to_taxi, + position_edge_from=pos_to_taxi, id_edge_to=id_edge_to, position_edge_to=pos_edge_to, ) else: - # print ' cycle from bikerack to destination',time - id_stage_bike, time = ridestages.append_stage( + print ' ride taxi from taxi edge to destination', time + # take taxi + id_stage_taxi, time = ridestages.append_stage( id_plan, time, id_veh=id_veh, - # delay to be sure that person arrived!(workaround in combination with parking=False) - time_init=time-10, # time_from, - id_edge_from=id_edge_from_bike, - position_edge_from=pos_from_bike, + # could book taxi here in advance? + time_init=time, # time_from, + id_edge_from=id_edge_from_taxi, + position_edge_from=pos_from_taxi, id_edge_to=id_edge_to, position_edge_to=pos_edge_to, ) else: - # print ' cycle directly from orign edge',time_from - if id_edge_to_bike != id_edge_to: - # print ' must cycle from origin to bikerack',time_from + print ' take taxi directly from edge of origin', time_from + if id_edge_to_taxi != id_edge_to: + print ' must walk from taxi accessible destination to destination', time_from - #pos_to_bike = 0.1*edges.lengths[id_edge_to_bike] - id_stage_bike, time = ridestages.append_stage( + id_stage_taxi, time = ridestages.append_stage( id_plan, time_from, id_veh=id_veh, - # delay to be sure that person arrived!(workaround in combination with parking=False) - time_init=time_from-10, # time_from, + # could book taxi here in advance? + time_init=time_from, # time_from, id_edge_from=id_edge_from, position_edge_from=pos_edge_from, - id_edge_to=id_edge_to_bike, - position_edge_to=pos_to_bike, + id_edge_to=id_edge_to_taxi, + position_edge_to=pos_to_taxi, ) - if id_stage_bike > -1: + if id_stage_taxi > -1: id_stage_walk2, time = walkstages.append_stage( id_plan, time, - id_edge_from=id_edge_to_bike, - position_edge_from=pos_to_bike, + id_edge_from=id_edge_to_taxi, + position_edge_from=pos_to_taxi, id_edge_to=id_edge_to, position_edge_to=pos_edge_to, ) else: - # print ' must cycle from origin to destination',time_from - id_stage_bike, time = ridestages.append_stage( + print ' take taxi directly from origin to destination', time_from + id_stage_taxi, time = ridestages.append_stage( id_plan, time_from, id_veh=id_veh, - # delay to be sure that person arrived!(workaround in combination with parking=False) - time_init=time_from-10, # time_from, + # could book taxi here in advance? + time_init=time_from, # time_from, id_edge_from=id_edge_from, position_edge_from=pos_edge_from, id_edge_to=id_edge_to, position_edge_to=pos_edge_to, ) - # here we should have created a bike ride - # if not, for ehatever reason, + # here we should have created a taxi ride + # if not, for whatever reason, # we walk from origin to destination - if id_stage_bike == -1: - # print ' walk because no ride stage has been planned',time_from + if id_stage_taxi == -1: + print ' walk because no ride stage has been planned', time_from if id_stage_walk1 == -1: # no walk stage has been planned id_stage_walk1, time = walkstages.append_stage( @@ -2088,8 +2666,8 @@ ) elif time_from == time: - # walking to bike has already been schedules, - # but cycling failed. So walk the whole way + # walking to taxi has already been schedules, + # but taxi ride failed. So walk the whole way time = walkstages.modify_stage( id_stage_walk1, time_from, id_edge_from=id_edge_from, @@ -2109,7 +2687,7 @@ virtualpop = self.get_virtualpop() plans = virtualpop.get_plans() # self._plans walkstages = plans.get_stagetable('walks') - ridestages = plans.get_stagetable('bikerides') + ridestages = plans.get_stagetable('taxirides') activitystages = plans.get_stagetable('activities') activities = virtualpop.get_activities() @@ -2126,7 +2704,7 @@ #times_est_plan = plans.times_est # here we can determine edge weights for different modes - plans.prepare_stagetables(['walks', 'bikerides', 'activities']) + plans.prepare_stagetables(['walks', 'taxirides', 'activities']) # get initial travel times for persons. # initial travel times depend on the initial activity @@ -2137,7 +2715,7 @@ = virtualpop.get_activities_from_pattern(0, ids_person=ids_person) if len(ids_person_act) == 0: - print 'WARNING in BikeStrategy.plan: no eligible persons found.' + print 'WARNING in TaxiStrategy.plan: no eligible persons found.' return False # ok @@ -2167,7 +2745,7 @@ #map_ids_parking_from[ids_person_act] = ids_parking_from n_plans = len(ids_person_act) - print 'BikeStrategy.plan n_plans=', n_plans + print 'TaxiStrategy.plan n_plans=', n_plans # print ' map_ids_parking_from[ids_person_act].shape',map_ids_parking_from[ids_person_act].shape # set initial activity # this is because the following steps start with travel @@ -2221,7 +2799,7 @@ # an activity at index ind_act while len(ids_person_act) > 0: ids_plan = map_ids_plan[ids_person_act] - ids_veh = virtualpop.ids_ibike[ids_person_act] + ids_veh = virtualpop.ids_imoto[ids_person_act] dists_walk_max = virtualpop.dists_walk_max[ids_person_act] times_from = map_times[ids_person_act] @@ -2238,23 +2816,6 @@ centroids_from = facilities.centroids[ids_fac_from] - # this method will find and occupy parking space - #ids_parking_from = map_ids_parking_from[ids_person_act] - - # print ' ids_veh.shape',ids_veh.shape - # print ' centroids_to.shape',centroids_to.shape - #ids_parking_to, inds_vehparking = parking.get_closest_parkings(ids_veh, centroids_to) - - #ids_lane_parking_from = parking.ids_lane[ids_parking_from] - #ids_edge_parking_from = lanes.ids_edge[ids_lane_parking_from] - #poss_edge_parking_from = parking.positions[ids_parking_from] - - # print ' ids_parking_to.shape',ids_parking_to.shape - # print ' np.max(parking.get_ids()), np.max(ids_parking_to)',np.max(parking.get_ids()), np.max(ids_parking_to) - #ids_lane_parking_to = parking.ids_lane[ids_parking_to] - #ids_edge_parking_to = lanes.ids_edge[ids_lane_parking_to] - #poss_edge_parking_to = parking.positions[ids_parking_to] - # destination edge and position ids_edge_to = facilities.ids_roadedge_closest[ids_fac_to] @@ -2262,10 +2823,6 @@ poss_edge_to = self.clip_positions(poss_edge_to1, ids_edge_to) centroids_to = facilities.centroids[ids_fac_to] - # debug poscorrection..OK - # for id_edge, id_edge_sumo, length, pos_to1, pos in zip(ids_edge_to, edges.ids_sumo[ids_edge_to],edges.lengths[ids_edge_to],poss_edge_to1, poss_edge_to): - # print ' ',id_edge, 'IDe%s'%id_edge_sumo, 'L=%.2fm'%length, '%.2fm'%pos_to1, '%.2fm'%pos - dists_from_to = np.sqrt(np.sum((centroids_to - centroids_from)**2, 1)) i = 0.0 @@ -2279,7 +2836,7 @@ print ' plan id_plan', id_plan, 'time_from', time_from, 'from', id_edge_from, pos_edge_from, 'to', id_edge_to, pos_edge_to print ' id_edge_from', edges.ids_sumo[id_edge_from], 'id_edge_to', edges.ids_sumo[id_edge_to] - time = self.plan_bikeride(id_plan, time_from, id_veh, + time = self.plan_taxiride(id_plan, time_from, id_veh, id_edge_from, pos_edge_from, id_edge_to, pos_edge_to, dist_from_to, dist_walk_max, @@ -2318,21 +2875,44 @@ return True -class TransitStrategy(StrategyMixin): +class MotorcycleStrategy(StrategyMixin): def __init__(self, ident, parent=None, - name='Public Transport Strategy', - info='With this strategy, the person uses public transport.', + name='motorcycle strategy', + info='With this strategy, the person uses his private motorcycle as main transport mode.', **kwargs): self._init_objman(ident, parent, name=name, info=info, **kwargs) attrsman = self.set_attrsman(cm.Attrsman(self)) # specific init - self._init_attributes() + self._init_attributes(**kwargs) self._init_constants() - def _init_attributes(self): + def _init_attributes(self, **kwargs): # print 'StrategyMixin._init_attributes' - pass + attrsman = self.get_attrsman() + + self._init_attributes_strategy(**kwargs) + self.n_iter_motoacces_max = attrsman.add(cm.AttrConf('n_iter_motoacces_max', kwargs.get('n_iter_motoacces_max', 5), + groupnames=['options'], + perm='rw', + name='Max. motorcycle access search iterations', + info='Max. number of iterations while searching an edge with motorcycle access.', + )) + + self.length_edge_min = attrsman.add(cm.AttrConf('length_edge_min', kwargs.get('length_edge_min', 20.0), + groupnames=['options'], + perm='rw', + name='Min. edge length search', + unit='m', + info='Min. edge length when searching an edge with motorcycle access.', + )) + + self.utility_constant = attrsman.add(cm.AttrConf('utility_constant', kwargs.get('utility_constant', -0.0161), + groupnames=['options'], + perm='rw', + name='Utility constant for moto strategy', + info='Constant to calculate utility: U = Const + value_of_time*time_exec', + )) def _init_constants(self): #virtualpop = self.get_virtualpop() @@ -2349,13 +2929,18 @@ # self.get_attrsman().do_not_save_attrs(['_activitystages','_ridestages','_walkstages','_plans']) modes = self.get_virtualpop().get_scenario().net.modes + self._id_mode_ped = modes.get_id_mode('pedestrian') self._id_mode_bike = modes.get_id_mode('bicycle') self._id_mode_auto = modes.get_id_mode('passenger') self._id_mode_moto = modes.get_id_mode('motorcycle') - self._id_mode_bus = modes.get_id_mode('bus') + self._edges = self.get_virtualpop().get_scenario().net.edges self.get_attrsman().do_not_save_attrs([ - '_id_mode_bike', '_id_mode_auto', '_id_mode_moto', '_id_mode_bus' - ]) + '_id_mode_bike', '_id_mode_auto', '_id_mode_moto', + '_id_mode_ped', + '_edges']) + + def get_utility_specific(self, id_plan): + return self.utility_constant def preevaluate(self, ids_person): """ @@ -2370,172 +2955,249 @@ """ n_pers = len(ids_person) + print 'MotorcycleStrategy.preevaluate', n_pers, 'persons' persons = self.get_virtualpop() preeval = np.zeros(n_pers, dtype=np.int32) - # TODO: here we could exclude by age or distance facilities-stops - - # put 0 for persons whose preference is not public transport - preeval[persons.ids_mode_preferred[ids_person] != self._id_mode_bus] = 0 + # put -1 for persons without motorcycle access + preeval[persons.ids_imoto[ids_person] == -1] = -1 + print ' persons having no motorcycle', len(np.flatnonzero(persons.ids_imoto[ids_person] == -1)) + + # put 0 for persons with motorcycle but with a different preferred mode + preeval[(persons.ids_imoto[ids_person] > -1) + & (persons.ids_mode_preferred[ids_person] != self._id_mode_moto)] = 0 + + print ' persons with motorcycle but with a different preferred mode', len(np.flatnonzero((persons.ids_imoto[ids_person] > -1) & (persons.ids_mode_preferred[ids_person] != self._id_mode_moto))) + + # put 2 for persons with motorcycle access and who prefer the car + preeval[(persons.ids_imoto[ids_person] > -1) + & (persons.ids_mode_preferred[ids_person] == self._id_mode_moto)] = 2 + print ' persons with motorcycle access and who prefer the car', len(np.flatnonzero((persons.ids_imoto[ids_person] > -1) & (persons.ids_mode_preferred[ids_person] == self._id_mode_moto))) - # put 2 for persons with car access and who prefer cars - preeval[persons.ids_mode_preferred[ids_person] == self._id_mode_bus] = 2 - - print ' TransitStrategy.preevaluate', len(np.flatnonzero(preeval)) return preeval - def plan_transit(self, id_plan, time_from, - id_edge_from, pos_edge_from, - id_edge_to, pos_edge_to, - id_stop_from, id_stopedge_from, pos_stop_from, - id_stop_to, id_stopedge_to, pos_stop_to, - #dist_from_to, dist_walk_max, - walkstages, transitstages, - ptlines, ptfstar, pttimes, - stops_to_enter, stops_to_exit, - ids_laneedge, ids_stoplane, ptstops): + def get_edge_motoaccess(self, id_edge, is_search_backward=False, is_get_route=False, is_star=False, bstar=0, fstar=0, n_iter_motoacces_max=None): + # get firts edge allowing bikes and pedestrian, saving route, frontward or backward. You can include bstar or fstar: + # check only connected links. You can obtain also the route. + # print 'get_edge_bikeaccess',id_edge, is_search_backward,'id_sumo',self._edges.ids_sumo[id_edge] - ptlinks = ptlines.get_ptlinks() - ptlinktypes = ptlinks.types.choices - type_enter = ptlinktypes['enter'] - type_transit = ptlinktypes['transit'] - type_board = ptlinktypes['board'] - type_alight = ptlinktypes['alight'] - type_transfer = ptlinktypes['transfer'] - type_walk = ptlinktypes['walk'] - type_exit = ptlinktypes['exit'] + if n_iter_motoacces_max is None: + n_iter_motoacces_max = self.n_iter_motoacces_max - if (id_edge_from == id_stopedge_from) & (abs(pos_edge_from-pos_stop_from) < 1.0): - time = time_from - id_stage_walk1 = None + id_mode = self._id_mode_moto + id_mode_ped = self._id_mode_ped + get_accesslevel = self._edges.get_accesslevel + if is_star: + if is_search_backward: + get_next = bstar + else: + get_next = fstar else: - id_stage_walk1, time = walkstages.append_stage(id_plan, time_from, - id_edge_from=id_edge_from, - position_edge_from=pos_edge_from, - id_edge_to=id_stopedge_from, - position_edge_to=pos_stop_from, # -7.0, - ) + if is_search_backward: + get_next = self._edges.get_incoming + else: + get_next = self._edges.get_outgoing - # print ' id_stopedge_from',id_stopedge_from - # print ' pos_stop_from',pos_stop_from + edgelengths = self._edges.lengths + #ids_tried = set() + ids_current = [id_edge] + id_motoedge = -1 + pos = 0.0 + n = 0 + ids = [id_edge] + coll_ids = [0] + route = [] + while (id_motoedge < 0) & (n < n_iter_motoacces_max): + n += 1 - # print - # print ' id_stopedge_to',id_stopedge_to - # print ' pos_stop_to',pos_stop_to - # print - # print ' id_stop_from',id_stop_from - # print ' id_stop_to',id_stop_to + ids_new = [] + for id_edge_test, is_long_enough in zip(ids_current, edgelengths[ids_current] > self.length_edge_min): + # print ' check id',id_edge_test, is_long_enough,get_accesslevel(id_edge_test, id_mode) + if is_long_enough & (get_accesslevel(id_edge_test, id_mode) >= 0) & (get_accesslevel(id_edge_test, id_mode_ped) >= 0): + id_motoedge = id_edge_test - durations, linktypes, ids_line, ids_fromstop, ids_tostop =\ - ptlinks.route(id_stop_from, id_stop_to, - fstar=ptfstar, times=pttimes, - stops_to_enter=stops_to_enter, - stops_to_exit=stops_to_exit) + if is_get_route: + if n == 1: + route = [] + else: + route.append(id_edge_test) + if n > 2: + route.append(coll_ids[ids.index(id_edge_test)]) + if n > 3: + for n in range(n-3): + route.append(coll_ids[ids.index(route[-1])]) + if is_search_backward is not True: + route.reverse() - # print ' routing done. make plan..' + # print ' found',id_motoedge,self._edges.ids_sumo[id_motoedge] + break + else: - if len(linktypes) > 0: - if linktypes[-1] == type_walk: # is last stage a walk? - # remove it, because will go directly to destination - linktypes = linktypes[:-1] - ids_line = ids_line[:-1] - durations = durations[:-1] - ids_fromstop = ids_fromstop[:-1] - ids_tostop = ids_tostop[:-1] - - # print ' ids_line ',ids_line - # print ' ids_fromstop',ids_fromstop - # print ' ids_tostop ',ids_tostop + if is_star: + ids_new += get_next[id_edge_test] + if is_get_route: + ids += get_next[id_edge_test] + for i in range(len(get_next[id_edge_test])): + coll_ids.append(id_edge_test) - if len(linktypes) > 0: # is there any public transport line to take? + else: + ids_new += get_next(id_edge_test) + if is_get_route: + ids += get_next(id_edge_test) + for i in range(len(get_next(id_edge_test))): + coll_ids += id_edge_test - # go though PT links and generate transits and walks to trasfer - ids_stopedge_from = ids_laneedge[ids_stoplane[ids_fromstop]] - ids_stopedge_to = ids_laneedge[ids_stoplane[ids_tostop]] - poss_stop_from = 0.5*(ptstops.positions_from[ids_fromstop] - + ptstops.positions_to[ids_fromstop]) - poss_stop_to = 0.5*(ptstops.positions_from[ids_tostop] - + ptstops.positions_to[ids_tostop]) + ids_current = ids_new - # this is wait time buffer to be added to the successive stage - # as waiting is currently not modelled as an extra stage - duration_wait = 0.0 + if id_motoedge > -1: + if is_search_backward: + pos = edgelengths[id_motoedge]-0.5*self.length_edge_min + else: + pos = 0.5*self.length_edge_min - # create stages for PT - for linktype, id_line, duration,\ - id_stopedge_from, pos_fromstop,\ - id_stopedge_to, pos_tostop in\ - zip(linktypes, - ids_line, - durations, - ids_stopedge_from, poss_stop_from, - ids_stopedge_to, poss_stop_to, - ): - # print ' stage for linktype %2d fromedge %s toedge %s'%(linktype, edges.ids_sumo[id_stopedge_from],edges.ids_sumo[id_stopedge_to] ) + if id_motoedge == -1: + print 'WARNING in get_edge_motoaccess no access for', id_edge, self._edges.ids_sumo[id_edge] - print ' id_stopedge_from,id_stopedge_to', id_stopedge_from, id_stopedge_to - if linktype == type_transit: # transit! - print ' add transit' - id_stage_transit, time = transitstages.append_stage( - id_plan, time, - id_line=id_line, - duration=duration+duration_wait, - id_fromedge=id_stopedge_from, - id_toedge=id_stopedge_to, - ) - duration_wait = 0.0 + if is_get_route: + return id_motoedge, pos, route + else: + return id_motoedge, pos - elif linktype == type_walk: # walk to transfer - print ' add transfer' - id_stage_transfer, time = walkstages.append_stage( - id_plan, time, - id_edge_from=id_stopedge_from, - position_edge_from=pos_fromstop, - id_edge_to=id_stopedge_to, - position_edge_to=pos_tostop, - duration=duration+duration_wait, - ) - duration_wait = 0.0 + def plan_motoride(self, id_plan, time_from, id_veh, + id_edge_from, pos_edge_from, + id_edge_to, pos_edge_to, + dist_from_to, dist_walk_max, + walkstages, ridestages): - else: # all other link time are no modelld - # do not do anything , just add wait time to next stage - print ' add duration', duration - duration_wait += duration + # start creating stages + id_stage_walk1 = -1 + id_stage_moto = -1 - # walk from final stop to activity - # print ' Stage for linktype %2d fromedge %s toedge %s'%(linktype, edges.ids_sumo[id_stopedge_to],edges.ids_sumo[id_edge_to] ) - # if (id_edge_to == id_stopedge_to)&(abs(pos_edge_to-pos_tostop)<1.0): - # print ' already at right edge and position' - # pass - # else: - id_stage_walk2, time = walkstages.append_stage(id_plan, time, - id_edge_from=id_stopedge_to, - position_edge_from=pos_tostop, - id_edge_to=id_edge_to, - position_edge_to=pos_edge_to, - ) + id_edge_from_moto, pos_from_moto = self.get_edge_motoaccess(id_edge_from) + id_edge_to_moto, pos_to_moto = self.get_edge_motoaccess(id_edge_to, is_search_backward=True) + + if (dist_from_to < dist_walk_max) | (id_edge_from_moto == -1) | (id_edge_to_moto == -1): + # print ' go by foot because distance is too short or no moto access',dist_from_to,id_edge_from_moto,id_edge_to_moto + id_stage_walk1, time = walkstages.append_stage( + id_plan, time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) else: - # there is no public transport line linking these nodes. + # print ' try to take the moto',id_veh + # print ' id_edge_from_moto',edges.ids_sumo[id_edge_from_moto],pos_from_moto + # print ' id_edge_to_moto',edges.ids_sumo[id_edge_to_moto],pos_to_moto - if id_stage_walk1 is None: - # Create first walk directly from home to activity - id_stage_walk1, time = walkstages.append_stage(id_plan, - time_from, - id_edge_from=id_edge_from, - position_edge_from=pos_edge_from, - id_edge_to=id_edge_to, - position_edge_to=pos_edge_to, - ) + if id_edge_from_moto != id_edge_from: + # print ' must walk from origin to motorack',time_from + + id_stage_walk1, time = walkstages.append_stage( + id_plan, time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_from_moto, + position_edge_to=pos_from_moto, + ) + + if id_edge_to_moto != id_edge_to: + # print ' must ride from motorack to dest motorack',time + id_stage_moto, time = ridestages.append_stage( + id_plan, time, + id_veh=id_veh, + # delay to be sure that person arrived!(workaround in combination with parking=False) + time_init=time-10, # time_from, + id_edge_from=id_edge_from_moto, + position_edge_from=pos_from_moto, + id_edge_to=id_edge_to_moto, + position_edge_to=pos_to_moto, + ) + if id_stage_moto > -1: + # print ' must walk from dest motorack to dest',time + id_stage_walk2, time = walkstages.append_stage( + id_plan, time, + id_edge_from=id_edge_to_moto, + position_edge_from=pos_to_moto, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + + else: + # print ' ride from motorack to destination',time + id_stage_moto, time = ridestages.append_stage( + id_plan, time, + id_veh=id_veh, + # delay to be sure that person arrived!(workaround in combination with parking=False) + time_init=time-10, # time_from, + id_edge_from=id_edge_from_moto, + position_edge_from=pos_from_moto, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) else: - # Modify first walk directly from home to activity - time = walkstages.modify_stage(id_stage_walk1, time_from, - id_edge_from=id_edge_from, - position_edge_from=pos_edge_from, - id_edge_to=id_edge_to, - position_edge_to=pos_edge_to, - ) + # print ' cycle directly from orign edge',time_from + if id_edge_to_moto != id_edge_to: + # print ' must ride from origin to motorack',time_from + + #pos_to_bike = 0.1*edges.lengths[id_edge_to_bike] + id_stage_moto, time = ridestages.append_stage( + id_plan, time_from, + id_veh=id_veh, + # delay to be sure that person arrived!(workaround in combination with parking=False) + time_init=time_from-10, # time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_to_moto, + position_edge_to=pos_to_moto, + ) + if id_stage_moto > -1: + id_stage_walk2, time = walkstages.append_stage( + id_plan, time, + id_edge_from=id_edge_to_moto, + position_edge_from=pos_to_moto, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + else: + # print ' must ride from origin to destination',time_from + id_stage_moto, time = ridestages.append_stage( + id_plan, time_from, + id_veh=id_veh, + # delay to be sure that person arrived!(workaround in combination with parking=False) + time_init=time_from-10, # time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + + # here we should have created a moto ride + # if not, for ehatever reason, + # we walk from origin to destination + if id_stage_moto == -1: + # print ' walk because no ride stage has been planned',time_from + if id_stage_walk1 == -1: + # no walk stage has been planned + id_stage_walk1, time = walkstages.append_stage( + id_plan, time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + elif time_from == time: + # walking to bike has already been schedules, + # but cycling failed. So walk the whole way + time = walkstages.modify_stage( + id_stage_walk1, time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) return time def plan(self, ids_person, logger=None): @@ -2543,72 +3205,47 @@ Generates a plan for these person according to this strategie. Overriden by specific strategy. """ - print 'TransitStrategy.plan', len(ids_person) #make_plans_private(self, ids_person = None, mode = 'passenger') # routing necessary? virtualpop = self.get_virtualpop() plans = virtualpop.get_plans() # self._plans - demand = virtualpop.get_demand() - ptlines = demand.ptlines - walkstages = plans.get_stagetable('walks') - transitstages = plans.get_stagetable('transits') + ridestages = plans.get_stagetable('motorides') activitystages = plans.get_stagetable('activities') activities = virtualpop.get_activities() - activitytypes = demand.activitytypes + activitytypes = virtualpop.get_demand().activitytypes landuse = virtualpop.get_landuse() facilities = landuse.facilities - parking = landuse.parking + #parking = landuse.parking scenario = virtualpop.get_scenario() - net = scenario.net - edges = net.edges - lanes = net.lanes - modes = net.modes - - ptstops = net.ptstops - - # print ' demand',demand - # print ' demand.ptlines',demand.ptlines,dir(demand.ptlines) - # print ' demand.ptlines.get_ptlinks()',demand.ptlines.get_ptlinks() - # print ' demand.virtualpop',demand.virtualpop,dir(demand.virtualpop) - # print ' demand.trips',demand.trips,dir(demand.trips) - if len(ptlines) == 0: - print 'WARNING in TrasitStrategy.plan: no transit services available. Create public trasit services by connecting stops.' - return False - - ptlinks = ptlines.get_ptlinks() - if len(ptlinks) == 0: - print 'WARNING in TrasitStrategy.plan: no public transport links. Run methods: "create routes" and "build links" from public trasport services.' - return False - - ptlinktypes = ptlinks.types.choices - - ptfstar = ptlinks.get_fstar() - pttimes = ptlinks.get_times() - stops_to_enter, stops_to_exit = ptlinks.get_stops_to_enter_exit() + edges = scenario.net.edges + lanes = scenario.net.lanes + modes = scenario.net.modes - ids_stoplane = ptstops.ids_lane - ids_laneedge = net.lanes.ids_edge + #times_est_plan = plans.times_est - times_est_plan = plans.times_est # here we can determine edge weights for different modes + plans.prepare_stagetables(['walks', 'motorides', 'activities']) - # this could be centralized to avoid redundance - plans.prepare_stagetables(['walks', 'transits', 'activities']) + # get initial travel times for persons. + # initial travel times depend on the initial activity + + # landuse.parking.clear_booking() ids_person_act, ids_act_from, ids_act_to\ = virtualpop.get_activities_from_pattern(0, ids_person=ids_person) if len(ids_person_act) == 0: - print 'WARNING in TrasitStrategy.plan: no eligible persons found.' + print 'WARNING in MotorcycleStrategy.plan: no eligible persons found.' return False + # ok + # temporary maps from ids_person to other parameters nm = np.max(ids_person_act)+1 map_ids_plan = np.zeros(nm, dtype=np.int32) - #ids_plan_act = virtualpop.add_plans(ids_person_act, id_strategy = self.get_id_strategy()) map_ids_plan[ids_person_act] = virtualpop.add_plans(ids_person_act, id_strategy=self.get_id_strategy()) map_times = np.zeros(nm, dtype=np.int32) @@ -2620,20 +3257,43 @@ map_ids_fac_from = np.zeros(nm, dtype=np.int32) map_ids_fac_from[ids_person_act] = activities.ids_facility[ids_act_from] - n_plans = len(ids_person_act) - print 'TrasitStrategy.plan n_plans=', n_plans + #map_ids_parking_from = np.zeros(nm, dtype = np.int32) + # ids_parking_from, inds_vehparking = parking.get_closest_parkings( virtualpop.ids_iauto[ids_person_act], + # facilities.centroids[activities.ids_facility[ids_act_from]]) + # if len(ids_parking_from)==0: + # return False - # make initial activity stage - ids_edge_from = facilities.ids_roadedge_closest[map_ids_fac_from[ids_person_act]] - poss_edge_from = facilities.positions_roadedge_closest[map_ids_fac_from[ids_person_act]] - # this is the time when first activity starts - # first activity is normally not simulated + # err - names_acttype_from = activitytypes.names[activities.ids_activitytype[ids_act_from]] - durations_act_from = activities.get_durations(ids_act_from) + #map_ids_parking_from[ids_person_act] = ids_parking_from + + n_plans = len(ids_person_act) + print 'MotorcycleStrategy.plan n_plans=', n_plans + # print ' map_ids_parking_from[ids_person_act].shape',map_ids_parking_from[ids_person_act].shape + # set initial activity + # this is because the following steps start with travel + # and set the next activity + #names_acttype_from = activitytypes.names[activities.ids_activitytype[ids_act_from]] + # for id_plan + + ind_act = 0 + + # make initial activity stage + ids_edge_from = facilities.ids_roadedge_closest[map_ids_fac_from[ids_person_act]] + + poss_edge_from = facilities.positions_roadedge_closest[map_ids_fac_from[ids_person_act]] + poss_edge_from = self.clip_positions(poss_edge_from, ids_edge_from) + + # this is the time when first activity starts + # first activity is normally not simulated + + names_acttype_from = activitytypes.names[activities.ids_activitytype[ids_act_from]] + durations_act_from = activities.get_durations(ids_act_from) times_from = map_times[ids_person_act]-durations_act_from #times_from = activities.get_times_end(ids_act_from, pdf = 'unit') + # do initial stage + # could be common to all strategies for id_plan,\ time,\ id_act_from,\ @@ -2658,15 +3318,12 @@ positions=pos_edge_from, ) - ## - - ind_act = 0 - # main loop while there are persons performing # an activity at index ind_act while len(ids_person_act) > 0: ids_plan = map_ids_plan[ids_person_act] - + ids_veh = virtualpop.ids_imoto[ids_person_act] + dists_walk_max = virtualpop.dists_walk_max[ids_person_act] times_from = map_times[ids_person_act] names_acttype_to = activitytypes.names[activities.ids_activitytype[ids_act_to]] @@ -2675,57 +3332,71 @@ ids_fac_from = map_ids_fac_from[ids_person_act] ids_fac_to = activities.ids_facility[ids_act_to] - centroids_from = facilities.centroids[ids_fac_from] - centroids_to = facilities.centroids[ids_fac_to] - # origin edge and position ids_edge_from = facilities.ids_roadedge_closest[ids_fac_from] poss_edge_from = facilities.positions_roadedge_closest[ids_fac_from] + poss_edge_from = self.clip_positions(poss_edge_from, ids_edge_from) + + centroids_from = facilities.centroids[ids_fac_from] + + # this method will find and occupy parking space + #ids_parking_from = map_ids_parking_from[ids_person_act] + + # print ' ids_veh.shape',ids_veh.shape + # print ' centroids_to.shape',centroids_to.shape + #ids_parking_to, inds_vehparking = parking.get_closest_parkings(ids_veh, centroids_to) + + #ids_lane_parking_from = parking.ids_lane[ids_parking_from] + #ids_edge_parking_from = lanes.ids_edge[ids_lane_parking_from] + #poss_edge_parking_from = parking.positions[ids_parking_from] + + # print ' ids_parking_to.shape',ids_parking_to.shape + # print ' np.max(parking.get_ids()), np.max(ids_parking_to)',np.max(parking.get_ids()), np.max(ids_parking_to) + #ids_lane_parking_to = parking.ids_lane[ids_parking_to] + #ids_edge_parking_to = lanes.ids_edge[ids_lane_parking_to] + #poss_edge_parking_to = parking.positions[ids_parking_to] # destination edge and position ids_edge_to = facilities.ids_roadedge_closest[ids_fac_to] - poss_edge_to = facilities.positions_roadedge_closest[ids_fac_to] - - ids_stop_from = ptstops.get_closest(centroids_from) - ids_stop_to = ptstops.get_closest(centroids_to) - ids_stopedge_from = ids_laneedge[ids_stoplane[ids_stop_from]] - ids_stopedge_to = ids_laneedge[ids_stoplane[ids_stop_to]] + poss_edge_to1 = facilities.positions_roadedge_closest[ids_fac_to] + poss_edge_to = self.clip_positions(poss_edge_to1, ids_edge_to) + centroids_to = facilities.centroids[ids_fac_to] - # do random pos here - poss_stop_from = 0.5*(ptstops.positions_from[ids_stop_from] - + ptstops.positions_to[ids_stop_from]) + # debug poscorrection..OK + # for id_edge, id_edge_sumo, length, pos_to1, pos in zip(ids_edge_to, edges.ids_sumo[ids_edge_to],edges.lengths[ids_edge_to],poss_edge_to1, poss_edge_to): + # print ' ',id_edge, 'IDe%s'%id_edge_sumo, 'L=%.2fm'%length, '%.2fm'%pos_to1, '%.2fm'%pos - poss_stop_to = 0.5*(ptstops.positions_from[ids_stop_to] - + ptstops.positions_to[ids_stop_to]) + dists_from_to = np.sqrt(np.sum((centroids_to - centroids_from)**2, 1)) i = 0.0 - for id_person, id_plan, time_from, id_act_from, id_act_to, name_acttype_to, duration_act_to, id_edge_from, pos_edge_from, id_edge_to, pos_edge_to, id_stop_from, id_stopedge_from, pos_stop_from, id_stop_to, id_stopedge_to, pos_stop_to\ - in zip(ids_person_act, ids_plan, times_from, ids_act_from, ids_act_to, names_acttype_to, durations_act_to, ids_edge_from, poss_edge_from, ids_edge_to, poss_edge_to, ids_stop_from, ids_stopedge_from, poss_stop_from, ids_stop_to, ids_stopedge_to, poss_stop_to): - n_pers = len(ids_person_act) + n_pers = len(ids_person_act) + for id_person, id_plan, time_from, id_act_from, id_act_to, name_acttype_to, duration_act_to, id_veh, id_edge_from, pos_edge_from, id_edge_to, pos_edge_to, dist_from_to, dist_walk_max\ + in zip(ids_person_act, ids_plan, times_from, ids_act_from, ids_act_to, names_acttype_to, durations_act_to, ids_veh, ids_edge_from, poss_edge_from, ids_edge_to, poss_edge_to, dists_from_to, dists_walk_max): if logger: logger.progress(i/n_pers*100) i += 1.0 - print 79*'_' - print ' id_plan=%d, id_person=%d, ' % (id_plan, id_person) + print 79*'*' + print ' plan id_plan', id_plan, 'time_from', time_from, 'from', id_edge_from, pos_edge_from, 'to', id_edge_to, pos_edge_to + print ' id_edge_from', edges.ids_sumo[id_edge_from], 'id_edge_to', edges.ids_sumo[id_edge_to] - time = self.plan_transit(id_plan, time_from, - id_edge_from, pos_edge_from, - id_edge_to, pos_edge_to, - id_stop_from, id_stopedge_from, pos_stop_from, - id_stop_to, id_stopedge_to, pos_stop_to, - #dist_from_to, dist_walk_max, - walkstages, transitstages, - ptlines, ptfstar, pttimes, - stops_to_enter, stops_to_exit, - ids_laneedge, ids_stoplane, ptstops) + time = self.plan_motoride(id_plan, time_from, id_veh, + id_edge_from, pos_edge_from, + id_edge_to, pos_edge_to, + dist_from_to, dist_walk_max, + walkstages, ridestages) - # update time for trips estimation for this plan + ################ + + # store time estimation for this plan + # note that these are the travel times, no activity time plans.times_est[id_plan] += time-time_from # define current end time without last activity duration plans.times_end[id_plan] = time + # finally add activity and respective duration + id_stage_act, time = activitystages.append_stage( id_plan, time, ids_activity=id_act_to, @@ -2735,20 +3406,23 @@ positions=pos_edge_to, ) - # store time for next iteration in case other activities are - # following map_times[id_person] = time + # return time + ## # select persons and activities for next setp ind_act += 1 ids_person_act, ids_act_from, ids_act_to\ = virtualpop.get_activities_from_pattern(ind_act, ids_person=ids_person_act) + # update timing with (random) activity duration!! + + return True -class BikeTransitStrategy(BikeStrategy, TransitStrategy): +class TransitStrategy(StrategyMixin): def __init__(self, ident, parent=None, - name='Bike+Public Transport Strategy', - info='With this strategy, the person combines bike and public transport.', + name='Public Transport Strategy', + info='With this strategy, the person uses public transport.', **kwargs): self._init_objman(ident, parent, name=name, info=info, **kwargs) @@ -2757,15 +3431,39 @@ self._init_attributes() self._init_constants() - def _init_attributes(self): + def _init_attributes(self, **kwargs): # print 'StrategyMixin._init_attributes' - BikeStrategy._init_attributes(self) - TransitStrategy._init_attributes(self) + attrsman = self.get_attrsman() + + self.utility_constant = attrsman.add(cm.AttrConf('utility_constant', kwargs.get('utility_constant', 0.3727), + groupnames=['options'], + perm='rw', + name='Utility constant for transit strategy', + info='Constant to calculate utility: U = Const + value_of_time*time_exec', + )) def _init_constants(self): + #virtualpop = self.get_virtualpop() + #stagetables = virtualpop.get_stagetables() - BikeStrategy._init_constants(self) - TransitStrategy._init_constants(self) + #self._walkstages = stagetables.get_stagetable('walks') + #self._ridestages = stagetables.get_stagetable('rides') + #self._activitystages = stagetables.get_stagetable('activities') + + #self._plans = virtualpop.get_plans() + # + # print 'AutoStrategy._init_constants' + # print dir(self) + # self.get_attrsman().do_not_save_attrs(['_activitystages','_ridestages','_walkstages','_plans']) + + modes = self.get_virtualpop().get_scenario().net.modes + self._id_mode_bike = modes.get_id_mode('bicycle') + self._id_mode_auto = modes.get_id_mode('passenger') + self._id_mode_moto = modes.get_id_mode('motorcycle') + self._id_mode_bus = modes.get_id_mode('bus') + self.get_attrsman().do_not_save_attrs([ + '_id_mode_bike', '_id_mode_auto', '_id_mode_moto', '_id_mode_bus' + ]) def preevaluate(self, ids_person): """ @@ -2783,93 +3481,314 @@ persons = self.get_virtualpop() preeval = np.zeros(n_pers, dtype=np.int32) - inds_prefer = (persons.ids_mode_preferred[ids_person] == self._id_mode_bus)\ - | (persons.ids_mode_preferred[ids_person] == self._id_mode_bike)\ - - inds_avail = persons.ids_ibike[ids_person] > -1 - preeval[np.logical_not(inds_avail)] = -1 # TODO: here we could exclude by age or distance facilities-stops # put 0 for persons whose preference is not public transport - preeval[inds_avail & np.logical_not(inds_prefer)] = 0 + preeval[persons.ids_mode_preferred[ids_person] != self._id_mode_bus] = 0 - # put 2 for persons with bike access and who prefer bike or bus - preeval[inds_avail & inds_prefer] = 1 + # put 2 for persons with car access and who prefer cars + preeval[persons.ids_mode_preferred[ids_person] == self._id_mode_bus] = 2 - print ' BikeTransitStrategy.preevaluate', len(np.flatnonzero(preeval)) + print ' TransitStrategy.preevaluate', len(np.flatnonzero(preeval)) return preeval - def plan(self, ids_person, logger=None): - """ - Generates a plan for these person according to this strategie. - Overriden by specific strategy. - """ - print 'TransitStrategy.plan', len(ids_person) - #make_plans_private(self, ids_person = None, mode = 'passenger') - # routing necessary? - virtualpop = self.get_virtualpop() - plans = virtualpop.get_plans() # self._plans - demand = virtualpop.get_demand() - ptlines = demand.ptlines - - walkstages = plans.get_stagetable('walks') - transitstages = plans.get_stagetable('transits') - ridestages = plans.get_stagetable('bikerides') - activitystages = plans.get_stagetable('activities') + def plan_transit(self, id_plan, time_from, + id_edge_from, pos_edge_from, + id_edge_to, pos_edge_to, + id_stop_from, id_stopedge_from, pos_stop_from, + id_stop_to, id_stopedge_to, pos_stop_to, + #dist_from_to, dist_walk_max, + walkstages, transitstages, + ptlines, ptfstar, pttimes, + stops_to_enter, stops_to_exit, + ids_laneedge, ids_stoplane, ptstops): - activities = virtualpop.get_activities() - activitytypes = demand.activitytypes - landuse = virtualpop.get_landuse() - facilities = landuse.facilities - #parking = landuse.parking + edges = self.get_scenario().net.edges + print 'plan_transit id_plan', id_plan, 'id_edge_from %d (%s)' % (id_edge_from, edges.ids_sumo[id_edge_from]), 'id_edge_to %d (%s)' % (id_edge_to, edges.ids_sumo[id_edge_to]) - scenario = virtualpop.get_scenario() - net = scenario.net - edges = net.edges - lanes = net.lanes - modes = net.modes + # debug? + is_debug = False # id_plan == 14983 - ptstops = net.ptstops + if is_debug: - # print ' demand',demand - # print ' demand.ptlines',demand.ptlines,dir(demand.ptlines) - # print ' demand.ptlines.get_ptlinks()',demand.ptlines.get_ptlinks() - # print ' demand.virtualpop',demand.virtualpop,dir(demand.virtualpop) - # print ' demand.trips',demand.trips,dir(demand.trips) - if len(ptlines) == 0: - print 'WARNING in TrasitStrategy.plan: no transit services available.' - return False + print ' id_stop_from', id_stop_from, 'id_stop_to', id_stop_to ptlinks = ptlines.get_ptlinks() ptlinktypes = ptlinks.types.choices + type_enter = ptlinktypes['enter'] + type_transit = ptlinktypes['transit'] + type_board = ptlinktypes['board'] + type_alight = ptlinktypes['alight'] + type_transfer = ptlinktypes['transfer'] + type_walk = ptlinktypes['walk'] + type_exit = ptlinktypes['exit'] - ptfstar = ptlinks.get_fstar() - pttimes = ptlinks.get_times() - stops_to_enter, stops_to_exit = ptlinks.get_stops_to_enter_exit() - - ids_stoplane = ptstops.ids_lane - ids_laneedge = net.lanes.ids_edge + if (id_edge_from == id_stopedge_from) & (abs(pos_edge_from-pos_stop_from) < 1.0): + time = time_from + id_stage_walk1 = None + if is_debug: + print ' no initial walk required.' + print ' id_edge_from', id_edge_from, edges.ids_sumo[id_edge_from] + print ' pos_edge_from', pos_edge_from + else: + id_stage_walk1, time = walkstages.append_stage(id_plan, time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_stopedge_from, + position_edge_to=pos_stop_from, # -7.0, + ) + if is_debug: + print ' add initial walk stage' + print ' id_edge_from', id_edge_from, edges.ids_sumo[id_edge_from] + print ' pos_edge_from', pos_edge_from + print ' IIIInitial walk' + print ' id_stopedge_from', id_stopedge_from, edges.ids_sumo[id_stopedge_from] + print ' pos_stop_from', pos_stop_from + + if is_debug: + print ' TTTransit' + print ' id_stopedge_to', id_stopedge_to, edges.ids_sumo[id_stopedge_to] + print ' pos_stop_to', pos_stop_to + print ' ----------------------------------' + print ' id_stop_from', id_stop_from + print ' id_stop_to', id_stop_to - times_est_plan = plans.times_est - # here we can determine edge weights for different modes + durations, linktypes, ids_line, ids_fromstop, ids_tostop =\ + ptlinks.route(id_stop_from, id_stop_to, + fstar=ptfstar, times=pttimes, + stops_to_enter=stops_to_enter, + stops_to_exit=stops_to_exit) - # this could be centralized to avoid redundance - plans.prepare_stagetables(['walks', 'bikerides', 'transits', 'activities']) + if is_debug: + print ' routing done. make plan, success', len(linktypes) > 0 - ids_person_act, ids_act_from, ids_act_to\ - = virtualpop.get_activities_from_pattern(0, ids_person=ids_person) + if is_debug: + print ' ids_line ', ids_line + print ' ids_fromstop', ids_fromstop + print ' ids_tostop ', ids_tostop - if len(ids_person_act) == 0: - print 'WARNING in TrasitStrategy.plan: no eligible persons found.' - return False + if (type_transit in linktypes): # is there any public transport line to take? - # temporary maps from ids_person to other parameters - nm = np.max(ids_person_act)+1 - map_ids_plan = np.zeros(nm, dtype=np.int32) - #ids_plan_act = virtualpop.add_plans(ids_person_act, id_strategy = self.get_id_strategy()) - map_ids_plan[ids_person_act] = virtualpop.add_plans(ids_person_act, id_strategy=self.get_id_strategy()) + # go though PT links and generate transits and walks to trasfer + ids_stopedge_from = ids_laneedge[ids_stoplane[ids_fromstop]] + ids_stopedge_to = ids_laneedge[ids_stoplane[ids_tostop]] + poss_stop_from = 0.5*(ptstops.positions_from[ids_fromstop] + + ptstops.positions_to[ids_fromstop]) + poss_stop_to = 0.5*(ptstops.positions_from[ids_tostop] + + ptstops.positions_to[ids_tostop]) - map_times = np.zeros(nm, dtype=np.int32) + # this is wait time buffer to be added to the successive stage + # as waiting is currently not modelled as an extra stage + duration_wait = 0.0 + + # check if initial walk needs to be modified + if (id_stage_walk1 is not None) & (linktypes[0] == type_walk): + if is_debug: + print ' Modify initial walk from stop fromedge %d (%s) toedge %d (%s)' % (id_edge_from, edges.ids_sumo[id_edge_from], ids_stopedge_from[0], edges.ids_sumo[ids_stopedge_from[0]]) + + is_initial_walk_done = True + time = walkstages.modify_stage( + id_stage_walk1, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=ids_stopedge_to[0], + position_edge_to=poss_stop_to[0], + ) + else: + is_initial_walk_done = False + + # create stages for PT + for i, linktype, id_line, duration,\ + id_stopedge_from, pos_fromstop,\ + id_stopedge_to, pos_tostop in\ + zip(xrange(len(linktypes)), + linktypes, + ids_line, + durations, + ids_stopedge_from, poss_stop_from, + ids_stopedge_to, poss_stop_to, + ): + if is_debug: + print ' ...........................' + print ' stage for linktype %2d fromedge %s toedge %s' % (linktype, edges.ids_sumo[id_stopedge_from], edges.ids_sumo[id_stopedge_to]) + print ' id_stopedge_from,id_stopedge_to', id_stopedge_from, id_stopedge_to + + if linktype == type_transit: # transit! + # check if last link type has also been a transit + if i > 0: + if linktypes[i-1] == type_transit: + if is_debug: + print ' add inter-transit walk stage' + # introdice a walk stage to be sure that + # person gets to the middle of the stop + id_stage_transfer, time = walkstages.append_stage( + id_plan, time, + id_edge_from=ids_stopedge_to[i-1], + position_edge_from=poss_stop_to[i-1], + id_edge_to=ids_stopedge_to[i-1], + position_edge_to=poss_stop_to[i-1], + duration=0.0, # moving within stop area + ) + + if is_debug: + print ' add transit stage id_line', id_line + id_stage_transit, time = transitstages.append_stage( + id_plan, time, + id_line=id_line, + duration=duration+duration_wait, + id_fromedge=id_stopedge_from, + id_toedge=id_stopedge_to, + ) + duration_wait = 0.0 + + elif (linktype == type_walk) & ((i > 0) | (not is_initial_walk_done)): + # walk to transfer, no initial walk if done + if is_debug: + print ' add walk to transfer' + id_stage_transfer, time = walkstages.append_stage( + id_plan, time, + id_edge_from=id_stopedge_from, + position_edge_from=pos_fromstop, + id_edge_to=id_stopedge_to, + position_edge_to=pos_tostop, + duration=duration+duration_wait, + ) + duration_wait = 0.0 + + else: # all other link time are no modelld + # do not do anything , just add wait time to next stage + if is_debug: + print ' do noting add duration', duration + duration_wait += duration + + # walk from final stop to activity + i = len(linktypes)-1 # last link index + + if is_debug: + print ' linktypes', linktypes, 'i', i, 'linktypes[i]', linktypes[i], linktypes[i] == type_walk + + if linktypes[i] == type_walk: + if is_debug: + print ' Modify final walk from stop fromedge %d (%s) toedge %d (%s)' % (id_stopedge_to, edges.ids_sumo[id_stopedge_to], id_edge_to, edges.ids_sumo[id_edge_to]) + + time = walkstages.modify_stage( + id_stage_transfer, + id_edge_from=ids_stopedge_from[i], + position_edge_from=poss_stop_from[i], + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + + else: + if is_debug: + print ' Add final walk stage fromedge %d (%s) toedge %d (%s)' % (id_stopedge_to, edges.ids_sumo[id_stopedge_to], id_edge_to, edges.ids_sumo[id_edge_to]) + + id_stage_walk2, time = walkstages.append_stage(id_plan, time, + id_edge_from=id_stopedge_to, + position_edge_from=pos_tostop, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + + else: + # there is no public transport line linking these nodes. + if is_debug: + print ' No PT lines used create direct walk stage' + + if id_stage_walk1 is None: + # Create first walk directly from home to activity + id_stage_walk1, time = walkstages.append_stage(id_plan, + time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + else: + # Modify first walk directly from home to activity + time = walkstages.modify_stage(id_stage_walk1, time_from, + id_edge_from=id_edge_from, + position_edge_from=pos_edge_from, + id_edge_to=id_edge_to, + position_edge_to=pos_edge_to, + ) + + return time + + def plan(self, ids_person, logger=None, **kwargs): + """ + Generates a plan for these person according to this strategie. + Overriden by specific strategy. + """ + print 'TransitStrategy.plan', len(ids_person) + #make_plans_private(self, ids_person = None, mode = 'passenger') + # routing necessary? + virtualpop = self.get_virtualpop() + plans = virtualpop.get_plans() # self._plans + demand = virtualpop.get_demand() + ptlines = demand.ptlines + + walkstages = plans.get_stagetable('walks') + transitstages = plans.get_stagetable('transits') + activitystages = plans.get_stagetable('activities') + + activities = virtualpop.get_activities() + activitytypes = demand.activitytypes + landuse = virtualpop.get_landuse() + facilities = landuse.facilities + parking = landuse.parking + + scenario = virtualpop.get_scenario() + net = scenario.net + edges = net.edges + lanes = net.lanes + modes = net.modes + + ptstops = net.ptstops + + # print ' demand',demand + # print ' demand.ptlines',demand.ptlines,dir(demand.ptlines) + # print ' demand.ptlines.get_ptlinks()',demand.ptlines.get_ptlinks() + # print ' demand.virtualpop',demand.virtualpop,dir(demand.virtualpop) + # print ' demand.trips',demand.trips,dir(demand.trips) + if len(ptlines) == 0: + print 'WARNING in TrasitStrategy.plan: no transit services available. Create public trasit services by connecting stops.' + return False + + ptlinks = ptlines.get_ptlinks() + if len(ptlinks) == 0: + print 'WARNING in TrasitStrategy.plan: no public transport links. Run methods: "create routes" and "build links" from public trasport services.' + return False + + ptlinktypes = ptlinks.types.choices + + ptfstar = ptlinks.get_fstar() + pttimes = ptlinks.get_times() + stops_to_enter, stops_to_exit = ptlinks.get_stops_to_enter_exit() + + ids_stoplane = ptstops.ids_lane + ids_laneedge = net.lanes.ids_edge + + times_est_plan = plans.times_est + # here we can determine edge weights for different modes + + # this could be centralized to avoid redundance + plans.prepare_stagetables(['walks', 'transits', 'activities']) + + ids_person_act, ids_act_from, ids_act_to\ + = virtualpop.get_activities_from_pattern(0, ids_person=ids_person) + + if len(ids_person_act) == 0: + print 'WARNING in TrasitStrategy.plan: no eligible persons found.' + return False + + # temporary maps from ids_person to other parameters + nm = np.max(ids_person_act)+1 + map_ids_plan = np.zeros(nm, dtype=np.int32) + #ids_plan_act = virtualpop.add_plans(ids_person_act, id_strategy = self.get_id_strategy()) + map_ids_plan[ids_person_act] = virtualpop.add_plans(ids_person_act, id_strategy=self.get_id_strategy()) + + map_times = np.zeros(nm, dtype=np.int32) map_times[ids_person_act] = activities.get_times_end(ids_act_from, pdf='unit') # set start time to plans (important!) @@ -2927,8 +3846,6 @@ times_from = map_times[ids_person_act] - ids_veh = virtualpop.ids_ibike[ids_person_act] - dists_walk_max = virtualpop.dists_walk_max[ids_person_act] names_acttype_to = activitytypes.names[activities.ids_activitytype[ids_act_to]] durations_act_to = activities.get_durations(ids_act_to) @@ -2952,8 +3869,6 @@ ids_stopedge_from = ids_laneedge[ids_stoplane[ids_stop_from]] ids_stopedge_to = ids_laneedge[ids_stoplane[ids_stop_to]] - centroids_stop_from = ptstops.centroids[ids_stop_from] - centroids_stop_to = ptstops.centroids[ids_stop_to] # do random pos here poss_stop_from = 0.5*(ptstops.positions_from[ids_stop_from] + ptstops.positions_to[ids_stop_from]) @@ -2961,30 +3876,19 @@ poss_stop_to = 0.5*(ptstops.positions_from[ids_stop_to] + ptstops.positions_to[ids_stop_to]) - dists_from_to = np.sqrt(np.sum((centroids_to - centroids_from)**2, 1)) - dists_from_stop_from = np.sqrt(np.sum((centroids_stop_from - centroids_from)**2, 1)) - dists_stop_to_to = np.sqrt(np.sum((centroids_to - centroids_stop_to)**2, 1)) - i = 0.0 - for id_person, id_plan, time_from, id_act_from, id_act_to, name_acttype_to, duration_act_to, id_veh, id_edge_from, pos_edge_from, id_edge_to, pos_edge_to, id_stop_from, id_stopedge_from, pos_stop_from, id_stop_to, id_stopedge_to, pos_stop_to, dists_from_to, dist_from_stop_from, dist_stop_to_to, dist_walk_max\ - in zip(ids_person_act, ids_plan, times_from, ids_act_from, ids_act_to, names_acttype_to, durations_act_to, ids_veh, ids_edge_from, poss_edge_from, ids_edge_to, poss_edge_to, ids_stop_from, ids_stopedge_from, poss_stop_from, ids_stop_to, ids_stopedge_to, poss_stop_to, dists_from_to, dists_from_stop_from, dists_stop_to_to, dists_walk_max): + for id_person, id_plan, time_from, id_act_from, id_act_to, name_acttype_to, duration_act_to, id_edge_from, pos_edge_from, id_edge_to, pos_edge_to, id_stop_from, id_stopedge_from, pos_stop_from, id_stop_to, id_stopedge_to, pos_stop_to\ + in zip(ids_person_act, ids_plan, times_from, ids_act_from, ids_act_to, names_acttype_to, durations_act_to, ids_edge_from, poss_edge_from, ids_edge_to, poss_edge_to, ids_stop_from, ids_stopedge_from, poss_stop_from, ids_stop_to, ids_stopedge_to, poss_stop_to): n_pers = len(ids_person_act) if logger: logger.progress(i/n_pers*100) i += 1.0 print 79*'_' print ' id_plan=%d, id_person=%d, ' % (id_plan, id_person) - #dist_from_stop_from, dist_stop_to_to - - time = self.plan_bikeride(id_plan, time_from, id_veh, - id_edge_from, pos_edge_from, - id_stopedge_from, pos_stop_from, - dist_from_stop_from, dist_walk_max, - walkstages, ridestages) - time = self.plan_transit(id_plan, time, - id_stopedge_from, pos_stop_from, - id_stopedge_to, pos_stop_to, + time = self.plan_transit(id_plan, time_from, + id_edge_from, pos_edge_from, + id_edge_to, pos_edge_to, id_stop_from, id_stopedge_from, pos_stop_from, id_stop_to, id_stopedge_to, pos_stop_to, #dist_from_to, dist_walk_max, @@ -2993,12 +3897,6 @@ stops_to_enter, stops_to_exit, ids_laneedge, ids_stoplane, ptstops) - time = self.plan_bikeride(id_plan, time, id_veh, - id_stopedge_to, pos_stop_to, - id_edge_to, pos_edge_to, - dist_stop_to_to, dist_walk_max, - walkstages, ridestages) - # update time for trips estimation for this plan plans.times_est[id_plan] += time-time_from @@ -3024,302 +3922,1059 @@ = virtualpop.get_activities_from_pattern(ind_act, ids_person=ids_person_act) -class Strategies(am.ArrayObjman): - def __init__(self, ident, virtualpop, **kwargs): - self._init_objman(ident, - parent=virtualpop, - name='Mobility Strategies', - info="""Contains different mobility strategies. - A strategy has methods to identify whether a strategy is applicaple to a person - and to make a plan fo a person. - """, - version=0.2, - **kwargs) +class BikeTransitStrategy(BikeStrategy, TransitStrategy): + def __init__(self, ident, parent=None, + name='Bike+Public Transport Strategy', + info='With this strategy, the person combines bike and public transport.', + **kwargs): - self.add_col(am.ArrayConf('names', - default='', - dtype='object', - perm='r', - is_index=True, - name='Short name', - info='Strategy name. Must be unique, used as index.', - )) + self._init_objman(ident, parent, name=name, info=info, **kwargs) + attrsman = self.set_attrsman(cm.Attrsman(self)) + # specific init self._init_attributes() self._init_constants() def _init_attributes(self): + # print 'StrategyMixin._init_attributes' + BikeStrategy._init_attributes(self) + TransitStrategy._init_attributes(self) - self.add_col(cm.ObjsConf('strategies', - #groupnames = ['state'], - name='Strategy', - info='Strategy object.', - )) + def _init_constants(self): - self.add_col(am.ArrayConf('colors', np.ones(4, np.float32), - dtype=np.float32, - metatype='color', - perm='rw', - name='Color', - info="Route color. Color as RGBA tuple with values from 0.0 to 1.0", - xmltag='color', - )) - if self.get_version() < 0.2: - self._set_colors_default() - self.set_version(0.2) + BikeStrategy._init_constants(self) + TransitStrategy._init_constants(self) - def format_ids(self, ids): - return ', '.join(self.names[ids]) + def preevaluate(self, ids_person): + """ + Preevaluation strategies for person IDs in vector ids_person. - def get_id_from_formatted(self, idstr): - return self.names.get_id_from_index(idstr) + Returns a preevaluation vector with a preevaluation value + for each person ID. The values of the preevaluation vector are as follows: + -1 : Strategy cannot be applied + 0 : Stategy can be applied, but the preferred mode is not used + 1 : Stategy can be applied, and preferred mode is part of the strategy + 2 : Strategy uses predomunantly preferred mode - def get_ids_from_formatted(self, idstrs): - return self.names.get_ids_from_indices_save(idstrs.split(',')) + """ + n_pers = len(ids_person) + persons = self.get_virtualpop() + preeval = np.zeros(n_pers, dtype=np.int32) - def add_default(self): + inds_prefer = (persons.ids_mode_preferred[ids_person] == self._id_mode_bus)\ + | (persons.ids_mode_preferred[ids_person] == self._id_mode_bike)\ - self.add_strategy('walk', WalkStrategy) - self.add_strategy('auto', AutoStrategy) - self.add_strategy('bike', BikeStrategy) + inds_avail = persons.ids_ibike[ids_person] > -1 + preeval[np.logical_not(inds_avail)] = -1 + # TODO: here we could exclude by age or distance facilities-stops + + # put 0 for persons whose preference is not public transport + preeval[inds_avail & np.logical_not(inds_prefer)] = 0 + + # put 2 for persons with bike access and who prefer bike or bus + preeval[inds_avail & inds_prefer] = 1 + + print ' BikeTransitStrategy.preevaluate', len(np.flatnonzero(preeval)) + return preeval + + def plan(self, ids_person, logger=None, **kwargs): + """ + Generates a plan for these person according to this strategie. + Overriden by specific strategy. + """ + print 'TransitStrategy.plan', len(ids_person) + #make_plans_private(self, ids_person = None, mode = 'passenger') + # routing necessary? + virtualpop = self.get_virtualpop() + plans = virtualpop.get_plans() # self._plans + demand = virtualpop.get_demand() + ptlines = demand.ptlines + + walkstages = plans.get_stagetable('walks') + transitstages = plans.get_stagetable('transits') + ridestages = plans.get_stagetable('bikerides') + activitystages = plans.get_stagetable('activities') + + activities = virtualpop.get_activities() + activitytypes = demand.activitytypes + landuse = virtualpop.get_landuse() + facilities = landuse.facilities + #parking = landuse.parking + + scenario = virtualpop.get_scenario() + net = scenario.net + edges = net.edges + lanes = net.lanes + modes = net.modes + + ptstops = net.ptstops + + # print ' demand',demand + # print ' demand.ptlines',demand.ptlines,dir(demand.ptlines) + # print ' demand.ptlines.get_ptlinks()',demand.ptlines.get_ptlinks() + # print ' demand.virtualpop',demand.virtualpop,dir(demand.virtualpop) + # print ' demand.trips',demand.trips,dir(demand.trips) + if len(ptlines) == 0: + print 'WARNING in TrasitStrategy.plan: no transit services available.' + return False + + ptlinks = ptlines.get_ptlinks() + ptlinktypes = ptlinks.types.choices + + ptfstar = ptlinks.get_fstar() + pttimes = ptlinks.get_times() + stops_to_enter, stops_to_exit = ptlinks.get_stops_to_enter_exit() + + ids_stoplane = ptstops.ids_lane + ids_laneedge = net.lanes.ids_edge + + times_est_plan = plans.times_est + # here we can determine edge weights for different modes + + # this could be centralized to avoid redundance + plans.prepare_stagetables(['walks', 'bikerides', 'transits', 'activities']) + + ids_person_act, ids_act_from, ids_act_to\ + = virtualpop.get_activities_from_pattern(0, ids_person=ids_person) + + if len(ids_person_act) == 0: + print 'WARNING in TrasitStrategy.plan: no eligible persons found.' + return False + + # temporary maps from ids_person to other parameters + nm = np.max(ids_person_act)+1 + map_ids_plan = np.zeros(nm, dtype=np.int32) + #ids_plan_act = virtualpop.add_plans(ids_person_act, id_strategy = self.get_id_strategy()) + map_ids_plan[ids_person_act] = virtualpop.add_plans(ids_person_act, id_strategy=self.get_id_strategy()) + + map_times = np.zeros(nm, dtype=np.int32) + map_times[ids_person_act] = activities.get_times_end(ids_act_from, pdf='unit') + + # set start time to plans (important!) + plans.times_begin[map_ids_plan[ids_person_act]] = map_times[ids_person_act] + + map_ids_fac_from = np.zeros(nm, dtype=np.int32) + map_ids_fac_from[ids_person_act] = activities.ids_facility[ids_act_from] + + n_plans = len(ids_person_act) + print 'TrasitStrategy.plan n_plans=', n_plans + + # make initial activity stage + ids_edge_from = facilities.ids_roadedge_closest[map_ids_fac_from[ids_person_act]] + poss_edge_from = facilities.positions_roadedge_closest[map_ids_fac_from[ids_person_act]] + # this is the time when first activity starts + # first activity is normally not simulated + + names_acttype_from = activitytypes.names[activities.ids_activitytype[ids_act_from]] + durations_act_from = activities.get_durations(ids_act_from) + times_from = map_times[ids_person_act]-durations_act_from + #times_from = activities.get_times_end(ids_act_from, pdf = 'unit') + + for id_plan,\ + time,\ + id_act_from,\ + name_acttype_from,\ + duration_act_from,\ + id_edge_from,\ + pos_edge_from \ + in zip(map_ids_plan[ids_person_act], + times_from, + ids_act_from, + names_acttype_from, + durations_act_from, + ids_edge_from, + poss_edge_from): + + id_stage_act, time = activitystages.append_stage( + id_plan, time, + ids_activity=id_act_from, + names_activitytype=name_acttype_from, + durations=duration_act_from, + ids_lane=edges.ids_lanes[id_edge_from][0], + positions=pos_edge_from, + ) + + ## + + ind_act = 0 + + # main loop while there are persons performing + # an activity at index ind_act + while len(ids_person_act) > 0: + ids_plan = map_ids_plan[ids_person_act] + + times_from = map_times[ids_person_act] + + ids_veh = virtualpop.ids_ibike[ids_person_act] + dists_walk_max = virtualpop.dists_walk_max[ids_person_act] + names_acttype_to = activitytypes.names[activities.ids_activitytype[ids_act_to]] + durations_act_to = activities.get_durations(ids_act_to) + + ids_fac_from = map_ids_fac_from[ids_person_act] + ids_fac_to = activities.ids_facility[ids_act_to] + + centroids_from = facilities.centroids[ids_fac_from] + centroids_to = facilities.centroids[ids_fac_to] + + # origin edge and position + ids_edge_from = facilities.ids_roadedge_closest[ids_fac_from] + poss_edge_from = facilities.positions_roadedge_closest[ids_fac_from] + + # destination edge and position + ids_edge_to = facilities.ids_roadedge_closest[ids_fac_to] + poss_edge_to = facilities.positions_roadedge_closest[ids_fac_to] + + ids_stop_from = ptstops.get_closest(centroids_from) + ids_stop_to = ptstops.get_closest(centroids_to) + + ids_stopedge_from = ids_laneedge[ids_stoplane[ids_stop_from]] + ids_stopedge_to = ids_laneedge[ids_stoplane[ids_stop_to]] + + centroids_stop_from = ptstops.centroids[ids_stop_from] + centroids_stop_to = ptstops.centroids[ids_stop_to] + # do random pos here + poss_stop_from = 0.5*(ptstops.positions_from[ids_stop_from] + + ptstops.positions_to[ids_stop_from]) + + poss_stop_to = 0.5*(ptstops.positions_from[ids_stop_to] + + ptstops.positions_to[ids_stop_to]) + + dists_from_to = np.sqrt(np.sum((centroids_to - centroids_from)**2, 1)) + dists_from_stop_from = np.sqrt(np.sum((centroids_stop_from - centroids_from)**2, 1)) + dists_stop_to_to = np.sqrt(np.sum((centroids_to - centroids_stop_to)**2, 1)) + + i = 0.0 + for id_person, id_plan, time_from, id_act_from, id_act_to, name_acttype_to, duration_act_to, id_veh, id_edge_from, pos_edge_from, id_edge_to, pos_edge_to, id_stop_from, id_stopedge_from, pos_stop_from, id_stop_to, id_stopedge_to, pos_stop_to, dists_from_to, dist_from_stop_from, dist_stop_to_to, dist_walk_max\ + in zip(ids_person_act, ids_plan, times_from, ids_act_from, ids_act_to, names_acttype_to, durations_act_to, ids_veh, ids_edge_from, poss_edge_from, ids_edge_to, poss_edge_to, ids_stop_from, ids_stopedge_from, poss_stop_from, ids_stop_to, ids_stopedge_to, poss_stop_to, dists_from_to, dists_from_stop_from, dists_stop_to_to, dists_walk_max): + n_pers = len(ids_person_act) + if logger: + logger.progress(i/n_pers*100) + i += 1.0 + print 79*'_' + print ' id_plan=%d, id_person=%d, ' % (id_plan, id_person) + #dist_from_stop_from, dist_stop_to_to + + time = self.plan_bikeride(id_plan, time_from, id_veh, + id_edge_from, pos_edge_from, + id_stopedge_from, pos_stop_from, + dist_from_stop_from, dist_walk_max, + walkstages, ridestages) + + time = self.plan_transit(id_plan, time, + id_stopedge_from, pos_stop_from, + id_stopedge_to, pos_stop_to, + id_stop_from, id_stopedge_from, pos_stop_from, + id_stop_to, id_stopedge_to, pos_stop_to, + #dist_from_to, dist_walk_max, + walkstages, transitstages, + ptlines, ptfstar, pttimes, + stops_to_enter, stops_to_exit, + ids_laneedge, ids_stoplane, ptstops) + + time = self.plan_bikeride(id_plan, time, id_veh, + id_stopedge_to, pos_stop_to, + id_edge_to, pos_edge_to, + dist_stop_to_to, dist_walk_max, + walkstages, ridestages) + + # update time for trips estimation for this plan + plans.times_est[id_plan] += time-time_from + + # define current end time without last activity duration + plans.times_end[id_plan] = time + + id_stage_act, time = activitystages.append_stage( + id_plan, time, + ids_activity=id_act_to, + names_activitytype=name_acttype_to, + durations=duration_act_to, + ids_lane=edges.ids_lanes[id_edge_to][0], + positions=pos_edge_to, + ) + + # store time for next iteration in case other activities are + # following + map_times[id_person] = time + + # select persons and activities for next setp + ind_act += 1 + ids_person_act, ids_act_from, ids_act_to\ + = virtualpop.get_activities_from_pattern(ind_act, ids_person=ids_person_act) + + +class Strategies(am.ArrayObjman): + def __init__(self, ident, virtualpop, **kwargs): + self._init_objman(ident, + parent=virtualpop, + name='Mobility Strategies', + info="""Contains different mobility strategies. + A strategy has methods to identify whether a strategy is applicaple to a person + and to make a plan fo a person. + """, + version=0.3, + **kwargs) + + self.add_col(am.ArrayConf('names', + default='', + dtype='object', + perm='r', + is_index=True, + name='Short name', + info='Strategy name. Must be unique, used as index.', + )) + self._init_attributes() + self._init_constants() + + def _init_attributes(self): + + self.add_col(cm.ObjsConf('strategies', + groupnames=['state'], + name='Strategy', + info='Strategy object.', + )) + + if hasattr(self, 'vot'): # self.get_version() < 0.3: + value_of_time_default = self.vot.get_value() + self.delete('vot') + else: + value_of_time_default = 0.07/60 # here in euro per second + + self.add(cm.AttrConf('value_of_time', value_of_time_default, + groupnames=['parameters'], + name='Value of time (VOT)', + unit='1/s', + perm='rw', + info="This parameter weights the travel time in each strategies utility function: utility = utility_strategy_specific + value_of_time*time_exec +noise", + )) + + self.add_col(am.ArrayConf('colors', np.ones(4, np.float32), + dtype=np.float32, + groupnames=['parameters'], + metatype='color', + perm='rw', + name='Color', + info="Route color. Color as RGBA tuple with values from 0.0 to 1.0", + xmltag='color', + )) + + if self.get_version() < 0.2: + self._set_colors_default() + + if self.get_version() < 0.3: + self.set_version(0.3) + + def format_ids(self, ids): + return ', '.join(self.names[ids]) + + def get_id_from_formatted(self, idstr): + return self.names.get_id_from_index(idstr) + + def get_ids_from_formatted(self, idstrs): + return self.names.get_ids_from_indices_save(idstrs.split(',')) + + def add_default(self): + + self.add_strategy('walk', WalkStrategy) + self.add_strategy('auto', AutoStrategy) + self.add_strategy('bike', BikeStrategy) self.add_strategy('transit', TransitStrategy) self.add_strategy('biketransit', BikeTransitStrategy) + self.add_strategy('motorcycle', MotorcycleStrategy) + self.add_strategy('taxi', TaxiStrategy) self._set_colors_default() - def _set_colors_default(self): - colors_default = {'walk': np.array([160, 72, 0, 220], np.float32)/255, - 'auto': np.array([250, 213, 0, 220], np.float32)/255, - 'bike': np.array([8, 191, 73, 210], np.float32)/255, - 'transit': np.array([8, 77, 191, 220], np.float32)/255, - 'biketransit': np.array([8, 201, 223, 220], np.float32)/255, - } - ids = self.names.get_ids_from_indices_save(colors_default.keys()) - self.colors[ids] = colors_default.values() # np.array(colors_default.values(), np.float32).reshape(-1,4) + def _set_colors_default(self): + colors_default = {'walk': np.array([160, 72, 0, 220], np.float32)/255, + 'auto': np.array([250, 213, 0, 220], np.float32)/255, + 'bike': np.array([8, 191, 73, 210], np.float32)/255, + 'transit': np.array([8, 77, 191, 220], np.float32)/255, + 'biketransit': np.array([8, 201, 223, 220], np.float32)/255, + 'motorcycle': np.array([170, 200, 0, 220], np.float32)/255, + 'taxi': np.array([40, 240, 240, 220], np.float32)/255, + } + ids = self.names.get_ids_from_indices_save(colors_default.keys()) + self.colors[ids] = colors_default.values() # np.array(colors_default.values(), np.float32).reshape(-1,4) + + #self.colors.indexset(colors_default.keys(), colors_default.values()) + + def add_strategy(self, ident, Strategyclass, color=(0.0, 0.0, 0.0, 1.0)): + # print 'add_strategy', ident + if not self.names.has_index(ident): + strategy = Strategyclass(ident, self) + self.add_row(names=ident, + strategies=strategy, + colours=color, + ) + return strategy + else: + # print 'WARNING in add_strategy: strategy %s already initialized'%ident + return self.strategies[self.names.get_id_from_index(ident)] + + def preevaluate(self, ids_person): + """ + Preevaluation of strategies for person IDs in vector ids_person. + + Returns a vector with strategy IDs and a preevaluation matrix. + The rows of the matrix corrispond to each person ID. + The columns corrsopond to reck strategy ID. + The values of the preevaluation matrix are as follows: + -1 : Strategy cannot be applied + 0 : Stategy can be applied, but the preferred mode is not used + 1 : Stategy can be applied, and preferred mode is part of the strategy + 2 : Strategy uses predomunantly preferred mode + + """ + print 'preevaluate strategies' + ids_strat = self.get_ids() + n_pers = len(ids_person) + n_strat = len(ids_strat) + + preeval = np.zeros((n_pers, n_strat), dtype=np.int32) + for i, strategy in zip(range(n_strat), self.strategies[ids_strat]): + print ' preevaluate strategiy', strategy.ident + preeval[i, :] = strategy.preevaluate(ids_person) + + return ids_strat, preeval + + +class StageTypeMixin(am.ArrayObjman): + def init_stagetable(self, ident, stages, name='', info="Stage of Plan"): + + self._init_objman(ident=ident, parent=stages, name=name, + info=info, + version=0.2, + ) + + self.add_col(am.IdsArrayConf('ids_plan', self.get_plans(), + #groupnames = ['state'], + name='ID plan', + info='ID of plan.', + xmltag='type', + )) + + self.add_col(am.ArrayConf('times_start', -1.0, + groupnames=['parameters'], # new + name='Start time', + unit='s', + info='Planned or estimated time when this stage starts. Value -1 means unknown.', + )) + + self.add_col(am.ArrayConf('durations', -1.0, + name='Duration', + groupnames=['parameters'], # new + unit='s', + info='Planned or estimated duration for this stage starts. Value -1 means unknown.', + xmltag='type', + )) + + def _init_constants(self): + self._fstarmap = {} + self._timesmap = {} + self._distancesmap = {} + self.get_attrsman().do_not_save_attrs(['_fstarmap', '_timesmap', '_distancesmap']) + self._init_constants_specific() + + def _init_constants_specific(self): + # to be overridden + pass + + def get_plans(self): + return self.parent + + def get_ids_from_ids_plan(self, ids_plan): + """ + Returns only stage IDs which are part of the given plans IDs. + """ + # print 'get_ids_from_ids_plan for',type(ids_plan),ids_plan + + ids = self.get_ids() + #ids_plan_part = self.ids_plan[ids] + are_selected = np.zeros(len(ids), dtype=np.bool) + for ind, id_plan_part in zip(xrange(len(ids)), self.ids_plan[ids]): + are_selected[ind] = id_plan_part in ids_plan + return ids[are_selected] + # print ' ids_plan_part',type(ids_plan_part),ids_plan_part + # print ' ids_selected',type(ids_plan_part.intersection(ids_plan)),ids_plan_part.intersection(ids_plan) + # return np.array(list(ids_plan_part.intersection(ids_plan)), dtype = np.int32) + + def get_virtualpop(self): + # print 'get_virtualpop ' + return self.parent.parent + + def prepare_planning(self): + pass + + def append_stage(self, id_plan, time_start, **kwargs): + + # try to fix timing + # if time_start<0: + # time_start_prev, duration_prev = self.parent.plans.get_timing_laststage(id_plan) + # if (duration_prev>=0)&(time_start_prev>=0): + # time_start = time_start_prev+duration_prev + + id_stage = self.add_row(ids_plan=id_plan, times_start=time_start, **kwargs) + # print 'STAGE.appended stage %s id_plan=%d, id_stage=%d, t=%d'%(self.get_name(),id_plan,id_stage,time_start) + # for key in kwargs.keys(): + # print ' %s=%s'%(key,kwargs[key]) + # print ' --id_plan, self, id_stage',id_plan, self, id_stage#,self.ids_plan.get_linktab() + + self.parent.append_stage(id_plan, self, id_stage) + # print ' plan appended',id_plan, self, id_stage + + return id_stage, time_start+self.durations[id_stage] + + def modify_stage(self, id_stage, time_start=None, **kwargs): + if time_start is None: + time_start = self.times_start[id_stage] + self.set_row(id_stage, **kwargs) + return time_start+self.durations[id_stage] + + def get_timing(self, id_stage): + #ind = self.get_ind(id_stage) + return self.times_start[id_stage], self.durations[id_stage] + + def get_times(self, id_mode): + """ + Returns a vector mapping id_edge to edge travel times + for given mode id_mode + """ + print 'get_times', self._timesmap.keys() + + if not self._timesmap.has_key(id_mode): + edges = self.get_virtualpop().get_scenario().net.edges + self._timesmap[id_mode] = edges.get_times(id_mode=id_mode, + is_check_lanes=True, + ) + + return self._timesmap[id_mode] + + def get_distances(self, id_mode): + """ + Returns a vector mapping id_edge to edge distances + for given mode id_mode + """ + print 'get_distances', self._distancesmap.keys() + + if not self._distancesmap.has_key(id_mode): + edges = self.get_virtualpop().get_scenario().net.edges + self._distancesmap[id_mode] = edges.get_distances(id_mode=id_mode, + is_check_lanes=True, + ) + + return self._distancesmap[id_mode] + + def get_fstar(self, id_mode, is_return_arrays=True, is_ignor_connections=False): + """ + Returns a fstar + for given mode id_mode + """ + print 'get_fstar', self._fstarmap.keys() + + if not self._fstarmap.has_key(id_mode): + edges = self.get_virtualpop().get_scenario().net.edges + self._fstarmap[id_mode] = edges.get_fstar(id_mode=id_mode, + is_ignor_connections=is_ignor_connections, + is_return_arrays=is_return_arrays, + ) + return self._fstarmap[id_mode] + + def to_xml(self, id_stage, fd, indent=0): + """ + To be overridden by specific stage class. + """ + pass + + +class TransitStages(StageTypeMixin): + def __init__(self, ident, stages, name='Transit rides', info='Ride on a single public transport line (no transfers).'): + self.init_stagetable(ident, + stages, name=name, + info=info, + ) + self._init_attributes() + + def _init_attributes(self): + #ptstops = self.parent.get_ptstops() + edges = self.get_virtualpop().get_net().edges + if hasattr(self, 'ids_fromstop'): + self.delete('ids_fromstop') + self.delete('ids_tostop') + + self.add_col(am.IdsArrayConf('ids_line', self.get_virtualpop().get_ptlines(), + groupnames=['parameters'], + name='ID line', + info='ID of public transport line.', + )) + + self.add_col(am.IdsArrayConf('ids_fromedge', edges, + groupnames=['parameters'], + name='Edge ID from', + info='Edge ID of departure bus stop or station.', + )) + + self.add_col(am.IdsArrayConf('ids_toedge', edges, + groupnames=['parameters'], + name='Edge ID to', + info='Edge ID of destination bus stop or station.', + )) + + def _init_constants_specific(self): + self.get_attrsman().do_not_save_attrs(['_costs', '_fstar', ]) + + def prepare_planning(self): + ptlinks = self.ids_line.get_linktab().ptlinks.get_value() + if len(ptlinks) == 0: + # no links built...built them + ptlinks.build() + + self._costs = ptlinks.get_times() + self._fstar = ptlinks.get_fstar() + + def append_stage(self, id_plan, time_start=-1.0, + id_line=-1, duration=0.0, + id_fromedge=-1, id_toedge=-1, **kwargs): + """ + Appends a transit stage to plan id_plan. + + """ + # print 'TransitStages.append_stage',id_stage + + id_stage, time_end = StageTypeMixin.append_stage(self, + id_plan, + time_start, + durations=duration, + ids_line=id_line, + ids_fromedge=id_fromedge, + ids_toedge=id_toedge, + ) + + # add this stage to the vehicle database + # ind_ride gives the index of this ride (within the same plan??) + #ind_ride = self.parent.get_iautos().append_ride(id_veh, id_stage) + return id_stage, time_end + + def to_xml(self, id_stage, fd, indent=0): + # + net = self.get_virtualpop().get_net() + #ids_stoplane = net.ptstops.ids_lane + #ids_laneedge = net.lanes.ids_edge + ids_sumoedge = net.edges.ids_sumo + + #ind = self.get_ind(id_stage) + fd.write(xm.start('ride', indent=indent)) + fd.write(xm.num('from', ids_sumoedge[self.ids_fromedge[id_stage]])) + fd.write(xm.num('to', ids_sumoedge[self.ids_toedge[id_stage]])) + fd.write(xm.num('lines', self.ids_line.get_linktab().linenames[self.ids_line[id_stage]])) + # if self.cols.pos_edge_from[ind]>0: + # fd.write(xm.num('departPos', self.cols.pos_edge_from[ind])) + # if self.cols.pos_edge_to[ind]>0: + # fd.write(xm.num('arrivalPos', self.cols.pos_edge_to[ind])) + + fd.write(xm.stopit()) # ends stage + + +class AutorideStages(StageTypeMixin): + + def __init__(self, ident, population, + name='Auto rides', + info='Rides with privately owned auto.', + version=1.1, + ): + + self.init_stagetable(ident, population, name=name, info=info) + # print 'Rides.__init__',self.get_name() + self._init_attributes() + + def _init_attributes(self): + # TODO: this structure needs review: the private vehicle is part of a person, not a stage + # street parking at home and work could be in stage. Private garage is part of person... + # print '_init_attributes',self.parent.get_iautos(), self.ident,self.parent.get_landuse().parking + + self.add_col(am.IdsArrayConf('ids_iauto', self.get_virtualpop().get_iautos(), + groupnames=['parameter'], + name='ID vehicle', + info='ID of private vehicle.', + )) + + self.add_col(am.ArrayConf('times_init', -1.0, + groupnames=['parameter'], + name='Init. time', + unit='s', + info='Initialization time, which is the time when the vehicle appears in the scenario. Value -1 means unknown.', + )) + + self.add_col(am.IdsArrayConf('ids_parking_from', self.get_virtualpop().get_landuse().parking, + groupnames=['parameter'], + name='ID dep. parking', + info='Parking ID at the departure of the ride starts.', + )) + + self.add_col(am.IdsArrayConf('ids_parking_to', self.get_virtualpop().get_landuse().parking, + groupnames=['parameter'], + name='ID arr. parking', + info='Parking ID at the arrival of the ride.', + )) + + self.add_col(am.IdlistsArrayConf('ids_edges', self.get_virtualpop().get_net().edges, + groupnames=['parameter'], + name='Route', + info="The vehicle's route as a sequence of edge IDs.", + )) + + if self.get_version() < 1.1: + self.ids_edges.del_groupname('_private') + + self.add(cm.AttrConf('dist_ride_min', 400.0, + groupnames=['options'], + perm='rw', + name='Min ride dist.', + info='Minimum ride distance. If the distanve between parkings is less, then the person will walk.', + )) + + self.set_version(1.1) + # if hasattr(self,'parking'): + # self.delete('parking') + + def prepare_planning(self): + # now in _init_constants + pass + #net = self.get_virtualpop().get_net() + #id_mode = net.modes.get_id_mode('passenger') + #self._costs = {} + # self._costs[id_mode] = net.edges.get_times( id_mode = id_mode, + # is_check_lanes = True) + #self._fstars = {} + #self._fstars[id_mode] = net.edges.get_fstar(is_ignor_connections = False, id_mode = id_mode) + #self._fstar = net.edges.get_fstar(is_ignor_connections = False) + + def append_stage(self, id_plan, id_mode, + is_fallback=False, id_mode_fallback=None, + time_start=-1.0, id_veh=-1, time_init=-1, + id_parking_from=.1, id_parking_to=-1, **kwargs): + """ + Appends a ride stage to plan id_plan in case the ride is feasible. + The ride is feasible if from parking and to parking are connected. + + If feasible, the stage ID and estimated time when stage is finished + will be returned. + + If not feasible -1 and start time will be returned. + """ + print 'Rides.append_stage id_plan', id_plan, is_fallback + + route, dist, duration, is_fallback = self.get_route_between_parking( + id_parking_from, id_parking_to, id_mode, + is_fallback, id_mode_fallback,) - #self.colors.indexset(colors_default.keys(), colors_default.values()) + print ' after routing: is_fallback', is_fallback, 'route', route + + if (len(route) > 0): # |(dist > self.dist_ride_min.get_value()): # is there a connection + # create stage + id_stage, time_end = StageTypeMixin.append_stage(self, + id_plan, + time_start, + durations=duration, + times_init=time_init, + ids_iauto=id_veh, + ids_parking_from=id_parking_from, + ids_parking_to=id_parking_to, + ids_edges=route, + ) + + # add this stage to the vehicle database + # ind_ride gives the index of this ride (within the same plan??) + #ind_ride = self.parent.get_iautos().append_ride(id_veh, id_stage) + return id_stage, time_end, is_fallback - def add_strategy(self, ident, Strategyclass, color=(0.0, 0.0, 0.0, 1.0)): - # print 'add_strategy', ident - if not self.names.has_index(ident): - strategy = Strategyclass(ident, self) - self.add_row(names=ident, - strategies=strategy, - colours=color, - ) - return strategy else: - # print 'WARNING in add_strategy: strategy %s already initialized'%ident - return self.strategies[self.names.get_id_from_index(ident)] + # not connected or too short of a distance + return -1, time_start, is_fallback # no stage creation took place - def preevaluate(self, ids_person): + def get_route_between_parking(self, id_parking_from, id_parking_to, id_mode, + is_fallback=False, id_mode_fallback=None): """ - Preevaluation of strategies for person IDs in vector ids_person. + Return route and distance of ride with vehicle type vtype + between id_parking_from and id_parking_to - Returns a vector with strategy IDs and a preevaluation matrix. - The rows of the matrix corrispond to each person ID. - The columns corrsopond to reck strategy ID. - The values of the preevaluation matrix are as follows: - -1 : Strategy cannot be applied - 0 : Stategy can be applied, but the preferred mode is not used - 1 : Stategy can be applied, and preferred mode is part of the strategy - 2 : Strategy uses predomunantly preferred mode """ - print 'preevaluate strategies' - ids_strat = self.get_ids() - n_pers = len(ids_person) - n_strat = len(ids_strat) - - preeval = np.zeros((n_pers, n_strat), dtype=np.int32) - for i, strategy in zip(range(n_strat), self.strategies[ids_strat]): - print ' preevaluate strategiy', strategy.ident - preeval[i, :] = strategy.preevaluate(ids_person) + print 'get_route_between_parking', id_parking_from, id_parking_to, 'is_fallback', is_fallback, 'id_mode_fallback', id_mode_fallback + scenario = self.get_virtualpop().get_scenario() + edges = scenario.net.edges + lanes = scenario.net.lanes - return ids_strat, preeval + # print self.get_demand().getVehicles().cols.maxSpeed + #v_max = self.get_demand().getVehicles().maxSpeed.get(vtype) + parking = scenario.landuse.parking + ids_lanes = parking.ids_lane[[id_parking_from, id_parking_to]] + id_edge_from, id_edge_to = lanes.ids_edge[ids_lanes] + pos_from, pos_to = parking.positions[[id_parking_from, id_parking_to]] -class StageTypeMixin(am.ArrayObjman): - def init_stagetable(self, ident, stages, name='', info="Stage of Plan"): + if is_fallback & (id_mode_fallback is not None): + print ' use id_mode_fallback', id_mode_fallback + id_mode_current = id_mode_fallback - self._init_objman(ident=ident, parent=stages, name=name, - info=info, - version=0.2, - ) + else: + print ' use id_mode', id_mode + id_mode_current = id_mode - self.add_col(am.IdsArrayConf('ids_plan', self.get_plans(), - #groupnames = ['state'], - name='ID plan', - info='ID of plan.', - xmltag='type', - )) + # print ' id_edge_from, id_edge_to=',id_edge_from, id_edge_to + duration_approx, route = routing.get_mincostroute_edge2edge( + id_edge_from, + id_edge_to, + weights=self.get_times(id_mode_current), + fstar=self.get_fstar(id_mode_current), + ) - self.add_col(am.ArrayConf('times_start', -1.0, - groupnames=['parameters'], # new - name='Start time', - unit='s', - info='Planned or estimated time when this stage starts. Value -1 means unknown.', - )) + if (len(route) == 0) & (not is_fallback) & (id_mode_fallback is not None): + is_fallback = True + id_mode_current = id_mode_fallback + print ' no route found with normal mode, try fallback', is_fallback + # now retry with fallback + duration_approx, route = routing.get_mincostroute_edge2edge( + id_edge_from, + id_edge_to, + weights=self.get_times(id_mode_current), + fstar=self.get_fstar(id_mode_current), + ) + if len(route) > 0: + print ' fallback has been successful' - self.add_col(am.ArrayConf('durations', -1.0, - name='Duration', - groupnames=['parameters'], # new - unit='s', - info='Planned or estimated duration for this stage starts. Value -1 means unknown.', - xmltag='type', - )) + # here is a big problem: starting with the successive node of edge_from + # may result that the first edge of the route is not connected with edge_from + # And arriving at the preceding node of edge_to may result that from + # the last edge in route the edge_to is not connected. - def get_plans(self): - return self.parent + #route = [edge_from]+route+[edge_to] + dist = np.sum(edges.lengths[route]) + dist = dist - pos_from - (edges.lengths[id_edge_to] - pos_to) + # if 0: + # if len(route)>0: + # print ' dist,duration',dist,duration_approx + # else: + # print ' no route found' - def get_ids_from_ids_plan(self, ids_plan): - """ - Returns only stage IDs which are part of the given plans IDs. - """ - # print 'get_ids_from_ids_plan for',type(ids_plan),ids_plan + return route, dist, duration_approx, is_fallback - ids = self.get_ids() - #ids_plan_part = self.ids_plan[ids] - are_selected = np.zeros(len(ids), dtype=np.bool) - for ind, id_plan_part in zip(xrange(len(ids)), self.ids_plan[ids]): - are_selected[ind] = id_plan_part in ids_plan - return ids[are_selected] - # print ' ids_plan_part',type(ids_plan_part),ids_plan_part - # print ' ids_selected',type(ids_plan_part.intersection(ids_plan)),ids_plan_part.intersection(ids_plan) - # return np.array(list(ids_plan_part.intersection(ids_plan)), dtype = np.int32) + # def make_id_veh_ride(self, id_stage, i_ride): + # # make a unique vehicle ID for this stage + # self.inds_ride[id_stage] = i_ride + # return str(self.ids_veh[id_stage])+'.'+str(i_ride) - def get_virtualpop(self): - # print 'get_virtualpop ' - return self.parent.parent + def get_writexmlinfo(self, ids_plan, is_route=True, is_plain=False): + print 'AutorideStages.get_writexmlinfo', len(ids_plan), is_route, 'is_plain', is_plain + iautos = self.get_virtualpop().get_iautos() + writefunc = iautos.prepare_write_xml(is_route, is_plain) - def prepare_planning(self): - pass + # not all auto plans contain autoride stages! + ids = self.get_ids_from_ids_plan(ids_plan) + writefuncs = np.zeros(len(ids), dtype=np.object) + writefuncs[:] = writefunc + return self.times_init[ids], writefuncs, ids - def append_stage(self, id_plan, time_start, **kwargs): + def to_xml(self, id_stage, fd, indent=0): + #lanes = self.parent.get_scenario().net.lanes + scenario = self.get_virtualpop().get_scenario() - # try to fix timing - # if time_start<0: - # time_start_prev, duration_prev = self.parent.plans.get_timing_laststage(id_plan) - # if (duration_prev>=0)&(time_start_prev>=0): - # time_start = time_start_prev+duration_prev + edges = scenario.net.edges + edgeindex = edges.ids_sumo + parking = scenario.landuse.parking - id_stage = self.add_row(ids_plan=id_plan, times_start=time_start, **kwargs) - # print 'STAGE.appended stage %s id_plan=%d, id_stage=%d, t=%d'%(self.get_name(),id_plan,id_stage,time_start) - # for key in kwargs.keys(): - # print ' %s=%s'%(key,kwargs[key]) - # print ' --id_plan, self, id_stage',id_plan, self, id_stage#,self.ids_plan.get_linktab() + ind = self.get_ind(id_stage) + fd.write(xm.start('ride', indent=indent)) - self.parent.append_stage(id_plan, self, id_stage) - # print ' plan appended',id_plan, self, id_stage + id_edge_from, pos_from = parking.get_edge_pos_parking(self.ids_parking_from.value[ind]) + id_edge_to, pos_to = parking.get_edge_pos_parking(self.ids_parking_to.value[ind]) - return id_stage, time_start+self.durations[id_stage] + # edgeindex.get_index_from_id(self.ids_edge_to.value[ind]) + fd.write(xm.num('from', edgeindex[id_edge_from])) + fd.write(xm.num('to', edgeindex[id_edge_to])) + fd.write(xm.num('lines', self.ids_iauto.get_linktab().get_id_line_xml( + self.ids_iauto[id_stage]))) # mode specific - def modify_stage(self, id_stage, time_start, **kwargs): - self.set_row(id_stage, **kwargs) - return time_start+self.durations[id_stage] + fd.write(xm.stopit()) # ends stage - def get_timing(self, id_stage): - #ind = self.get_ind(id_stage) - return self.times_start[id_stage], self.durations[id_stage] - def to_xml(self, id_stage, fd, indent=0): - """ - To be overridden by specific stage class. - """ - pass +class BikerideStages(StageTypeMixin): + def __init__(self, ident, population, + name='Bike rides', + info='Rides with privately owned bike.', + version=1.0, + ): -class TransitStages(StageTypeMixin): - def __init__(self, ident, stages, name='Transit rides', info='Ride on a single public transport line (no transfers).'): - self.init_stagetable(ident, - stages, name=name, - info=info, - ) + self.init_stagetable(ident, population, name=name, info=info) + # print 'Rides.__init__',self.get_name() self._init_attributes() - def _init_attributes(self): - #ptstops = self.parent.get_ptstops() - edges = self.get_virtualpop().get_net().edges - if hasattr(self, 'ids_fromstop'): - self.delete('ids_fromstop') - self.delete('ids_tostop') + def _init_attributes(self): + # TODO: this structure needs review: the private vehicle is part of a person, not a stage + # street parking at home and work could be in stage. Private garage is part of person... + # print '_init_attributes',self.parent.get_iautos(), self.ident,self.parent.get_landuse().parking + + self.add_col(am.IdsArrayConf('ids_ibike', self.get_virtualpop().get_ibikes(), + groupnames=['state'], + name='ID bike', + info='ID of private, individual bike.', + )) + + self.add_col(am.ArrayConf('times_init', -1.0, + name='Init. time', + unit='s', + info='Initialization time, which is the time when the vehicle appears in the scenario. Value -1 means unknown.', + )) + + edges = self.get_virtualpop().get_net().edges + + self.add_col(am.IdsArrayConf('ids_edge_from', edges, + groupnames=['state'], + name='ID Dep. edge', + info='Edge ID at departure of walk.', + )) + + self.add_col(am.IdsArrayConf('ids_edge_to', edges, + groupnames=['state'], + name='ID Arr. edge', + info='Edge ID where walk finishes.', + )) + + self.add_col(am.ArrayConf('positions_from', 0.0, + dtype=np.float32, + #choices = OPTIONMAP_POS_DEPARTURE, + perm='r', + name='Depart pos', + unit='m', + info="Position on edge at the moment of departure.", + #xmltag = 'departPos', + #xmlmap = get_inversemap(OPTIONMAP_POS_ARRIVAL), + )) + + self.add_col(am.ArrayConf('positions_to', 0.0, + dtype=np.float32, + #choices = OPTIONMAP_POS_ARRIVAL, + perm='r', + name='Arrival pos', + unit='m', + info="Position on edge at the moment of arrival.", + #xmltag = 'arrivalPos', + #xmlmap = get_inversemap(OPTIONMAP_POS_ARRIVAL), + )) + + self.add_col(am.IdlistsArrayConf('ids_edges', self.get_virtualpop().get_net().edges, + groupnames=['_private'], + name='Route', + info="The vehicle's route as a sequence of edge IDs.", + )) + + def _init_constants_specific(self): + net = self.get_virtualpop().get_net() + self.id_mode_bike = net.modes.get_id_mode('bicycle') + self.get_attrsman().do_not_save_attrs(['id_mode_bike', ]) + + def prepare_planning(self): + pass + + def append_stage(self, id_plan, time_start=-1.0, id_veh=-1, + time_init=-1, + id_edge_from=-1, id_edge_to=-1, + position_edge_from=0.0, position_edge_to=0.0, + is_route=True, route=-1, duration_approx=-1, + **kwargs): + """ + Appends a ride stage to plan id_plan in case the ride is feasible. + The ride is feasible if from parking and to parking are connected. + + If feasible, the stage ID and estimated time when stage is finished + will be returned. - self.add_col(am.IdsArrayConf('ids_line', self.get_virtualpop().get_ptlines(), - groupnames=['parameters'], - name='ID line', - info='ID of public transport line.', - )) + If not feasible -1 and start time will be returned. + """ + # print 'BikeRides.append_stage',id_plan,time_start,time_init + #edges = self.get_virtualpop().get_net().edges + # check feasibility + #route, dist, duration = self.get_route_between_parking(id_parking_from, id_parking_to) - self.add_col(am.IdsArrayConf('ids_fromedge', edges, - groupnames=['parameters'], - name='Edge ID from', - info='Edge ID of departure bus stop or station.', - )) + # print ' id_edge_from, id_edge_to=',id_edge_from, id_edge_to - self.add_col(am.IdsArrayConf('ids_toedge', edges, - groupnames=['parameters'], - name='Edge ID to', - info='Edge ID of destination bus stop or station.', - )) + if is_route: + duration_approx, route = routing.get_mincostroute_edge2edge( + id_edge_from, + id_edge_to, + weights=self.get_times(self.id_mode_bike), + fstar=self.get_fstar(self.id_mode_bike), + ) - def _init_constants(self): - self.get_attrsman().do_not_save_attrs(['_costs', '_fstar', ]) + #route = [edge_from]+route+[edge_to] - def prepare_planning(self): - ptlinks = self.ids_line.get_linktab().ptlinks.get_value() - if len(ptlinks) == 0: - # no links built...built them - ptlinks.build() + #dist = np.sum(edges.lengths[route]) + #dist = dist - pos_from - ( edges.lengths[id_edge_to] - pos_to) - self._costs = ptlinks.get_times() - self._fstar = ptlinks.get_fstar() + if (len(route) > 0): # |(dist > self.dist_ride_min.get_value()): # is there a connection + # create stage + id_stage, time_end = StageTypeMixin.append_stage(self, + id_plan, + time_start, + durations=duration_approx, + times_init=time_init, + ids_ibike=id_veh, + ids_edge_from=id_edge_from, + positions_from=position_edge_from, + ids_edge_to=id_edge_to, + positions_to=position_edge_to, + ids_edges=route, + ) - def append_stage(self, id_plan, time_start=-1.0, - id_line=-1, duration=0.0, - id_fromedge=-1, id_toedge=-1, **kwargs): - """ - Appends a transit stage to plan id_plan. + # print ' route = ',route + # print ' ids_edges = ',self.ids_edges[id_stage] + # add this stage to the vehicle database + # ind_ride gives the index of this ride (within the same plan??) + #ind_ride = self.parent.get_iautos().append_ride(id_veh, id_stage) + return id_stage, time_end - """ - # print 'TransitStages.append_stage',id_stage + else: + # not connected or too short of a distance + return -1, time_start # no stage creation took place - id_stage, time_end = StageTypeMixin.append_stage(self, - id_plan, - time_start, - durations=duration, - ids_line=id_line, - ids_fromedge=id_fromedge, - ids_toedge=id_toedge, - ) + def get_writexmlinfo(self, ids_plan, is_route=True, is_plain=False): + print 'BikerideStages.get_writexmlinfo', len(ids_plan), is_plain + ibikes = self.get_virtualpop().get_ibikes() + bikewritefunc = ibikes.prepare_write_xml(is_plain=is_plain) + ids = self.get_ids_from_ids_plan(ids_plan) - # add this stage to the vehicle database - # ind_ride gives the index of this ride (within the same plan??) - #ind_ride = self.parent.get_iautos().append_ride(id_veh, id_stage) - return id_stage, time_end + bikewritefuncs = np.zeros(len(ids), dtype=np.object) + bikewritefuncs[:] = bikewritefunc + return self.times_init[ids], bikewritefuncs, ids def to_xml(self, id_stage, fd, indent=0): - # - net = self.get_virtualpop().get_net() - #ids_stoplane = net.ptstops.ids_lane - #ids_laneedge = net.lanes.ids_edge - ids_sumoedge = net.edges.ids_sumo + #lanes = self.parent.get_scenario().net.lanes + scenario = self.get_virtualpop().get_scenario() + + edges = scenario.net.edges + edgeindex = edges.ids_sumo + + #parking = scenario.landuse.parking #ind = self.get_ind(id_stage) fd.write(xm.start('ride', indent=indent)) - fd.write(xm.num('from', ids_sumoedge[self.ids_fromedge[id_stage]])) - fd.write(xm.num('to', ids_sumoedge[self.ids_toedge[id_stage]])) - fd.write(xm.num('lines', self.ids_line.get_linktab().linenames[self.ids_line[id_stage]])) - # if self.cols.pos_edge_from[ind]>0: - # fd.write(xm.num('departPos', self.cols.pos_edge_from[ind])) - # if self.cols.pos_edge_to[ind]>0: - # fd.write(xm.num('arrivalPos', self.cols.pos_edge_to[ind])) + + #id_edge_from, pos_from = parking.get_edge_pos_parking(self.ids_parking_from.value[ind]) + #id_edge_to, pos_to = parking.get_edge_pos_parking(self.ids_parking_to.value[ind]) + + # edgeindex.get_index_from_id(self.ids_edge_to.value[ind]) + id_edge_from = self.ids_edge_from[id_stage] + fd.write(xm.num('from', edgeindex[self.ids_edge_from[id_stage]])) + fd.write(xm.num('to', edgeindex[self.ids_edge_to[id_stage]])) + fd.write(xm.num('lines', self.ids_ibike.get_linktab().get_id_line_xml( + self.ids_ibike[id_stage]))) # mode specific fd.write(xm.stopit()) # ends stage -class AutorideStages(StageTypeMixin): +class MotorcyclerideStages(StageTypeMixin): def __init__(self, ident, population, - name='Auto rides', - info='Rides with privately owned auto.', + name='Motorcycle rides', + info='Rides with privately owned motorcycle.', version=1.0, ): @@ -3332,10 +4987,10 @@ # street parking at home and work could be in stage. Private garage is part of person... # print '_init_attributes',self.parent.get_iautos(), self.ident,self.parent.get_landuse().parking - self.add_col(am.IdsArrayConf('ids_iauto', self.get_virtualpop().get_iautos(), + self.add_col(am.IdsArrayConf('ids_imoto', self.get_virtualpop().get_imotos(), groupnames=['state'], - name='ID vehicle', - info='ID of private vehicle.', + name='ID moto', + info='ID of private, individual motorcycle.', )) self.add_col(am.ArrayConf('times_init', -1.0, @@ -3344,48 +4999,62 @@ info='Initialization time, which is the time when the vehicle appears in the scenario. Value -1 means unknown.', )) - self.add_col(am.IdsArrayConf('ids_parking_from', self.get_virtualpop().get_landuse().parking, + edges = self.get_virtualpop().get_net().edges + + self.add_col(am.IdsArrayConf('ids_edge_from', edges, groupnames=['state'], - name='ID dep. parking', - info='Parking ID at the departure of the ride starts.', + name='ID Dep. edge', + info='Edge ID at departure of walk.', )) - self.add_col(am.IdsArrayConf('ids_parking_to', self.get_virtualpop().get_landuse().parking, + self.add_col(am.IdsArrayConf('ids_edge_to', edges, groupnames=['state'], - name='ID arr. parking', - info='Parking ID at the arrival of the ride.', + name='ID Arr. edge', + info='Edge ID where walk finishes.', )) + self.add_col(am.ArrayConf('positions_from', 0.0, + dtype=np.float32, + #choices = OPTIONMAP_POS_DEPARTURE, + perm='r', + name='Depart pos', + unit='m', + info="Position on edge at the moment of departure.", + #xmltag = 'departPos', + #xmlmap = get_inversemap(OPTIONMAP_POS_ARRIVAL), + )) + + self.add_col(am.ArrayConf('positions_to', 0.0, + dtype=np.float32, + #choices = OPTIONMAP_POS_ARRIVAL, + perm='r', + name='Arrival pos', + unit='m', + info="Position on edge at the moment of arrival.", + #xmltag = 'arrivalPos', + #xmlmap = get_inversemap(OPTIONMAP_POS_ARRIVAL), + )) + self.add_col(am.IdlistsArrayConf('ids_edges', self.get_virtualpop().get_net().edges, groupnames=['_private'], name='Route', info="The vehicle's route as a sequence of edge IDs.", )) - self.add(cm.AttrConf('dist_ride_min', 400.0, - dtype='object', - groupnames=['options'], - perm='rw', - name='Min ride dist.', - info='Minimum ride distance. If the distanve between parkings is less, then the person will walk.', - )) - - # if hasattr(self,'parking'): - # self.delete('parking') - - def _init_constants(self): - self.get_attrsman().do_not_save_attrs(['_costs', '_fstar', ]) + def _init_constants_specific(self): + net = self.get_virtualpop().get_net() + self.id_mode_moto = net.modes.get_id_mode('motorcycle') + self.get_attrsman().do_not_save_attrs(['id_mode_moto', ]) def prepare_planning(self): - net = self.get_virtualpop().get_net() - # ??? do this for all vehicles?? - self._costs = net.edges.get_times(id_mode=net.modes.get_id_mode('passenger'), - is_check_lanes=True) - self._fstar = net.edges.get_fstar(is_ignor_connections=False) + pass def append_stage(self, id_plan, time_start=-1.0, id_veh=-1, time_init=-1, - id_parking_from=.1, id_parking_to=-1, **kwargs): + id_edge_from=-1, id_edge_to=-1, + position_edge_from=0.0, position_edge_to=0.0, + is_route=True, route=-1, duration_approx=-1, + **kwargs): """ Appends a ride stage to plan id_plan in case the ride is feasible. The ride is feasible if from parking and to parking are connected. @@ -3395,89 +5064,60 @@ If not feasible -1 and start time will be returned. """ - # print 'Rides.append_stage',id_stage - + # print 'BikeRides.append_stage',id_plan,time_start,time_init + #edges = self.get_virtualpop().get_net().edges # check feasibility - route, dist, duration = self.get_route_between_parking(id_parking_from, id_parking_to) + #route, dist, duration = self.get_route_between_parking(id_parking_from, id_parking_to) + + # print ' id_edge_from, id_edge_to=',id_edge_from, id_edge_to + if is_route: + duration_approx, route = routing.get_mincostroute_edge2edge( + id_edge_from, + id_edge_to, + weights=self.get_times(self.id_mode_moto), + fstar=self.get_fstar(self.id_mode_moto), + ) + + #route = [edge_from]+route+[edge_to] + + #dist = np.sum(edges.lengths[route]) + #dist = dist - pos_from - ( edges.lengths[id_edge_to] - pos_to) if (len(route) > 0): # |(dist > self.dist_ride_min.get_value()): # is there a connection # create stage id_stage, time_end = StageTypeMixin.append_stage(self, id_plan, time_start, - durations=duration, + durations=duration_approx, times_init=time_init, - ids_iauto=id_veh, - ids_parking_from=id_parking_from, - ids_parking_to=id_parking_to, + ids_imoto=id_veh, + ids_edge_from=id_edge_from, + positions_from=position_edge_from, + ids_edge_to=id_edge_to, + positions_to=position_edge_to, ids_edges=route, ) + # print ' route = ',route + # print ' ids_edges = ',self.ids_edges[id_stage] # add this stage to the vehicle database # ind_ride gives the index of this ride (within the same plan??) #ind_ride = self.parent.get_iautos().append_ride(id_veh, id_stage) return id_stage, time_end - else: - # not connected or too short of a distance - return -1, time_start # no stage creation took place - - def get_route_between_parking(self, id_parking_from, id_parking_to): - """ - Return route and distance of ride with vehicle type vtype - between id_parking_from and id_parking_to - - """ - # print 'get_route_between_parking',id_parking_from, id_parking_to - scenario = self.get_virtualpop().get_scenario() - edges = scenario.net.edges - lanes = scenario.net.lanes - - # print self.get_demand().getVehicles().cols.maxSpeed - #v_max = self.get_demand().getVehicles().maxSpeed.get(vtype) - parking = scenario.landuse.parking - - ids_lanes = parking.ids_lane[[id_parking_from, id_parking_to]] - id_edge_from, id_edge_to = lanes.ids_edge[ids_lanes] - pos_from, pos_to = parking.positions[[id_parking_from, id_parking_to]] - - # print ' id_edge_from, id_edge_to=',id_edge_from, id_edge_to - duration_approx, route = routing.get_mincostroute_edge2edge( - id_edge_from, - id_edge_to, - weights=self._costs, # mode-specific!! - fstar=self._fstar # mode-specific!! - ) - - # here is a big problem: starting with the successive node of edge_from - # may result that the first edge of the route is not connected with edge_from - # And arriving at the preceding node of edge_to may result that from - # the last edge in route the edge_to is not connected. - - #route = [edge_from]+route+[edge_to] - dist = np.sum(edges.lengths[route]) - dist = dist - pos_from - (edges.lengths[id_edge_to] - pos_to) - # if 0: - # if len(route)>0: - # print ' dist,duration',dist,duration_approx - # else: - # print ' no route found' - - return route, dist, duration_approx - - # def make_id_veh_ride(self, id_stage, i_ride): - # # make a unique vehicle ID for this stage - # self.inds_ride[id_stage] = i_ride - # return str(self.ids_veh[id_stage])+'.'+str(i_ride) - - def get_writexmlinfo(self, ids_plan, is_route=True): - print 'AutorideStages.get_writexmlinfo', len(ids_plan) - iautos = self.get_virtualpop().get_iautos() - writefunc = iautos.prepare_write_xml() + else: + # not connected or too short of a distance + return -1, time_start # no stage creation took place + + def get_writexmlinfo(self, ids_plan, is_route=True, is_plain=False): + print 'MotorcyclerideStages.get_writexmlinfo', len(ids_plan), is_plain + imotos = self.get_virtualpop().get_imotos() + motowritefunc = imotos.prepare_write_xml(is_plain=is_plain) ids = self.get_ids_from_ids_plan(ids_plan) - writefuncs = np.zeros(len(ids), dtype=np.object) - writefuncs[:] = writefunc - return self.times_init[ids], writefuncs, ids + + motowritefuncs = np.zeros(len(ids), dtype=np.object) + motowritefuncs[:] = motowritefunc + return self.times_init[ids], motowritefuncs, ids def to_xml(self, id_stage, fd, indent=0): #lanes = self.parent.get_scenario().net.lanes @@ -3485,52 +5125,30 @@ edges = scenario.net.edges edgeindex = edges.ids_sumo - parking = scenario.landuse.parking - ind = self.get_ind(id_stage) + #parking = scenario.landuse.parking + + #ind = self.get_ind(id_stage) fd.write(xm.start('ride', indent=indent)) - id_edge_from, pos_from = parking.get_edge_pos_parking(self.ids_parking_from.value[ind]) - id_edge_to, pos_to = parking.get_edge_pos_parking(self.ids_parking_to.value[ind]) + #id_edge_from, pos_from = parking.get_edge_pos_parking(self.ids_parking_from.value[ind]) + #id_edge_to, pos_to = parking.get_edge_pos_parking(self.ids_parking_to.value[ind]) # edgeindex.get_index_from_id(self.ids_edge_to.value[ind]) - fd.write(xm.num('from', edgeindex[id_edge_from])) - fd.write(xm.num('to', edgeindex[id_edge_to])) - fd.write(xm.num('lines', self.ids_iauto.get_linktab().get_id_line_xml( - self.ids_iauto[id_stage]))) # mode specific - - # if 0: - # #pos = pos_from - # length = max(edges.lengths[id_edge_from]-4.0,0.0) - # - # if (pos_from>0) & (pos_from < length ): - # fd.write(xm.num('departPos', pos)) - # - # elif pos_from < 0: - # fd.write(xm.num('departPos', 0.0)) - # - # else: - # fd.write(xm.num('departPos', length)) - # - # #pos = self.positions_to.value[ind] - # length = max(edges.lengths[id_edge_to]-4.0, 0.0) - # if (pos_to>0) & (pos_to < length ): - # fd.write(xm.num('arrivalPos', pos_to)) - # - # elif pos_to < 0: - # fd.write(xm.num('arrivalPos', 0.0)) - # - # else: - # fd.write(xm.num('arrivalPos', length)) + id_edge_from = self.ids_edge_from[id_stage] + fd.write(xm.num('from', edgeindex[self.ids_edge_from[id_stage]])) + fd.write(xm.num('to', edgeindex[self.ids_edge_to[id_stage]])) + fd.write(xm.num('lines', self.ids_imoto.get_linktab().get_id_line_xml( + self.ids_imoto[id_stage]))) # mode specific fd.write(xm.stopit()) # ends stage -class BikerideStages(StageTypeMixin): +class TaxirideStages(StageTypeMixin): def __init__(self, ident, population, - name='Bike rides', - info='Rides with privately owned bike.', + name='Taxi rides', + info='Rides with Taxi.', version=1.0, ): @@ -3539,15 +5157,6 @@ self._init_attributes() def _init_attributes(self): - # TODO: this structure needs review: the private vehicle is part of a person, not a stage - # street parking at home and work could be in stage. Private garage is part of person... - # print '_init_attributes',self.parent.get_iautos(), self.ident,self.parent.get_landuse().parking - - self.add_col(am.IdsArrayConf('ids_ibike', self.get_virtualpop().get_ibikes(), - groupnames=['state'], - name='ID bike', - info='ID of private, individual bike.', - )) self.add_col(am.ArrayConf('times_init', -1.0, name='Init. time', @@ -3591,59 +5200,40 @@ #xmlmap = get_inversemap(OPTIONMAP_POS_ARRIVAL), )) - self.add_col(am.IdlistsArrayConf('ids_edges', self.get_virtualpop().get_net().edges, - groupnames=['_private'], - name='Route', - info="The vehicle's route as a sequence of edge IDs.", - )) - - def _init_constants(self): - self.get_attrsman().do_not_save_attrs(['_costs', '_fstar', ]) - - def prepare_planning(self): + def _init_constants_specific(self): net = self.get_virtualpop().get_net() + self.id_mode_taxi = net.modes.get_id_mode('taxi') + self.get_attrsman().do_not_save_attrs(['id_mode_taxi', ]) - print 'prepare_planning' - self._costs = net.edges.get_times(id_mode=net.modes.get_id_mode('bicycle'), - is_check_lanes=True) - - ids_edge = net.edges.get_ids() - for id_edge, cost in zip(ids_edge, self._costs[ids_edge]): - print ' id_edge', id_edge, 'sumo', net.edges.ids_sumo[id_edge], cost - - self._fstar = net.edges.get_fstar(is_ignor_connections=False) + def prepare_planning(self): + pass - def append_stage(self, id_plan, time_start=-1.0, id_veh=-1, + def append_stage(self, id_plan, time_start=-1.0, time_init=-1, id_edge_from=-1, id_edge_to=-1, position_edge_from=0.0, position_edge_to=0.0, + duration_approx=-1, + is_route=True, + route=[], **kwargs): """ Appends a ride stage to plan id_plan in case the ride is feasible. - The ride is feasible if from parking and to parking are connected. + If feasible, the stage ID and estimated time when stage is finished will be returned. If not feasible -1 and start time will be returned. """ - # print 'BikeRides.append_stage',id_plan,time_start,time_init - #edges = self.get_virtualpop().get_net().edges - # check feasibility - #route, dist, duration = self.get_route_between_parking(id_parking_from, id_parking_to) # print ' id_edge_from, id_edge_to=',id_edge_from, id_edge_to - duration_approx, route = routing.get_mincostroute_edge2edge( - id_edge_from, - id_edge_to, - weights=self._costs, # mode-specific!! - fstar=self._fstar # mode-specific!! - ) - - #route = [edge_from]+route+[edge_to] - - #dist = np.sum(edges.lengths[route]) - #dist = dist - pos_from - ( edges.lengths[id_edge_to] - pos_to) + if is_route: + duration_approx, route = routing.get_mincostroute_edge2edge( + id_edge_from, + id_edge_to, + weights=self.get_times(self.id_mode_taxi), + fstar=self.get_fstar(self.id_mode_taxi), + ) if (len(route) > 0): # |(dist > self.dist_ride_min.get_value()): # is there a connection # create stage @@ -3652,12 +5242,10 @@ time_start, durations=duration_approx, times_init=time_init, - ids_ibike=id_veh, ids_edge_from=id_edge_from, positions_from=position_edge_from, ids_edge_to=id_edge_to, positions_to=position_edge_to, - ids_edges=route, ) # print ' route = ',route @@ -3671,61 +5259,18 @@ # not connected or too short of a distance return -1, time_start # no stage creation took place - def get_writexmlinfo(self, ids_plan, is_route=True): - print 'BikerideStages.get_writexmlinfo', len(ids_plan) - ibikes = self.get_virtualpop().get_ibikes() - bikewritefunc = ibikes.prepare_write_xml() - ids = self.get_ids_from_ids_plan(ids_plan) - - bikewritefuncs = np.zeros(len(ids), dtype=np.object) - bikewritefuncs[:] = bikewritefunc - return self.times_init[ids], bikewritefuncs, ids - def to_xml(self, id_stage, fd, indent=0): - #lanes = self.parent.get_scenario().net.lanes scenario = self.get_virtualpop().get_scenario() edges = scenario.net.edges edgeindex = edges.ids_sumo - #parking = scenario.landuse.parking - - #ind = self.get_ind(id_stage) fd.write(xm.start('ride', indent=indent)) - #id_edge_from, pos_from = parking.get_edge_pos_parking(self.ids_parking_from.value[ind]) - #id_edge_to, pos_to = parking.get_edge_pos_parking(self.ids_parking_to.value[ind]) - - # edgeindex.get_index_from_id(self.ids_edge_to.value[ind]) id_edge_from = self.ids_edge_from[id_stage] fd.write(xm.num('from', edgeindex[self.ids_edge_from[id_stage]])) fd.write(xm.num('to', edgeindex[self.ids_edge_to[id_stage]])) - fd.write(xm.num('lines', self.ids_ibike.get_linktab().get_id_line_xml( - self.ids_ibike[id_stage]))) # mode specific - - # if 0: - # #pos = pos_from - # length = max(edges.lengths[id_edge_from]-4.0,0.0) - # - # if (pos_from>0) & (pos_from < length ): - # fd.write(xm.num('departPos', pos)) - # - # elif pos_from < 0: - # fd.write(xm.num('departPos', 0.0)) - # - # else: - # fd.write(xm.num('departPos', length)) - # - # #pos = self.positions_to.value[ind] - # length = max(edges.lengths[id_edge_to]-4.0, 0.0) - # if (pos_to>0) & (pos_to < length ): - # fd.write(xm.num('arrivalPos', pos_to)) - # - # elif pos_to < 0: - # fd.write(xm.num('arrivalPos', 0.0)) - # - # else: - # fd.write(xm.num('arrivalPos', length)) + fd.write(xm.num('lines', 'taxi')) # mode specific fd.write(xm.stopit()) # ends stage @@ -3797,7 +5342,7 @@ return id_stage, time_end - def modify_stage(self, id_stage, time_start, + def modify_stage(self, id_stage, time_start=None, id_edge_from=-1, id_edge_to=-1, position_edge_from=0.1, position_edge_to=0.0): @@ -3963,11 +5508,18 @@ self.positions[ids_stage] def _init_constants(self): - #self._activities = self.get_virtualpop().get_activities() - #self._activitytypes = self.get_virtualpop().get_demand().activitytypes - # self.do_not_save_attrs(['_activities','_activitytypes']) + #self._activities = self.get_virtualpop().get_activities() + #self._activitytypes = self.get_virtualpop().get_demand().activitytypes + # self.do_not_save_attrs(['_activities','_activitytypes']) pass + # def del_row(self, id_stage): + # # actually this should no happen, activities should not be + # # copied for each plan + # print 'ActivityStages.del_row id_stage',id_stage,'id_activity',self.ids_activity[id_stage] + # self.get_virtualpop().get_activities().del_row(self.ids_activity[id_stage]) + # am.ArrayObjman.del_row(self, id_stage) + def to_xml(self, id_stage, fd, indent=0): # @@ -4032,7 +5584,9 @@ self.add_stagetable('walks', WalkStages) self.add_stagetable('autorides', AutorideStages) self.add_stagetable('bikerides', BikerideStages) + self.add_stagetable('motorides', MotorcyclerideStages) self.add_stagetable('transits', TransitStages) + self.add_stagetable('taxirides', TaxirideStages) self.add_stagetable('activities', ActivityStages) self.add_col(am.IdsArrayConf('ids_person', persons, @@ -4220,7 +5774,7 @@ dtype=np.object, groupnames=['socioeconomic'], name='Name', - info='Identification or name of person.', + info='Identification or name of person. Does not need to be unique.', )) self.add_col(am.ArrayConf('ids_gender', default=-1, @@ -4318,7 +5872,7 @@ info='ID of individual motorcycle. Negative value means no motorcycle available.', )) - self.add_col(am.ArrayConf('dists_walk_max', default=300.0, + self.add_col(am.ArrayConf('dists_walk_max', default=400.0, dtype=np.float32, groupnames=['mobility'], name='Max. walk dist', @@ -4355,7 +5909,7 @@ # self.clear() self.clear_plans() self.clear_ivehicles() - + self.get_activities().clear_rows() # TODO: this should disappear self.get_landuse().parking.clear_booking() @@ -4363,6 +5917,43 @@ # attrconfig.clear() self.clear_rows() + def del_persons(self, ids_pers_delete): + print 'delete', len(ids_pers_delete), 'persons' + ids_plans_all = set() + ids_activity_del = set() + lists_ids_plan = self.lists_ids_plan[ids_pers_delete] + for id_pers, ids_plan in zip(ids_pers_delete, self.lists_ids_plan[ids_pers_delete]): + ids_plans_all.update(ids_plan) + for stageinfo in self.get_plans().stagelists[ids_plan]: + for stages, id_stage in stageinfo: + # print ' id_pers ',id_pers,'del',stages,'id_stage',id_stage,stages.__class__,id_stage,stages.__class__== ActivityStages + + # if stages.__class__ == ActivityStages: + # print ' ids_activity',stages.ids_activity[id_stage] + # ids_activity_del.add(stages.ids_activity[id_stage]) + + stages.del_row(id_stage) + # print ' check',id_stage in stages + + ids_plans_delete_all = list(ids_plans_all) + # print 'len(plans)', len(plans),'delete ',len(ids_plans_delete_all) + self.get_plans().del_rows(ids_plans_delete_all) + # print ' ',len(self.get_activities()),'activities' + #ids_activity_del = [] + for ids_activity in self.activitypatterns[ids_pers_delete]: + ids_activity_del.update(ids_activity) + + ids_activity_del = list(ids_activity_del) + # print ' del',len(ids_activity_del),'of',len(self.get_activities()),'activities' + self.get_activities().del_rows(ids_activity_del) + + self.get_iautos().del_rows(self.ids_iauto[ids_pers_delete]) + self.get_ibikes().del_rows(self.ids_ibike[ids_pers_delete]) + self.get_imotos().del_rows(self.ids_imoto[ids_pers_delete]) + + # print 'len(virtualpop)', len(virtualpop),'delete ',len(ids_pers_delete) + self.del_rows(ids_pers_delete) + def clear_plans(self): # print 'clear_plans',self.get_stagetables() self.ids_plan.reset() @@ -4478,7 +6069,8 @@ return self.add_rows(n=n, **kwargs) def disaggregate_odflow(self, time_start, time_end, id_mode, - ids_fac, probs_fac_orig, probs_fac_dest, + ids_fac, + probs_fac_orig, probs_fac_dest, tripnumber_tot, id_activitytype_orig, id_activitytype_dest, @@ -4493,6 +6085,7 @@ scale=1.0, hour_offset=8.0, # 08:00 hour_tripbudget=25.0/60, # 25min + dist_walk_max=400, # scalar! **kwargs ): """ @@ -4507,10 +6100,10 @@ tripnumber = int(scale*tripnumber_tot) print 'disaggregate_odflow', time_start, time_end, id_mode, tripnumber - print ' id_activitytype_orig,id_activitytype_dest', id_activitytype_orig, id_activitytype_dest + print ' id_activitytype_orig,id_activitytype_dest', id_activitytype_orig, id_activitytype_dest - # print ' probs_orig',sum(probs_fac_orig),'\n',probs_fac_orig - # print ' probs_dest',sum(probs_fac_dest),'\n',probs_fac_dest + # print ' probs_orig',sum(probs_fac_orig)#,'\n',probs_fac_orig + # print ' probs_dest',sum(probs_fac_dest)#,'\n',probs_fac_dest # is there a chance to find facilities to locate persons in # origin and destination zone @@ -4528,6 +6121,7 @@ #times_start = np.random.randint(time_start,time_end,tripnumber) ids_person = self.make_multiple(tripnumber, ids_mode_preferred=id_mode * np.ones(tripnumber, dtype=np.int32), + dists_walk_max=dist_walk_max * np.ones(tripnumber, dtype=np.int32), #times_start = times_start, ) @@ -4622,26 +6216,33 @@ activitytypes = demand.activitytypes log = kwargs.get('logger', self.get_logger()) + # self._make_map_id_act_to_ids_facattrconf() + ids_flow = odflowtab.get_ids() + n_flows = len(ids_flow) + + ids_activitytype_orig = odflowtab.ids_activitytype_orig[ids_flow] + ids_activitytype_dest = odflowtab.ids_activitytype_dest[ids_flow] + if is_use_landusetypes: # TODO: not tested and works only for one landusetype per activity #activitytypes = self.activitytypes.get_value() #id_landusetype_orig = activitytypes.ids_landusetypes[kwargs['id_activitytype_orig']][0] #id_landusetype_dest = activitytypes.ids_landusetypes[kwargs['id_activitytype_dest']][0] - pass + # TODO: get activitypes from activity #probs_fac, ids_fac = self.get_landuse().facilities.get_departure_probabilities_landuse() - + probs_activitytype_fac_area = {} + ids_acttype = activitytypes.get_ids() + for id_acttype, ids_landusetype in zip(ids_acttype, activitytypes.ids_landusetypes[ids_acttype]): + # print 50*'-' + # print ' id_acttype',id_acttype,'ids_landusetype',ids_landusetype + probs_activitytype, ids_fac = landuse.facilities.get_departure_probabilities_landuse2(ids_landusetype) + probs_activitytype_fac_area[id_acttype] = probs_activitytype + # print ' probs_activitytype_fac_area',probs_activitytype_fac_area[id_acttype] else: probs_fac_area, ids_fac = landuse.facilities.get_departure_probabilities() - # self._make_map_id_act_to_ids_facattrconf() - ids_flow = odflowtab.get_ids() - n_flows = len(ids_flow) - - ids_activitytype_orig = odflowtab.ids_activitytype_orig[ids_flow] - ids_activitytype_dest = odflowtab.ids_activitytype_dest[ids_flow] - i = 0.0 for id_flow,\ id_orig,\ @@ -4680,6 +6281,7 @@ ): log.progress(i/n_flows*100) + # print ' disagg between zones',id_orig,id_dest i += 1 if is_use_landusetypes: # TODO: not tested and works only for one landusetype per activity @@ -4688,7 +6290,9 @@ # idea: add the probabilities for landuse types of origin and dest #probs_fac_orig = probs_fac[id_orig][id_landusetype_orig] #probs_fac_dest = probs_fac[id_dest][id_landusetype_dest] - pass + probs_fac_orig = probs_activitytype_fac_area[id_activitytype_orig][id_orig] + probs_fac_dest = probs_activitytype_fac_area[id_activitytype_dest][id_dest] + else: probs_fac_orig = probs_fac_area[id_orig] probs_fac_dest = probs_fac_area[id_dest] @@ -4739,15 +6343,29 @@ self.lists_ids_plan[id_person].append(id_plan) return ids_plan - def plan_with_strategy(self, id_strategy, evalcrit=0, logger=None): + def plan_with_strategy(self, id_strategy, evalcrit=0, is_plan_no_preferred=False, is_substitute=False, logger=None): strategy = self.get_strategies().strategies[id_strategy] + plans = self.get_plans() + ids_person = self.get_ids() + evals = strategy.preevaluate(ids_person) - # TODO: check whether at least two activities are in - # activitypattern...could be done centrally - ids_person_preeval = ids_person[evals >= evalcrit] + if is_plan_no_preferred: # considering only people with vehicle but with another preferred mode + inds_preeval = (evals == 0) | (evals == 1) + else: + inds_preeval = evals >= evalcrit + + # if is_substitute: + # for i, id_strat_pers in zip(xrange(len(inds_preeval)), self.plans.ids_strategy[ids_person[inds_preeval]]): + # if id_strat_pers + + ids_person_preeval = ids_person[inds_preeval] print 'plan_with_strategy', strategy.ident, 'n_pers', len(ids_person_preeval) + + # TODO: is_substitute = is_substitute could be an argument to plan() + # and then passed to the centralized add_plan() method of the VP. + strategy.plan(ids_person_preeval, logger=logger) # def get_times(self, ind, ids_person = None, pdf = 'unit'): @@ -4833,21 +6451,22 @@ plans = self.get_plans() self.ids_plan.reset() for id_pers, ids_plan in zip(ids_pers, self.lists_ids_plan[ids_pers]): - if len(ids_plan) > 0: - # print ' id_pers,ids_plan',id_pers,ids_plan - # print ' ids_strat, preeval',plans.ids_strategy[ids_plan],preevals[id_pers,plans.ids_strategy[ids_plan]] - inds_sel = preevals[id_pers, plans.ids_strategy[ids_plan]] == preferred - # print ' inds_sel',inds_sel,np.flatnonzero(inds_sel),inds_sel.dtype - if len(inds_sel) > 0: - #ids_plan_sel = np.array(ids_plan)[inds_sel] - # print ' ids_plan_sel',ids_plan_sel - # at least one plan contains preferred mode - self.ids_plan[id_pers] = np.array(ids_plan)[inds_sel][0] # whu [1]? - # else: - # assumption: a plan for the preferred mode always exists - # # no preferred mode found try to satisfy best possible - # #ids_plan[preevals[id_pers,plans.ids_strategy[ids_plan]] == preferred] - # self.ids_plan[id_pers] = -1 + if ids_plan is not None: + if len(ids_plan) > 0: + print ' id_pers,ids_plan', id_pers, ids_plan + print ' ids_strat, preeval', plans.ids_strategy[ids_plan], preevals[id_pers, plans.ids_strategy[ids_plan]] + inds_sel = np.flatnonzero(preevals[id_pers, plans.ids_strategy[ids_plan]] == preferred) + print ' inds_sel', inds_sel, inds_sel.dtype + if len(inds_sel) > 0: + #ids_plan_sel = np.array(ids_plan)[inds_sel] + # print ' ids_plan_sel',ids_plan_sel + # at least one plan contains preferred mode + self.ids_plan[id_pers] = np.array(ids_plan)[inds_sel][0] # whu [1]? + # else: + # assumption: a plan for the preferred mode always exists + # # no preferred mode found try to satisfy best possible + # #ids_plan[preevals[id_pers,plans.ids_strategy[ids_plan]] == preferred] + # self.ids_plan[id_pers] = -1 return True def select_plans_min_time_est(self, fraction=1.0, timedev=-1.0, c_probit=-1.0, **kwargs): @@ -5014,6 +6633,67 @@ # print ' finally: ids_plan=',self.ids_plan.get_value() return True + def select_plans_utility_function(self, fraction=0.1, timedev=-1, c_probit=-1, **kwargs): + """ + Select plan with utility function, which is based on the minimum executed travel time selection method + but considering also a constant (different for each plan strategy) and a multiplicative parameter (the + same for every strategy). + """ + strategies = self.get_strategies() + value_of_time = strategies.value_of_time.get_value() + + plans = self.get_plans() + ids_pers_all = self.get_ids() + + print 'select_plans_utility_function', len(ids_pers_all) + + ids_pers = ids_pers_all[np.random.random(len(ids_pers_all)) > (1.0-fraction)] + times_exec = self.get_plans().times_exec + times_est = self.get_plans().times_est + ids_plans_all = self.lists_ids_plan[ids_pers] + + for id_pers, ids_plan_all in zip(ids_pers, ids_plans_all): + + # print ' ids_plan_all',ids_plan_all,type(ids_plan_all) + n_plan = len(ids_plan) + + # if cycle necessary to apply a casual variation on plans executive times (in addition or in reduction) + if n_plan > 0: + traveltimes = np.zeros(n_plan, dtype=np.float32) + traveltimes_noise = np.zeros(n_plan, dtype=np.float32) + + inds_exec = times_exec[ids_plan_all] > 0. + inds_est = times_exec[ids_plan_all] <= 0. + + traveltimes[inds_exec] = times_exec[ids_plan_all[inds_exec]] + traveltimes[inds_est] = times_est[ids_plan_all[inds_est]] + + if timedev > 0: + # noise is normal distributed with deviation timedev + traveltimes_noise = np.random.normal(0.0, timedev, n_plan) + + elif c_probit > 0: + # noise is normal distributed with deviation c_probit *traveltimes + traveltimes_noise = np.random.normal(0.0, c_probit * traveltimes, n_plan) + + else: + # no travel time noise + traveltimes_noise = np.zeros(n_plan, dtype=np.float32) + + for id_plan, strategy, traveltime, timetime_noise in zip(ids_plan_all, + strategies.strategies[plans.ids_strategy[ids_plan_all]], + traveltimes, + traveltimes_noise): + + utility = strategy.get_utility_specific(id_plan) - value_of_time * (traveltime + timetime_noise) + + plans.utilities[id_plan] = utility + + # set current plan of person to the one with the maximum utility + self.ids_plan[id_pers] = ids_plan_all[np.argmax(plans.utilities[ids_plan_all])] + + return True + def prepare_sim(self, process): return [] # [(steptime1,func1),(steptime2,func2),...] @@ -5021,7 +6701,7 @@ # returns trip object, method common to all demand objects return self.get_iautos() - def get_writexmlinfo(self, is_route=False): + def get_writexmlinfo(self, is_route=False, is_plain=False, **kwargs): """ Returns three array where the first array is the begin time of the first vehicle and the second array is the @@ -5030,7 +6710,7 @@ Method used to sort trips when exporting to route or trip xml file """ - print 'Virtualpop.get_writexmlinfo' + print 'Virtualpop.get_writexmlinfo is_plain', is_plain plans = self.get_plans() ids_pers = self.select_ids(self.ids_plan.get_value() >= 0) @@ -5039,9 +6719,11 @@ # get vehicle trip info times_depart_bike, writefuncs_bike, ids_rides_bike = plans.get_stagetable( - 'bikerides').get_writexmlinfo(ids_plans, is_route) + 'bikerides').get_writexmlinfo(ids_plans, is_route, is_plain) times_depart_auto, writefuncs_auto, ids_rides_auto = plans.get_stagetable( - 'autorides').get_writexmlinfo(ids_plans, is_route) + 'autorides').get_writexmlinfo(ids_plans, is_route, is_plain) + times_depart_moto, writefuncs_moto, ids_rides_moto = plans.get_stagetable( + 'motorides').get_writexmlinfo(ids_plans, is_route, is_plain) #self.add_stagetable('walks', WalkStages) #self.add_stagetable('autorides', AutorideStages) @@ -5051,30 +6733,49 @@ #rides = plans.get_stagetable('autorides') - # do persons + if not is_plain: + # do persons - times_depart_pers = plans.times_begin[ids_plans] - writefuncs_pers = np.zeros(n_pers, dtype=np.object) - writefuncs_pers[:] = self.write_person_xml - - # assemble vectors - print ' times_depart_pers.shape', times_depart_pers.shape - print ' times_depart_bike.shape', times_depart_bike.shape - print ' times_depart_auto.shape', times_depart_auto.shape - times_depart = np.concatenate((times_depart_pers, - times_depart_auto, - times_depart_bike, - )) - - writefuncs = np.concatenate((writefuncs_pers, - writefuncs_auto, - writefuncs_bike, - )) + times_depart_pers = plans.times_begin[ids_plans] + writefuncs_pers = np.zeros(n_pers, dtype=np.object) + writefuncs_pers[:] = self.write_person_xml + + # assemble vectors + print ' times_depart_pers.shape', times_depart_pers.shape + print ' times_depart_bike.shape', times_depart_bike.shape + print ' times_depart_auto.shape', times_depart_auto.shape + times_depart = np.concatenate((times_depart_pers, + times_depart_auto, + times_depart_bike, + times_depart_moto, + )) + + writefuncs = np.concatenate((writefuncs_pers, + writefuncs_auto, + writefuncs_bike, + writefuncs_moto, + )) + + ids = np.concatenate((ids_pers, + ids_rides_auto, + ids_rides_bike, + ids_rides_moto, + )) + else: + times_depart = np.concatenate((times_depart_auto, + times_depart_bike, + times_depart_moto, + )) + + writefuncs = np.concatenate((writefuncs_auto, + writefuncs_bike, + writefuncs_moto, + )) - ids = np.concatenate((ids_pers, - ids_rides_auto, - ids_rides_bike, - )) + ids = np.concatenate((ids_rides_auto, + ids_rides_bike, + ids_rides_moto, + )) return times_depart, writefuncs, ids @@ -5119,14 +6820,21 @@ self.get_iautos(), self.get_net().edges, name='Auto trip results', - info='Table with trip results mad with individual autos. The results refer to all trips made by a specific vehicle during the entire simulation period.', + info='Table with trip results made by individual autos. The results refer to all trips made by a specific vehicle during the entire simulation period.', ), groupnames=['Trip results']) results.add_resultobj(res.Vehicleresults('ibiketripresults', results, self.get_ibikes(), self.get_net().edges, name='Bike trip results', - info='Table with trip results mad with individual bikes. The results refer to all trips made by a specific vehicle during the entire simulation period.', + info='Table with trip results made by individual bikes. The results refer to all trips made by a specific vehicle during the entire simulation period.', + ), groupnames=['Trip results']) + + results.add_resultobj(res.Vehicleresults('imototripresults', results, + self.get_imotos(), + self.get_net().edges, + name='Motorcycle trip results', + info='Table with trip results made by individual motorcycles. The results refer to all trips made by a specific vehicle during the entire simulation period.', ), groupnames=['Trip results']) # def process_results(self, results, process = None): @@ -5149,6 +6857,216 @@ # change mobility plan based on updated travel times pass + def import_routes_xml(self, filepath, is_clear_trips=False, + ids_strategy=None, + is_generate_ids=True, is_add=False, + is_overwrite_only=True): + """Reads route information of vehicles, and overwrites existing routes in stages. + Used for example read results from Duaiterate process. + """ + print 'Virtualop.import_routes_xml from %s' % (filepath) + if is_clear_trips: + self.clear_trips() + + counter = RouteCounter() + parse(filepath, counter) + reader = RouteReaderVp(self, counter) + if 1: # try: + parse(filepath, reader) + print ' call make_routes', is_generate_ids, 'is_add', is_add + reader.insert_routes(ids_strategy=ids_strategy) + + else: # except KeyError: + print >> sys.stderr, "Error: Problems with reading routes!" + raise + + +class DuarouterVp(routing.RouterMixin): + def __init__(self, ident='vpduarouter', virtualpop=None, + netfilepath=None, + routefilepaths=None, + outfilepath=None, + is_export_net=True, + is_export_trips=True, + logger=None, + **kwargs): + print 'DuarouterVp.__init__ ' + + self._init_common(ident, name='Virtual Population DUA router', + parent=virtualpop, + logger=logger, + info='DUA router for virtual population.', + ) + cml = 'duarouter' + self.init_cml(cml) # pass main shell command + + scenario = virtualpop.get_scenario() + demand = virtualpop.parent + net = scenario.net + attrsman = self.get_attrsman() + + if routefilepaths is None: + routefilepaths = demand.get_routefilepath() + + print ' default routefilepaths', routefilepaths + self.add_option('routefilepaths', routefilepaths, + groupnames=['files'], + cml='--route-files', + perm='rw', + name='Route file(s)', + wildcards='Route XML files (*.rou.xml)|*.rou.xml', + metatype='filepaths', + info='SUMO route files in XML format.', + ) + + self.is_virtualpop_only = attrsman.add(cm.AttrConf('is_virtualpop_only', kwargs.get('is_virtualpop_only', False), + groupnames=['options'], + name='Consider only virtualpop demand', + info="""Consider only virtualpop demand.""", + )) + + #strategychoices = {} + strategies = virtualpop.get_strategies() + #ids_strat = strategies.get_ids() + # for id_strat, name_strat in zip(ids_strat, strategies.names[ids_strat]): + # strategychoices[name_strat] = id_strat + strategychoices = strategies.names.get_indexmap() + self.ids_strategy = attrsman.add(cm.ListConf('ids_strategy', kwargs.get('ids_strategy', strategychoices.values()), + choices=strategychoices, + groupnames=['options'], + name='Rerouted strategies', + info="""Strategies to be rerouted. Note that the entire demand will be used for routing, but only the selected routes will be reimported in the virtual population.""", + )) + + self.is_export_net = is_export_net + + if netfilepath is None: + netfilepath = net.get_filepath() + + self.add_option('netfilepath', netfilepath, + groupnames=['_private'], + cml='--net-file', + perm='r', + name='Net file', + wildcards='Net XML files (*.net.xml)|*.net.xml', + metatype='filepath', + info='SUMO Net file in XML format.', + ) + + if outfilepath is None: + outfilepath = scenario.get_rootfilepath()+'.dua.rou.xml' + + self.add_option('outfilepath', outfilepath, + groupnames=['_private'], + cml='--output-file', + perm='r', + name='Output routefile', + wildcards='Route XML files (*.rou.xml)|*.rou.xml', + metatype='filepath', + info='Output file of the routing process, which is a SUMO route file in XML format.', + ) + + self.init_options_time(**kwargs) + self.init_options_methods(**kwargs) + self.init_options_processing_common(**kwargs) + self.init_options_processing_dua(**kwargs) + routing.init_random(self, **kwargs) + + def do(self): + virtualpop = self.parent + scenario = virtualpop.get_scenario() + demand = virtualpop.parent + net = scenario.net + + if self.is_export_net: + net.export_netxml(self.netfilepath) + + if self.is_virtualpop_only: + demandobjects = [virtualpop] + else: + demandobjects = None # means entire demand is exported by default + + demand.export_routes_xml(filepath=self.routefilepaths, + encoding='UTF-8', + demandobjects=demandobjects, + is_route=False, # allow True if route export is implemened in virtual population self.is_skip_first_routing,# produce routes only if first dua routing is skipped + vtypeattrs_excluded=['times_boarding', 'times_loading'], # bug of duaiterate!! + is_plain=True, # this will prevent exporting stops and plans which causes routing errors with stops + ) + + self.update_params() + cml = self.get_cml() + + self.run_cml(cml) + if self.status == 'success': + print ' DUA routing done.' + if os.path.isfile(self.outfilepath): + print ' outfile exists, start importing routes' + virtualpop.import_routes_xml(self.outfilepath, ids_strategy=self.ids_strategy) + + return True + else: + return False + return False + + +class RouteReaderVp(RouteReader): + def insert_routes(self, ids_strategy=None): + + virtualpop = self._trips # parent is called trips here need to be changed + print 'RouteReaderVp.insert_routes found %d routes.' % (len(self.ids_sumo)) + plans = virtualpop.get_plans() + strategies = virtualpop.get_strategies() + id_strat_auto = strategies.names.get_id_from_index('auto') + id_strat_bike = strategies.names.get_id_from_index('bike') + id_strat_motorcycle = strategies.names.get_id_from_index('motorcycle') + n_change_route = 0 + if (ids_strategy is None): + ids_strategy = [id_strat_auto, id_strat_bike, id_strat_motorcycle] + + if id_strat_auto in ids_strategy: + iautos = virtualpop.get_iautos() + stages = iautos.get_stagetable() + for id_sumo, ids_edge in zip(self.ids_sumo, self.routes): + id_veh, id_stage = iautos.get_info_from_id_sumo(id_sumo) + if (id_veh > -1) & (id_stage > 1): + # print ' iauto: id_sumo %s id_veh %d id_stage %d'%(id_sumo,id_veh,id_stage) + # print ' before:',stages.ids_edges[id_stage] + if stages.ids_edges[id_stage] != ids_edge: + n_change_route += 1 + print ' route change of id_veh', id_veh, 'id_stage', id_stage + stages.ids_edges[id_stage] = ids_edge + # print ' after :',stages.ids_edges[id_stage] + + if id_strat_bike in ids_strategy: + ibikes = virtualpop.get_ibikes() + stages = ibikes.get_stagetable() + for id_sumo, ids_edge in zip(self.ids_sumo, self.routes): + id_veh, id_stage = ibikes.get_info_from_id_sumo(id_sumo) + if (id_veh > -1) & (id_stage > 1): + # print ' ibike: id_sumo %s id_veh %d id_stage %d'%(id_sumo,id_veh,id_stage) + # print ' before:',stages.ids_edges[id_stage] + if stages.ids_edges[id_stage] != ids_edge: + n_change_route += 1 + print ' route change of id_veh', id_veh, 'id_stage', id_stage + stages.ids_edges[id_stage] = ids_edge + # print ' after :',stages.ids_edges[id_stage] + + if id_strat_motorcycle in ids_strategy: + imotos = virtualpop.get_imotos() + stages = imotos.get_stagetable() + for id_sumo, ids_edge in zip(self.ids_sumo, self.routes): + id_veh, id_stage = imotos.get_info_from_id_sumo(id_sumo) + if (id_veh > -1) & (id_stage > 1): + # print ' ibike: id_sumo %s id_veh %d id_stage %d'%(id_sumo,id_veh,id_stage) + # print ' before:',stages.ids_edges[id_stage] + if stages.ids_edges[id_stage] != ids_edge: + n_change_route += 1 + print ' route change of id_veh', id_veh, 'id_stage', id_stage + stages.ids_edges[id_stage] = ids_edge + # print ' after :',stages.ids_edges[id_stage] + print ' RouteReaderVp: Total number of changed routes:', n_change_route + class PopGenerator(Process): def __init__(self, ident='virtualpopgenerator', virtualpop=None, logger=None, **kwargs): @@ -5243,6 +7161,11 @@ name='PT share', info="""Share of public transport user.""", )) + self.is_delete_existing_pop = attrsman.add(cm.AttrConf('is_delete_existing_pop', kwargs.get('is_delete_existing_pop', True), + groupnames=['options'], + name='Delete existing Virtual Population', + info='If it is True: Delete existing virtual population. If it is False: keep existing virtual population', + )) #self.modeshares = attrsman.add( cm.ObjConf(ModeShares('modeshares',self,scenario.net.modes),groupnames = ['options']) ) @@ -5251,7 +7174,8 @@ # links virtualpop = self.parent - virtualpop.clear_population() + if self.is_delete_existing_pop == True: + virtualpop.clear_population() logger = self.get_logger() #logger.w('Update Landuse...') scenario = virtualpop.get_scenario() @@ -5349,10 +7273,9 @@ # idea: adjust wake-up time with employment type activities = virtualpop.get_activities() - ids_activity_from = activities.add_rows( - n=n_pers, - ids_activitytype=self.ids_acttype_default[0] * unitvec_int, - ids_facility=ids_fac_from, + ids_activity_from = activities.add_activities( + self.ids_acttype_default[0] * unitvec_int, + ids_fac_from, # use default #hours_begin_earliest = None, #hours_begin_latest = None, @@ -5360,10 +7283,9 @@ #durations_max = None, ) - ids_activity_to = activities.add_rows( - n=n_pers, - ids_activitytype=self.ids_acttype_default[1] * unitvec_int, - ids_facility=ids_fac_to, + ids_activity_to = activities.add_activities( + self.ids_acttype_default[1] * unitvec_int, + ids_fac_to, # use default #hours_begin_earliest = None, #hours_begin_latest = None, @@ -5445,6 +7367,16 @@ info='Hour when simulation starts. This is the hour (of the day) when simulation time shows zero seconds.', )) + self.dist_walk_max = attrsman.add(cm.AttrConf('dist_walk_max', kwargs.get('dist_walk_max', 400), + groupnames=['options'], + perm='rw', + name='Max. walking dist', + unit='m', + info="""Maximum distance that a person accepts to walk, + either to reach the destination or to access any sort of vehicle (tranfers at bus stops, walking to carparking, etc). + """, + )) + self.hour_tripbudget = attrsman.add(cm.AttrConf('hour_tripbudget', kwargs.get('hour_tripbudget', 0.5), groupnames=['options'], perm='rw', @@ -5505,9 +7437,8 @@ class Planner(Process): - def __init__(self, ident='planner', virtualpop=None, strategy='all', logger=None, **kwargs): + def __init__(self, ident='planner', virtualpop=None, ids_strategy=None, logger=None, **kwargs): print 'Planner.__init__' - # TODO: let this be independent, link to it or child?? self._init_common(ident, @@ -5521,15 +7452,24 @@ # make for each possible pattern a field for prob strategies = virtualpop.get_strategies() - strategychoices = {'all': -1} - strategychoices.update(strategies.names.get_indexmap()) - self.id_strategy = attrsman.add(cm.AttrConf('id_strategy', strategychoices[strategy], - groupnames=['options'], - choices=strategychoices, - perm='rw', - name='Strategy', - info='Strategy to be used to create mobility plane. In case of all strategies, the planner generates all applicable plans.', - )) + + strategychoices = strategies.names.get_indexmap() + + if (ids_strategy is None): + # no info given, select all + ids_strategy_default = strategychoices.values() + + elif ids_strategy is not None: + ids_strategy_default = ids_strategy + + print ' ids_strategy_default', ids_strategy_default + self.ids_strategy = attrsman.add(cm.ListConf('ids_strategy', ids_strategy_default, + groupnames=['options'], + choices=strategychoices, + perm='rw', + name='Strategies', + info='Strategies to be used to create mobility plans.', + )) evalcrits = {'apply to all persons if feasible': 0, 'apply only if preferred mode is used': 1, @@ -5547,8 +7487,16 @@ """, )) + self.is_plan_no_preferred = attrsman.add(cm.AttrConf('is_plan_no_preferred', kwargs.get('is_plan_no_preferred', False), + groupnames=['options'], + name='Plan for no preferred', + info=""" If it is True: Generate new plans only for strategies that are different from the preferred strategies. + If it is False: Generate new plans for all strategies + """, + )) + def do(self): - print 'Planner.do' + print 'Planner.do', len(self.ids_strategy) # links virtualpop = self.parent @@ -5556,18 +7504,33 @@ #logger.w('Check applicability') #strategies = virtualpop.strategies.get_value() - if self.id_strategy != -1: - virtualpop.plan_with_strategy(self.id_strategy, evalcrit=self.evalcrit, logger=logger) + # if self.id_strategy != -1: + # virtualpop.plan_with_strategy(self.id_strategy, evalcrit = self.evalcrit, is_npm = self.is_new_planner_method, logger = logger) + # + # else: #plan with all strategies + + i = 1 + strategies = virtualpop.get_strategies() + print ' strategies:', self.ids_strategy, strategies.names[self.ids_strategy] + print ' instances', strategies.strategies[self.ids_strategy] - else: # plan with all strategies - for id_strategy in virtualpop.get_strategies().get_ids(): - virtualpop.plan_with_strategy(id_strategy, evalcrit=self.evalcrit, logger=logger) + n_strat = len(self.ids_strategy) + for id_strategy, strategy in zip(self.ids_strategy, strategies.strategies[self.ids_strategy]): + print ' current strategy', strategy, id(strategy) + logger.w('Plan with '+strategy.get_name()+' (%d/%d)' % (i, n_strat)) + virtualpop.plan_with_strategy(id_strategy, evalcrit=self.evalcrit, + is_plan_no_preferred=self.is_plan_no_preferred, logger=logger) + i += 1 return True class PlanSelector(Process): - def __init__(self, ident='planselector', virtualpop=None, logger=None, **kwargs): + def __init__(self, ident='planselector', virtualpop=None, + ids_strategy=None, # not yet implemeted + methodname='plan with shortest estim. time', + logger=None, **kwargs): + print 'PlanSelector.__init__' # TODO: let this be independent, link to it or child?? @@ -5585,15 +7548,34 @@ strategies = virtualpop.get_strategies() # strategychoices.update(strategies.names.get_indexmap()) + strategychoices = strategies.names.get_indexmap() + + # if (ids_strategy is None): + # # no info given, select all + # ids_strategy_default = strategychoices.values() + # + # elif ids_strategy is not None: + # ids_strategy_default = ids_strategy + + # print ' ids_strategy_default',ids_strategy_default + # self.ids_strategy = attrsman.add(cm.ListConf( 'ids_strategy',ids_strategy_default, + # groupnames = ['options'], + # choices = strategychoices, + # perm='rw', + # name = 'Strategies', + # info = 'Set of strategies from which one is selected per person for the next simulation run.', + # )) + methods = {'plan with shortest estim. time': virtualpop.select_plans_min_time_est, 'plan with shortest exec. time': virtualpop.select_plans_min_time_exec, 'plan with preferred mode': virtualpop.select_plans_preferred_mode, 'next plan in list': virtualpop.select_plans_next, 'random plan': virtualpop.select_plans_random, - 'plan with shortest exec. time or est. time': virtualpop.select_plans_min_time_exec_est + 'plan with shortest exec. time or est. time': virtualpop.select_plans_min_time_exec_est, + 'plan with utility function': virtualpop.select_plans_utility_function } - self.method = attrsman.add(cm.AttrConf('method', methods[kwargs.get('methodname', 'plan with shortest estim. time')], + self.method = attrsman.add(cm.AttrConf('method', methods[methodname], groupnames=['options'], choices=methods, perm='rw', @@ -5613,7 +7595,9 @@ groupnames=['options'], perm='rw', name='Time deviation', - info='Time deviation of random time component of estimated or effective time. If zero, no random time is added.', + info="""Time deviation of random time component of estimated or effective time. If zero, no random time is added. + Alternatively the probit constant can be given to quantify the amount of noise. + """, )) self.c_probit = attrsman.add(cm.AttrConf('c_probit', kwargs.get('c_probit', 0.0), @@ -5621,7 +7605,8 @@ perm='rw', name='Probit const', info="""Probit constant used to determine the deviation of the normal distributed random time component. - The deviation is the product of this constant and the travel time. If zero, no random time is added.""", + The deviation is the product of this constant and the travel time. If zero, no random time is added. + This is an alternative to explicitely giving the time deviation.""", )) def do(self): @@ -5631,7 +7616,10 @@ #virtualpop = self.parent logger = self.get_logger() #logger.w('Check applicability') - return self.method(logger=logger, **self.get_kwoptions()) + return self.method(logger=logger, + #ids_strategy = self.ids_strategy, + **self.get_kwoptions() + ) class VehicleProvider(Process): @@ -5706,13 +7694,12 @@ #n_none = int(self.share_autoowner*n_person)-(n_person-n_current) n_need = int(self.share_autoowner*n_person)-n_current if n_need > 0: - ids_pers_miss = np.flatnonzero(virtualpop.ids_iauto.get_value() == -1) + ids_pers_miss = np.flatnonzero(virtualpop.ids_iauto.get_value() == -1)+1 # print ' n_person,n_current,n_target,n_need,len(ids_pers_miss)',n_person,n_current,int(self.share_autoowner*n_person),n_need,len(ids_pers_miss) ids_pers_assign = np.random.choice(ids_pers_miss, n_need, replace=False) ids_iauto = iautos.assign_to_persons(ids_pers_assign) - print ' created %d autos, target share=%.2f, share = %.2f' % ( - iautos.get_share(is_abs=True), iautos.get_share(), self.share_autoowner) + print ' created %d autos, target share=%.2f, share = %.2f' % (iautos.get_share(is_abs=True), iautos.get_share(), self.share_autoowner) ids_prefer_bike = virtualpop.select_ids( (virtualpop.ids_mode_preferred.get_value() == id_mode_bike) & (virtualpop.ids_ibike.get_value() == -1)) @@ -5721,13 +7708,12 @@ n_current = ibikes.get_share(is_abs=True) n_need = int(self.share_bikeowner*n_person)-n_current if n_need > 0: - ids_pers_miss = np.flatnonzero(virtualpop.ids_ibike.get_value() == -1) + ids_pers_miss = np.flatnonzero(virtualpop.ids_ibike.get_value() == -1)+1 # print ' n_person,n_current,n_target,n_need,len(ids_pers_miss)',n_person,n_current,int(self.share_autoowner*n_person),n_need,len(ids_pers_miss) ids_pers_assign = np.random.choice(ids_pers_miss, n_need, replace=False) ids_ibike = ibikes.assign_to_persons(ids_pers_assign) - print ' created %d bikes, target share=%.2f, share = %.2f' % ( - ibikes.get_share(is_abs=True), ibikes.get_share(), self.share_bikeowner) + print ' created %d bikes, target share=%.2f, share = %.2f' % (ibikes.get_share(is_abs=True), ibikes.get_share(), self.share_bikeowner) ids_prefer_moto = virtualpop.select_ids( (virtualpop.ids_mode_preferred.get_value() == id_mode_moto) & (virtualpop.ids_imoto.get_value() == -1)) @@ -5736,12 +7722,11 @@ n_current = imotos.get_share(is_abs=True) n_need = int(self.share_motorcycleowner*n_person)-n_current if n_need > 0: - ids_pers_miss = np.flatnonzero(virtualpop.ids_imoto.get_value() == -1) + ids_pers_miss = np.flatnonzero(virtualpop.ids_imoto.get_value() == -1)+1 ids_pers_assign = np.random.choice(ids_pers_miss, n_need, replace=False) ids_imoto = imotos.assign_to_persons(ids_pers_assign) - print ' created %d moto, target share=%.2f, share = %.2f' % ( - imotos.get_share(is_abs=True), imotos.get_share(), self.share_motorcycleowner) + print ' created %d moto, target share=%.2f, share = %.2f' % (imotos.get_share(is_abs=True), imotos.get_share(), self.share_motorcycleowner) return True # TODO: generate and assign additional vehicles diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/virtualpop_results_mpl.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/virtualpop_results_mpl.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/virtualpop_results_mpl.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/virtualpop_results_mpl.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,12 +14,12 @@ # @file virtualpop_results_mpl.py # @author Joerg Schweizer -# @date +# @date 2012 import os import numpy as np from collections import OrderedDict -# import matplotlib as mpl +#import matplotlib as mpl from agilepy.lib_base.geometry import * from coremodules.misc.matplottools import * import agilepy.lib_base.classman as cm @@ -28,6 +28,277 @@ from agilepy.lib_base.processes import Process +class IteratePlotter(PlotoptionsMixin, Process): + def __init__(self, scenario, name='Virtualpopulation Iterate Matplotlob Plotter', + info="""Creates plots to show results from iteratively executed simulation runs with the virtual population. + The data is produced by the script script_vp_iterate.py + The result data must also be loaded into the scenario. + """, + logger=None, **kwargs): + + self._init_common('virtualpopiterateplotter', parent=scenario, + name=name, + info=info, logger=logger) + + print 'VirtualpopIteratePlotter.__init__', self.parent + attrsman = self.get_attrsman() + + self.is_strategy_share = attrsman.add(cm.AttrConf('is_strategy_share', kwargs.get('is_strategy_share', True), + groupnames=['options', 'plots'], + name='Plot shares', + plotfunction=self.plot_strategy_share, + info=self.plot_strategy_share.__doc__, + )) + + self.is_strategy_time_est_tot = attrsman.add(cm.AttrConf('is_strategy_time_est_tot', kwargs.get('is_strategy_time_est_tot', True), + groupnames=['options', 'plots'], + name='Plot total est times', + plotfunction=self.plot_strategy_time_tot_est, + info='', + )) + + self.is_strategy_time_tot = attrsman.add(cm.AttrConf('is_strategy_time_tot', kwargs.get('is_strategy_time_tot', True), + groupnames=['options', 'plots'], + name='Plot total times', + plotfunction=self.plot_strategy_time_tot, + info='Plot effective times for each stategy over iterations.', + )) + + self.is_strategy_changes = attrsman.add(cm.AttrConf('is_strategy_changes', kwargs.get('is_strategy_changes', True), + groupnames=['options', 'plots'], + name='Plot total changes', + plotfunction=self.plot_strategy_changes, + info=self.plot_strategy_changes.__doc__, + )) + + self.add_plotoptions_lineplot(**kwargs) + self.add_save_options(**kwargs) + + def show(self): + print 'show' + # if self.axis is None: + self.init_figures() + plt.rc('lines', linewidth=self.width_line) + # plt.rc('axes', prop_cycle=(cycler('color', ['r', 'g', 'b', 'y']) + + # cycler('linestyle', ['-', '--', ':', '-.']))) + + for plotattr in self.get_attrsman().get_group('plots'): + print ' ', plotattr.attrname, plotattr.get_value() + if plotattr.get_value(): + plotattr.plotfunction() + + # if not self.is_save: + show_plot() + + def get_scenario(self): + return self.parent + + def get_resultattrconf(self, attrname): + scenario = self.get_scenario() + simresults = scenario.simulation.results + vpiterstats = simresults.get_resultobj('vpiterstats') + return getattr(vpiterstats, attrname) + + def plot_strategy_share(self): + """ + Plot total est times for each stategy over iterations. + """ + print 'plot_strategy_share' + scenario = self.get_scenario() + simresults = scenario.simulation.results + vpiterstats = simresults.get_resultobj('vpiterstats') + iters = vpiterstats.get_ids() + + fig = self.create_figure() + ax = fig.add_subplot(111) + + # sum total triptimes + virtualpop = scenario.demand.virtualpop + strategies = virtualpop.get_strategies() + ids_strat = strategies.get_ids() + trips_tot = np.zeros(len(iters), dtype=np.float32) + for id_strat, strategy in zip(ids_strat, strategies.strategies[ids_strat]): + trips_tot += self.get_resultattrconf(vpiterstats.get_stratcountattr(strategy))[iters] + + # plots for each strategy + i = 0 + for id_strat, strategy in zip(ids_strat, strategies.strategies[ids_strat]): + ident_strat = strategy.get_ident() + name_strat = strategy.get_name() + counts = self.get_resultattrconf(vpiterstats.get_stratcountattr(strategy)) + print ' name_strat', name_strat, 'counts', counts + if np.any(counts[iters] > 0): + ax.plot(iters, 1.0*counts[iters]/trips_tot*100, + label=name_strat, + color=get_color(i), + linestyle='-', + linewidth=self.width_line, + marker=get_marker(i), + markersize=self.size_marker, + alpha=self.alpha_results, + ) + i += 1 + + # for attrconf in vpiterstats.get_group('est. times'): + + ax.legend(loc='best', shadow=True, fontsize=self.size_labelfont) + ax.grid(self.is_grid) + if self.is_show_title: + ax.set_title('Strategy shares', fontsize=self.size_titlefont) + + ax.set_xlabel('Iterations', fontsize=self.size_labelfont) + ax.set_ylabel('Share [%]', fontsize=self.size_labelfont) + ax.tick_params(axis='x', labelsize=int(0.8*self.size_labelfont)) + ax.tick_params(axis='y', labelsize=int(0.8*self.size_labelfont)) + # fig.tight_layout() + if self.is_save: + # rootname of figure will be rootfilename of scenario + self.save_fig('fig_shares') + + def plot_strategy_changes(self): + """'Plot strategy changes over iterations.""" + print 'plot_strategy_changes' + scenario = self.get_scenario() + simresults = scenario.simulation.results + vpiterstats = simresults.get_resultobj('vpiterstats') + iters = vpiterstats.get_ids() + + fig = self.create_figure() + ax = fig.add_subplot(111) + + ax.plot(iters, vpiterstats.numbers_changes[iters], + #label = 'All strategies', + color=self.color_line, + linestyle='-', + linewidth=self.width_line+1, + marker='s', markersize=self.size_marker, + ) + + ax.grid(self.is_grid) + if self.is_show_title: + ax.set_title('Strategy changes', fontsize=self.size_titlefont) + + ax.set_xlabel('Iterations', fontsize=self.size_labelfont) + ax.set_ylabel('Number of changes', fontsize=self.size_labelfont) + ax.tick_params(axis='x', labelsize=int(0.8*self.size_labelfont)) + ax.tick_params(axis='y', labelsize=int(0.8*self.size_labelfont)) + # fig.tight_layout() + if self.is_save: + # rootname of figure will be rootfilename of scenario + self.save_fig('fig_changes') + + def plot_strategy_time_tot_est(self): + print 'plot_strategy_time_tot_est' + scenario = self.get_scenario() + simresults = scenario.simulation.results + vpiterstats = simresults.get_resultobj('vpiterstats') + iters = vpiterstats.get_ids() + + fig = self.create_figure() + ax = fig.add_subplot(111) + + ax.plot(iters, vpiterstats.times_tot_est[iters]/3600, + label='All strategies', + color='k', + linestyle='-', + linewidth=self.width_line+1, + # marker = 's', markersize = 4*self.width_line, + ) + + # plot total times for each strategy + virtualpop = scenario.demand.virtualpop + strategies = virtualpop.get_strategies() + ids_strat = strategies.get_ids() + i = 0 + for id_strat, strategy in zip(ids_strat, strategies.strategies[ids_strat]): + ident_strat = strategy.get_ident() + name_strat = strategy.get_name() + times_tot = self.get_resultattrconf(vpiterstats.get_stratesttimeattr(strategy)) + # print ' times_tot',times_tot + if np.any(times_tot[iters] > 0): + ax.plot(iters, times_tot[iters]/3600, + label=name_strat, + color=get_color(i), + linestyle='-', + linewidth=self.width_line, + marker=get_marker(i), + markersize=self.size_marker, + alpha=self.alpha_results, + ) + i += 1 + + # for attrconf in vpiterstats.get_group('est. times'): + + ax.legend(loc='best', shadow=True, fontsize=self.size_labelfont) + ax.grid(self.is_grid) + if self.is_show_title: + ax.set_title('Total est. travel times by strategy', fontsize=self.size_titlefont) + + ax.set_xlabel('Iterations', fontsize=self.size_labelfont) + ax.set_ylabel('Tot. est. travel times [h]', fontsize=self.size_labelfont) + ax.tick_params(axis='x', labelsize=int(0.8*self.size_labelfont)) + ax.tick_params(axis='y', labelsize=int(0.8*self.size_labelfont)) + # fig.tight_layout() + if self.is_save: + # rootname of figure will be rootfilename of scenario + self.save_fig('fig_time_tot_est') + + def plot_strategy_time_tot(self): + print 'plot_strategy_time_tot' + scenario = self.get_scenario() + simresults = scenario.simulation.results + vpiterstats = simresults.get_resultobj('vpiterstats') + iters = vpiterstats.get_ids() # not suppress last + + fig = self.create_figure() + ax = fig.add_subplot(111) + + ax.plot(iters, vpiterstats.times_tot[iters]/3600, + label='All strategies', + color='k', + linestyle='-', + linewidth=self.width_line+1, + # marker = 's', markersize = 4*self.width_line, + ) + + # plot total times for each strategy + virtualpop = scenario.demand.virtualpop + strategies = virtualpop.get_strategies() + ids_strat = strategies.get_ids() + i = 0 + for id_strat, strategy in zip(ids_strat, strategies.strategies[ids_strat]): + ident_strat = strategy.get_ident() + name_strat = strategy.get_name() + times_tot = self.get_resultattrconf(vpiterstats.get_strattimeattr(strategy)) + # print ' times_tot',times_tot + if np.any(times_tot > 0): + ax.plot(iters, times_tot[iters]/3600, + label=name_strat, + color=get_color(i), + linestyle='-', + linewidth=self.width_line, + marker=get_marker(i), + markersize=self.size_marker, + alpha=self.alpha_results, + ) + i += 1 + + # for attrconf in vpiterstats.get_group('est. times'): + + ax.legend(loc='best', shadow=True, fontsize=self.size_labelfont) + ax.grid(self.is_grid) + if self.is_show_title: + ax.set_title('Total travel times by strategy', fontsize=self.size_titlefont) + ax.set_xlabel('Iterations', fontsize=self.size_labelfont) + ax.set_ylabel('Tot. travel times [h]', fontsize=self.size_labelfont) + ax.tick_params(axis='x', labelsize=int(0.8*self.size_labelfont)) + ax.tick_params(axis='y', labelsize=int(0.8*self.size_labelfont)) + # fig.tight_layout() + if self.is_save: + # rootname of figure will be rootfilename of scenario + self.save_fig('fig_time_tot') + + class StrategyPlotter(PlotoptionsMixin, Process): def __init__(self, virtualpop, name='Plot strategy results with Matplotlib', info="Creates plots of different strategy results using matplotlib", @@ -81,40 +352,6 @@ info='Size of time intervals in histograms.', )) - # self.add_plotoptions(**kwargs) - self.is_title = attrsman.add(cm.AttrConf('is_title', kwargs.get('is_title', True), - groupnames=['options'], - name='Show title', - info='Show title of diagrams.', - )) - - self.size_titlefont = attrsman.add(cm.AttrConf('size_titlefont', kwargs.get('size_titlefont', 32), - groupnames=['options'], - name='Title fontsize', - info='Title fontsize.', - )) - - self.size_labelfont = attrsman.add(cm.AttrConf('size_labelfont', kwargs.get('size_labelfont', 24), - groupnames=['options'], - name='Label fontsize', - info='Label fontsize.', - )) - - self.width_line = attrsman.add(cm.AttrConf('width_line', kwargs.get('width_line', 2), - groupnames=['options'], - perm='wr', - name='Line width', - info='Width of plotted lines.', - )) - - self.color_line = attrsman.add(cm.AttrConf('color_line', kwargs.get('color_line', np.array([0, 0, 0, 1], dtype=np.float32)), - groupnames=['options'], - perm='wr', - metatype='color', - name='Line color', - info='Color of line in various diagrams.', - )) - self.color_chart = attrsman.add(cm.AttrConf('color_chart', kwargs.get('color_chart', np.array([0.3, 0.1, 0.9, 1], dtype=np.float32)), groupnames=['options'], perm='wr', @@ -123,12 +360,7 @@ info='Main Color of chart bars.', )) - self.is_grid = attrsman.add(cm.AttrConf('is_grid', kwargs.get('is_grid', True), - groupnames=['options'], - name='Show grid?', - info='If True, shows a grid on the graphical representation.', - )) - + self.add_plotoptions_lineplot(**kwargs) self.add_save_options(**kwargs) def show(self): @@ -177,13 +409,13 @@ inds_plot = np.arange(len(index_strat[inds_nz])) bar_width = 0.45 opacity = 0.5 - # error_config = {'ecolor': '0.3'} + #error_config = {'ecolor': '0.3'} rects = ax.barh(inds_plot, values[inds][inds_nz], # align='center', alpha=opacity, height=bar_width, color=colors[inds][inds_nz], # self.color_chart, - # yerr=std_women, error_kw=error_config, + #yerr=std_women, error_kw=error_config, linewidth=self.width_line, # facecolor=colors[inds][inds_nz], ) @@ -192,9 +424,9 @@ ax.set_yticklabels(names_strat[inds][inds_nz]) ax.legend() - # ax.legend(loc='best',shadow=True, fontsize=self.size_labelfont) + #ax.legend(loc='best',shadow=True, fontsize=self.size_labelfont) ax.grid(self.is_grid) - if self.is_title: + if self.is_show_title: ax.set_title('Strategy shares', fontsize=self.size_titlefont) ax.set_xlabel('Share', fontsize=self.size_labelfont) ax.set_ylabel('Strategies', fontsize=self.size_labelfont) @@ -239,13 +471,13 @@ bar_width = 0.45 opacity = 0.5 - # error_config = {'ecolor': '0.3'} + #error_config = {'ecolor': '0.3'} rects = ax.barh(inds_plot, values[inds][inds_nz], # align='center', alpha=opacity, height=bar_width, color=colors[inds][inds_nz], - # yerr=std_women, error_kw=error_config, + #yerr=std_women, error_kw=error_config, linewidth=self.width_line, # facecolor=colors[inds][inds_nz], ) @@ -254,9 +486,9 @@ ax.set_yticklabels(names_strat[inds][inds_nz]) ax.legend() - # ax.legend(loc='best',shadow=True, fontsize=self.size_labelfont) + #ax.legend(loc='best',shadow=True, fontsize=self.size_labelfont) ax.grid(self.is_grid) - if self.is_title: + if self.is_show_title: ax.set_title('Mean estimated travel time of strategies', fontsize=self.size_titlefont) ax.set_xlabel('Mean est. time [s]', fontsize=self.size_labelfont) @@ -317,7 +549,7 @@ if len(timefactors) > 0: x_max = max(x_max, np.max(timefactors)) - # bins = np.linspace(x_min,x_max,self.n_bins) + #bins = np.linspace(x_min,x_max,self.n_bins) bins = np.arange(x_min, x_max, self.timeint_bins) if len(bins) > 0: for id_strat, timefactors in strategytimefactors.iteritems(): @@ -337,7 +569,7 @@ ax.legend(loc='best', shadow=True, fontsize=self.size_labelfont) ax.grid(self.is_grid) - if self.is_title: + if self.is_show_title: ax.set_title('Estimated time factor with respect to fastest strategy', fontsize=self.size_titlefont) ax.set_xlabel('Estimated time factor', fontsize=self.size_labelfont) ax.set_ylabel('Probability distribution', fontsize=self.size_labelfont) @@ -402,7 +634,7 @@ if len(timefactors) > 0: x_max = max(x_max, np.max(timefactors)) - # bins = np.linspace(x_min,x_max,self.n_bins) + #bins = np.linspace(x_min,x_max,self.n_bins) bins = np.arange(x_min, x_max, self.timeint_bins) if len(bins) > 0: for id_strat, timefactors in strategytimefactors.iteritems(): @@ -422,7 +654,7 @@ ax.legend(loc='best', shadow=True, fontsize=self.size_labelfont) ax.grid(self.is_grid) - if self.is_title: + if self.is_show_title: ax.set_title('Time factor with respect to fastest strategy', fontsize=self.size_titlefont) ax.set_xlabel('Time factor', fontsize=self.size_labelfont) ax.set_ylabel('Probability distribution', fontsize=self.size_labelfont) diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/virtualpop_results.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/virtualpop_results.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/virtualpop_results.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/virtualpop_results.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file virtualpop_results.py # @author Joerg Schweizer -# @date +# @date 2012 import os import sys @@ -28,6 +28,165 @@ from coremodules.simulation import results as res +class IterateStatistics(am.ArrayObjman): + def __init__(self, scenario, parent=None, + name='VP Iteration statistics', + info='Table with aggegate simulation statistics for each virtual population simulation step.', + **kwargs): + + self._init_objman(ident='vpiterstats', + parent=parent, # usually main results object + info=info, + name=name, + **kwargs) + + self.add_col(am.ArrayConf('times_tot', 0.0, + dtype=np.float32, + groupnames=['general'], + perm='r', + name='Total triptimes', + info='Sum of trip times of executed trips. Etimated trip time is used if respective strategy has not been executed during the last simulation.', + )) + + self.add_col(am.ArrayConf('times_tot_est', 0.0, + dtype=np.float32, + groupnames=['general'], + perm='r', + name='Total est. triptimes', + info='Sum of all estimated journey times for the next iteration. Effective travel time is used if the respective strategy has been simulated in a previous iteration.', + )) + + self.add_col(am.ArrayConf('numbers_changes', 0, + dtype=np.int32, + groupnames=['general'], + perm='r', + name='Number changes', + info='Number of strategy changes with respect to the previous simulation run.', + )) + + virtualpop = scenario.demand.virtualpop + strategies = virtualpop.get_strategies() + ids_strat = strategies.get_ids() + for id_strat, strategy in zip(ids_strat, strategies.strategies[ids_strat]): + ident_strat = strategy.get_ident() + name_strat = strategy.get_name() + self.add_col(am.ArrayConf(self.get_stratcountattr(strategy), 0, + dtype=np.int32, + groupnames=['trips'], + perm='r', + name='Pers. using '+name_strat, + info='Total number of persons using the %s mobility strategy.' % name_strat, + )) + + self.add_col(am.ArrayConf(self.get_strattimeattr(strategy), 0.0, + dtype=np.float32, + groupnames=['times'], + perm='r', + name='Times with '+name_strat, + info='Total travel times of all persons using strategy %s.' % name_strat, + )) + + self.add_col(am.ArrayConf(self.get_stratesttimeattr(strategy), 0.0, + dtype=np.float32, + groupnames=['est. times'], + perm='r', + name='Est. times with '+name_strat, + info='Total estimated or effective travel times of all persons using strategy %s.' % name_strat, + )) + + self.add_col(am.ArrayConf(self.get_stratutilattr(strategy), 0.0, + dtype=np.float32, + groupnames=['utilities'], + perm='r', + name='Utility with '+name_strat, + info='Total utility of all persons using strategy %s.' % name_strat, + )) + + self.add_col(am.ArrayConf(self.get_stratestutilattr(strategy), 0.0, + dtype=np.float32, + groupnames=['est. utilities'], + perm='r', + name='Est. utility with '+name_strat, + info='Total estimated utility of all persons using strategy %s.' % name_strat, + )) + + def import_xml(self, sumo, datapaths): + return True + + def get_strattimeattr(self, strategy): + return 'times_'+strategy.get_ident() + + def get_stratesttimeattr(self, strategy): + return 'esttimes_'+strategy.get_ident() + + def get_stratcountattr(self, strategy): + return 'stratcounts_'+strategy.get_ident() + + def get_stratutilattr(self, strategy): + return 'utils_'+strategy.get_ident() + + def get_stratestutilattr(self, strategy): + return 'estutils_'+strategy.get_ident() + + def add_results(self, scenario, ids_plan_before, ids_plan_after): + print 'add_results iteration:', len(self)+1 + # print ' ids_plan_before',ids_plan_before + # print ' ids_plan_after',ids_plan_after + # print ' changes',np.sum(ids_plan_before != ids_plan_after) + virtualpop = scenario.demand.virtualpop + plans = virtualpop.get_plans() + strategies = virtualpop.get_strategies() + ids_strat = strategies.get_ids() + + ids_strat_before = plans.ids_strategy[ids_plan_before] + ids_strat_after = plans.ids_strategy[ids_plan_after] + + # make estinated tiime for current and exec for last + times_before = plans.times_exec[ids_plan_before] + # in case no times_exec available, replace by estimated + inds_times_est = np.logical_not(times_before > 0) + times_before[inds_times_est] = plans.times_est[ids_plan_before[inds_times_est]] + + times_after = plans.times_exec[ids_plan_after] + # in case no times_exec available, replace by estimated + inds_times_est = np.logical_not(times_after > 0) + times_after[inds_times_est] = plans.times_est[ids_plan_after[inds_times_est]] + + # get utilities + + #ids_strat_sim, frequ_strat_sim = itemfrequencies(ids_strat_after) + id_run = self.add_row() +# if id_run>1: +## self.numbers_changes[id_run] = np.sum(ids_plan_before != ids_plan_after) +## self.times_tot[id_run-1] = np.sum(times_before) +## self.times_tot_est[id_run] = np.sum(times_after) +# else: +## self.times_tot_est[id_run] = np.sum(times_after) + self.numbers_changes[id_run] = np.sum(ids_plan_before != ids_plan_after) + self.times_tot[id_run] = np.sum(times_before) + self.times_tot_est[id_run] = np.sum(times_after) + + for id_strat, strategy in zip(ids_strat, strategies.strategies[ids_strat]): + inds_thisstrat_before = ids_strat_before == id_strat + inds_thisstrat_after = ids_strat_after == id_strat + print ' check', id_strat, strategy, np.sum(inds_thisstrat_before), np.sum(inds_thisstrat_after) + stratcountattr = self.get_stratcountattr(strategy) + getattr(self, stratcountattr)[id_run] = np.sum(inds_thisstrat_after) + + # determine effective executed time before new plan selection +# if id_run>1: +## strattimeattr = self.get_strattimeattr(strategy) +## getattr(self, strattimeattr)[id_run-1] = np.sum(times_before[inds_thisstrat_before]) + strattimeattr = self.get_strattimeattr(strategy) + getattr(self, strattimeattr)[id_run] = np.sum(times_before[inds_thisstrat_before]) + # determine estimated or effective time (if available) + # after plan selection + stratesttimeattr = self.get_stratesttimeattr(strategy) + getattr(self, stratesttimeattr)[id_run] = np.sum(times_after[inds_thisstrat_after]) + + return id_run + + class Vehicleresults(res.Tripresults): pass @@ -93,7 +252,7 @@ # default cannot be kwarg default = kwargs['default'] del kwargs['default'] - if 'groupnames' in kwargs: + if kwargs.has_key('groupnames'): kwargs['groupnames'].append('results') else: kwargs['groupnames'] = ['results'] @@ -102,7 +261,7 @@ def import_xml(self, sumo, datapaths): datapathkey = self.datapathkey.get_value() - if datapathkey in datapaths: + if datapaths.has_key(datapathkey): self.import_sumoxml(datapaths[datapathkey], sumo) self.get_persons().update_results(self) diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/virtualpop_wxgui-01.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/virtualpop_wxgui-01.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/virtualpop_wxgui-01.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/virtualpop_wxgui-01.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,288 +0,0 @@ -# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. -# SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM -# 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 virtualpop_wxgui-01.py -# @author Joerg Schweizer -# @date - -import wx - - -import agilepy.lib_base.classman as cm -import agilepy.lib_base.arrayman as am -from agilepy.lib_base.misc import get_inversemap -from agilepy.lib_wx.ogleditor import * -import virtualpop - - -from agilepy.lib_wx.processdialog import ProcessDialog, ProcessDialogInteractive - - -class VirtualpopWxGuiMixin: - """Contains Virtualpopulation spacific functions that communicate between the widgets of the main wx gui - and the functions of the plugin. - """ - - # def refresh_virtualpop(self,is_refresh): - # if is_refresh: - # neteditor = self.get_neteditor() - # #neteditor.add_tool(AddODflowTool(self, odintervals)) - # #neteditor.add_toolclass(AddODflowTool) - - def add_menu_virtualpop(self, menubar): - menubar.append_menu('demand/virtual population', - bitmap=self.get_icon("icon_virtualpopulation.jpg") - ) - menubar.append_menu('demand/virtual population/configure population', - # bitmap = self.get_icon("icon_virtualpopulation.jpg") - ) - - menubar.append_item('demand/virtual population/configure population/generate...', - self.on_generate, - ) - - menubar.append_item('demand/virtual population/configure population/create from zone-to-zone flows...', - self.on_create_pop_from_odflows, - ) - - menubar.append_menu('demand/virtual population/configure vehicles', - # bitmap = self.get_icon("icon_virtualpopulation.jpg") - ) - - menubar.append_item('demand/virtual population/configure vehicles/provide vehicles...', - self.on_provide_vehicles, - ) - - menubar.append_item('demand/virtual population/configure vehicles/clear individual vehicles', - self.on_clear_ivehicles, - bitmap=wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_MENU), - ) - - menubar.append_menu('demand/virtual population/plans', - # bitmap = self.get_icon("icon_virtualpopulation.jpg") - ) - - menubar.append_item('demand/virtual population/plans/generate...', - self.on_generate_plan, - # info='Generate plans for private transport.', - # bitmap = self.get_icon("Document_Import_24px.png"), - ) - - menubar.append_item('demand/virtual population/plans/select plans with preferred mode', - self.on_select_plans_preferred_mode, - # info='Generate plans for private transport.', - # bitmap = self.get_icon("Document_Import_24px.png"), - ) - - menubar.append_item('demand/virtual population/plans/select plans with min. est. travel time', - self.on_select_plans_min_time_est, - # info='Generate plans for private transport.', - # bitmap = self.get_icon("Document_Import_24px.png"), - ) - - menubar.append_item('demand/virtual population/plans/select plans with min. eff. travel time', - self.on_select_plans_min_time_exec, - # info='Generate plans for private transport.', - # bitmap = self.get_icon("Document_Import_24px.png"), - ) - - menubar.append_item('demand/virtual population/plans/select next plan', - self.on_select_plans_next, - # info='Generate plans for private transport.', - # bitmap = self.get_icon("Document_Import_24px.png"), - ) - - menubar.append_item('demand/virtual population/plans/clear plans', - self.on_clear_plans, - bitmap=wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_MENU), - ) - - # menubar.append_item( 'demand/virtual population/plans/export plans to SUMO xml...', - # self.on_write_plans_to_sumoxml, - # info='Export all plans to SUMO routes XML format.', - # bitmap = self.get_icon("Document_Import_24px.png"), - # ) - - menubar.append_item('demand/virtual population/clear polulation, plans and vehicles', - self.on_clear_pop, - bitmap=wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_MENU), - ) - - def on_clear_plans(self, event=None): - self._demand.virtualpop.clear_plans() - self._mainframe.browse_obj(self._demand.virtualpop.get_plans()) - - def on_clear_ivehicles(self, event=None): - self._demand.virtualpop.clear_ivehicles() - self._mainframe.browse_obj(self._demand.virtualpop) - - def on_clear_pop(self, event=None): - self._demand.virtualpop.clear_population() - self._mainframe.browse_obj(self._demand.virtualpop) - # if event: event.Skip() - - def on_select_plans_preferred_mode(self, event=None): - """ - Select current plan as plan which satisfy the person's preferred mode. - """ - self._demand.virtualpop.select_plans_preferred_mode() - self._mainframe.browse_obj(self._demand.virtualpop) - - def on_select_plans_min_time_est(self, event=None): - """ - Select plan with minimum estimated travel time as current plant. - """ - self._demand.virtualpop.select_plans_min_time_est() - self._mainframe.browse_obj(self._demand.virtualpop) - - def on_select_plans_min_time_exec(self, event=None): - """ - Select plan with minimum effective travel time as current plant. - The effective travel time is the time of the last executed simulation run. - """ - self._demand.virtualpop.select_plans_min_time_exec() - self._mainframe.browse_obj(self._demand.virtualpop) - - def on_select_plans_next(self, event=None): - """ - Select next plan in the plan list. - """ - self._demand.virtualpop.select_plans_next() - self._mainframe.browse_obj(self._demand.virtualpop) - - def on_generate(self, event=None): - """ - Generates virtual population based on some statistical data. - """ - - # self._demand.trips.clear_routes() - - self.proc = virtualpop.PopGenerator('pop_generator', - self._demand.virtualpop, - logger=self._mainframe.get_logger() - ) - - dlg = ProcessDialogInteractive(self._mainframe, - self.proc, - title=self.proc.get_name(), - func_close=self.close_process, - ) - - dlg.CenterOnScreen() - - # this does not return until the dialog is closed. - # val = dlg.ShowModal() - print 'on_create_pop_from_odflows' - dlg.Show() - dlg.MakeModal(True) - - def on_create_pop_from_odflows(self, event=None): - """ - Generates virtual population from OD flow matrix. - """ - - # self._demand.trips.clear_routes() - - self.proc = virtualpop.PopFromOdfGenerator('pop_from_odflow_creator', - self._demand.virtualpop, - logger=self._mainframe.get_logger() - ) - - dlg = ProcessDialogInteractive(self._mainframe, - self.proc, - title=self.proc.get_name(), - func_close=self.close_process, - ) - - dlg.CenterOnScreen() - - # this does not return until the dialog is closed. - # val = dlg.ShowModal() - print 'on_create_pop_from_odflows' - dlg.Show() - dlg.MakeModal(True) - - def on_provide_vehicles(self, event=None): - """ - Provide vehicles to satisfy predefined statistical characteristics. - """ - - # self._demand.trips.clear_routes() - - self.proc = virtualpop.VehicleProvider('vehicleprovider', - self._demand.virtualpop, - logger=self._mainframe.get_logger() - ) - - dlg = ProcessDialogInteractive(self._mainframe, - self.proc, - title=self.proc.get_name(), - func_close=self.close_process, - ) - - dlg.CenterOnScreen() - - # this does not return until the dialog is closed. - # val = dlg.ShowModal() - print 'on_provide_vehicles' - dlg.Show() - dlg.MakeModal(True) - - def on_generate_plan(self, event=None): - """ - Generates mobility plans using different strategies.. - """ - - # self._demand.trips.clear_routes() - - self.proc = virtualpop.Planner('planner', - self._demand.virtualpop, - logger=self._mainframe.get_logger() - ) - - dlg = ProcessDialogInteractive(self._mainframe, - self.proc, - title=self.proc.get_name(), - func_close=self.close_process, - ) - - dlg.CenterOnScreen() - - # this does not return until the dialog is closed. - # val = dlg.ShowModal() - print 'on_generate_plan' - dlg.Show() - dlg.MakeModal(True) - - def close_process(self, dlg): - # called before destroying the process dialog - if self.proc.status == 'success': - self._mainframe.browse_obj(self._demand.virtualpop) - - def on_write_plans_to_sumoxml(self, event=None): - # print 'on_write_plans_to_sumoxml' - dirpath = self.get_scenario().get_workdirpath() - defaultFile = self.get_scenario().get_rootfilename()+'.rou.xml' - wildcards_all = 'All files (*.*)|*.*|XML files (*.xml)|*.xml' - dlg = wx.FileDialog(None, message='Write plans to SUMO rou.xml', - defaultDir=dirpath, - defaultFile=defaultFile, - wildcard=wildcards_all, style=wx.SAVE | wx.CHANGE_DIR) - if dlg.ShowModal() == wx.ID_OK: - filepath = dlg.GetPath() - - else: - return - - self._demand.virtualpop.export_sumoxml(filepath) diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/virtualpop_wxgui.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/virtualpop_wxgui.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/virtualpop_wxgui.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/virtualpop_wxgui.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file virtualpop_wxgui.py # @author Joerg Schweizer -# @date +# @date 2012 import wx @@ -52,7 +52,6 @@ bitmap=self.get_icon("icon_virtualpopulation.jpg") ) menubar.append_menu('demand/virtual population/configure population', - # bitmap = self.get_icon("icon_virtualpopulation.jpg") ) menubar.append_item('demand/virtual population/configure population/generate...', @@ -64,7 +63,7 @@ ) menubar.append_menu('demand/virtual population/configure vehicles', - # bitmap = self.get_icon("icon_virtualpopulation.jpg") + #bitmap = self.get_icon("icon_virtualpopulation.jpg") ) menubar.append_item('demand/virtual population/configure vehicles/provide vehicles...', @@ -77,19 +76,24 @@ ) menubar.append_menu('demand/virtual population/plans', - # bitmap = self.get_icon("icon_virtualpopulation.jpg") + #bitmap = self.get_icon("icon_virtualpopulation.jpg") ) menubar.append_item('demand/virtual population/plans/generate...', self.on_generate_plan, - # info='Generate plans for private transport.', - # bitmap = self.get_icon("Document_Import_24px.png"), ) menubar.append_item('demand/virtual population/plans/select current plans...', self.on_planselection, - # info='Generate plans for private transport.', - # bitmap = self.get_icon("Document_Import_24px.png"), + ) + + menubar.append_item('demand/virtual population/plans/reroute current plans...', + self.on_dua_reroute, + ) + + menubar.append_item('demand/virtual population/plans/import plans from route file...', + self.on_import_plans, + bitmap=self.get_agileicon("Document_Import_24px.png"), ) menubar.append_item('demand/virtual population/plans/clear plans', @@ -100,23 +104,34 @@ # menubar.append_item( 'demand/virtual population/plans/export plans to SUMO xml...', # self.on_write_plans_to_sumoxml, # info='Export all plans to SUMO routes XML format.', - # # bitmap = self.get_icon("Document_Import_24px.png"), + # #bitmap = self.get_icon("Document_Import_24px.png"), # ) - menubar.append_item('demand/virtual population/clear polulation, plans and vehicles', + menubar.append_item('demand/virtual population/clear polulation, plans, vehicles and activities', self.on_clear_pop, bitmap=wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_MENU), ) + menubar.append_menu('demand/virtual population/analysis', + bitmap=self.get_agileicon('icon_results_24px.png'), + ) if is_mpl: - menubar.append_menu('demand/virtual population/analysis', - bitmap=results_mpl.get_mplicon(), - ) + menubar.append_item('demand/virtual population/analysis/plot strategy data...', self.on_plot_strategies, bitmap=results_mpl.get_mplicon(), # , ) + menubar.append_item('demand/virtual population/analysis/load iteration results...', + self.on_open_iterationresults, + bitmap=self.get_agileicon("Document_Import_24px.png"), + ) + + menubar.append_item('demand/virtual population/analysis/plot iteration results...', + self.on_plot_iterations, + bitmap=results_mpl.get_mplicon(), # , + ) + def on_clear_plans(self, event=None): self._demand.virtualpop.clear_plans() self._mainframe.browse_obj(self._demand.virtualpop.get_plans()) @@ -127,49 +142,21 @@ def on_clear_pop(self, event=None): self._demand.virtualpop.clear_population() + self._demand.virtualpop.activities.clear() self._mainframe.browse_obj(self._demand.virtualpop) - # if event: event.Skip() - - def on_select_plans_preferred_mode(self, event=None): - """ - Select current plan as plan which satisfy the person's preferred mode. - """ - self._demand.virtualpop.select_plans_preferred_mode() - self._mainframe.browse_obj(self._demand.virtualpop) - - def on_select_plans_min_time_est(self, event=None): - """ - Select plan with minimum estimated travel time as current plant. - """ - self._demand.virtualpop.select_plans_min_time_est() - self._mainframe.browse_obj(self._demand.virtualpop) - - def on_select_plans_min_time_exec(self, event=None): - """ - Select plan with minimum effective travel time as current plant. - The effective travel time is the time of the last executed simulation run. - """ - self._demand.virtualpop.select_plans_min_time_exec() - self._mainframe.browse_obj(self._demand.virtualpop) - - def on_select_plans_next(self, event=None): - """ - Select next plan in the plan list. - """ - self._demand.virtualpop.select_plans_next() - self._mainframe.browse_obj(self._demand.virtualpop) + #if event: event.Skip() def on_planselection(self, event=None): """ Plan selector to set current plan with different methods """ # self._landuse.parking.make_parking() - # self._canvas = canvas.draw() - # drawing = self.get_drawing().get_drawobj_by_ident('parkingdraws') + #self._canvas = canvas.draw() + #drawing = self.get_drawing().get_drawobj_by_ident('parkingdraws') # TODO: make a proper import mask that allows to set parameters # self._landuse.maps.download() - proc = virtualpop.PlanSelector('parkinggenerator', self._demand.virtualpop, logger=self._mainframe.get_logger()) + proc = virtualpop.PlanSelector('planselector', self._demand.virtualpop, logger=self._mainframe.get_logger()) dlg = ProcessDialog(self._mainframe, proc, immediate_apply=True) dlg.CenterOnScreen() @@ -211,11 +198,60 @@ dlg.CenterOnScreen() # this does not return until the dialog is closed. - # val = dlg.ShowModal() + #val = dlg.ShowModal() print 'on_create_pop_from_odflows' dlg.Show() dlg.MakeModal(True) + def on_import_plans(self, event=None): + """Import plans from SUMO route xml file.""" + wildcards_all = "All files (*.*)|*.*" + dlg = wx.FileDialog(self._mainframe, message="Open SUMO route file", + defaultDir=self.get_scenario().get_rootfilepath(), + # defaultFile="", + wildcard="XML file (*.xml,*.XML)|*.xml;*.XML|"+wildcards_all, + style=wx.OPEN | wx.CHANGE_DIR + ) + + # Show the dialog and retrieve the user response. If it is the OK response, + # process the data. + if dlg.ShowModal() == wx.ID_OK: + # This returns a Python list of files that were selected. + paths = dlg.GetPaths() + # print 'You selected %d files:' % len(paths) + if len(paths) > 0: + filepath = paths[0] + print 'call import_routes_xml', filepath + self._demand.virtualpop.import_routes_xml(filepath) + self._mainframe.browse_obj(self._demand.virtualpop.get_plans()) + + dlg.Destroy() + + def on_dua_reroute(self, event=None): + """ + Reroutes the virtual population with DUA router. Diffferent rerouting methods can be chosen. + """ + + # self._demand.trips.clear_routes() + + self.proc = virtualpop.DuarouterVp('vpduarouter', + self._demand.virtualpop, + logger=self._mainframe.get_logger() + ) + + dlg = ProcessDialogInteractive(self._mainframe, + self.proc, + title=self.proc.get_name(), + func_close=self.close_process, + ) + + dlg.CenterOnScreen() + + # this does not return until the dialog is closed. + #val = dlg.ShowModal() + dlg.Show() + dlg.MakeModal(True) + def on_create_pop_from_odflows(self, event=None): """ Generates virtual population from OD flow matrix. @@ -237,7 +273,7 @@ dlg.CenterOnScreen() # this does not return until the dialog is closed. - # val = dlg.ShowModal() + #val = dlg.ShowModal() print 'on_create_pop_from_odflows' dlg.Show() dlg.MakeModal(True) @@ -263,7 +299,7 @@ dlg.CenterOnScreen() # this does not return until the dialog is closed. - # val = dlg.ShowModal() + #val = dlg.ShowModal() print 'on_provide_vehicles' dlg.Show() dlg.MakeModal(True) @@ -282,17 +318,20 @@ dlg = ProcessDialogInteractive(self._mainframe, self.proc, - title=self.proc.get_name(), + #title = self.proc.get_name(), func_close=self.close_process, + is_close_after_completion=False, ) dlg.CenterOnScreen() # this does not return until the dialog is closed. - # val = dlg.ShowModal() + #val = dlg.ShowModal() print 'on_generate_plan' dlg.Show() dlg.MakeModal(True) + if self.proc.status == 'success': + self._mainframe.browse_obj(self._demand.virtualpop) def close_process(self, dlg): # called before destroying the process dialog @@ -306,7 +345,7 @@ wildcards_all = 'All files (*.*)|*.*|XML files (*.xml)|*.xml' dlg = wx.FileDialog(None, message='Write plans to SUMO rou.xml', defaultDir=dirpath, - defaultFile=defaultFile, + # defaultFile=defaultFile, wildcard=wildcards_all, style=wx.SAVE | wx.CHANGE_DIR) if dlg.ShowModal() == wx.ID_OK: filepath = dlg.GetPath() @@ -327,6 +366,93 @@ dlg = results_mpl.ResultDialog(self._mainframe, resultplotter) dlg.CenterOnScreen() + + # this does not return until the dialog is closed. + val = dlg.ShowModal() + # print ' val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL + # print ' status =',dlg.get_status() + if dlg.get_status() != 'success': # val == wx.ID_CANCEL: + # print ">>>>>>>>>Unsuccessful\n" + dlg.Destroy() + + if dlg.get_status() == 'success': + # print ">>>>>>>>>successful\n" + # apply current widget values to scenario instance + dlg.apply() + dlg.Destroy() + + def on_open_iterationresults(self, event=None): + """ + Load results from virtual population iteration simulation script_vp_iter.py + """ + + wildcards_all = "All files (*.*)|*.*" + wildcards_obj = "VP iterate result files (*.vpiterres.obj)|*.vpiterres.obj|Python binary files (*.obj)|*.obj" + wildcards = wildcards_obj+"|"+wildcards_all + + # Finally, if the directory is changed in the process of getting files, this + # dialog is set up to change the current working directory to the path chosen. + dlg = wx.FileDialog( + self._mainframe, message="Open VP iteration results file", + defaultDir=self.get_scenario().get_workdirpath(), + #defaultFile = self.get_scenario().get_rootfilepath()+'.vpiterres.obj', + wildcard=wildcards, + style=wx.OPEN | wx.CHANGE_DIR + ) + + # Show the dialog and retrieve the user response. If it is the OK response, + # process the data. + is_newresults = False + if dlg.ShowModal() == wx.ID_OK: + # This returns a Python list of files that were selected. + filepath = dlg.GetPath() + if len(filepath) > 0: + simresults = self._demand.parent.simulation.results + if simresults is not None: + + # delete old object, if any + vpiterstats = simresults.get_resultobj('vpiterstats') + if vpiterstats is not None: + simresults.delete('vpiterstats') + del vpiterstats + + vpiterstats = cm.load_obj(filepath) + + simresults.add_resultobj(vpiterstats) + + is_newresults = True + + # Destroy the dialog. Don't do this until you are done with it! + # BAD things can happen otherwise! + dlg.Destroy() + + if is_newresults: + # this should update all widgets for the new scenario!! + # print 'call self._mainframe.refresh_moduleguis()' + self._mainframe.browse_obj(simresults) + # self._mainframe.select_view(name = "Result viewer") #!!!!!!!!tricky, crashes without + # self.refresh_widgets() + # wx.CallAfter(self.refresh_widgets) + # self._mainframe.refresh_moduleguis() + #if event: event.Skip() + + def on_plot_iterations(self, event=None): + """ + Plot different results on strategies in Matplotlib plotting envitonment. + First iteration results must be loaded. + """ + scenario = self._demand.parent + + vpiterstats = scenario.simulation.results.get_resultobj('vpiterstats') + print 'on_plot_iterations ' + print ' vpiterstats ', vpiterstats + if is_mpl & (vpiterstats is not None): + resultplotter = results_mpl.IteratePlotter(scenario, + logger=self._mainframe.get_logger() + ) + dlg = results_mpl.ResultDialog(self._mainframe, resultplotter) + + dlg.CenterOnScreen() # this does not return until the dialog is closed. val = dlg.ShowModal() diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/wxgui.py sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/wxgui.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/demand/wxgui.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/demand/wxgui.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file wxgui.py # @author Joerg Schweizer -# @date +# @date 2012 import os import wx @@ -33,6 +33,7 @@ import origin_to_destination_wxgui as odgui import turnflows_wxgui as turnflowsgui import virtualpop_wxgui as virtualpopgui +import detectorflows_wxgui as detectorflowsgui import publictransportservices_wxgui as pt @@ -84,9 +85,9 @@ landusetypes = self._facilities.get_landusetypes() ids_landusetype = self._facilities.ids_landusetype.value for id_landusetype in landusetypes.get_ids(): - # inds = np.flatnonzero(ids_landusetype == id_landusetype) - # color = landusetypes.colors[id_landusetype] - # self.colors.value[self._inds_map[inds]] = color + #inds = np.flatnonzero(ids_landusetype == id_landusetype) + #color = landusetypes.colors[id_landusetype] + #self.colors.value[self._inds_map[inds]] = color self.colors.value[self._inds_map[np.flatnonzero( ids_landusetype == id_landusetype)]] = landusetypes.colors[id_landusetype] @@ -132,7 +133,7 @@ self.del_rows(self.get_ids()) ids = self._zones.get_ids() - # self._inds_map = self._zones.get_inds(ids) + #self._inds_map = self._zones.get_inds(ids) self.add_rows(ids=ids) # plugins to keep grapgics syncronized with netelements @@ -171,7 +172,7 @@ colors=self.color_default.value, colors_highl=self._get_colors_highl(self.color_default.value) ) - # self._inds_map = self._zones.get_inds(self._zones.get_ids()) + #self._inds_map = self._zones.get_inds(self._zones.get_ids()) # self._update_vertexvbo() # self._update_colorvbo() @@ -199,7 +200,7 @@ # print ' self.get_vertices_array()=\n',self.get_vertices_array() # self._drawobj_anim.del_drawobj(self.id_anim) self.update_internal() - # self._inds_map = self._zones.get_inds(self._zones.get_ids()) + #self._inds_map = self._zones.get_inds(self._zones.get_ids()) # self._update_vertexvbo() # self._update_colorvbo() return True @@ -207,7 +208,7 @@ def del_elem(self, id_zone): """ Deletes an element from network and then in on canvas - through callback on_del_element + through callback on_del_element """ # print 'del_elem' # print ' len(self),len(self._zones)',len(self),len(self._zones) @@ -249,6 +250,7 @@ class WxGui(turnflowsgui.TurnflowWxGuiMixin, odgui.OdFlowsWxGuiMixin, virtualpopgui.VirtualpopWxGuiMixin, + detectorflowsgui.DetectorflowsWxGuiMixin, pt.PublicTransportWxGuiMixin, ModuleGui): @@ -275,7 +277,7 @@ Set mainframe and initialize widgets to various places. """ self._mainframe = mainframe - # self._neteditor = mainframe.add_view("Network", Neteditor) + #self._neteditor = mainframe.add_view("Network", Neteditor) # mainframe.browse_obj(self._module) self.make_menu() @@ -285,7 +287,7 @@ """ Check through mainframe what the state of the application is and reset widgets. For exampe enable/disable widgets - dependent on the availability of data. + dependent on the availability of data. """ scenario = self.get_scenario() # print 'demand refresh_widgets',scenario.net @@ -331,11 +333,14 @@ info='Import vehicle types from xml file', bitmap=self.get_agileicon("Document_Import_24px.png"), ) - + menubar.append_item('demand/vehicles/export vehicle types from xml...', + self.on_export_vtypes, + bitmap=self.get_agileicon("Document_Export_24px.png"), + ) menubar.append_item('demand/vehicles/load defaults', self.on_load_vtypes_defaults, info='Load default vehicle types, removing all existing vehicle types.', - # bitmap = self.get_icon("route3_24px.png"), + #bitmap = self.get_icon("route3_24px.png"), ) # ---------------------------------------------------------------------- @@ -343,6 +348,8 @@ # ---------------------------------------------------------------------- self.add_menu_turnflow(menubar) # ---------------------------------------------------------------------- + self.add_menu_detectorflow(menubar) + # ---------------------------------------------------------------------- self.add_menu_pt(menubar) # ---------------------------------------------------------------------- @@ -350,30 +357,34 @@ bitmap=self.get_icon("trip3_24px.png"), ) - menubar.append_item('demand/trips and routes/trips to routes with fastest path', + menubar.append_item('demand/trips and routes/quickroute with fastest path', self.on_route, bitmap=self.get_icon("route3_24px.png"), ) - menubar.append_item('demand/trips and routes/trips to routes with fastest path, del. disconnected', - self.on_route_del_disconnected, - bitmap=self.get_icon("route3_24px.png"), - ) + # menubar.append_item( 'demand/trips and routes/trips to routes with fastest path, del. disconnected', + # self.on_route_del_disconnected, + # bitmap = self.get_icon("route3_24px.png"), + # ) - menubar.append_item('demand/trips and routes/trips to routes with duarouter', + menubar.append_item('demand/trips and routes/duarouter fastest route', self.on_duaroute, bitmap=self.get_icon("route3_24px.png"), ) - # menubar.append_item( 'demand/trips and routes/trips to routes with uncongested net ...', - # self.on_route_uncongested, - # bitmap = self.get_icon("route3_24px.png"), - # ) + menubar.append_item('demand/trips and routes/duarouter stochastic assignment...', + self.on_duaroute_stochastic, + bitmap=self.get_icon("route3_24px.png"), + ) # menubar.append_item( 'demand/trips and routes/trips to routes with congested net ...', # self.on_route_congested, # bitmap = self.get_icon("route3_24px.png"), # ) + menubar.append_item('demand/trips and routes/generate taxi trips...', + self.on_generate_taxitrips, + ) + menubar.append_item('demand/trips and routes/export trips to SUMO xml...', self.on_export_sumotrips, info='Export all trips to SUMO XML format.', @@ -388,26 +399,28 @@ menubar.append_item('demand/trips and routes/import trips from SUMO xml...', self.on_import_trips_xml, - info=self.on_import_trips_xml.__doc__.strip(), bitmap=self.get_agileicon("Document_Import_24px.png"), ) menubar.append_item('demand/trips and routes/import trips with routes from SUMO xml...', self.on_import_triproutes_xml, - info=self.on_import_triproutes_xml.__doc__.strip(), bitmap=self.get_agileicon("Document_Import_24px.png"), ) - menubar.append_item('demand/trips and routes/import routes to existing trips from SUMO xml...', + menubar.append_item('demand/trips and routes/import and overwrite routes to existing trips from SUMO xml...', + self.on_import_routes_overwrite_xml, + bitmap=self.get_agileicon("Document_Import_24px.png"), + ) + + menubar.append_item('demand/trips and routes/import and add routes to existing trips from SUMO xml...', self.on_import_routes_alternative_xml, - info=self.on_import_routes_alternative_xml.__doc__.strip(), bitmap=self.get_agileicon("Document_Import_24px.png"), ) menubar.append_item('demand/trips and routes/import trips from scenario...', self.on_import_trips_from_scenario, info='Import trips from another scenario', - bitmap=self.get_agileicon("Document_Import_24px.png"), + ## bitmap = self.get_agileicon("Document_Import_24px.png"), ) menubar.append_item('demand/trips and routes/clear all trips and routes', @@ -422,6 +435,11 @@ bitmap=wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_MENU), ) + menubar.append_item('demand/trips and routes/clear alternative routes', + self.on_clear_route_alternatves, + info='Clear alternative routes, only current route will remain.', + bitmap=wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_MENU), + ) # ---------------------------------------------------------------------- self.add_menu_virtualpop(menubar) @@ -433,73 +451,76 @@ bitmap=self.get_agileicon("Document_Export_24px.png"), ) - + menubar.append_item('demand/update all routes from SUMO xml...', + self.on_update_all_sumoroutes, + info='Update all routes available in the demand database from SUMO XML format. Note that no new routes are going to be imported.', + bitmap=self.get_agileicon("Document_Import_24px.png"), + ) # (self._menuitem_draw_route, id_item,) = menubar.append_item( -# 'plugins/traces/draw selected route in network', +## 'plugins/traces/draw selected route in network', # self.on_renew_objectbrowser, -# info='Enable visualization of routes in network tab. Double-click on trace in table.', +## info='Enable visualization of routes in network tab. Double-click on trace in table.', # check=True) # self._menuitem_draw_route.Check(False) -# +## # (self._menuitem_plot_route, id_item,) = menubar.append_item( -# 'plugins/traces/add plot selected route', +## 'plugins/traces/add plot selected route', # self.on_renew_objectbrowser, -# info='Enable adding of routes to graphics in trace tab. Double-click on trace in table.', +## info='Enable adding of routes to graphics in trace tab. Double-click on trace in table.', # check=True) # self._menuitem_plot_route.Check(False) def on_clear_vtypes(self, event=None): self._demand.vtypes.clear_vtypes() self._mainframe.browse_obj(self._demand.vtypes) - # if event: event.Skip() + #if event: event.Skip() def on_load_vtypes_defaults(self, event=None): self._demand.vtypes.clear_vtypes() + self._demand.vtypes.eprofiles.get_value().add_profiles_default() self._demand.vtypes.add_vtypes_default() self._mainframe.browse_obj(self._demand.vtypes) - # if event: event.Skip() + #if event: event.Skip() def on_clear_trips(self, event=None): self._demand.trips.clear_trips() self._mainframe.browse_obj(self._demand.trips) - # if event: event.Skip() def on_clear_routes(self, event=None): self._demand.trips.clear_routes() self._mainframe.browse_obj(self._demand.trips) - # if event: event.Skip() + + def on_clear_route_alternatves(self, event=None): + self._demand.trips.clear_route_alternatves() + self._mainframe.browse_obj(self._demand.trips) def on_route(self, event=None): """Generates routes from current trip info. Uses a python implementation of a fastest path router. """ # self._demand.trips.clear_routes() - self._demand.trips.route() + self._demand.trips.route(is_set_current=True) self._mainframe.browse_obj(self._demand.trips) - def on_route_del_disconnected(self, event=None): - """Generates routes from current trip info and deletes disconnected trips. Uses a python implementation of - a fastest path router. - """ - # self._demand.trips.clear_routes() - self._demand.trips.route(is_del_disconnected=True) - self._mainframe.browse_obj(self._demand.trips) + # def on_route_del_disconnected(self, event=None): + # """Generates routes from current trip info and deletes disconnected trips. Uses a python implementation of a fastest path router. + # """ + # #self._demand.trips.clear_routes() + # self._demand.trips.route(is_del_disconnected = True) + # self._mainframe.browse_obj(self._demand.trips) def on_duaroute(self, event=None): - """Generates routes from current trip info. Uses simple shortest path routing based on duarouter. + """Fastest route traffic assignment with duarouter. """ # self._demand.trips.clear_routes() self._demand.trips.duaroute(is_export_net=True, is_export_trips=True) self._mainframe.browse_obj(self._demand.trips) - def on_route_uncongested(self, event=None): - """Generates routes from current trip info using routing methods with uncongested network assumption. - Based on duarouter. + def on_generate_taxitrips(self, event=None): + """Stochastic traffic assignment with duarouter. """ - # self._demand.trips.clear_routes() - obj = routing.DuaRouter(self.get_scenario().net, - trips=self._demand.trips, - logger=self._mainframe.get_logger()) + obj = demand.TaxiGenerator(self._demand, + logger=self._mainframe.get_logger()) dlg = ProcessDialog(self._mainframe, obj) @@ -509,30 +530,21 @@ val = dlg.ShowModal() # print ' val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL # print ' status =',dlg.get_status() - if dlg.get_status() != 'success': # val == wx.ID_CANCEL: - # print ">>>>>>>>>Unsuccessful\n" - dlg.Destroy() if dlg.get_status() == 'success': - # print ">>>>>>>>>successful\n" dlg.apply() dlg.Destroy() self._mainframe.browse_obj(self._demand.trips) - # this should update all widgets for the new scenario!! - # print 'call self._mainframe.refresh_moduleguis()' - # self._mainframe.refresh_moduleguis() - - def on_route_congested(self, event=None): - """Generates routes from current trip info using routing methods with congested network assumption. - Based on marouter. + def on_duaroute_stochastic(self, event=None): + """Stochastic traffic assignment with duarouter. """ # self._demand.trips.clear_routes() - obj = routing.MacroRouter(self.get_scenario().net, - trips=self._demand.trips, - logger=self._mainframe.get_logger()) + obj = routing.DuaRouter(self.get_scenario().net, + trips=self._demand.trips, + logger=self._mainframe.get_logger()) dlg = ProcessDialog(self._mainframe, obj) @@ -542,12 +554,8 @@ val = dlg.ShowModal() # print ' val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL # print ' status =',dlg.get_status() - if dlg.get_status() != 'success': # val == wx.ID_CANCEL: - # print ">>>>>>>>>Unsuccessful\n" - dlg.Destroy() if dlg.get_status() == 'success': - # print ">>>>>>>>>successful\n" dlg.apply() dlg.Destroy() @@ -558,15 +566,15 @@ # self._mainframe.refresh_moduleguis() def on_import_vtypes_xml(self, event=None): - """Select xml file and import new vehicle types. + """Select xml file and import new vehicle types. """ filepath = self._demand.trips.get_routefilepath() - defaultFile = os.path.dirname(filepath) + # defaultFile = = os.path.dirname(filepath) dirpath = os.path.dirname(filepath) wildcards_all = 'XML files (*.xml)|*.xml|All files (*.*)|*.*' dlg = wx.FileDialog(None, message='Import vtypes from SUMO xml', defaultDir=dirpath, - defaultFile=defaultFile, + # defaultFile = =# defaultFile = , wildcard=wildcards_all, style=wx.SAVE | wx.CHANGE_DIR) if dlg.ShowModal() == wx.ID_OK: filepath = dlg.GetPath() @@ -578,16 +586,16 @@ self._mainframe.browse_obj(self._demand.vtypes) def on_import_trips_xml(self, event=None): - """Select xml file and import new trips. - New trips with associated routes will generated. + """Select xml file and import new trips. + New trips with associated routes will generated. """ filepath = self._demand.trips.get_routefilepath() - defaultFile = os.path.dirname(filepath) + # defaultFile = = os.path.dirname(filepath) dirpath = os.path.dirname(filepath) wildcards_all = 'XML trip files (*.trip.xml)|*.trip.xml|All files (*.*)|*.*' dlg = wx.FileDialog(None, message='Import trips and routes from SUMO xml', defaultDir=dirpath, - defaultFile=defaultFile, + # defaultFile = =# defaultFile = , wildcard=wildcards_all, style=wx.SAVE | wx.CHANGE_DIR) if dlg.ShowModal() == wx.ID_OK: filepath = dlg.GetPath() @@ -600,16 +608,16 @@ self._mainframe.browse_obj(self._demand.trips) def on_import_triproutes_xml(self, event=None): - """Select xml file and import trips and routes. - New trips with associated routes will generated. + """Select xml file and import trips and routes. + New trips with associated routes will generated. """ filepath = self._demand.trips.get_routefilepath() - defaultFile = os.path.dirname(filepath) + # defaultFile = = os.path.dirname(filepath) dirpath = os.path.dirname(filepath) wildcards_all = 'XML route files (*.rou.xml)|*.rou.xml|All files (*.*)|*.*' dlg = wx.FileDialog(None, message='Import trips and routes from SUMO xml', defaultDir=dirpath, - defaultFile=defaultFile, + # defaultFile = =# defaultFile = , wildcard=wildcards_all, style=wx.SAVE | wx.CHANGE_DIR) if dlg.ShowModal() == wx.ID_OK: filepath = dlg.GetPath() @@ -622,17 +630,43 @@ is_add=False) self._mainframe.browse_obj(self._demand.trips) + def on_import_routes_overwrite_xml(self, event=None): + """Select xml file and import routes. + Overwrite current routes of existing trips. + """ + filepath = self._demand.trips.get_routefilepath() + # defaultFile = = os.path.dirname(filepath) + dirpath = os.path.dirname(filepath) + wildcards_all = 'XML route files (*.rou.xml)|*.rou.xml|All files (*.*)|*.*' + dlg = wx.FileDialog(None, message='Import trips and routes from SUMO xml', + defaultDir=dirpath, + # defaultFile = =# defaultFile = , + wildcard=wildcards_all, style=wx.OPEN | wx.CHANGE_DIR + ) + + if dlg.ShowModal() == wx.ID_OK: + filepath = dlg.GetPath() + + else: + return + + self._demand.trips.import_routes_xml(filepath, is_clear_trips=False, + is_overwrite_only=True, + is_generate_ids=False, + is_add=False) + self._mainframe.browse_obj(self._demand.trips) + def on_import_routes_alternative_xml(self, event=None): - """Select xml file and import routes. - Routes will added as route alternative to existing trips. + """Select xml file and import routes. + Add routes as alternative of existing trips. """ filepath = self._demand.trips.get_routefilepath() - defaultFile = os.path.dirname(filepath) + # defaultFile = = os.path.dirname(filepath) dirpath = os.path.dirname(filepath) wildcards_all = 'XML route files (*.rou.xml)|*.rou.xml|All files (*.*)|*.*' dlg = wx.FileDialog(None, message='Import trips and routes from SUMO xml', defaultDir=dirpath, - defaultFile=defaultFile, + # defaultFile = =# defaultFile = , wildcard=wildcards_all, style=wx.OPEN | wx.CHANGE_DIR ) @@ -648,10 +682,10 @@ self._mainframe.browse_obj(self._demand.trips) def on_import_trips_from_scenario(self, event=None): - """Select xml file and import new vehicle types. + """Select xml file and import new vehicle types. """ filepath = self.get_scenario().get_rootfilepath() - # defaultFile = os.path.dirname(filepath) + # defaultFile = = os.path.dirname(filepath) dirpath = os.path.dirname(filepath) wildcards_all = "All files (*.*)|*.*" wildcards_obj = "Python binary files (*.obj)|*.obj" @@ -659,7 +693,7 @@ dlg = wx.FileDialog( self._mainframe, message="Open scenario file", defaultDir=dirpath, - defaultFile=filepath+'.obj', + # # defaultFile = = filepath+'.obj', wildcard=wildcards, style=wx.OPEN | wx.CHANGE_DIR ) @@ -675,12 +709,12 @@ def on_export_sumotrips(self, event=None): # print 'on_export_sumotrips' filepath = self._demand.trips.get_tripfilepath() - defaultFile = os.path.dirname(filepath) + # defaultFile = = os.path.dirname(filepath) dirpath = os.path.dirname(filepath) wildcards_all = '*.*|XML trip files (*.trip.xml)|*.trip.xml|All files (*.*)' dlg = wx.FileDialog(None, message='Write trips to SUMO xml', defaultDir=dirpath, - defaultFile=defaultFile, + # defaultFile = =# defaultFile = , wildcard=wildcards_all, style=wx.SAVE | wx.CHANGE_DIR) if dlg.ShowModal() == wx.ID_OK: filepath = dlg.GetPath() @@ -690,15 +724,36 @@ self._demand.trips.export_trips_xml(filepath) + def on_export_vtypes(self, event=None): + """ + Write vtypes to SUMO xml + """ + # print 'on_export_vtypes' + filepath = self._demand.trips.get_tripfilepath() + # defaultFile = = os.path.dirname(filepath) + dirpath = os.path.dirname(filepath) + wildcards_all = '*.*|XML vtype files (*.vtype.xml)|*.vtype.xml|All files (*.*)' + dlg = wx.FileDialog(None, message='Write vtypes to SUMO xml', + defaultDir=dirpath, + # defaultFile = =# defaultFile = , + wildcard=wildcards_all, style=wx.SAVE | wx.CHANGE_DIR) + if dlg.ShowModal() == wx.ID_OK: + filepath = dlg.GetPath() + + else: + return + + self._demand.vtypes.export_xml(filepath) + # def on_export_sumoroutes(self, event = None): # #print 'on_export_sumotrips' # filepath = self._demand.trips.get_routefilepath() - # defaultFile = os.path.basename(filepath) + # # defaultFile = = os.path.basename(filepath) # dirpath = os.path.dirname(filepath) # wildcards_all = 'XML route files (*rou.xml)|*rou.xml|All files (*.*)|*.*' # dlg = wx.FileDialog(None, message='Write routes to SUMO xml', # defaultDir=dirpath, - # defaultFile=defaultFile, + # # defaultFile = =# defaultFile = , # wildcard=wildcards_all, style=wx.SAVE | wx.CHANGE_DIR) # if dlg.ShowModal() == wx.ID_OK: # filepath = dlg.GetPath() @@ -711,12 +766,12 @@ def on_export_all_sumoroutes(self, event=None): # print 'on_export_sumotrips' filepath = self._demand.get_routefilepath() - defaultFile = os.path.basename(filepath) + # defaultFile = = os.path.basename(filepath) dirpath = os.path.dirname(filepath) wildcards_all = 'XML route files (*rou.xml)|*rou.xml|All files (*.*)|*.*' dlg = wx.FileDialog(None, message='Write all routes to SUMO xml', defaultDir=dirpath, - defaultFile=defaultFile, + # defaultFile = =# defaultFile = , wildcard=wildcards_all, style=wx.SAVE | wx.CHANGE_DIR) if dlg.ShowModal() == wx.ID_OK: filepath = dlg.GetPath() @@ -725,3 +780,21 @@ return self._demand.export_routes_xml(filepath) + + def on_update_all_sumoroutes(self, event=None): + # print 'on_export_sumotrips' + filepath = self._demand.get_routefilepath() + # defaultFile = = os.path.basename(filepath) + dirpath = os.path.dirname(filepath) + wildcards_all = 'XML route files (*rou.xml)|*rou.xml|All files (*.*)|*.*' + dlg = wx.FileDialog(None, message='Update all routes from SUMO xml', + defaultDir=dirpath, + # defaultFile = =# defaultFile = , + wildcard=wildcards_all, style=wx.OPEN | wx.CHANGE_DIR) + if dlg.ShowModal() == wx.ID_OK: + filepath = dlg.GetPath() + + else: + return + + self._demand.import_routes_xml(filepath) diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/__init__.py sumo-1.12.0/tools/contributed/sumopy/coremodules/__init__.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/__init__.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/__init__.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,6 +14,6 @@ # @file __init__.py # @author Joerg Schweizer -# @date +# @date 2012 __version__ = "0.0" diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/landuse/CREATE_ZONES.py sumo-1.12.0/tools/contributed/sumopy/coremodules/landuse/CREATE_ZONES.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/landuse/CREATE_ZONES.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/landuse/CREATE_ZONES.py 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,100 @@ +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. +# SUMOPy module +# Copyright (C) 2012-2021 University of Bologna - DICAM +# 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 CREATE_ZONES.py +# @author Joerg Schweizer +# @date 2012 + + +# CREATE GRID ZONES + + +def create_zones(n_zones, x_min, x_max, y_min, y_max): + zone_binx = np.int(np.sqrt(n_zones)) + zone_biny = np.int(np.sqrt(n_zones)) + zones = myscenario.landuse.zones + zones.clear() + + x_bin = (x_max-x_min)/(zone_binx) + y_bin = (y_max-y_min)/(zone_biny) + zone_name = 1 + for i in range(zone_binx): + for j in range(zone_biny): + shape = [[x_min+i*x_bin, y_min+j*y_bin, 0.], [x_min+i*x_bin, y_min+(j+1)*y_bin, 0.], [x_min+(i+1)*x_bin, y_min+( + j+1)*y_bin, 0.], [x_min+(i+1)*x_bin, y_min+j*y_bin, 0.], [x_min+i*x_bin, y_min+j*y_bin, 0.]] + zones.make(zonename=zone_name, coord=np.zeros(3, dtype=np.float32), shape=shape, id_landusetype=6) + zone_name += 1 + ids_zone = zones.get_ids() + for id_zone in ids_zone: + zones.identify_zonearea(id_zone) + # ~ if zones.areas[id_zone] == 0: + #~ zones.del_element(id_zone) + ids_zone = zones.get_ids() + return ids_zone + +# CREATE ZONES by CLUSTER OF POINTS + + print 'k-value cluster' + # k-value cluster + # https://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.vq.kmeans.html + + features = np.array(origin_dest_points) + print 'features', features + # Whiten data + st_dev_x = np.std(features[:][0]) + st_dev_y = np.std(features[:][1]) + print 'st_dev_x', st_dev_x + print 'st_dev_y', st_dev_y + + whitened = whiten(features) + # Find 2 clusters in the data + codebook, distortion = kmeans(features, n_zones) + print 'codebook', codebook + + features[:, 0] = features[:, 0]*st_dev_x + features[:, 1] = features[:, 1]*st_dev_y + codebook[:, 0] = codebook[:, 0]*st_dev_x + codebook[:, 1] = codebook[:, 1]*st_dev_y + + # Plot whitened data and cluster centers in red + plt.scatter(features[:, 0], features[:, 1]) + plt.scatter(codebook[:, 0], codebook[:, 1], c='r') + # Create and plot zones Voronoy + vor = Voronoi(codebook) + fig = voronoi_plot_2d(vor) + plt.show() + + # Create zones ON SUMOPY + # myscenario.landuse.zones.clear() + vertices = vor.vertices + regions = vor.regions + print vertices + print regions + zone_name = 1 + for region in regions: + if region != []: + shape = [] + for vertice in region: + shape.append([vertices[vertice][0], vertices[vertice][1], 0.]) + ids_zone = myscenario.landuse.zones.get_ids() + print 'n_zones =', len(ids_zone) + print shape + zone_name += 1 + # np.concatenate(shape).astype(None) + print shape + myscenario.landuse.zones.make(zonename='zone_name', coord=np.zeros( + 3, dtype=np.float32), shape=shape, id_landusetype=6) + ids_zone = myscenario.landuse.zones.get_ids() + zones_shape = myscenario.landuse.zones.shapes[ids_zone] + # ~ #plt.scatter(zones_shape[0], zones_shape[1]) diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/landuse/__init__.py sumo-1.12.0/tools/contributed/sumopy/coremodules/landuse/__init__.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/landuse/__init__.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/landuse/__init__.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file __init__.py # @author Joerg Schweizer -# @date +# @date 2012 __version__ = "0.0" diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/landuse/landuse.py sumo-1.12.0/tools/contributed/sumopy/coremodules/landuse/landuse.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/landuse/landuse.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/landuse/landuse.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,8 +14,21 @@ # @file landuse.py # @author Joerg Schweizer -# @date +# @date 2012 +import maps +from agilepy.lib_base.processes import Process, CmlMixin +from collections import OrderedDict +from numpy import random +import numpy as np +from coremodules.misc.shapeformat import ShapefileImporter +from coremodules.network.network import SumoIdsConf, MODES +from agilepy.lib_base.misc import string_to_float +from agilepy.lib_base.geometry import * +import agilepy.lib_base.xmlman as xm +import agilepy.lib_base.arrayman as am +import agilepy.lib_base.classman as cm +from coremodules.modules_common import * import os import sys import time @@ -28,19 +41,18 @@ APPDIR = os.path.dirname(os.path.abspath(sys.argv[0])) SUMOPYDIR = os.path.join(APPDIR, '..', '..') sys.path.append(SUMOPYDIR) - - -import numpy as np -from numpy import random -from collections import OrderedDict -from coremodules.modules_common import * -import agilepy.lib_base.classman as cm -import agilepy.lib_base.arrayman as am -import agilepy.lib_base.xmlman as xm -from agilepy.lib_base.geometry import * -from agilepy.lib_base.processes import Process, CmlMixin -from coremodules.network.network import SumoIdsConf, MODES -import maps +try: + import pyproj +except: + from mpl_toolkits.basemap import pyproj + +#from coremodules.network.routing import get_mincostroute_edge2edges + +try: + from shapely.geometry import MultiPoint, Polygon + IS_SHAPELY = True +except: + IS_SHAPELY = False def clean_osm(filepath_in, filepath_out): @@ -89,12 +101,6 @@ # info = 'Name of facility type used as reference in OSM.', # )) - self.add_col(am.ListArrayConf('osmfilters', - perm='r', - name='OSM filter', - info='List of openstreetmap filters that allow to identify this facility type.', - )) - self.add_col(am.ArrayConf('colors', np.ones(4, np.float32), dtype=np.float32, metatype='color', @@ -111,10 +117,37 @@ info='Information about this landuse.', )) + self.add_col(am.ArrayConf('are_area', False, + perm='rw', + name='is area', + info='True if this is an area of particular use, instead of a single facility. An area can include several facilities. If False, then it is dealt with a single facility.', + )) + + self.add_col(am.ListArrayConf('osmfilters', + perm='r', + name='OSM filter', + info='List of openstreetmap filters that allow to identify this facility type.', + )) + + # this will remove all previous and setnw if len(self) > 0: self.clear() self.add_types_default() + def get_landusetype_facility_from_area(self, id_landuse_area): + # get typekey + typekey_area = self.typekeys[id_landuse_area] + typekey_info = typekey_area.split('_') + if len(typekey_info) == 2: + if typekey_info[1] == 'area': + return self.typekeys.get_id_from_index(typekey_info[0]) + else: + # no area, return unchanged + return id_landuse_area + else: + # no area, return unchanged + return id_landuse_area + def format_ids(self, ids): return ','.join(self.typekeys[ids]) @@ -127,35 +160,43 @@ def add_types_default(self): # default types self.add_row(typekeys='leisure', - descriptions='Areas which offer leasure type activities', - osmfilters=['sport', 'leisure.park', 'park'], + descriptions='Facilities which offer leasure type activities', + osmfilters=['historic.church', 'building.church', 'sport', 'sport.*'], colors=(0.2, 0.5, 0.3, 0.7) ) + # leisure.nature_reserve is actually an area so remove 'leisure.*' + self.add_row(typekeys='commercial', - descriptions='Areas with trade, offices, banks, shopping opportunitties, etc.', - osmfilters=['shop.*', 'building.commercial'], + descriptions='Facility with trade, offices, banks, shopping opportunitties, etc.', + osmfilters=['building.hospital', 'building.retail', 'building.shop', + 'building.restaurant', 'building.cafe', 'restaurant', 'shop.*', 'building.commercial', ], colors=(0.6171875, 0.6171875, 0.875, 0.7), ) + self.add_row(typekeys='industrial', - descriptions='Areas with industrial production facilities.', + descriptions='industrial production facilities.', osmfilters=['building.industrial'], colors=(0.89453125, 0.65625, 0.63671875, 0.7), ) + self.add_row(typekeys='parking', - descriptions='Areas reserved for car parking.', - osmfilters=['building.parking', 'amenity.parking'], + descriptions='Areas reserved for car parking. This can be either area or building.', + osmfilters=['building.parking', ], colors=(0.52734375, 0.875, 0.875, 0.7), ) + self.add_row(typekeys='residential', - descriptions='Residential Areas', - osmfilters=['building.*', 'building'], + descriptions='Facilities with residential use', + osmfilters=['building.house', 'building.apartments', 'building.*', 'building'], colors=(0.921875, 0.78125, 0.4375, 0.7), ) + self.add_row(typekeys='mixed', - descriptions='Areas with mixed land use, which cannot be clearly assigned to one of the other landuse types.', + descriptions='Facilities with mixed land use, which cannot be clearly assigned to one of the other landuse types.', osmfilters=[], colors=(0.5, 0.9, 0.5, 0.7), ) + self.add_row(typekeys='sink', descriptions='Areas where vehicles disappear (evaporate). These zones are used for turn-flow demand models in order to avoid the creation of routes with loops.', osmfilters=[], @@ -163,8 +204,59 @@ ) self.add_row(typekeys='education', descriptions='Educational facilities such as schools, universities', - osmfilters=['building.scool', 'building.university'], + # with amenity and landuse, we should look inside and assign all buildings + osmfilters=['building.school', 'building.university'], + colors=(0.89453125, 0.65625, 0.89453125, 0.7), + ) + + self.add_row(typekeys='leisure_area', + descriptions='Areas on which leasure type activitiesbare offered', + osmfilters=['leisure.park', 'park', 'amenity.park', + 'landuse.park', 'amenity.sport', 'landuse.sport'], + are_area=True, + colors=(0.2, 0.5, 0.3, 0.7) + ) + + self.add_row(typekeys='industrial_area', + descriptions='Area with industrial production facilities.', + osmfilters=['amenity.industrial', 'landuse.industrial', ], + are_area=True, + colors=(0.89453125, 0.65625, 0.63671875, 0.7), + ) + + self.add_row(typekeys='commercial_area', + descriptions='Areas with trade, offices, banks, shopping opportunitties, or other customer services.', + osmfilters=['amenity.hospital', 'amenity.commercial', 'landuse.commercial', ], + colors=(0.6171875, 0.6171875, 0.875, 0.7), + are_area=True, + ) + + self.add_row(typekeys='residential_area', + descriptions='Areas with residential facilities.', + osmfilters=['amenity.residential', 'landuse.residential'], colors=(0.921875, 0.78125, 0.4375, 0.7), + are_area=True, + ) + + self.add_row(typekeys='mixed_area', + descriptions='Facilities with mixed land use, which cannot be clearly assigned to one of the other landuse types.', + osmfilters=[], + colors=(0.5, 0.9, 0.5, 0.7), + are_area=True, + ) + + self.add_row(typekeys='education_area', + descriptions='Educational facilities such as schools, universities', + osmfilters=['landuse.university', 'landuse.school', 'amenity.school', 'amenity.university'], + colors=(0.89453125, 0.65625, 0.89453125, 0.7), + are_area=True, + ) + + self.add_row(typekeys='parking_area', + descriptions='Areas reserved for car parking. This can be either area or building.', + osmfilters=['amenity.parking'], + colors=(0.52734375, 0.875, 0.875, 0.7), + are_area=True, ) @@ -174,15 +266,24 @@ name='Zones', info='Traffic Zones which can be used for zone-to-zone traffic transport demand or to specify zones for traffic evaporation.', is_plugin=True, - version=0.1, + version=0.3, **kwargs) self._init_attributes() + self._init_constants() def _init_attributes(self): - # print 'Zones._init_attributes',hasattr(self,'are_evaporate') + # print 'Zones._init_attributes',hasattr(self,'are_evaporate'),'version',self.get_version() edges = self.parent.get_net().edges - self.add_col(SumoIdsConf('Zone', name='Name', perm='rw')) + self.add_col(SumoIdsConf('Zone', name='Name', perm='rw', info='Unique short name or ID to identify zone.')) + + self.add_col(am.ArrayConf('names_extended', '', + dtype=np.object, + groupnames=['parameter'], + perm='rw', + name='Extended name', + info='Extended, human readable name, no uniqueness required, not used as key.', + )) self.add_col(am.IdsArrayConf('ids_landusetype', self.parent.landusetypes, id_default=6, @@ -212,30 +313,69 @@ is_plugin=True, )) - self.add_col(am.IdlistsArrayConf('ids_edges_orig', edges, - groupnames=['state'], - name='IDs orig edges', - info='List with IDs of network edges that can be used as origins for trips in this zone.', - )) + self.add_col(am.ListArrayConf('areas', + groupnames=['state'], + perm='rw', + name='Area', + unit='km^2', + info='Area of the zone in square kilometers.', + is_plugin=True, + )) - self.add_col(am.IdlistsArrayConf('ids_edges_dest', edges, + # self.add_col(am.IdlistsArrayConf( 'ids_edges_orig', edges, + # groupnames = ['state'], + # name = 'IDs orig edges', + # info = 'List with IDs of network edges that can be used as origins for trips in this zone.', + # )) + + # self.add_col(am.IdlistsArrayConf( 'ids_edges_dest', edges, + # groupnames = ['state'], + # name = 'IDs dest edges', + # info = 'List with IDs of network edges that can be used as origins for trips in this zone.', + # )) + + if self.get_version() < 0.2: + self.delete('priority_max') + self.delete('speed_max') + self.delete('n_edges_min_length') + self.delete('n_edges_max_length') + + # self.add_col(am.ListArrayConf( 'probs_edges_orig', + # groupnames = ['_private'], + # #perm='rw', + # name = 'edge probs origin', + # info = 'Probabilities of edges to be at the origin of a trip departing from this zone.', + # )) + # self.add_col(am.ListArrayConf( 'probs_edges_dest', + # groupnames = ['_private'], + # #perm='rw', + # name = 'edge probs dest', + # info = 'Probabilities of edges to be a destination of a trip arriving at this zone.', + # )) + + self.add_col(am.IdlistsArrayConf('ids_edges_inside', edges, groupnames=['state'], - name='IDs dest edges', - info='List with IDs of network edges that can be used as origins for trips in this zone.', + name='Edge IDs inside', + info='List with IDs of network edges that are entirely inside each zone.', )) - self.add_col(am.ListArrayConf('probs_edges_orig', - groupnames=['_private'], - # perm='rw', - name='edge probs origin', - info='Probabilities of edges to be at the origin of a trip departing from this zone.', - )) - self.add_col(am.ListArrayConf('probs_edges_dest', - groupnames=['_private'], - # perm='rw', - name='edge probs dest', - info='Probabilities of edges to be a destination of a trip arriving at this zone.', - )) + if self.get_version() < 0.3: + ids = self.get_ids() + self.ids_edges_inside[ids] = self.ids_edges_orig[ids] + self.delete('ids_edges_dest') + self.delete('ids_edges_orig') + self.delete('probs_edges_orig') + self.delete('probs_edges_dest') + + self.set_version(0.3) + + def _init_constants(self): + self._proj = None + self._offset = None + self._mode_to_edges_inside = {} + attrsman = self.get_attrsman() + attrsman.do_not_save_attrs(['_proj', '_offset', '_mode_to_edges_inside']) + # self.set_version(0.2) def make(self, zonename='', coord=np.zeros(3, dtype=np.float32), @@ -249,7 +389,7 @@ self.get_coords_from_shape(shape) id_zone = self.add_row(coords=self.get_coords_from_shape(shape), - shapes=shape, + shapes=shape, areas=find_area(shape)/1000000., ids_landusetype=id_landusetype, ) if zonename == '': @@ -281,12 +421,29 @@ self.del_row(id_zone) def get_edges(self): - return self.ids_edges_dest.get_linktab() + return self.ids_edges_inside.get_linktab() + + def update_zones(self): + """Update all dependent attributes of all zones""" + ids = self.get_ids() + for id_zone, shape in zip(ids, self.shapes[ids]): + self.coords[id_zone] = self.get_coords_from_shape(shape) + self.areas[id_zone] = find_area(shape)/1000000.0 + self.identify_zoneedges(id_zone) def refresh_zoneedges(self): for _id in self.get_ids(): self.identify_zoneedges(_id) - self.make_egdeprobs(_id) + # self.make_egdeprobs(_id) + self.coords[_id] = self.get_coords_from_shape(self.shapes[_id]) + + def refresh_zonearea(self): + """ + Update the area of each zone + """ + ids_zone = self.get_ids() + for id_zone in ids_zone: + self.identify_zonearea(id_zone) def update_netoffset(self, deltaoffset): """ @@ -301,89 +458,346 @@ s[:, :2] = s[:, :2] + deltaoffset shapes[i] = list(s) + def identify_zonearea(self, id_zone): + # print 'identify_zonearea',id_zone + shape = self.shapes[id_zone] + self.areas[id_zone] = find_area(shape)/1000000.0 + def identify_zoneedges(self, id_zone): - # print 'identify_zoneedges',id_zone - inds_within = [] - ind = 0 - # print ' self.shapes[id_zone]',self.shapes[id_zone] - - polygon = np.array(self.shapes[id_zone])[:, :2] - for polyline in self.get_edges().shapes.value: - # print ' polygon',polygon,type(polygon) - # print ' np.array(polyline)[:,:2]',np.array(polyline)[:,:2],type(np.array(polyline)[:,:2]) - if is_polyline_in_polygon(np.array(polyline)[:, :2], polygon): - inds_within.append(ind) - ind += 1 - - # print ' inds_within',inds_within - - # select and determine weights - self.ids_edges_orig[id_zone] = self.get_edges().get_ids(inds_within) - self.ids_edges_dest[id_zone] = self.get_edges().get_ids(inds_within) + print 'identify_zoneedges of id_zone', id_zone + + if len(self.shapes[id_zone]) >= 3: + # must have at least 3 vertices to be an area + + inds_within = [] + ind = 0 + # print ' self.shapes[id_zone]',self.shapes[id_zone] + if not IS_SHAPELY: + polygon = np.array(self.shapes[id_zone])[:, :2] + # print ' polygon',type(polygon) + for polyline in self.get_edges().shapes.get_value(): + + # print ' np.array(polyline)[:,:2]',np.array(polyline)[:,:2],type(np.array(polyline)[:,:2]) + if is_polyline_in_polygon(np.array(polyline)[:, :2], polygon): + inds_within.append(ind) + ind += 1 + else: + polygon = Polygon(np.array(self.shapes[id_zone])[:, :2]) + for polyline in self.get_edges().shapes.get_value(): + if MultiPoint(np.array(polyline)[:, :2]).within(polygon): + inds_within.append(ind) + ind += 1 + + # print ' inds_within',inds_within + + # select and determine weights + self.ids_edges_inside[id_zone] = self.get_edges().get_ids(inds_within) + print ' found', len(self.ids_edges_inside[id_zone]), 'edges' + if len(self.ids_edges_inside[id_zone]) == 0: + print 'WARNING in identify_zoneedges: no edges found in zone', id_zone + + def get_zoneedges_by_mode_fast(self, id_zone, id_mode, speed_max=None, + modeconst_excl=0.0, modeconst_mix=0.0, + weights=None, fstar=None): + """ + Returns a list of edge IDs which are connected and accessible by mode id_mode. + Uses cashed results, if possible. + + Optionally weights and fstar can be provided to improve computational speed. + Otherwise weights and fstar are calculated with the optional parameters + modeconst_excl and modeconst_mix + """ + + # print 'get_zoneedges_by_mode_fast id_zone',id_zone,'id_mode',id_mode + if not self._mode_to_edges_inside.has_key(id_mode): + self._mode_to_edges_inside[id_mode] = {} + + if not self._mode_to_edges_inside[id_mode].has_key(id_zone): + self._mode_to_edges_inside[id_mode][id_zone] = self.get_zoneedges_by_mode( + id_zone, id_mode, weights=weights, fstar=fstar) + # print ' found edges',len(self._mode_to_edges_inside[id_mode][id_zone]) + return self._mode_to_edges_inside[id_mode][id_zone] + + def get_zoneedges_by_mode(self, id_zone, id_mode, speed_max=None, + modeconst_excl=0.0, modeconst_mix=0.0, + weights=None, fstar=None): + """ + Returns a list of edge IDs which are connected and accessible by mode id_mode. + The algorithm tries to maximize the number of reachabe edges. + + Optionally weights and fstar can be provided to improve computational speed. + Otherwise weights and fstar are calculated with the optional parameters + modeconst_excl and modeconst_mix + """ + # print 'get_zoneedges_by_mode id_zone',id_zone,'id_mode',id_mode + + return self.get_edges().get_max_connected( + ids_edge=self.ids_edges_inside[id_zone], + id_mode=id_mode, speed_max=speed_max, + modeconst_excl=modeconst_excl, + modeconst_mix=modeconst_mix, + weights=weights, fstar=fstar, + is_bidir=True) + + def get_egdeprobs(self, id_zone, n_edges_min_length, n_edges_max_length, priority_max, speed_max, is_normalize=True, is_dict=False): + """ + OBSOLETE!!! + Returns vectors ids_edge and edge_props + where ids_edge are the edge IDs of edges in id_zone and edge_props are + the respective probabilities to start/end a trip + + if is_dict is True then a dictionary is returnd with edge IDs as key + and arrival/departure probability as value + """ + # todo: rename ids_edges_orig to simply ids_edges + ids_edge_orig = self.ids_edges_orig[id_zone] + if ids_edge_orig is None: + print 'WARNING: no edges in zone', id_zone, '. Run edge detection first.' + if is_dict: + return {} + else: + return [], [] + + n_edges_orig = len(ids_edge_orig) + + if n_edges_orig > 0: + weights = self.get_edgeweights(ids_edge_orig, n_edges_min_length, + n_edges_max_length, priority_max, speed_max) + if is_normalize: + weights = weights/np.sum(weights) + if is_dict: + probs = {} + for id_edge, prob in zip(ids_edge_orig, weights): + probs[id_edge] = prob + return probs + else: + return ids_edge_orig, weights + else: + if is_dict: + return {} + else: + return [], [] - def make_egdeprobs(self, id_zone): + def make_egdeprobs(self, id_zone, n_edges_min_length, n_edges_max_length, priority_max, speed_max, is_normalize=True): """ - Returns two dictionaries with normalized edge weight distribution + OBSOLETE!!! This funzione has moved to origin_to_destination + Update probs_edges_orig and probs_edges_dest distribution one for departures and one for arrivals. - - The dictionaries have id_zone as key and a and an array of edge weights as value. """ + + # print 'make_egdeprobs',id_zone #zones = self.zones.value #edgeweights_orig = {} #edgeweights_dest = {} # for id_zone in zones.get_ids(): - n_edges_orig = len(self.ids_edges_orig[id_zone]) - n_edges_dest = len(self.ids_edges_dest[id_zone]) + ids_edge_orig = self.ids_edges_orig[id_zone] + ids_edge_dest = self.ids_edges_dest[id_zone] + n_edges_orig = len(ids_edge_orig) + n_edges_dest = len(ids_edge_dest) # da fare meglio... if n_edges_orig > 0: - self.probs_edges_orig[id_zone] = 1.0/float(n_edges_orig)*np.ones(n_edges_orig, np.float) + #self.probs_edges_orig[id_zone] = 1.0/float(n_edges_orig)*np.ones(n_edges_orig,np.float) + weights = self.get_edgeweights(ids_edge_orig, n_edges_min_length, + n_edges_max_length, priority_max, speed_max) + if is_normalize: + self.probs_edges_orig[id_zone] = weights/np.sum(weights) + else: + self.probs_edges_orig[id_zone] = weights else: - self.probs_edges_orig[id_zone] = 1.0 + self.probs_edges_orig[id_zone] = [] if n_edges_dest > 0: - self.probs_edges_dest[id_zone] = 1.0/float(n_edges_dest)*np.ones(n_edges_dest, np.float) + #self.probs_edges_dest[id_zone] = 1.0/float(n_edges_dest)*np.ones(n_edges_dest,np.float) + weights = self.get_edgeweights(ids_edge_dest, n_edges_min_length, + n_edges_max_length, priority_max, speed_max) + if is_normalize: + self.probs_edges_dest[id_zone] = weights/np.sum(weights) + else: + self.probs_edges_dest[id_zone] = weights + else: + self.probs_edges_dest[id_zone] = [] + + def get_edgeweights(self, ids_edge, n_edges_min_length, n_edges_max_length, priority_max, speed_max): + # OBSOLETE!!! This funzione has moved to origin_to_destination + # print 'get_edgeweights ids_edge',ids_edge + edges = self.get_edges() + n_edges = len(ids_edge) + if (n_edges > n_edges_min_length) & (n_edges < n_edges_max_length): + return edges.lengths[ids_edge]*((edges.priorities[ids_edge] < priority_max) & (edges.speeds_max[ids_edge] < speed_max)) else: - self.probs_edges_dest[id_zone] = 1.0 + return np.ones(n_edges, dtype=np.float32)*((edges.priorities[ids_edge] < priority_max) & (edges.speeds_max[ids_edge] < speed_max)) - def export_evaporator_xml(self, filepath=None, encoding='UTF-8'): + def write_kml(self, fd=None, indent=0): + + ids_zone = self.get_ids() + for id_zone in ids_zone: + fd.write(xm.begin('Placemark', indent + 2)) + fd.write((indent + 4)*' '+'%s\n' % self.names_extended[id_zone]) + fd.write(xm.begin('LineString', indent + 4)) + fd.write(xm.begin('coordinates', indent + 6)) + + for point in self.shapes[id_zone]: + + projection = self.project(point[0], point[1]) + fd.write((indent+8)*' '+'%f,%f\n' % (projection[0], projection[1])) + + fd.write(xm.end('coordinates', indent + 6)) + fd.write(xm.end('LineString', indent + 4)) + fd.write(xm.end('Placemark', indent + 2)) + + def write_xml(self, fd=None, indent=0): + print 'Zones.write_xml' + net = self.parent.parent.net + ids_edge_sumo = net.edges.ids_sumo + ids_zone = self.get_ids() + fd.write(xm.begin('tazs', indent)) + for id_zone_sumo, shape, id_edges_orig, id_edges_dest, probs_edge_orig, probs_edge_dest in zip( + self.ids_sumo[ids_zone], self.shapes[ids_zone], + self.ids_edges_orig[ids_zone], self.ids_edges_dest[ids_zone], + self.probs_edges_orig[ids_zone], self.probs_edges_dest[ids_zone]): + + if id_edges_orig is not None: + if len(id_edges_orig) > 0: + # print ' id_zone_sumo',id_zone_sumo,'id_edges_orig',id_edges_orig,'probs_edge_orig',probs_edge_orig + # + # + # ... further source edges ... + # + # + # ... further destination edges ... + # + + fd.write(xm.start('taz', indent + 2)) + fd.write(xm.num('id', id_zone_sumo)) + fd.write(xm.mat('shape', shape)) + fd.write(xm.stop()) + # for id_edge_sumo, prob_edge in zip(ids_edge_sumo[id_edges_orig], probs_edge_orig): + # fd.write(xm.start('tazSource',indent + 4)) + # fd.write(xm.num('id',id_edge_sumo)) + # fd.write(xm.num('weight',prob_edge)) + # fd.write(xm.stopit()) + # + # for id_edge_sumo, prob_edge in zip(ids_edge_sumo[id_edges_dest], probs_edge_dest): + # fd.write(xm.start('tazSink',indent + 4)) + # fd.write(xm.num('id',id_edge_sumo)) + # fd.write(xm.num('weight',prob_edge)) + # fd.write(xm.stopit()) + + fd.write(xm.end('taz', indent + 2)) + + fd.write(xm.end('tazs', indent)) + + def project(self, x, y): + if self._proj is None: + self._proj, self._offset = self.get_proj_and_offset() + lons, lats = self._proj(x-self._offset[0], y-self._offset[1], inverse=True) + return np.transpose(np.concatenate(([lons], [lats]), axis=0)) + + def get_proj_and_offset(self): + if self._proj is None: + net = self.parent.parent.net + proj_params = str(net.get_projparams()) + # try: + self._proj = pyproj.Proj(proj_params) + # except: + # proj_params ="+proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" + # self._proj = pyproj.Proj(self.proj_params) + + self._offset = net.get_offset() + + return self._proj, self._offset + + def get_zonefilepath(self): + return self.parent.parent.get_rootfilepath()+'.taz' + + def export_kml(self, filepath=None, encoding='UTF-8'): """ - Export trips to SUMO xml file. - Method takes care of sorting trips by departure time. + Export zones to Google kml file formate. """ + print 'export_sumoxml', filepath, len(self) + if len(self) == 0: + return None + if filepath is None: - filepath = self.get_tripfilepath() - print 'export_trips_xml', filepath + filepath = self.get_zonefilepath()+'.kml' + try: fd = open(filepath, 'w') except: print 'WARNING in write_obj_to_xml: could not open', filepath return False - + #xmltag, xmltag_item, attrname_id = self.xmltag fd.write('\n' % encoding) - fd.write(xm.begin('???')) - indent = 2 + fd.write('\n') + indent = 0 + #fd.write(xm.begin('routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.sf.net/xsd/routes_file.xsd"',indent)) - for id_zone in self.select_ids(self.are_evaporate.value): + fd.write(xm.begin('Document', indent=0)) - inds_selected[ids_vtype == id_vtype] = False - ids_trip_selected = ids_trip[inds_selected] - ids_vtype_selected = set(ids_vtype[inds_selected]) - #ids_vtypes_selected = set(ids_vtypes).difference(ids_vtypes_exclude) - - self.parent.vtypes.write_xml(fd, indent=indent, - ids=ids_vtype_selected, - is_print_begin_end=False) - - self.write_xml(fd, indent=indent, - ids=ids_trip_selected, - attrconfigs_excluded=[self.routes, self.ids_routes], - is_print_begin_end=False) + self.write_kml(fd, indent=0) - fd.write(xm.end(xmltag)) + fd.write(xm.end('Document', indent=0)) + fd.write(xm.end('kml', indent=0)) fd.close() return filepath + def export_sumoxml(self, filepath=None, encoding='UTF-8'): + """ + Export zones to SUMO xml file formate. + """ + print 'export_sumoxml', filepath, len(self) + if len(self) == 0: + return None + + if filepath is None: + filepath = self.get_zonefilepath()+'.xml' + + try: + fd = open(filepath, 'w') + except: + print 'WARNING in export_sumoxml: could not open', filepath + return False + #xmltag, xmltag_item, attrname_id = self.xmltag + #fd.write('\n'%encoding) + #fd.write('\n') + indent = 0 + #fd.write(xm.begin('routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.sf.net/xsd/routes_file.xsd"',indent)) + + self.write_xml(fd, indent=0) + + fd.close() + return filepath + + +class ZonesFromShapeImporter(ShapefileImporter): + def __init__(self, ident='zonesfromshapeimporter', zones=None, + name='Zones from Shapefile importer', + shapeattr_ids_zone='ID', + shapeattr_names_zone='', + shapeattr_names_landuse='', + filepath='', logger=None, **kwargs): + + net = zones.parent.parent.net + ShapefileImporter.__init__(self, ident, parent=zones, + name=name, + filepath=filepath, + coordsattr='shapes', + attrnames_to_shapeattrs={'ids_sumo': shapeattr_ids_zone, + 'names_extended': shapeattr_names_zone, + 'ids_landusetype': shapeattr_names_landuse}, + projparams_target=net.get_projparams(), + offset=net.get_offset(), + boundaries=net.get_boundaries(is_netboundaries=True), + logger=logger, + **kwargs) + + def do(self): + ShapefileImporter.do(self) + + # update zones + self.parent.update_zones() + class FacilityTypeMixin(cm.BaseObjman): def __init__(self, ident, parent, @@ -701,6 +1115,7 @@ **kwargs) self._init_attributes() + self._init_constants() if net is not None: self.add_col(am.IdsArrayConf('ids_roadedge_closest', net.edges, @@ -725,6 +1140,13 @@ # info = 'List of IDs of closest public transport stops.', # )) + def _init_constants(self): + self._proj = None + self._offset = None + + attrsman = self.get_attrsman() + attrsman.do_not_save_attrs(['_proj', '_offset']) + def _init_attributes(self): landusetypes = self.parent.landusetypes zones = self.parent.zones @@ -732,6 +1154,14 @@ self.add_col(SumoIdsConf('Facility', info='SUMO facility ID')) + self.add_col(am.ArrayConf('names', '', + dtype='object', # actually a string of variable length + perm='rw', + name='Name', + info='Name of facility.', + is_plugin=True, + )) + self.add_col(am.IdsArrayConf('ids_landusetype', landusetypes, groupnames=['landuse'], perm='rw', @@ -892,7 +1322,7 @@ # print 'del_element',id_zone self.del_row(id_fac) - def write_xml(self, fd, indent=0, is_print_begin_end=True): + def write_xml(self, fd, indent=0, is_print_begin_end=True, delta=np.zeros(3, dtype=np.float32)): xmltag, xmltag_item, attrname_id = self.xmltag layer_default = -1 fill_default = 1 @@ -902,12 +1332,16 @@ if is_print_begin_end: fd.write(xm.begin(xmltag, indent)) - attrsconfigs_write = [self.ids_sumo, self.osmkeys, self.shapes] + attrsconfigs_write = [self.ids_sumo, self.osmkeys] + xmltag_shape = self.shapes.xmltag + sep_shape = self.shapes.xmlsep for _id in self.get_ids(): fd.write(xm.start(xmltag_item, indent+2)) for attrsconfig in attrsconfigs_write: attrsconfig.write_xml(fd, _id) + fd.write(xm.mat(xmltag_shape, self.shapes[_id] - delta)) + landusecolors.write_xml(fd, ids_landusetype[_id]) fd.write(xm.num('layer', layer_default)) fd.write(xm.num('fill', fill_default)) @@ -990,6 +1424,58 @@ return probabilities, self.get_ids(inds_fac) + def get_departure_probabilities_landuse2(self, ids_landusetype): + """ + Returns a dictionary, where probabilities[id_zone] + is a vector of departure probabilities for each facility + of zone id_zone. + Probabilities are proportional to the capacity attribute of the facility. + + Only facilities with one of the landuse given in ids_landusetype + have non-zero probabilities. + + The ids_fac is an array that contains the facility ids in correspondence + to the probability vector. + """ + print 'get_departure_probabilities_landuse2 ids_landusetype', ids_landusetype + probabilities = {} + zones = self.ids_zone.get_linktab() + inds_fac = self.get_inds() + n_frac = len(inds_fac) + for id_zone in zones.get_ids(): + # probabilities[id_zone]={} + utils = np.zeros(n_frac, dtype=np.float32) + util_tot = 0.0 + for id_landusetype in ids_landusetype: + # print ' id_zone,id_landusetype',id_zone,id_landusetype + # print ' ids_landusetype',self.ids_landusetype.value[inds_fac] + # print ' ids_zone',self.ids_zone.value[inds_fac] + # print '' + utils_new = self.capacities.value[inds_fac].astype( + np.float32)*np.logical_and((self.ids_landusetype.value[inds_fac] == id_landusetype), (self.ids_zone.value[inds_fac] == id_zone)) + utils += utils_new + util_tot += np.sum(utils_new) + # print '\n\n [id_taz][ftype]',id_taz,ftype,util_tot,np.sum(util/np.sum(util)) + # print ' self.type==ftype',self.type==ftype + # print ' self.id_taz==id_taz',self.id_taz==id_taz + # print ' util',np.sum(utils) + + if util_tot > 0.0: + probabilities[id_zone] = utils/util_tot + else: + probabilities[id_zone] = utils # all zero prob + + if 0: # debug + print ' sum(probs)', np.sum(probabilities[id_zone]) + if np.sum(probabilities[id_zone]) > 0: + ids_fac = self.get_ids(inds_fac) + for id_fac, id_landusetype, id_thiszone, prob in zip(ids_fac, self.ids_landusetype[ids_fac], self.ids_zone[ids_fac], probabilities[id_zone]): + if (id_thiszone == id_zone): # & (id_landusetype in ids_landusetype): + if prob > 0: + print ' id_fac', id_fac, 'id_landusetype', id_landusetype, 'prob', prob + + return probabilities, self.get_ids(inds_fac) + def get_departure_probabilities_landuse(self): """ Returns the dictionnary of dictionaries with departure (or arrival) @@ -1038,22 +1524,72 @@ self.update_area(_id) #self.areas[_id] = get_polygonarea_fast(np.array(self.shapes[_id],float)[:,0], np.array(self.shapes[_id],float)[:,1]) + self.identify_landuse_from_area(ids) self.update_capacities(ids) # self.identify_closest_edge(ids) + def get_ids_area(self, ids=None): + if ids is None: + ids = self.get_ids() + return ids[self.get_landusetypes().are_area[self.ids_landusetype[ids]]] + + def get_ids_building(self, ids=None): + """Returns all building type of facilities""" + # print 'get_ids_building' + if ids is None: + ids = self.get_ids() + # debug + #landusetypes = self.get_landusetypes() + # for id_fac in ids[self.get_landusetypes().are_area[self.ids_landusetype[ids]] == False]: + # id_landusetype = self.ids_landusetype[id_fac] + # print ' id_fac',id_fac,id_landusetype,'is_area',landusetypes.are_area[id_landusetype] + + return ids[self.get_landusetypes().are_area[self.ids_landusetype[ids]] == False] + + def identify_landuse_from_area(self, ids_fac=None): + """Determines the landuse of facilities from the landuse of areas in which their are located""" + print 'identify_landuse_from_area', ids_fac + # TODO: + landusetypes = self.get_landusetypes() + ids_area = self.get_ids_area(ids_fac) + ids_build = self.get_ids_building(ids_fac) + + for id_area, shape, id_landuse in zip(ids_area, self.shapes[ids_area], self.ids_landusetype[ids_area]): + id_landusetype_fac = landusetypes.get_landusetype_facility_from_area(self.ids_landusetype[id_area]) + for id_fac, osmkey, coord in zip(ids_build, self.osmkeys[ids_build], self.centroids[ids_build]): + + if osmkey == 'building.yes': + if is_point_in_polygon(coord[:2], np.array(shape, dtype=np.float32)[:, :2], is_use_shapely=IS_SHAPELY): + print ' found id_fac', id_fac, osmkey, 'in id_area', id_area + print ' id_landusetype', self.ids_landusetype[id_fac], 'is_area', landusetypes.are_area[self.ids_landusetype[id_fac]], '->', id_landusetype_fac + self.ids_landusetype[id_fac] = id_landusetype_fac + def update_centroid(self, _id): self.centroids[_id] = np.mean(self.shapes[_id], 0) def update_area(self, _id): - self.areas[_id] = get_polygonarea_fast(np.array(self.shapes[_id], float)[ - :, 0], np.array(self.shapes[_id], float)[:, 1]) + if IS_SHAPELY: + self.areas[_id] = find_area(self.shapes[_id]) + else: + self.areas[_id] = get_polygonarea_fast(np.array(self.shapes[_id], float)[ + :, 0], np.array(self.shapes[_id], float)[:, 1]) def update_capacity(self, id_fac): self.update_capacities([id_fac]) def update_capacities(self, ids): - volumes_unit = self.get_facilitytypes().unitvolumes[self.ids_facilitytype[ids]] - self.capacities[ids] = self.areas[ids]*self.heights[ids]/volumes_unit + ids_fac = self.get_ids_building(ids) + ids_area = self.get_ids_area(ids) + volumes_unit = self.get_facilitytypes().unitvolumes[self.ids_facilitytype[ids_fac]] + + self.capacities[ids_fac] = self.areas[ids_fac]*self.heights[ids_fac]/volumes_unit + + # here we assume that pure areas do not have capacities + # this will prevent that activities are assigned to areas + # instead of facilities (buildings) + # TODO: problem is for example parks with no buildings + # fixed: parks etc. are areas + self.capacities[ids_area] = 0.0 def get_dists(self, ids_fac_from, ids_fac_to): """ @@ -1063,7 +1599,7 @@ return np.sqrt(np.sum((self.centroids[ids_fac_to]-self.centroids[ids_fac_from])**2)) - def identify_closest_edge(self, ids=None, priority_max=5, has_sidewalk=True): + def identify_closest_edge(self, ids=None, priority_max=5, has_sidewalk=True, n_best=10): """ Identifies edge ID and position on this edge that is closest to the centoid of each facility and the satisfies certain @@ -1071,62 +1607,63 @@ """ print 'identify_closest_edge' edges = self.get_edges() - + id_ped = self.get_net().modes.get_id_mode('pedestrian') # select edges...if (edges.priorities[id_edge]<=priority_max) & edges.has_sidewalk(id_edge): - ids_edge = edges.select_ids((edges.priorities.get_value() < priority_max) - & (edges.widths_sidewalk.get_value() > 0.0)) + # ids_edge = edges.select_ids((edges.priorities.get_value()0.0)) + accesslevels = edges.get_accesslevels(id_ped) + # edges.make_segment_edge_map() - edges.make_segment_edge_map(ids_edge) + for id_fac in self.get_ids(): + ids_edge, dists = edges.get_closest_edge(self.centroids[id_fac], n_best=n_best, accesslevels=accesslevels) - if ids is None: - ids = self.get_ids() - for id_fac in ids: - id_edge = edges.get_closest_edge(self.centroids[id_fac]) + if len(ids_edge) > 0: + id_edge = ids_edge[0] - # determin position on edeg where edge is closest to centroid - # TODO: solve this faster with precalculated maps!! - xc, yc, zc = self.centroids[id_fac] - shape = edges.shapes[id_edge] - n_segs = len(shape) - - d_min = 10.0**8 - x_min = 0.0 - y_min = 0.0 - j_min = 0 - p_min = 0.0 - pos = 0.0 - x1, y1, z1 = shape[0] - edgelength = edges.lengths[id_edge] - for j in xrange(1, n_segs): - x2, y2, z2 = shape[j] - d, xp, yp = shortest_dist(x1, y1, x2, y2, xc, yc) - # print ' x1,y1=(%d,%d)'%(x1,y1),',x2,y2=(%d,%d)'%(x2,y2),',xc,yc=(%d,%d)'%(xc,yc) - # print ' d,x,y=(%d,%d,%d)'%shortest_dist(x1,y1, x2,y2, xc,yc) - if d < d_min: - d_min = d - # print ' **d_min=',d_min,[xp,yp] - x_min = xp - y_min = yp - j_min = j - p_min = pos - # print ' pos',pos,[x2-x1,y2-y1],'p_min',p_min - pos += np.linalg.norm([x2-x1, y2-y1]) - x1, y1 = x2, y2 - - x1, y1, z1 = shape[j_min-1] - pos_min = p_min+np.linalg.norm([x_min-x1, y_min-y1]) - # print ' k=%d,d_min=%d, x1,y1=(%d,%d),xmin,ymin=(%d,%d),xc,yc=(%d,%d)'%(k,d_min,x1,y1,x_min,y_min,xc,yc) - # print ' pos=%d,p_min=%d,pos_min=%d'%(pos,p_min,pos_min) - - if pos_min > edgelength: - pos_min = edgelength - - if pos_min < 0: - pos_min = 0 - # print ' id_fac,id_edge',id_fac,id_edge,pos_min - self.ids_roadedge_closest[id_fac] = id_edge - self.positions_roadedge_closest[id_fac] = pos_min + # determin position on edeg where edge is closest to centroid + # TODO: solve this faster with precalculated maps!! + xc, yc, zc = self.centroids[id_fac] + shape = edges.shapes[id_edge] + n_segs = len(shape) + + d_min = 10.0**8 + x_min = 0.0 + y_min = 0.0 + j_min = 0 + p_min = 0.0 + pos = 0.0 + x1, y1, z1 = shape[0] + edgelength = edges.lengths[id_edge] + for j in xrange(1, n_segs): + x2, y2, z2 = shape[j] + d, xp, yp = shortest_dist(x1, y1, x2, y2, xc, yc) + # print ' x1,y1=(%d,%d)'%(x1,y1),',x2,y2=(%d,%d)'%(x2,y2),',xc,yc=(%d,%d)'%(xc,yc) + # print ' d,x,y=(%d,%d,%d)'%shortest_dist(x1,y1, x2,y2, xc,yc) + if d < d_min: + d_min = d + # print ' **d_min=',d_min,[xp,yp] + x_min = xp + y_min = yp + j_min = j + p_min = pos + # print ' pos',pos,[x2-x1,y2-y1],'p_min',p_min + pos += np.linalg.norm([x2-x1, y2-y1]) + x1, y1 = x2, y2 + + x1, y1, z1 = shape[j_min-1] + pos_min = p_min+np.linalg.norm([x_min-x1, y_min-y1]) + # print ' k=%d,d_min=%d, x1,y1=(%d,%d),xmin,ymin=(%d,%d),xc,yc=(%d,%d)'%(k,d_min,x1,y1,x_min,y_min,xc,yc) + # print ' pos=%d,p_min=%d,pos_min=%d'%(pos,p_min,pos_min) + + if pos_min > edgelength: + pos_min = edgelength + + if pos_min < 0: + pos_min = 0 + # print ' id_fac,id_edge',id_fac,id_edge,pos_min + self.ids_roadedge_closest[id_fac] = id_edge + self.positions_roadedge_closest[id_fac] = pos_min def set_shape(self, id_fac, shape): # print 'set_shape',id_fac,shape @@ -1149,56 +1686,21 @@ # print 'add_poly',id_sumo,id_landusetype,osmkey landusetypes = self.get_landusetypes() - if id_landusetype is not None: - # this means that landusetype has been previousely identified - if osmkey is None: - # use filter as key - osmkey = landusetypes.osmfilters[id_landusetype][0] - - id_fac = self.add_row(ids_sumo=id_sumo, - ids_landusetype=id_landusetype, - osmkeys=osmkey, - ) - self.set_shape(id_fac, shape) - return id_fac - else: - # identify ftype from fkeys... - keyvec = osmkey.split('.') - len_keyvec = len(keyvec) - is_match = False - for id_landusetype in landusetypes.get_ids(): - # print ' ',landusetypes.osmfilters[id_landusetype] - # if fkeys==('building.industrial'): print ' check',facilitytype - for osmfilter in landusetypes.osmfilters[id_landusetype]: - # print ' ', - osmfiltervec = osmfilter.split('.') - if osmkey == osmfilter: # exact match of filter - is_match = True - # if fkeys==('building.industrial'):print ' found exact',osmkey - elif (len(osmfiltervec) == 2) & (len_keyvec == 2): - - if osmfiltervec[0] == keyvec[0]: - - if osmfiltervec[1] == '*': - is_match = True - # if fkeys==('building.industrial'):print ' found match',osmkeyvec[0] - - # redundent to exact match - # elif osmkeyvec[1]==keyvec[1]: - # is_match = True - # if is_match: - # print ' found exact',osmkey - - if is_match: - # if fkeys==('building.industrial'):print ' *found:',facilitytype,fkeys - # return self.facilities.set_row(ident, type = facilitytype, polygon=polygon, fkeys = fkeys,area=find_area(polygon),centroid=np.mean(polygon,0)) - id_fac = self.add_row(ids_sumo=id_sumo, - ids_landusetype=id_landusetype, - osmkeys=osmkey, - ) - self.set_shape(id_fac, shape) - return id_fac + if id_landusetype is None: + # make default landuse + id_landusetype = landusetypes.typekeys.get_id_from_index('residential') + + if osmkey is None: + # use first filter as key + osmkey = landusetypes.osmfilters[id_landusetype][0] + + id_fac = self.add_row(ids_sumo=id_sumo, + ids_landusetype=id_landusetype, + osmkeys=osmkey, + ) + self.set_shape(id_fac, shape) + return id_fac def clear(self): # self.reset() @@ -1210,9 +1712,10 @@ ids = [ids] self.update(ids) - def import_poly(self, polyfilepath, is_remove_xmlfiles=False): + def import_poly(self, polyfilepath, is_remove_xmlfiles=False, is_clear=True, **kwargs): print 'import_poly from %s ' % (polyfilepath,) - self.clear() + if is_clear: + self.clear() # let's read first the offset information, which are in the # comment area fd = open(polyfilepath, 'r') @@ -1238,7 +1741,7 @@ counter = SumoPolyCounter() parse(polyfilepath, counter) - fastreader = SumoPolyReader(self, counter, offset_delta) + fastreader = SumoPolyReader(self, counter, offset_delta, **kwargs) parse(polyfilepath, fastreader) fastreader.finish() @@ -1250,6 +1753,86 @@ # print ' self.shapes',self.shapes.value + def write_kml(self, fd=None, indent=0): + # + + ids_fac = self.get_ids() + for id_fac in ids_fac: + fd.write(xm.begin('Placemark', indent + 2)) + fd.write((indent+4)*' '+'%s\n' % id_fac) + fd.write(xm.begin('Polygon', indent + 4)) + fd.write((indent+6)*' '+'1\n' % id_fac) + fd.write((indent+6)*' '+'relativeToGround\n' % id_fac) + fd.write(xm.begin('outerBoundaryIs', indent + 6)) + + fd.write(xm.begin('LinearRing', indent + 8)) + fd.write(xm.begin('coordinates', indent + 10)) + + for point in self.shapes[id_fac]: + + projection = self.project(point[0], point[1]) + fd.write((indent+12)*' '+'%f,%f,%f\n' % (projection[0], projection[1], self.heights[id_fac])) + + fd.write(xm.end('coordinates', indent + 10)) + fd.write(xm.end('LinearRing', indent + 8)) + fd.write(xm.end('outerBoundaryIs', indent + 6)) + fd.write(xm.end('Polygon', indent + 4)) + fd.write(xm.end('Placemark', indent + 2)) + + def project(self, x, y): + if self._proj is None: + self._proj, self._offset = self.get_proj_and_offset() + lons, lats = self._proj(x-self._offset[0], y-self._offset[1], inverse=True) + return np.transpose(np.concatenate(([lons], [lats]), axis=0)) + + def get_proj_and_offset(self): + if self._proj is None: + net = self.parent.parent.net + proj_params = str(net.get_projparams()) + # try: + self._proj = pyproj.Proj(proj_params) + # except: + # proj_params ="+proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" + # self._proj = pyproj.Proj(self.proj_params) + + self._offset = net.get_offset() + + return self._proj, self._offset + + def get_facfilepath(self): + return self.parent.parent.get_rootfilepath()+'.fac.kml' + + def export_sumokml(self, filepath=None, encoding='UTF-8'): + """ + Export stops to SUMO stop xml file. + """ + print 'export_sumoxml', filepath, len(self) + if len(self) == 0: + return None + + if filepath is None: + filepath = self.get_facfilepath() + + try: + fd = open(filepath, 'w') + except: + print 'WARNING in write_obj_to_xml: could not open', filepath + return False + #xmltag, xmltag_item, attrname_id = self.xmltag + fd.write('\n' % encoding) + fd.write('\n') + indent = 0 + #fd.write(xm.begin('routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.sf.net/xsd/routes_file.xsd"',indent)) + + fd.write(xm.begin('Document', indent=0)) + + self.write_kml(fd, indent=0) + + fd.write(xm.end('Document', indent=0)) + fd.write(xm.end('kml', indent=0)) + fd.close() + return filepath + class SumoPolyCounter(handler.ContentHandler): """Counts facilities from poly.xml file into facility structure""" @@ -1266,8 +1849,10 @@ class SumoPolyReader(handler.ContentHandler): """Reads facilities from poly.xml file into facility structure""" - def __init__(self, facilities, counter, offset_delta): + def __init__(self, facilities, counter, offset_delta, type_default='building.yes', height_default=7.0): + self._type_default = type_default + self._height_default = height_default self._facilities = facilities self._ids_landusetype_all = self._facilities.get_landusetypes().get_ids() self._osmfilters = self._facilities.get_landusetypes().osmfilters @@ -1276,8 +1861,10 @@ self.ids_sumo = np.zeros(counter.n_fac, np.object) self.ids_landusetype = -1*np.ones(counter.n_fac, np.int32) self.osmkeys = np.zeros(counter.n_fac, np.object) + self.names = np.zeros(counter.n_fac, np.object) self.shape = np.zeros(counter.n_fac, np.object) self.areas = np.zeros(counter.n_fac, np.float32) + self.heights = self._height_default * np.ones(counter.n_fac, np.float32) self.centroids = np.zeros((counter.n_fac, 3), np.float32) #self._id_facility = None @@ -1290,8 +1877,8 @@ self._ind_fac += 1 i = self._ind_fac - osmkey = attrs.get('type', 'building.yes') - + osmkey = attrs.get('type', self._type_default) + # print ' id_sumo=',attrs['id'],osmkey id_landuse = self.get_landuse(osmkey) if id_landuse >= 0: # land use is interesting shape = xm.process_shape(attrs.get('shape', ''), offset=self._offset_delta) @@ -1303,6 +1890,16 @@ self.shape[i] = shape self.areas[i] = find_area(shapearray[:, :2]) self.centroids[i] = np.mean(shapearray, 0) + self.names[i] = '' + + # print ' control id_sumo',self.ids_sumo[i] + + elif name == 'param': + i = self._ind_fac + if attrs['key'] == 'height': + self.heights[i] = string_to_float(attrs['value']) + elif attrs['key'] == 'name': + self.names[i] = attrs['value'] # color info in this file no longer used as it is defined in # facility types table @@ -1311,23 +1908,30 @@ def get_landuse(self, osmkey): keyvec = osmkey.split('.') len_keyvec = len(keyvec) - # print 'get_landuse',len_keyvec,keyvec + print 'get_landuse', len_keyvec, keyvec #is_match = False for id_landusetype in self._ids_landusetype_all: - # print ' ',landusetypes.osmfilters[id_landusetype] + # print ' id_landusetype',id_landusetype # if fkeys==('building.industrial'): print ' check',facilitytype - for osmfilter in self._osmfilters[id_landusetype]: - osmfiltervec = osmfilter.split('.') - # print ' osmfiltervec',id_landusetype,osmfiltervec,osmkey==osmfilter,(len(osmfiltervec)==2)&(len_keyvec==2) + # first filter only exact matches before wildcards + for osmfilter in self._osmfilters[id_landusetype]: + # print ' ?osmfiltervec',osmfilter,osmkey==osmfilter if osmkey == osmfilter: # exact match of filter + print ' exact', osmkey return id_landusetype - elif (len(osmfiltervec) == 2) & (len_keyvec == 2): + # now check for wildcards + for id_landusetype in self._ids_landusetype_all: + # print ' *id_landusetype',id_landusetype + for osmfilter in self._osmfilters[id_landusetype]: + osmfiltervec = osmfilter.split('.') + # print ' ?osmfiltervec',osmfiltervec,(len(osmfiltervec)==2)&(len_keyvec==2) + if (len(osmfiltervec) == 2) & (len_keyvec == 2): if osmfiltervec[0] == keyvec[0]: - if osmfiltervec[1] == '*': + print ' *', keyvec[0] return id_landusetype return -1 @@ -1342,6 +1946,8 @@ shapes=self.shape[inds_valid], areas=self.areas[inds_valid], centroids=self.centroids[inds_valid], + heights=self.heights[inds_valid], + names=self.names[inds_valid] ) # def characters(self, content): @@ -1476,21 +2082,33 @@ def get_parkinglane_from_edge(self, id_edge, id_mode, length_min=15.0, priority_max=8, n_freelanes_min=1): """ - Check if edge can have on-road parking + Check if edge can have on-road parking. + Returns lane ID if parking is possible and -1 otherwise. """ edges = self.edges.get_value() lanes = self.lanes.get_value() - # check size - # laneindex = - # print 'get_parkinglane_from_edge',id_edge, id_mode,priority_max,length_min - # print ' check',(edges.priorities[id_edge]<=priority_max),(edges.lengths[id_edge]>length_min),(edges.widths_sidewalk[id_edge]>-1) - - if (edges.priorities[id_edge] <= priority_max) & (edges.lengths[id_edge] > length_min) & (edges.widths_sidewalk[id_edge] > 0): - - laneindex = edges.get_laneindex_allowed(id_edge, id_mode) - # print ' found',laneindex,edges.nums_lanes[id_edge]-laneindex > n_freelanes_min - if (laneindex >= 0) & (edges.nums_lanes[id_edge]-laneindex >= n_freelanes_min): - return edges.ids_lanes[id_edge][laneindex] + id_mode_ped = edges.parent.modes.get_id_mode('pedestrian') + # check access + ids_lane = edges.ids_lanes[id_edge] + edgelength = edges.lengths[id_edge] + + if (len(ids_lane) >= 2): + if (lanes.get_accesslevel([ids_lane[0]], id_mode_ped) > -1) & (lanes.get_accesslevel([ids_lane[1]], id_mode) > -1): + # check size + # laneindex = + # print 'get_parkinglane_from_edge',id_edge, id_mode,priority_max,length_min + # print ' check',(edges.priorities[id_edge]<=priority_max),(edges.lengths[id_edge]>length_min),(edges.widths_sidewalk[id_edge]>-1) + + if (edges.priorities[id_edge] <= priority_max) & (edgelength > length_min) & (edges.widths_sidewalk[id_edge] > 0): + + laneindex = 1 + # print ' found',laneindex,edges.nums_lanes[id_edge]-laneindex > n_freelanes_min + if (len(ids_lane)-laneindex >= n_freelanes_min): + return ids_lane[laneindex] + else: + return -1 + else: + return -1 else: return -1 @@ -1508,7 +2126,12 @@ # # return self.edges.get_value()(self.id_edge_parking[ind]),self.pos_edge_parking[ind] - def make_parking(self, id_mode=MODES['passenger'], length_min=42.0, length_noparking=15.0, length_lot=6.0, angle=0.0, is_clear=True, **kwargs): + def make_parking(self, id_mode=MODES['passenger'], + length_min=42.0, length_noparking=15.0, + length_lot=6.0, angle=0.0, + is_clear=True, + logger=None, + **kwargs): print 'make_parking' if is_clear: self.clear() @@ -1517,7 +2140,12 @@ n_parking = 0 ids_parking = [] ids_lane_current = self.ids_lane.get_value().copy() + ii = 0.0 + n_edges = len(edges.get_ids()) for id_edge in edges.get_ids(): + ii += 1 + if logger is not None: + logger.progress(int(ii/n_edges*100)) # check if edge is suitable... # print ' id_edge,length,n_lanes,',id_edge id_lane = self.get_parkinglane_from_edge(id_edge, id_mode, length_min, **kwargs) @@ -1572,14 +2200,20 @@ self.numbers_booking.get_value()[ind_parking_closest] += 1 return self.get_ids(ind_parking_closest), ind_parking_closest - def get_closest_parkings(self, ids_veh, coords, c_spread=2.0): + def get_closest_parkings(self, ids_veh, ids_mode, coords, dists_walk_max, c_spread=2.0, + n_retrials=20, id_mode_fallback=None): """ Returns parking space for each vehicle in ids_veh as close as possible to coords. """ + # Used by virtualpop + + lanes = self.ids_lane.get_linktab() + ids_lane = self.ids_lane.get_value() #inds_person = self.persons.get_inds(ids_person) n = len(ids_veh) - # print 'get_closest_parking',n,len(self) + + # print 'get_closest_parking',n,len(self),'n_retrials',n_retrials if len(self) == 0: print 'WARNING in get_closest_parkings: there is no parking.' return [], [] @@ -1591,28 +2225,66 @@ numbers_booking = self.numbers_booking.get_value() lengths = self.lengths.get_value() inds_vehparking = np.zeros(n, int) + are_fallback = np.zeros(n, bool) #inds_parking_avail = np.flatnonzero( self.ids_bookedveh.value == -1).tolist() inds_parking_avail = self.get_inds().copy() + #ids_veh = np.zeros(n,object) i = 0 - for id_veh, coord in zip(ids_veh, coords): - # print '\n id_veh',id_veh + for id_veh, id_mode, coord, dist_walk_max_sq in zip(ids_veh, ids_mode, coords, dists_walk_max**2): + # print ' search parking for id_veh',id_veh # print ' landuse.id_bookedveh_parking',landuse.id_bookedveh_parking # # print ' inds_parking_avail',inds_parking_avail # print ' dists',np.sum((coord-coord_parking[inds_parking_avail])**2,1),np.argmin(np.sum((coord-coord_parking[inds_parking_avail])**2,1)) - ind_parking_closest = inds_parking_avail[np.argmin( - np.sum((coord-coord_parking)**2, 1) + c_spread*lengths*numbers_booking)] - # print ' ind_parking_closest,n_avail',ind_parking_closest,len(inds_parking_avail) + is_fallback = False + penalties_inaccessible = np.ones(len(numbers_booking), dtype=np.float32) + n_search = n_retrials + is_search = True + while (n_search > 0) & is_search: + dists = np.sum((coord-coord_parking)**2, 1) + ind_parking_closest = inds_parking_avail[np.argmin( + dists + c_spread*lengths*numbers_booking*penalties_inaccessible)] + # print ' ind_parking_closest,n_avail',ind_parking_closest,len(inds_parking_avail),'n_search',n_search,'is_search',is_search + is_search = (not (lanes.get_accesslevel([ids_lane[ind_parking_closest]], id_mode) >= 0))\ + | (dists[ind_parking_closest] > dist_walk_max_sq) + penalties_inaccessible[ind_parking_closest] = np.inf # prevent reselection of this parking + n_search -= 1 + # print ' n_search',n_search,'is_search',is_search + + # print ' done with id_mode is_search',is_search + if is_search & (id_mode_fallback is not None): + # search mode means no parking has bee found for ordinary mode + # now try with fallback mode + + is_fallback = True + penalties_inaccessible = np.ones(len(numbers_booking), dtype=np.float32) + n_search = n_retrials + while (n_search > 0) & is_search: + dists = np.sum((coord-coord_parking)**2, 1) + ind_parking_closest = inds_parking_avail[np.argmin( + dists + c_spread*lengths*numbers_booking*penalties_inaccessible)] + # print ' ind_parking_closest,n_avail',ind_parking_closest,len(inds_parking_avail) + is_search = (not (lanes.get_accesslevel([ids_lane[ind_parking_closest]], id_mode_fallback) >= 0))\ + | (dists[ind_parking_closest] > dist_walk_max_sq) + penalties_inaccessible[ind_parking_closest] = np.inf # prevent reselection of this parking + n_search -= 1 + # print ' fallback n_search',n_search,'is_search',is_search + + if is_search: + print 'WARNING: inaccessible parking for id_veh', id_veh, 'is_fallback', is_fallback + print ' dist=%.1f' % (np.sqrt(dists[ind_parking_closest])), 'id_lane', ids_lane[ind_parking_closest], 'al', lanes.get_accesslevel([ids_lane[ind_parking_closest]], id_mode_fallback) + inds_vehparking[i] = ind_parking_closest + are_fallback[i] = is_fallback # print ' coords_veh',coord # print ' coord_park',coord_parking[ind_parking_closest] numbers_booking[ind_parking_closest] += 1 - id_parking = self.get_ids([ind_parking_closest]) - id_edge, pos = self.get_edge_pos_parking(id_parking) + #id_parking = self.get_ids([ind_parking_closest]) + #id_edge, pos = self.get_edge_pos_parking(id_parking) # print ' id_veh=%s,id_parking_closest=%s, dist =%.2fm'%(id_veh,id_parking,np.sqrt(np.sum((coord-coord_parking[ind_parking_closest])**2))) # ids_bookedveh[ind_parking_closest]=id_veh # occupy parking # print ' id_edge, pos',id_edge, pos @@ -1624,7 +2296,7 @@ # print ' ids_veh',ids_veh #self.ids_bookedveh.value[inds_vehparking] = ids_veh # self.ids_bookedveh.[ids_parking] =ids_bookedveh - return self.get_ids(inds_vehparking), inds_vehparking + return self.get_ids(inds_vehparking), are_fallback def assign_parking(self, ids_veh, coords, is_overbook=False): """ @@ -1702,7 +2374,7 @@ else: return None - def export_polyxml(self, filepath=None, encoding='UTF-8'): + def export_polyxml(self, filepath=None, encoding='UTF-8', delta=np.zeros(3, dtype=np.float32)): """ Export landuse facilities to SUMO poly.xml file. """ @@ -1732,10 +2404,16 @@ # print ' groups:',self.parent.net.get_attrsman().get_groups() for attrconfig in self.parent.net.get_attrsman().get_group('location'): # print ' locationconfig',attrconfig.attrname - attrconfig.write_xml(fd) + if attrconfig.attrname == '_boundaries': + delta_bb = np.zeros(4, dtype=np.float32) + delta_bb[0:2] = delta[:2] + delta_bb[2:4] = delta[:2] + fd.write(xm.arr('convBoundary', attrconfig.get_value()-delta_bb)) + else: + attrconfig.write_xml(fd) fd.write(xm.stopit()) - self.facilities.write_xml(fd, indent=indent+2, is_print_begin_end=False) + self.facilities.write_xml(fd, indent=indent+2, is_print_begin_end=False, delta=delta) fd.write(xm.end(xmltag_poly)) fd.close() @@ -1744,7 +2422,7 @@ def get_filepath(self): return self.parent.get_rootfilepath() + '.poly.xml' - def import_polyxml(self, rootname=None, dirname='', filepath=None): + def import_polyxml(self, rootname=None, dirname='', filepath=None, is_clear=True, **kwargs): if filepath is None: if rootname is not None: filepath = os.path.join(dirname, rootname+'.poly.xml') @@ -1752,7 +2430,7 @@ filepath = self.get_filepath() if os.path.isfile(filepath): - self.facilities.import_poly(filepath) + self.facilities.import_poly(filepath, is_clear=is_clear, **kwargs) else: self.get_logger().w('import_xml: files not found:'+filepath, key='message') @@ -1787,6 +2465,13 @@ info="""Minimum edge length for which houses are generated.""", )) + self.priority_max = attrsman.add(cm.AttrConf('priority_max', kwargs.get('priority_max', 7), + groupnames=['options'], + perm='rw', + name='Max. priority', + info="""Maximum edge priority where facilities will be created.""", + )) + self.height_max = attrsman.add(cm.AttrConf('height_max', kwargs.get('height_max', 20.0), groupnames=['options'], perm='rw', @@ -1830,10 +2515,10 @@ x1, y1, x2, y2 = edges.get_segvertices_xy() logger = self.get_logger() - #logger.w('Provide vehicles...') ids_edge = edges.select_ids((edges.widths_sidewalk.get_value() > 0) & (edges.lengths.get_value() > self.edgelength_min) + & (edges.priorities.get_value() < self.priority_max) ) facilitytypes = facilities.facilitytypes.get_value() @@ -1843,7 +2528,10 @@ # print ' facilitytypes, facilitytypeobjs',facilitytypes,facilitytypeobjs n_factypes = len(facilitytypes) n_fac = 0 + n_edges = len(ids_edge) + #logger.w('Add facilities to %d edges') # print ' eligible edges =',ids_edge + i = 0.0 for id_edge, edgelength, id_fromnode, id_tonode, shape, edgewidth\ in zip(ids_edge, edges.lengths[ids_edge], edges.ids_fromnode[ids_edge], @@ -1853,6 +2541,9 @@ ): pos = 5.0 # print ' Build at edge',id_edge,edgelength + #logger.w('Add facilities to %d edges') + i += 1 + logger.progress(i/n_edges*100) # identify opposite edge, which needs to be excluded # from bulding overlapping check @@ -1866,7 +2557,7 @@ id_edge_opp = id_edge_opp_set.pop() inds_seg_opp = edges.get_inds_seg_from_id_edge(id_edge_opp) else: - # no edge in opposite direction + # print ' no edge in opposite direction' id_edge_opp = -1 inds_seg_opp = None else: @@ -1989,7 +2680,7 @@ info="""Minimum edge length in order to qualify for parking.""", )) - self.length_noparking = attrsman.add(cm.AttrConf('length_noparking', kwargs.get('length_noparking', 6.0), + self.length_noparking = attrsman.add(cm.AttrConf('length_noparking', kwargs.get('length_noparking', 15.0), groupnames=['options'], perm='rw', unit='m', @@ -2004,6 +2695,7 @@ name='Lot length', info="""Length of a single parking lot.""", )) + self.angle = attrsman.add(cm.AttrConf('angle', kwargs.get('angle', 0.0), groupnames=['options'], perm='rw', @@ -2028,7 +2720,7 @@ groupnames=['options'], perm='rw', name='Clear', - info="""Clear precious parking areas.""", + info="""Clear previous parking areas from ntework.""", )) def do(self): @@ -2036,7 +2728,9 @@ # links # print ' self.id_mode',self.id_mode # print ' self.get_kwoptions()',self.get_kwoptions() - self.parent.make_parking(**self.get_kwoptions()) + logger = self.get_logger() + + self.parent.make_parking(logger=logger, **self.get_kwoptions()) return True @@ -2053,6 +2747,7 @@ is_use_name_for_id=False, polytypefilepath='', is_clean_osmfile=True, + is_merge=False, logger=None, **kwargs): print 'OsmPolyImporter.__init__', landuse, landuse.parent.get_rootfilename() self._init_common('osmpolyimporter', name='OSM Poly import', @@ -2086,11 +2781,16 @@ osmfilepaths = os.path.join(rootdirpath, rootname+'.osm.xml') if typefilepath is None: - typefilepath = os.path.join(os.path.dirname(os.path.abspath(__file__)), - '..', '..', 'typemap', 'osmPolyconvert.typ.xml') + if 'SUMO_HOME' in os.environ: + typemapdir = os.path.join(os.environ['SUMO_HOME'], 'data', 'typemap') + typefilepath = os.path.join(typemapdir, 'osmPolyconvert.typ.xml') + else: + print("No poly typemaps found. Please declare environment variable 'SUMO_HOME'") + typefilepath = '' + attrsman = self.get_attrsman() - self.workdirpath = rootdirpath + self.rootdirpath = rootdirpath self.rootname = rootname @@ -2104,6 +2804,13 @@ info='Openstreetmap files to be imported.', ) + self.is_merge = attrsman.add(cm.AttrConf('is_merge', is_merge, + groupnames=['options'], + perm='rw', + name='Merge', + info='If set, imported polygons are merged with existing.', + )) + self.is_clean_osmfile = attrsman.add(cm.AttrConf('is_clean_osmfile', is_clean_osmfile, groupnames=['options'], perm='rw', @@ -2111,6 +2818,20 @@ info='If set, OSM files are cleaned from strange characters prior to import (recommended).', )) + self.height_default = attrsman.add(cm.AttrConf('height_default', kwargs.get('height_default', 7.0), + groupnames=['options'], + perm='rw', + name='Default height', + info='Default height of facilities in case no height information is available.', + )) + + self.type_default = attrsman.add(cm.AttrConf('type_default', kwargs.get('type_default', 'building.yes'), + groupnames=['options'], + perm='rw', + name='Default facility type', + info='Default type of facilities in case no type information is available.', + )) + self.add_option('polyfilepath', polyfilepath, groupnames=['_private'], cml='--output-file', @@ -2225,7 +2946,10 @@ if self.status == 'success': if os.path.isfile(self.polyfilepath): print ' OSM->poly.xml successful, start importing xml files' - self._landuse.import_polyxml(self.rootname, self.workdirpath) + self._landuse.import_polyxml(self.rootname, self.rootdirpath, + is_clear=not self.is_merge, + type_default=self.type_default, + height_default=self.height_default) print ' import poly in sumopy done.' return True return False diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/landuse/maps.py sumo-1.12.0/tools/contributed/sumopy/coremodules/landuse/maps.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/landuse/maps.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/landuse/maps.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,9 +14,13 @@ # @file maps.py # @author Joerg Schweizer -# @date +# @date 2012 +# size limit at 1280x1280 +# http://maps.googleapis.com/maps/api/staticmap?size=500x500&path=color:0x000000|weight:10|44.35789,11.3093|44.4378,11.3935&format=GIF&maptype=satellite&scale=2 +# https://console.cloud.google.com/google/maps-apis import os +import sys import numpy as np import wx import urllib @@ -24,12 +28,23 @@ import agilepy.lib_base.classman as cm import agilepy.lib_base.arrayman as am import agilepy.lib_base.xmlman as xm -from agilepy.lib_base.processes import Process -#import timeit -#t = timeit.Timer() -#t_start = t.timer() -#from matplotlib import pyplot as plt +import matplotlib.pyplot as plt +from coremodules.misc.matplottools import * + +##from agilepy.lib_base.processes import Process +from coremodules. network import netconvert +from agilepy.lib_base.processes import Process, CmlMixin, P + +import csv + +from matplotlib import cm as cmp +from mpl_toolkits.mplot3d import Axes3D +try: + from scipy import interpolate + is_scipy = True +except: + is_scipy = False IS_MAPSUPPORT = True try: @@ -52,10 +67,11 @@ # raise -URL_GOOGLEMAP = "http://maps.googleapis.com/maps/api/staticmap?" +URL_GOOGLEMAP = "https://maps.googleapis.com/maps/api/staticmap?" def download_googlemap(filepath, bbox, proj, size=640, filetype='gif', maptype='satellite'): + print 'download_googlemap', bbox # https://developers.google.com/maps/documentation/static-maps/intro#Paths x_sw, y_sw = bbox[0] x_ne, y_ne = bbox[1] @@ -70,14 +86,17 @@ lon01, lat01 = proj(x_sw, y_ne, inverse=True) size_x = size_y = size/2 - urllib.urlretrieve(URL_GOOGLEMAP+"size=%dx%d&visible=%.6f,%.6f|%.6f,%.6f&format=%s&maptype=%s&scale=2" - % (size_x, size_y, lat00, lon00, lat11, lon11, filetype.upper(), maptype), filepath) + url = URL_GOOGLEMAP+"size=%dx%d&visible=%.6f,%.6f|%.6f,%.6f&format=%s&maptype=%s&scale=2"\ + % (size_x, size_y, lat00, lon00, lat11, lon11, filetype.upper(), maptype) + print ' url=', url + urllib.urlretrieve(url, filepath) bbox_lonlat = np.array([[lon00, lat00], [lon11, lat11]]) return bbox_lonlat -def download_googlemap_bb(filepath, bbox, proj, size=640, filetype='gif', maptype='satellite', color="0xff0000ff"): +def download_googlemap_bb(filepath, bbox, proj, apikey, size=640, filetype='gif', maptype='satellite', color="0xff0000ff"): + print 'download_googlemap_bb', bbox # https://developers.google.com/maps/documentation/static-maps/intro#Paths x_sw, y_sw = bbox[0] x_ne, y_ne = bbox[1] @@ -93,47 +112,77 @@ size_x = size_y = size/2 - url = URL_GOOGLEMAP + \ - "size=%dx%d&format=%s&maptype=%s&scale=2&path=color:%s|weight:1" % ( - size_x, size_y, filetype.upper(), maptype, color) - url += "|%.6f,%.6f" % (lat00, lon00) + # 3 + # + # 0 2 + # + # 1 + dhx = (x_ne-x_sw)/2 + dhy = (y_ne-y_sw)/2 + lon0, lat0 = proj(x_sw, y_sw+dhy, inverse=True) + lon1, lat1 = proj(x_sw+dhx, y_sw, inverse=True) + lon2, lat2 = proj(x_ne, y_sw+dhy, inverse=True) + lon3, lat3 = proj(x_sw+dhx, y_ne, inverse=True) + + url = URL_GOOGLEMAP+"key=%s&size=%dx%d&format=%s&maptype=%s&scale=2&path=color:%s|weight:3" % ( + apikey, size_x, size_y, filetype.upper(), maptype, color) + url += "|%.6f,%.6f" % (lat0, lon0) + url += "|%.6f,%.6f" % (lat2, lon2) url += "|%.6f,%.6f" % (lat10, lon10) - url += "|%.6f,%.6f" % (lat11, lon11) + url += "|%.6f,%.6f" % (lat1, lon1) + url += "|%.6f,%.6f" % (lat3, lon3) url += "|%.6f,%.6f" % (lat01, lon01) url += "|%.6f,%.6f" % (lat00, lon00) + url += "|%.6f,%.6f" % (lat10, lon10) + url += "|%.6f,%.6f" % (lat11, lon11) + url += "|%.6f,%.6f" % (lat3, lon3) + + #url = URL_GOOGLEMAP+"key=%s&size=%dx%d&format=%s&maptype=%s&scale=2&path=color:%s|weight:5"%(apikey,size_x,size_y,filetype.upper(),maptype,color) + #url += "|%.6f,%.6f"%(lat00,lon00) + #url += "|%.6f,%.6f"%(lat10,lon10) + #url += "|%.6f,%.6f"%(lat11,lon11) + #url += "|%.6f,%.6f"%(lat01,lon01) + #url += "|%.6f,%.6f"%(lat00,lon00) # urllib.urlretrieve (URL_GOOGLEMAP+"size=%dx%d&format=%s&maptype=%s&scale=2&path=color:0xff0000ff|weight:1|%.5f,%.5f|%.5f,%.5f|%.5f,%.5f|%.5f,%.5f"\ # %(size_x,size_y,filetype,maptype,lat00,lon00, lat11,lon11, lat01,lon01, lat10,lon10), filepath) - # print 'url=',url + print ' url=', url urllib.urlretrieve(url, filepath) bbox_lonlat = np.array([[lon00, lat00], [lon11, lat11]]) return bbox_lonlat -def estimate_angle(filepath, - rect=[(72, 36), (1243, 69), (1210, 1244), (39, 1211)], - ): +def estimate_angle(filepath): im = Image.open(filepath).convert("RGB") print 'estimate_angle image', filepath, "%dx%d" % im.size, im.mode, im.getbands() imr, img, imb = im.split() # calculate width and height of bbox in pixel from measured rectangle - wr = int(np.sqrt((rect[1][0]-rect[0][0])**2+(rect[1][1]-rect[0][1])**2)) + #wr = int(np.sqrt((rect[1][0]-rect[0][0])**2+(rect[1][1]-rect[0][1])**2)) #wr_check = int(np.sqrt((rect[2][0]-rect[3][0])**2+(rect[2][1]-rect[3][1])**2)) - hr = int(np.sqrt((rect[3][0]-rect[0][0])**2+(rect[3][1]-rect[0][1])**2)) + #hr = int(np.sqrt((rect[3][0]-rect[0][0])**2+(rect[3][1]-rect[0][1])**2)) #h_check = int(np.sqrt((rect[2][0]-rect[1][0])**2+(rect[2][1]-rect[1][1])**2)) xcb = im.size[0]/2 ycb = im.size[1]/2 + wx = im.size[0] + wy = im.size[1] + hx = wx/2 + hy = wy/2 - bbox = [(xcb-wr/2, ycb-hr/2), (xcb+wr/2, ycb-hr/2), (xcb+wr/2, ycb+hr/2), (xcb-wr/2, ycb+hr/2), (xcb-wr/2, ycb-hr/2)] + # create an image and draw a rectanle with coordinates from bbox + #bbox = [(xcb-wr/2,ycb-hr/2), (xcb+wr/2,ycb-hr/2), (xcb+wr/2,ycb+hr/2), (xcb-wr/2,ycb+hr/2),(xcb-wr/2,ycb-hr/2)] im_bbox = ImageChops.constant(im, 0) draw = ImageDraw.Draw(im_bbox) - draw.line(bbox, fill=255) + draw.line([(0, hy), (wx, hy)], fill=255) + draw.line([(hx, 0), (hx, wy)], fill=255) del draw - angles = np.arange(-2.0, 2.0, 0.01) + # rotate im_bbox with different angles + # and correlate with the red component of the image in filepath + # which contains a geo-referenced red rectangle + angles = np.arange(-3.0, 3.0, 0.01) matches = np.zeros(len(angles)) for i in xrange(len(angles)): im_bbox_rot = im_bbox.rotate(angles[i]) # gimp 1.62 @@ -145,8 +194,38 @@ angle_opt = angles[np.argmax(matches)] print ' angle_opt', angle_opt + + ys = np.arange(0, int(0.2*wy), 1) + matches = np.zeros(len(ys)) + for y in xrange(len(ys)): + im_bbox = ImageChops.constant(im, 0) + draw = ImageDraw.Draw(im_bbox) + draw.line([(0, y), (wx, y)], fill=255) + draw.line([(0, wy-y), (wx, wy-y)], fill=255) + del draw + im_bbox_rot = im_bbox.rotate(angle_opt) + im_corr = ImageChops.multiply(imr, im_bbox_rot) + # im_corr.show() + im_corr_arr = np.asarray(im_corr) + matches[y] = np.sum(im_corr_arr)/255 + # print ' y,matches[y]',y,matches[y] + + y_opt = ys[np.argmax(matches)] + print ' y_opt', y_opt + + if 0: + im_bbox = ImageChops.constant(im, 0) + draw = ImageDraw.Draw(im_bbox) + draw.line([(0, y_opt), (wx, y_opt)], fill=255) + draw.line([(0, wy-y_opt), (wx, wy-y_opt)], fill=255) + im_bbox_rot = im_bbox.rotate(angle_opt) + im_bbox_rot.show() + im.show() + + # assuming rectangle: + bbox = [(y_opt, y_opt), (wx-y_opt, y_opt), (wx-y_opt, wy-y_opt), (y_opt, wy-y_opt), (y_opt, y_opt)] + print ' bbox', bbox return -angle_opt, bbox - # im_box.show() class MapsImporter(Process): @@ -184,7 +263,7 @@ self.size_tile = attrsman.add(cm.AttrConf('size_tile', kwargs.get('size_tile', 1280), groupnames=['options'], - perm='rw', + perm='r', name='Tile size', info='Tile size in pixel. This is the size of one tile that will be downloaded and determins the map resolution. Maximum is 1280.', )) @@ -221,6 +300,13 @@ # info = 'User name of map server (if required).', # ) + self.apikey = attrsman.add(cm.AttrConf('apikey', kwargs.get('apikey', ''), + groupnames=['options'], + perm='rw', + name='API key', + info='API key for google maps. API key can be obtained from Google at https://cloud.google.com/maps-platform/?refresh=1&pli=1#get-started.', + )) + # self.add_option( 'password',kwargs.get('password',''), # perm='rw', # name = 'User', @@ -249,7 +335,7 @@ # width_tile = self.width_tile, size_tile = self.size_tile, # is_remove_orig = True): self._maps.download(maptype='satellite', mapserver='google', - filetype='png', rootfilepath=None, + filetype='png', rootfilepath=None, apikey=self.apikey, width_tile=self.width_tile, size_tile=self.size_tile, is_remove_orig=self.is_remove_orig) #import_xml(self, rootname, dirname, is_clean_nodes = True) @@ -320,7 +406,7 @@ info='Image file name.', )) - def write_decals(self, fd, indent=4, rootdir=None): + def write_decals(self, fd, indent=4, rootdir=None, delta=np.zeros(3, dtype=np.float32)): print 'write_decals', len(self) net = self.parent.get_net() if rootdir is None: @@ -330,6 +416,7 @@ #offset = net.get_offset() #width_tile = self.width_tile.value #size_tile = self.size_tile.value + for filename, bbox in zip(self.filenames.get_value(), self.bboxes.get_value()): #x0, y0 = proj(bbox_lonlat[0][0], bbox_lonlat[0][1]) #x1, y1 = proj(bbox_lonlat[1][0],bbox_lonlat[1][1]) @@ -341,7 +428,7 @@ #bbox = np.array([[x0, y0, 0.0],[x1, y1 ,0.0]],np.float32) # print ' bbox decal',bbox - xc, yc = 0.5*(bbox[0]+bbox[1]) + xc, yc = 0.5*(bbox[0]+bbox[1])-delta[:2] zc = 0.0 width_tile = bbox[1, 0] - bbox[0, 0] # print ' xc,yc',xc,yc @@ -386,7 +473,7 @@ ny = int(height/width_tile+0.5) return nx*ny - def download(self, maptype='satellite', mapserver='google', + def download(self, maptype='satellite', mapserver='google', apikey=None, filetype='png', rootfilepath=None, width_tile=1000.0, size_tile=1280, is_remove_orig=True): @@ -418,8 +505,8 @@ # width_tile_eff= width_tile#*float(2*size_tile)/238.0#500m 1205.0*width_tile#m 1208 # height_tile_eff = width_tile#*float(2*size_tile)/238.0# 500m1144.0*width_tile#m 1140 - nx = int(width/width_tile+0.5)+1 - ny = int(height/width_tile+0.5)+1 + nx = int(width/width_tile+0.5) + ny = int(height/width_tile+0.5) print ' offset', offset print ' bbox_sumo', bbox_sumo print ' width_tile', width_tile, 'm' @@ -458,30 +545,39 @@ # print ' filepath=',filepath if angle is None: - download_googlemap_bb(filepath, bbox_tile, proj, + download_googlemap_bb(filepath, bbox_tile, proj, apikey, size=size_tile, filetype=filetype, maptype=maptype) - angle, bbox = estimate_angle(filepath) + if os.path.getsize(filepath) > 2000: # download OK + angle, bbox = estimate_angle(filepath) + # sys.exit(0) + else: + print 'WARNING in download: no file downloaded from mapserver' + return ids_map - bbox_tile_lonlat = download_googlemap_bb(filepath, bbox_tile, proj, + bbox_tile_lonlat = download_googlemap_bb(filepath, bbox_tile, proj, apikey, size=size_tile, filetype=filetype, maptype=maptype, color="0x0000000f") + if os.path.getsize(filepath) < 2000: # download failed + print 'WARNING in download: no file downloaded from mapserver' + return ids_map + print ' bbox_tile', bbox_tile print ' bbox_tile_lonlat', bbox_tile_lonlat im = Image.open(filepath).convert("RGB") if 1: print ' downloaded image', filepath, "%dx%d" % im.size, im.mode, im.getbands() - # print ' x_sw,y_sw',x_sw,y_sw - # print ' x_ne,y_ne',x_ne,y_ne + print ' x_sw,y_sw', x_sw, y_sw + print ' x_ne,y_ne', x_ne, y_ne # print ' start rotation' im_rot = im.rotate(angle) # gimp 1.62 # im_rot.show() region = im_rot.crop([bbox[0][0], bbox[0][1], bbox[2][0], bbox[2][1]]) regsize = region.size - # print ' regsize',regsize + print ' regsize', regsize im_crop = Image.new('RGB', (regsize[0], regsize[1]), (0, 0, 0)) im_crop.paste(region, (0, 0, regsize[0], regsize[1])) im_tile = im_crop.resize((1024, 1024)) @@ -492,7 +588,7 @@ im_tile.save(outfilepath, filetype.upper()) # print ' bb_orig=',bb - + print ' bb_orig', bb #lon0, lat0 = proj(x_tile-offset[0], y_tile-offset[1]) #lon1, lat1 = proj(x_tile+width_tile-offset[0], y_tile+width_tile-offset[1]) @@ -513,6 +609,297 @@ return ids_map +class CsvElevationsImport(PlotoptionsMixin, CmlMixin, Process): + def __init__(self, landuse, rootname=None, rootdirpath=None, netfilepath=None, + is_clean_nodes=False, logger=None, **kwargs): + + self._init_common('csvelevationsimporter', name='Elevations csv import', + logger=logger, + info='Imports the elevations .csv file with 3 colums (Longitudes, Latitudes, Elevations), starting from the first lane', + ) + self._landuse = landuse + + self.init_cml('netconvert') + + attrsman = self.get_attrsman() + self.add_option('elevationscsv_filepath', '/home/cristian/scenarios_cri/Elevation/bo_elevations2.csv', + groupnames=['options'], # this will make it show up in the dialog + cml='--csv-elevation-file', + perm='rw', + name='Elevations file', + wildcards='Elevations CSV file(*.csv)|*.csv*', + metatype='filepath', + info='Elevations CSV file in', + ) + + self.interpolation_radius = attrsman.add(cm.AttrConf('interpolation_radius', kwargs.get('interpolation_radius', 150.), + groupnames=['options'], + name='Interpolation radius', + info='In order to find the quote of an unknown ponit, will be interpolated the elevation points around him within this radius.\ + If it count zero, the point wil have the quote equal to the nearest elevation point. ', + )) + +# self.method_interp = attrsman.add(cm.AttrConf( 'method_interp', kwargs.get('method_interp', 'cubic'), +## groupnames = ['options'], +## choices = ['linear', 'cubic', 'quintic'], +## name = 'Interpolation method', +## info = 'Elevation interpolation method.', +# )) + + self.x_offset = attrsman.add(cm.AttrConf('x_offset', kwargs.get('x_offset', -679244.), + groupnames=['options'], + perm='rw', + name='Longitude offset', + unit='m', + info='Longitude Offset for the importation phase.', + )) + + self.y_offset = attrsman.add(cm.AttrConf('y_offset', kwargs.get('y_offset', -4924610.), + groupnames=['options'], + perm='rw', + name='Latitude offset', + unit='m', + info='Latitude Offset for the importation phase.', + )) + + self.is_plot_elevations = attrsman.add(cm.AttrConf('is_plot_elevations', kwargs.get('is_plot_elevations', False), + groupnames=['options'], + perm='rw', + name='Plot Elevations', + info='Plot point elevations.', + )) + + # Match elevations + + self.is_match_to_nodes = attrsman.add(cm.AttrConf('is_match_to_nodes', kwargs.get('is_match_to_nodes', True), + groupnames=['options'], + perm='rw', + name='Match to node', + info='Match the elevations to the network nodes.', + )) + +# self.is_match_to_nodes_shape = attrsman.add(cm.AttrConf( 'is_match_to_nodes_shape',kwargs.get('is_match_to_nodes_shape',True), +## groupnames = ['options'], +# perm='rw', +## name = 'Match to node shapes', +## info = 'Match the elevations to the network nodes shapes.', +# )) + +# self.is_match_to_edge = attrsman.add(cm.AttrConf( 'is_match_to_node',kwargs.get('is_match_to_node',True), +## groupnames = ['options'], +# perm='rw', +## name = 'Match to node', +## info = 'Matche the elevations to the network nodes.', +# )) + + self.is_match_to_edges = attrsman.add(cm.AttrConf('is_match_to_edges', kwargs.get('is_match_to_edges', True), + groupnames=['options'], + perm='rw', + name='Match to edge ', + info='Match the elevations to the network edges.', + )) + + self.is_match_to_zones = attrsman.add(cm.AttrConf('is_match_to_zones', kwargs.get('is_match_to_zones', True), + groupnames=['options'], + perm='rw', + name='Match to zones', + info='Match the elevations to the assignment zones.', + )) + +# self.is_match_to_zones_shape = attrsman.add(cm.AttrConf( 'is_match_to_zones_shape',kwargs.get('is_match_to_zones_shape',True), +## groupnames = ['options'], +# perm='rw', +## name = 'Match to node shapes', +## info = 'Match the elevations to the network nodes shapes.', +# )) + + self.is_match_to_facilities = attrsman.add(cm.AttrConf('is_match_to_facilities', kwargs.get('is_match_to_facilities', True), + groupnames=['options'], + perm='rw', + name='Match to facilities', + info='Match the elevations to the facilities.', + )) + +# self.is_match_to_facilities_shape = attrsman.add(cm.AttrConf( 'is_match_to_facilities_shape',kwargs.get('is_match_to_facilities_shape',True), +## groupnames = ['options'], +# perm='rw', +## name = 'Match to facility shapes', +## info = 'Match the elevations to the facility shapes.', +# )) + + self.add_plotoptions(**kwargs) + self.add_save_options(**kwargs) + attrsman.delete('plottype') + attrsman.delete('length_arrowhead') + + def do(self): + + net = self._landuse.parent.net + + with open(self.elevationscsv_filepath, 'r') as csvFile: + reader = csv.reader(csvFile) + i = 1 + longitudes = [] + latitudes = [] + elevations = [] + ids_point = [] + for row in reader: + + longitudes.append(float(row[0])) + latitudes.append(float(row[1])) + elevations.append(float(row[2])) + ids_point.append(i) + i += 1 + + ids_point = np.array(ids_point) + longitudes = np.array(longitudes) + self.x_offset + latitudes = np.array(latitudes) + self.y_offset + elevations = np.array(elevations) + + csvFile.close() + ################################################################################# + quote = self.evaluate_quote(longitudes, latitudes, elevations, 2000., 10000.) + quote = self.evaluate_quote(longitudes, latitudes, elevations, 4000., 7000.) + quote = self.evaluate_quote(longitudes, latitudes, elevations, 7000., 11000.) + quote = self.evaluate_quote(longitudes, latitudes, elevations, 10000., 3000.) + ################################################### + + if self.is_match_to_nodes: + nodes = net.nodes + ids_node = nodes.get_ids() + coords = nodes.coords[ids_node] + for coord, id_node in zip(coords, ids_node): + + quote = self.evaluate_quote(longitudes, latitudes, elevations, coord[0], coord[1]) + + nodes.coords[id_node] = [coord[0], coord[1], quote] +# print 'node_coord', nodes.coords[id_node] + + shapes = nodes.shapes[ids_node] + for shape, id_node in zip(shapes, ids_node): + for coord, i in zip(shape, range(len(shape))): + # print coord + # print np.stack((longitudes, latitudes), axis = -1) + quote = self.evaluate_quote(longitudes, latitudes, elevations, coord[0], coord[1]) + nodes.shapes[id_node][i] = [coord[0], coord[1], quote] +# print 'node_shape', nodes.shapes[id_node] + +# coord[0] +# coord[1] + + if self.is_match_to_edges: + edges = net.edges + ids_edge = edges.get_ids() + shapes = edges.shapes[ids_edge] + for shape, id_edge in zip(shapes, ids_edge): + positive_climb = 0. + negative_climb = 0. + for coord, i in zip(shape, range(len(shape))): + # print coord + # print np.stack((longitudes, latitudes), axis = -1) + quote = self.evaluate_quote(longitudes, latitudes, elevations, coord[0], coord[1]) + + edges.shapes[id_edge][i] = [coord[0], coord[1], quote] + print edges.shapes[id_edge][i] + if i > 0 and (quote-quote_pre) > 0: + positive_climb += (quote-quote_pre) + elif i > 0 and (quote-quote_pre) < 0: + negative_climb += (-quote + quote_pre) + quote_pre = quote +# print 'edge_shape', edges.shapes[id_edge][i] + slope = (edges.shapes[id_edge][-1][2]-edges.shapes[id_edge][0][2])/edges.lengths[id_edge] + edges.average_slopes[id_edge] = slope + edges.positive_climbs[id_edge] = positive_climb + edges.negative_climbs[id_edge] = negative_climb +# print 'slope', slope + +# if self.is_match_to_zones: +## +# if self.is_match_to_facilities: + + ####################### + if self.is_plot_elevations: + fig = plt.figure() + ax = fig.add_subplot(111) +## import matplotlib +## import matplotlib.pyplot as plt +## cm = matplotlib.cm.get_cmap('RdYlBu') +# plt.subplot(111) +## plt.scatter(longitudes, latitudes, c=elevations, s=20, vmax = 70) +# plt.colorbar() +# plt.show() + plot_point_results_on_map(self, net, ax, longitudes, latitudes, values=elevations, + title='Elevations', valuelabel='[m]', + ) + plt.show() + ############################################ + + return True + + def evaluate_quote(self, longitudes, latitudes, elevations, x_point, y_point): + + dists = np.sqrt(np.sum((np.stack((longitudes, latitudes), axis=-1) - [x_point, y_point])**2, 1)) + + if is_scipy: + print 'use scipy to interpolate' + #tck = interpolate.splrep(x, y, s=0) + #xnew = np.linspace(np.min(x), np.max(x), 200) + #ynew = interpolate.splev(xnew, tck, der=0) + # if 1: + + nearest_longitudes = longitudes[(dists < self.interpolation_radius)] + nearest_latitudes = latitudes[(dists < self.interpolation_radius)] + nearest_elevations = elevations[(dists < self.interpolation_radius)] +## nearest_longitudes = longitudes[(longitudes < x_point + self.interpolation_radius)&(longitudes > x_point - self.interpolation_radius)&(latitudes < y_point + self.interpolation_radius)&(latitudes > y_point - self.interpolation_radius)] +## nearest_latitudes = latitudes[(longitudes < x_point + self.interpolation_radius)&(longitudes > x_point - self.interpolation_radius)&(latitudes < y_point + self.interpolation_radius)&(latitudes > y_point - self.interpolation_radius)] +## nearest_elevations = elevations[(longitudes < x_point + self.interpolation_radius)&(longitudes > x_point - self.interpolation_radius)&(latitudes < y_point + self.interpolation_radius)&(latitudes > y_point - self.interpolation_radius)] + print[x_point, y_point], nearest_longitudes, nearest_latitudes, nearest_elevations + if len(nearest_longitudes) > 15: + + f_inter = interpolate.SmoothBivariateSpline( + nearest_longitudes, nearest_latitudes, nearest_elevations,) # kind = self.method_interp ) +## ############################################# +## xnew = np.linspace(x_point-self.interpolation_radius/2, x_point+self.interpolation_radius/2,200) +## ynew = np.linspace(y_point-self.interpolation_radius/2, y_point+self.interpolation_radius/2,200) +## X, Y = np.meshgrid(xnew, ynew) +## Z = f_inter(xnew, ynew) +## +## +## fig = plt.figure() +## ax = fig.gca(projection='3d') +## +## +# Plot the surface. +# surf = ax.plot_surface(X, Y, Z, cmap=cmp.coolwarm, +# linewidth=0, antialiased=False) +## +## fig.colorbar(surf, shrink=0.5, aspect=5) +# plt.savefig('/home/cristian/scenarios_cri/Elevation/interpolation_%d'%(xnew[0])) +# plt.show() + ############################################# + quote = f_inter(x_point, y_point) + else: + quote = elevations[np.argmin(dists)] + print 'nearest quote' + else: + + nearest_quotes = elevations[(dists < 100)] + nearest_dists = dists[(dists < 100)] + numerator = 0.0 + denominator = 0.0 + for near_quote, near_dist in zip(nearest_quotes, nearest_dists): + numerator += near_quote/(10**(near_dist/10)) + denominator += 1/(10**(near_dist/10)) + # print numerator, denominator + if denominator != 0: + quote = numerator/denominator + else: + quote = elevations[np.argmin(dists)] + print 'nearest quote' + + return quote + + if __name__ == '__main__': ############################################################################ ### diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/landuse/wxgui.py sumo-1.12.0/tools/contributed/sumopy/coremodules/landuse/wxgui.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/landuse/wxgui.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/landuse/wxgui.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file wxgui.py # @author Joerg Schweizer -# @date +# @date 2012 import os import wx @@ -435,8 +435,7 @@ # print 'FacilityDrawings.update' n = len(self) - if n == 0: - return + # if n==0:return# causes problems with drawing the first houses self.colors.value[:] = np.ones((n, 4), np.float32)*self.color_facility_default.value self.colors_highl.value[:] = self._get_colors_highl(self.colors.value) @@ -743,16 +742,39 @@ bitmap=self.get_icon('map_del_24px.png'), ) + menubar.append_item('landuse/maps/import elevations from csv', + self.on_import_elevations_from_csv, + #bitmap = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE,wx.ART_MENU), + ) + menubar.append_menu('landuse/zones', bitmap=self.get_icon("fig_zone_24px.png"), ) + menubar.append_item('landuse/zones/import from shapefile...', + self.on_import_zones_from_shape, + #bitmap = self.get_icon('Files-Osm-icon_24.png'),# + ) menubar.append_item('landuse/zones/identify zone edges', self.on_refresh_zoneedges, info='Identify network edges that are located within each zone.', #bitmap = self.get_icon('Files-Osm-icon_24.png'),# ) - + menubar.append_item('landuse/zones/identify zone areas', + self.on_refresh_zoneareas, + info='Identify area of each zone in square kilometers.', + #bitmap = self.get_icon('Files-Osm-icon_24.png'),# + ) + menubar.append_item('landuse/zones/export zone.kml', + self.on_export_zone_kml, + info='Export zones in .kml format.', + bitmap=self.get_agileicon("Document_Export_24px.png"), + ) + menubar.append_item('landuse/zones/export to shape file...', + self.on_zones_to_shapefile, + #bitmap = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE,wx.ART_MENU) + bitmap=self.get_agileicon("Document_Export_24px.png"), + ) menubar.append_item('landuse/zones/clear all', self.on_clear_zones, info='Delete all zones.', @@ -779,7 +801,11 @@ #bitmap = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE,wx.ART_MENU) bitmap=self.get_agileicon("Document_Export_24px.png"), ) - + menubar.append_item('landuse/facilities/export kml file...', + self.on_facilities_to_kml, + #bitmap = wx.ArtProvider.GetBitmap(wx.ART_NORMAL_FILE,wx.ART_MENU) + bitmap=self.get_agileicon("Document_Export_24px.png"), + ) menubar.append_item('landuse/facilities/clean osm file...', self.on_clean_osm, info='Cleans OSM file from strange characters. Use if you have trouble importing from OSM.', @@ -828,10 +854,69 @@ bitmap=wx.ArtProvider.GetBitmap(wx.ART_DELETE, wx.ART_MENU), ) + def on_import_elevations_from_csv(self, event=None): + """ + Import elevation from a csv file. + """ + p = landuse.maps.CsvElevationsImport(self.get_scenario().net, logger=self._mainframe.get_logger()) + dlg = ProcessDialog(self._mainframe, p, immediate_apply=True) + + dlg.CenterOnScreen() + + # this does not return until the dialog is closed. + val = dlg.ShowModal() + # print ' val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL + # print ' status =',dlg.get_status() + if dlg.get_status() != 'success': # val == wx.ID_CANCEL: + # print ">>>>>>>>>Unsuccessful\n" + dlg.Destroy() + + if dlg.get_status() == 'success': + # print ">>>>>>>>>successful\n" + # apply current widget values to scenario instance + dlg.apply() + dlg.Destroy() +# self._mainframe.browse_obj(self.get_scenario().net.edges) + self._mainframe.refresh_moduleguis() + #self._is_needs_refresh = True + # self.refresh_widgets() + + def on_import_zones_from_shape(self, event=None): + """ + Import zones from shape file format. + """ + + proc = landuse.ZonesFromShapeImporter('shapeimporter', self._landuse.zones, logger=self._mainframe.get_logger()) + dlg = ProcessDialog(self._mainframe, proc, immediate_apply=True) + + dlg.CenterOnScreen() + + # this does not return until the dialog is closed. + val = dlg.ShowModal() + # print ' val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL + # print ' status =',dlg.get_status() + if dlg.get_status() != 'success': # val == wx.ID_CANCEL: + # print ">>>>>>>>>Unsuccessful\n" + dlg.Destroy() + + if dlg.get_status() == 'success': + # print ">>>>>>>>>successful\n" + # apply current widget values to scenario instance + dlg.apply() + dlg.Destroy() + # self._landuse.zones.refresh_zoneedges() + self._mainframe.browse_obj(self._landuse.zones) + self._is_needs_refresh = True + self._mainframe.refresh_moduleguis() + def on_refresh_zoneedges(self, event=None): self._landuse.zones.refresh_zoneedges() self._mainframe.browse_obj(self._landuse.zones) + def on_refresh_zoneareas(self, event=None): + self._landuse.zones.refresh_zonearea() + self._mainframe.browse_obj(self._landuse.zones) + def on_identify_taz(self, event=None): self._landuse.facilities.identify_taz() self._mainframe.browse_obj(self._landuse.facilities) @@ -890,7 +975,7 @@ dlg = wx.FileDialog( self._mainframe, message="Choose one or more osm files to clean", defaultDir=scenario.get_workdirpath(), - defaultFile=os.path.join(scenario.get_workdirpath(), scenario.get_rootfilename()+'osm.xml'), + # defaultFile = os.path.join(scenario.get_workdirpath(), scenario.get_rootfilename()+'osm.xml'), wildcard=wildcards, style=wx.OPEN | wx.MULTIPLE | wx.CHANGE_DIR ) @@ -938,7 +1023,7 @@ dlg = wx.FileDialog( self._mainframe, message="Choose one or more poly files", defaultDir=scenario.get_workdirpath(), - defaultFile=scenario.get_rootfilepath()+'.poly.xml', + # defaultFile = scenario.get_rootfilepath()+'.poly.xml', wildcard=wildcards, style=wx.OPEN | wx.MULTIPLE | wx.CHANGE_DIR ) @@ -967,6 +1052,35 @@ # BAD things can happen otherwise! dlg.Destroy() + def on_zones_to_shapefile(self, event=None): + """ + Export facility data to shape file. + """ + # print 'on_edges_to_shapefile' + + dirpath = self._landuse.parent.get_workdirpath() + defaultFile = self._landuse.parent.get_rootfilename()+'.facil.shp' + wildcards_all = 'All files (*.*)|*.*|SHP files (*.shp)|*.shp' + dlg = wx.FileDialog(None, message='Export facilities to shapefile', + defaultDir=dirpath, + # defaultFile=defaultFile, + wildcard=wildcards_all, style=wx.SAVE | wx.CHANGE_DIR) + if dlg.ShowModal() == wx.ID_OK: + filepath = dlg.GetPath() + + else: + return + + shapeformat.zones_to_shapefile(self._landuse.zones, + filepath, + log=self._mainframe.get_logger()) + + def on_export_zone_kml(self, event=None): + self._landuse.zones.export_sumokml() + self._mainframe.browse_obj(self._landuse.zones) + self._is_needs_refresh = True + self._mainframe.refresh_moduleguis() + def on_clear_zones(self, event=None): self._landuse.zones.clear() self._mainframe.browse_obj(self._landuse.zones) @@ -998,9 +1112,11 @@ def close_process_facilities(self, dlg): # called before destroying the process dialog + print 'close_process_facilities', self.proc.status if self.proc.status == 'success': self._mainframe.browse_obj(self._landuse.facilities) self._is_needs_refresh = True + self._mainframe.refresh_moduleguis() def on_clear_facilities(self, event=None): @@ -1028,7 +1144,7 @@ dlg = wx.FileDialog( self._mainframe, message="Choose one or more poly files", defaultDir=scenario.get_workdirpath(), - defaultFile=scenario.get_rootfilepath()+'.poly.xml', + # defaultFile = scenario.get_rootfilepath()+'.poly.xml', wildcard=wildcards, style=wx.SAVE | wx.CHANGE_DIR ) @@ -1054,7 +1170,8 @@ defaultFile = self._landuse.parent.get_rootfilename()+'.facil.shp' wildcards_all = 'All files (*.*)|*.*|SHP files (*.shp)|*.shp' dlg = wx.FileDialog(None, message='Export facilities to shapefile', - defaultDir=dirpath, defaultFile=defaultFile, + defaultDir=dirpath, + # defaultFile=defaultFile, wildcard=wildcards_all, style=wx.SAVE | wx.CHANGE_DIR) if dlg.ShowModal() == wx.ID_OK: filepath = dlg.GetPath() @@ -1066,6 +1183,17 @@ filepath, log=self._mainframe.get_logger()) + def on_facilities_to_kml(self, event=None): + """ + Export facility data to kml file. + """ + # print 'on_edges_to_kml' + + self._landuse.facilities.export_sumokml() + self._mainframe.browse_obj(self._landuse.zones) + self._is_needs_refresh = True + self._mainframe.refresh_moduleguis() + def on_import_osm(self, event=None): importer = landuse.OsmPolyImporter(self._landuse, logger=self._mainframe.get_logger()) dlg = ProcessDialog(self._mainframe, importer) diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/misc/__init__.py sumo-1.12.0/tools/contributed/sumopy/coremodules/misc/__init__.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/misc/__init__.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/misc/__init__.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file __init__.py # @author Joerg Schweizer -# @date +# @date 2012 __version__ = "0.0" diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/misc/matplottools.py sumo-1.12.0/tools/contributed/sumopy/coremodules/misc/matplottools.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/misc/matplottools.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/misc/matplottools.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,8 +14,13 @@ # @file matplottools.py # @author Joerg Schweizer -# @date +# @date 2012 +from agilepy.lib_wx.processdialog import ProcessDialog, ProcessDialogInteractive +from agilepy.lib_base.processes import Process +from agilepy.lib_base.geometry import * +import agilepy.lib_base.arrayman as am +import agilepy.lib_base.classman as cm import os import numpy as np from collections import OrderedDict @@ -27,39 +32,70 @@ import matplotlib.pyplot as plt import matplotlib.image as image from matplotlib.ticker import MaxNLocator +import matplotlib.patches as mpatches + +if 0: # change backend...makes problems with plt + gui_env = ['WXAgg', 'GTKAgg', 'Qt4Agg', 'TKAgg', ] + for gui in gui_env: + try: + print "Try Matplotlib backend:", gui + mpl.use(gui, warn=False, force=True) + from mpl.patches import Arrow, Circle, Wedge, Polygon, FancyArrow + from mpl.mpl import PatchCollection + import matplotlib.colors as colors + import mpl.cm as cmx + import mpl.pyplot as plt + import mpl.image as image + from mpl.ticker import MaxNLocator + import mpl.patches as mpatches + break + except: + continue + print "Using Matplotlib backend", mpl.get_backend() + try: import wx except: print 'WARNING: no wxwindows support' -import agilepy.lib_base.classman as cm -import agilepy.lib_base.arrayman as am -from agilepy.lib_base.geometry import * -from agilepy.lib_base.processes import Process -from agilepy.lib_wx.processdialog import ProcessDialog, ProcessDialogInteractive COLORS = ['#1f77b4', '#aec7e8', '#ff7f0e', '#ffbb78', '#2ca02c', '#98df8a', '#d62728', '#ff9896', '#9467bd', '#c5b0d5', '#8c564b', '#c49c94', '#e377c2', '#f7b6d2', '#7f7f7f', '#c7c7c7', '#bcbd22', '#dbdb8d', '#17becf', '#9edae5'] +LINESTYLES = ['-', '--', '-.', ':', 'None'] + -N_COLORS = len(COLORS) +MARKERSTYLES = ['None', 'o', 'v', 's', '*', '^', 'h', 'D', 'p', '<', '>'] + +global ind_fig +ind_fig = 0 def get_color(i): - return COLORS[i % len(N_COLORS)] + return COLORS[i % len(COLORS)] def get_colors(inds): return np.array(COLORS, dtype=np.str)[np.mod(inds, len(COLORS))] +def get_marker(i): + return MARKERSTYLES[i % len(MARKERSTYLES)] + + +def get_markers(inds): + return np.array(MARKERSTYLES, dtype=np.str)[np.mod(inds, len(MARKERSTYLES))] + + class ResultDialog(ProcessDialog): def _get_buttons(self): buttons = [('Plot and close', self.on_run, 'Plot selected quantity in matplotlib window and close this window thereafter.'), ('Plot', self.on_show, 'Plot selected quantity in matplotlib window.'), + ('Save Options...', self.on_save_options, self.on_save_options.__doc__), + ('Load Options...', self.on_load_options, self.on_load_options.__doc__), ] defaultbutton = 'Plot and close' standartbuttons = ['cancel', ] @@ -75,20 +111,54 @@ return wx.Bitmap(os.path.join(icondir, 'icon_mpl.png')) -def init_plot(): +def init_plot(tight_layout=True): plt.close("all") fig = plt.figure() ax = fig.add_subplot(111) - fig.tight_layout() + if tight_layout: + fig.tight_layout() return ax +def init_plot_fig_ax(): + plt.close("all") + fig = plt.figure() + ax = fig.add_subplot(111) + return fig, ax + + +def new_plot(tight_layout=True): + global ind_fig + fig = plt.figure(ind_fig) + ind_fig += 1 + ax = fig.add_subplot(111) + if tight_layout: + fig.tight_layout() + return ax + + +def new_doubkeplot(tight_layout=True): + global ind_fig + fig = plt.figure(ind_fig) + ind_fig += 1 + if tight_layout: + fig.tight_layout() + return plt.subplot(2, 1, 1), plt.subplot(2, 1, 2) + + def plot_net(ax, net, color_edge="gray", width_edge=2, color_node=None, - alpha=0.5): + alpha=0.5, is_show_connections=True, mapscale=1.0): for shape in net.edges.shapes.get_value(): x_vec = np.array(shape)[:, 0] y_vec = np.array(shape)[:, 1] - ax.plot(x_vec, y_vec, color=color_edge, lw=width_edge, alpha=alpha, zorder=-100) + ax.plot(x_vec*mapscale, y_vec*mapscale, color=color_edge, lw=width_edge, alpha=alpha, zorder=-100) + if is_show_connections: + for id_connection in net.connections.get_ids(): + x_vec = np.array([net.edges.shapes[net.lanes.ids_edge[net.connections.ids_fromlane[id_connection]]] + [-1, 0], net.edges.shapes[net.lanes.ids_edge[net.connections.ids_tolane[id_connection]]][0, 0]]) + y_vec = np.array([net.edges.shapes[net.lanes.ids_edge[net.connections.ids_fromlane[id_connection]]] + [-1, 1], net.edges.shapes[net.lanes.ids_edge[net.connections.ids_tolane[id_connection]]][0, 1]]) + ax.plot(x_vec*mapscale, y_vec*mapscale, color=color_edge, lw=width_edge*0.8, alpha=alpha, zorder=-100) # do nodes if color_node is None: @@ -103,7 +173,7 @@ #ax.scatter(coords[:,0], coords[:,1], s=np.pi * (radii)**2, alpha=0.5) #patches = [] for coord, radius in zip(coords, radii): - ax.add_patch(Circle(coord, radius=radius, + ax.add_patch(Circle(coord*mapscale, radius=radius*mapscale, linewidth=width_edge, edgecolor=color_edge, facecolor=color_node, @@ -112,7 +182,7 @@ zorder=-50)) -def plot_maps(ax, maps, alpha=0.5): +def plot_maps(ax, maps, alpha=0.5, mapscale=1.0): # print 'plot_maps' net = maps.parent.get_net() rootdir = os.path.dirname(net.parent.get_rootfilepath()) @@ -128,34 +198,102 @@ # print ' filepath',filepath im = image.imread(filepath) myaximage = ax.imshow(im, aspect='auto', extent=( - bbox[0, 0], bbox[1, 0], bbox[0, 1], bbox[1, 1]), alpha=alpha, zorder=-1000) + bbox[0, 0]*mapscale, bbox[1, 0]*mapscale, bbox[0, 1]*mapscale, bbox[1, 1]*mapscale), alpha=alpha, zorder=-1000) + +# def plot_facilities(ax, facilities, color_building = "gray", + # color_outline = 'white', width_line = 2, + # alpha = 0.5, mapscale=1.0): + + # if color_building is None: + # is_fill = False + # color_building = 'none' + # else: + # is_fill = True + # print mpl.patches.Polygon.__doc__ + # for shape in facilities.shapes.get_value(): + # #x_vec = np.array(shape)[:,0] + # #y_vec = np.array(shape)[:,1] + # #ax.plot(x_vec, y_vec, color = color_building, lw = width_line, + # # alpha=alpha ) + # print ' add shape',shape + # ax.add_patch(mpl.patches.Polygon( np.array(shape)[:,:2]*mapscale, + # linewidth = width_line, + # edgecolor = color_outline, + # facecolor = color_building, + # fill = is_fill, + # alpha = alpha, + # zorder = -200)) def plot_facilities(ax, facilities, color_building="gray", color_outline='white', width_line=2, - alpha=0.5): + alpha=0.5, mapscale=1.0): if color_building is None: is_fill = False color_building = 'none' else: is_fill = True - for shape in facilities.shapes.get_value(): #x_vec = np.array(shape)[:,0] #y_vec = np.array(shape)[:,1] # ax.plot(x_vec, y_vec, color = color_building, lw = width_line, # alpha=alpha ) - ax.add_patch(Polygon(np.array(shape)[:, :2], - linewidth=width_line, - edgecolor=color_outline, - facecolor=color_building, - fill=is_fill, - alpha=alpha, - zorder=-200)) + ax.add_patch(mpl.patches.Polygon(np.array(shape)[:, :2]*mapscale, + linewidth=width_line, + edgecolor=color_outline, + facecolor=color_building, + fill=is_fill, + alpha=alpha, + zorder=-200)) + + +def plot_zones(ax, zones, color_zone=None, + color_outline='green', width_line=2, + alpha=0.5, mapscale=1.0): + + if color_zone is None: + is_fill = False + color_zone = 'none' + else: + is_fill = True + for shape in zones.shapes.get_value(): + #x_vec = np.array(shape)[:,0] + #y_vec = np.array(shape)[:,1] + # ax.plot(x_vec, y_vec, color = color_building, lw = width_line, + # alpha=alpha ) + ax.add_patch(mpl.patches.Polygon(np.array(shape)[:, :2]*mapscale, + linewidth=width_line, + edgecolor=color_outline, + facecolor=color_zone, + fill=is_fill, + alpha=alpha, + zorder=200)) + + +def plot_zone(ax, zone_shape, color_zone="gray", + color_outline='white', width_line=2, + alpha=0.5, zorder=-200, mapscale=1.0): + + if color_zone is None: + is_fill = False + color_building = 'none' + else: + is_fill = True + + shape = (np.array(zone_shape)[:, :2]*mapscale).tolist() + print shape + ax.add_patch(Polygon(shape, + linewidth=width_line, + edgecolor=color_outline, + facecolor=color_zone, + fill=is_fill, + alpha=alpha, + zorder=-200)) -def plot_edgevalues_lines(ax, ids_result, config_ids_edge, values, +def plot_edgevalues_lines(ax, ids_result=None, config_ids_edge=None, values=[], + ids_edge=None, edges=None, width_max=10.0, alpha=0.8, printformat='%.2f', color_outline=None, color_fill=None, color_label='black', is_antialiased=True, @@ -164,13 +302,17 @@ headwidthstretch=1.3, fontsize=32, valuelabel='', - value_range=None): + value_range=None, + is_colorbar=True, + mapscale=1.0): + # ATTENTION: do not change order of args for backwards compatibility head_width = headwidthstretch*width_max fontsize_ticks = int(0.8*fontsize) - edges = config_ids_edge.get_linktab() - ids_edges = config_ids_edge[ids_result] + if ids_edge is None: + edges = config_ids_edge.get_linktab() + ids_edge = config_ids_edge[ids_result] #values = config_values[ids_result] values_norm = np.array(values, dtype=np.float32)/np.max(values) @@ -193,38 +335,44 @@ # http://stackoverflow.com/questions/8342549/matplotlib-add-colorbar-to-a-sequence-of-line-plots/11558629#11558629 sm = cmx.ScalarMappable(norm=c_norm, cmap=jet) sm.set_array(values_norm) - for id_edge, value, value_norm, linewidth in zip(ids_edges, values, values_norm, linewidths): - shape, angles_perb = get_resultshape(edges, id_edge, displacement) - x_vec = np.array(shape)[:, 0] - y_vec = np.array(shape)[:, 1] - deltax = x_vec[-1]-x_vec[0] - deltay = y_vec[-1]-y_vec[0] - # http://matplotlib.org/users/pyplot_tutorial.html - line = mpl.lines.Line2D(x_vec, y_vec, color=sm.to_rgba(value), - linewidth=linewidth, - antialiased=is_antialiased, - alpha=alpha, - solid_capstyle='round', - zorder=0, - ) - ax.add_line(line) - - if printformat is not '': - angles_text = np.arctan2(deltay, deltax)+deltaangle_text - # print ' angles_text',printformat%value,angles_text/(np.pi)*180,(angles_text>np.pi/2),(angles_text<3*np.pi/2) - if (angles_text > np.pi/2) | (angles_text < -np.pi/2): - angles_text += np.pi - x_label = x_vec[0]+0.66*deltax+displacement_text*np.cos(angles_text) - y_label = y_vec[0]+0.66*deltay+displacement_text*np.sin(angles_text) - - ax.text(x_label, y_label, printformat % value, - rotation=angles_text/(np.pi)*180, - color=color_label, - fontsize=fontsize_ticks, - zorder=10, - ) + for id_edge, value, value_norm, linewidth in zip(ids_edge, values, values_norm, linewidths): + if not np.isnan(value): + shape, angles_perb = get_resultshape(edges, id_edge, displacement) + x_vec = np.array(shape)[:, 0] + y_vec = np.array(shape)[:, 1] + deltax = x_vec[-1]-x_vec[0] + deltay = y_vec[-1]-y_vec[0] + if is_fill: # means that fill with value proportional color + color = sm.to_rgba(value) + else: + color = color_fill + + # http://matplotlib.org/users/pyplot_tutorial.html + line = mpl.lines.Line2D(x_vec*mapscale, y_vec*mapscale, color=color, + linewidth=linewidth, + antialiased=is_antialiased, + alpha=alpha, + solid_capstyle='round', + zorder=0, + ) + ax.add_line(line) - if is_fill: + if printformat is not '': + angles_text = np.arctan2(deltay, deltax)+deltaangle_text + # print ' angles_text',printformat%value,angles_text/(np.pi)*180,(angles_text>np.pi/2),(angles_text<3*np.pi/2) + if (angles_text > np.pi/2) | (angles_text < -np.pi/2): + angles_text += np.pi + x_label = x_vec[0]+0.66*deltax+displacement_text*np.cos(angles_text) + y_label = y_vec[0]+0.66*deltay+displacement_text*np.sin(angles_text) + + ax.text(x_label*mapscale, y_label*mapscale, printformat % value, + rotation=angles_text/(np.pi)*180, + color=color_label, + fontsize=fontsize_ticks, + zorder=10, + ) + + if is_fill & is_colorbar: cbar = plt.colorbar(sm) # mpl.setp(cbar.ax.yaxis.get_ticklabels(), fontsize=fontsize)#weight='bold', # cb.ax.tick_params(labelsize=font_size) @@ -235,7 +383,96 @@ l.set_fontsize(fontsize_ticks) -def plot_edgevalues_arrows(ax, ids_result, config_ids_edge, values, +def plot_connectionvalues_lines(ax, ids_result=None, config_ids_connection=None, values=[], + ids_connection=None, connections=None, net=None, + width_max=10.0, alpha=0.8, printformat='%.2f', + color_outline=None, color_fill=None, + color_label='black', is_antialiased=True, + is_fill=True, is_widthvalue=True, + arrowshape='left', length_arrowhead=10.0, + headwidthstretch=1.3, + fontsize=32, + valuelabel='', + value_range=None, + is_colorbar=True, + mapscale=1.0): + # ATTENTION: do not change order of args for backwards compatibility + + head_width = headwidthstretch*width_max + fontsize_ticks = int(0.8*fontsize) + + #values = config_values[ids_result] + values_norm = np.array(values, dtype=np.float32)/np.max(values) + + patches = [] + displacement = float(width_max)/2.0 + if is_widthvalue: + linewidths = width_max*values_norm + else: + linewidths = width_max * np.ones(len(values_norm), np.float32) + + deltaangle_text = -np.pi/2.0 + displacement_text = displacement+width_max + + jet = cm_jet = plt.get_cmap('jet') + if value_range is None: + c_norm = colors.Normalize(vmin=0, vmax=np.max(values)) + else: + c_norm = colors.Normalize(vmin=value_range[0], vmax=value_range[1]) + + # http://stackoverflow.com/questions/8342549/matplotlib-add-colorbar-to-a-sequence-of-line-plots/11558629#11558629 + sm = cmx.ScalarMappable(norm=c_norm, cmap=jet) + sm.set_array(values_norm) + for id_connection, value, value_norm, linewidth in zip(ids_connection, values, values_norm, linewidths): + if not np.isnan(value): + shape, angles_perb = get_resultshape_connections(net, id_connection, displacement) + x_vec = np.array(shape)[:, 0] + y_vec = np.array(shape)[:, 1] + deltax = x_vec[-1]-x_vec[0] + deltay = y_vec[-1]-y_vec[0] + if is_fill: # means that fill with value proportional color + color = sm.to_rgba(value) + else: + color = color_fill + + # http://matplotlib.org/users/pyplot_tutorial.html + line = mpl.lines.Line2D(x_vec*mapscale, y_vec*mapscale, color=color, + linewidth=linewidth, + antialiased=is_antialiased, + alpha=alpha, + solid_capstyle='round', + zorder=0, + ) + ax.add_line(line) + + if printformat is not '': + angles_text = np.arctan2(deltay, deltax)+deltaangle_text + # print ' angles_text',printformat%value,angles_text/(np.pi)*180,(angles_text>np.pi/2),(angles_text<3*np.pi/2) + if (angles_text > np.pi/2) | (angles_text < -np.pi/2): + angles_text += np.pi + x_label = x_vec[0]+0.66*deltax+displacement_text*np.cos(angles_text) + y_label = y_vec[0]+0.66*deltay+displacement_text*np.sin(angles_text) + + ax.text(x_label*mapscale, y_label*mapscale, printformat % value, + rotation=angles_text/(np.pi)*180, + color=color_label, + fontsize=fontsize_ticks, + zorder=10, + ) + + if is_fill & is_colorbar: + cbar = plt.colorbar(sm) + # mpl.setp(cbar.ax.yaxis.get_ticklabels(), fontsize=fontsize)#weight='bold', + # cb.ax.tick_params(labelsize=font_size) + if valuelabel != '': + cbar.ax.set_ylabel(valuelabel, fontsize=fontsize) # , weight="bold") + for l in cbar.ax.yaxis.get_ticklabels(): + # l.set_weight("bold") + l.set_fontsize(fontsize_ticks) + + +def plot_edgevalues_arrows(ax, ids_result=None, config_ids_edge=None, values=[], + ids_edge=None, edges=None, width_max=10.0, alpha=0.8, printformat='%.2f', color_outline=None, color_fill=None, color_label='black', is_antialiased=True, @@ -244,13 +481,20 @@ headwidthstretch=1.3, fontsize=32, valuelabel='', - value_range=None): + value_range=None, + mapscale=1.0): + + # ATTENTION: do not change order of args for backwards compatibility + print 'plot_edgevalues_arrows ids_result width_max', width_max + # print ' ids_result',ids_result + # print ' ids_edge',ids_edge + if ids_edge is None: + edges = config_ids_edge.get_linktab() + ids_edge = config_ids_edge[ids_result] head_width = headwidthstretch*width_max fontsize_ticks = int(0.8*fontsize) - edges = config_ids_edge.get_linktab() - ids_edges = config_ids_edge[ids_result] #values = config_values[ids_result] values_norm = np.array(values, dtype=np.float32)/np.max(values) @@ -263,36 +507,230 @@ deltaangle_text = -np.pi/2.0 displacement_text = displacement+width_max - for id_edge, value, value_norm, linewidth in zip(ids_edges, values, values_norm, linewidths): - shape, angles_perb = get_resultshape(edges, id_edge, displacement) - x_vec = np.array(shape)[:, 0] - y_vec = np.array(shape)[:, 1] - deltax = x_vec[-1]-x_vec[0] - deltay = y_vec[-1]-y_vec[0] + for id_edge, value, value_norm, linewidth in zip(ids_edge, values, values_norm, linewidths): + if not np.isnan(value): + shape, angles_perb = get_resultshape(edges, id_edge, displacement) + x_vec = np.array(shape)[:, 0] + y_vec = np.array(shape)[:, 1] + deltax = x_vec[-1]-x_vec[0] + deltay = y_vec[-1]-y_vec[0] + + if printformat is not '': + angles_text = np.arctan2(deltay, deltax)+deltaangle_text + if (angles_text > np.pi/2) | (angles_text < -np.pi/2): + angles_text += np.pi + x_label = x_vec[0]+0.66*deltax+displacement_text*np.cos(angles_text) + y_label = y_vec[0]+0.66*deltay+displacement_text*np.sin(angles_text) + + ax.text(x_label*mapscale, y_label*mapscale, printformat % value, + rotation=angles_text/(np.pi)*180, + color=color_label, + fontsize=fontsize_ticks, + zorder=10, + ) - if printformat is not '': - angles_text = np.arctan2(deltay, deltax)+deltaangle_text - if (angles_text > np.pi/2) | (angles_text < -np.pi/2): - angles_text += np.pi - x_label = x_vec[0]+0.66*deltax+displacement_text*np.cos(angles_text) - y_label = y_vec[0]+0.66*deltay+displacement_text*np.sin(angles_text) - - ax.text(x_label, y_label, printformat % value, - rotation=angles_text/(np.pi)*180, - color=color_label, - fontsize=fontsize_ticks, - zorder=10, - ) - - if is_widthvalue: - head_width = headwidthstretch*linewidth - arrow = FancyArrow(x_vec[0], y_vec[0], deltax, deltay, width=linewidth, - antialiased=is_antialiased, - edgecolor=color_outline, facecolor=color_fill, - head_width=head_width, head_length=length_arrowhead, - length_includes_head=True, - fill=True, shape=arrowshape, zorder=0) - patches.append(arrow) + if is_widthvalue: + head_width = headwidthstretch*linewidth + arrow = FancyArrow(x_vec[0]*mapscale, y_vec[0]*mapscale, deltax*mapscale, deltay*mapscale, width=linewidth*mapscale, + antialiased=is_antialiased, + edgecolor=color_outline, facecolor=color_fill, + head_width=head_width, head_length=length_arrowhead, + length_includes_head=True, + fill=True, shape=arrowshape, zorder=0) + patches.append(arrow) + + if is_fill: + alpha_patch = alpha + patchcollection = PatchCollection(patches, cmap=mpl.cm.jet, alpha=alpha_patch) + patchcollection.set_array(values) + + # custom value range + if value_range is not None: + patchcollection.set_clim(value_range) + + ax.add_collection(patchcollection) + cbar = plt.colorbar(patchcollection) + if valuelabel != '': + cbar.ax.set_ylabel(valuelabel, fontsize=fontsize) # , weight="bold") + for l in cbar.ax.yaxis.get_ticklabels(): + # l.set_weight("bold") + l.set_fontsize(fontsize_ticks) + else: + for patch in patches: + ax.add_patch(patch) + + +def plot_connectionvalues_arrows(ax, ids_result=None, config_ids_edge=None, values=[], + ids_connection=None, connections=None, net=None, + width_max=10.0, alpha=0.8, printformat='%.2f', + color_outline=None, color_fill=None, + color_label='black', is_antialiased=True, + is_fill=True, is_widthvalue=True, + arrowshape='left', length_arrowhead=10.0, + headwidthstretch=1.3, + fontsize=32, + valuelabel='', + value_range=None, + mapscale=1.0): + + # ATTENTION: do not change order of args for backwards compatibility + print 'plot_connectionvalues_arrows ids_result' + + head_width = headwidthstretch*width_max + fontsize_ticks = int(0.8*fontsize) + + #values = config_values[ids_result] + values_norm = np.array(values, dtype=np.float32)/np.max(values) + + patches = [] + displacement = float(width_max)/4.0 + if is_widthvalue: + linewidths = width_max*values_norm + else: + linewidths = width_max * np.ones(len(values_norm), np.float32) + + deltaangle_text = -np.pi/2.0 + displacement_text = displacement+width_max + for id_connection, value, value_norm, linewidth in zip(ids_connection, values, values_norm, linewidths): + if not np.isnan(value): + shape, angles_perb = get_resultshape_connections(net, id_connection, displacement) + x_vec = np.array(shape)[:, 0] + y_vec = np.array(shape)[:, 1] + deltax = x_vec[-1]-x_vec[0] + deltay = y_vec[-1]-y_vec[0] + + if printformat is not '': + angles_text = np.arctan2(deltay, deltax)+deltaangle_text + if (angles_text > np.pi/2) | (angles_text < -np.pi/2): + angles_text += np.pi + x_label = x_vec[0]+0.66*deltax+displacement_text*np.cos(angles_text) + y_label = y_vec[0]+0.66*deltay+displacement_text*np.sin(angles_text) + + ax.text(x_label*mapscale, y_label*mapscale, printformat % value, + rotation=angles_text/(np.pi)*180, + color=color_label, + fontsize=fontsize_ticks, + zorder=10, + ) + + if is_widthvalue: + head_width = headwidthstretch*linewidth + arrow = FancyArrow(x_vec[0]*mapscale, y_vec[0]*mapscale, deltax*mapscale, deltay*mapscale, width=linewidth*mapscale, + antialiased=is_antialiased, + edgecolor=color_outline, facecolor=color_fill, + head_width=head_width, head_length=length_arrowhead, + length_includes_head=True, + fill=True, shape=arrowshape, zorder=0) + patches.append(arrow) + + if is_fill: + alpha_patch = alpha + patchcollection = PatchCollection(patches, cmap=mpl.cm.jet, alpha=alpha_patch) + patchcollection.set_array(values) + + # custom value range + if value_range is not None: + patchcollection.set_clim(value_range) + + ax.add_collection(patchcollection) + cbar = plt.colorbar(patchcollection) + if valuelabel != '': + cbar.ax.set_ylabel(valuelabel, fontsize=fontsize) # , weight="bold") + for l in cbar.ax.yaxis.get_ticklabels(): + # l.set_weight("bold") + l.set_fontsize(fontsize_ticks) + else: + for patch in patches: + ax.add_patch(patch) + + +def plot_nodevalues(ax, ids_result=None, config_ids_edge=None, values=[], + ids_node=None, nodes=None, net=None, + ## width_max = 10.0, + alpha=0.8, + printformat='%.2f', + ## color_outline = None, + ## color_fill = None, + ## color_label = 'black', + ## is_antialiased = True, + is_fill=True, + ## is_widthvalue = True, + ## arrowshape = 'left', + ## length_arrowhead = 10.0, + ## headwidthstretch = 1.3, + fontsize=32, + valuelabel='', + value_range=None, + mapscale=1.0): + + # ATTENTION: do not change order of args for backwards compatibility + print 'plot_nodevalues ids_result' + fontsize_ticks = int(0.8*fontsize) + + patches = [] + for id_node, value, in zip(ids_node, values): + + if not np.isnan(value): + poly = mpl.patches.Polygon(np.transpose(np.stack((np.array(net.nodes.shapes[id_node])[ + :][:, 0]*mapscale, np.array(net.nodes.shapes[id_node])[:][:, 1]*mapscale)))) + patches.append(poly) + + if is_fill: + alpha_patch = alpha + patchcollection = PatchCollection(patches, cmap=mpl.cm.jet, alpha=alpha_patch) + patchcollection.set_array(values) + + # custom value range + if value_range is not None: + patchcollection.set_clim(value_range) + + ax.add_collection(patchcollection) + cbar = plt.colorbar(patchcollection) + if valuelabel != '': + cbar.ax.set_ylabel(valuelabel, fontsize=fontsize) # , weight="bold") + for l in cbar.ax.yaxis.get_ticklabels(): + # l.set_weight("bold") + l.set_fontsize(fontsize_ticks) + else: + for patch in patches: + ax.add_patch(patch) + + +def plot_pointvalues(ax, x_coords, y_coords, values, + net=None, + width_max=10.0, + alpha=0.8, + printformat='%.2f', + ## color_outline = None, + ## color_fill = None, + ## color_label = 'black', + ## is_antialiased = True, + is_fill=True, + is_widthvalue=True, + ## arrowshape = 'left', + ## length_arrowhead = 10.0, + ## headwidthstretch = 1.3, + fontsize=32, + valuelabel='', + value_range=None, + mapscale=1.0 + ): + + # ATTENTION: do not change order of args for backwards compatibility + print 'plot_pointvalues ids_result' + fontsize_ticks = int(0.8*fontsize) +## i = 0 + patches = [] + for x, y, value in zip(x_coords*mapscale, y_coords*mapscale, values): + + if not np.isnan(value): + if is_widthvalue: + poly = mpl.patches.Circle([x, y], radius=value*width_max/np.max(values)*mapscale, ) + else: + poly = mpl.patches.Circle([x, y], radius=width_max*mapscale) + patches.append(poly) +# print i +# i+=1 if is_fill: alpha_patch = alpha @@ -319,6 +757,7 @@ """ Return resultshape coords for this edge. """ + # print 'get_resultshape',edges,'id_edge',id_edge,'dispacement', dispacement shape = np.array(edges.shapes[id_edge], np.float32) n_vert = len(shape) resultshape = np.zeros(shape.shape, np.float32) @@ -333,41 +772,58 @@ return shape.copy(), angles_perb +def get_resultshape_connections(net, id_connection, dispacement): + """ + Return resultshape coords for this edge. + """ + print 'get_resultshape', 'connections', 'id_connection', id_connection, 'dispacement', dispacement + x0 = net.edges.shapes[net.lanes.ids_edge[net.connections.ids_fromlane[id_connection]]][-1, 0] + y0 = net.edges.shapes[net.lanes.ids_edge[net.connections.ids_fromlane[id_connection]]][-1, 1] + x1 = net.edges.shapes[net.lanes.ids_edge[net.connections.ids_tolane[id_connection]]][0, 0] + y1 = net.edges.shapes[net.lanes.ids_edge[net.connections.ids_tolane[id_connection]]][0, 1] + if x0 != x1 or y0 != y1: + shape = np.array([[x0, y0, 0.], [x1, y1, 0.]]) + else: + shape = np.array([[x0, y0, 0.], [x1 + 1., y1 + 1., 0.]]) + print 'connection', id_connection, 'has no shape' + n_vert = len(shape) + resultshape = np.zeros(shape.shape, np.float32) + #laneshapes = np.zeros((n_lanes,n_vert,3), np.float32) + angles_perb = get_angles_perpendicular(shape) + + return shape.copy(), angles_perb + + def show_plot(): plt.show() class PlotoptionsMixin: + def add_plotoptions(self, **kwargs): + """ + [depricated] + These are plotoptions for edge results shown on a map. + """ + attrsman = self.get_attrsman() + self.add_edgeresultoptions(**kwargs) + self.add_networkoptions(**kwargs) + self.add_facilityoptions(**kwargs) + self.add_zoneoptions(**kwargs) + self.add_plotoptions_mapbase(**kwargs) + self.add_plotoptions_base(**kwargs) + def add_edgeresultoptions(self, **kwargs): attrsman = self.get_attrsman() plottypes = ['arrows', 'polygons'] - self.plottype = attrsman.add(cm.AttrConf('plottype', kwargs.get('plottype', 'arrows'), + self.plottype = attrsman.add(cm.AttrConf('plottype', kwargs.get('plottype', 'polygons'), choices=plottypes, groupnames=['options'], name='Plot types', info='Plot type representing the results.', )) - self.is_show_title = attrsman.add(cm.AttrConf('is_show_title', kwargs.get('is_show_title', True), - groupnames=['options'], - name='Show tile', - info='Shows title and unit.', - )) - - self.size_titlefont = attrsman.add(cm.AttrConf('size_titlefont', kwargs.get('size_titlefont', 32), - groupnames=['options'], - name='Title fontsize', - info='Title fontsize.', - )) - - self.size_labelfont = attrsman.add(cm.AttrConf('size_labelfont', kwargs.get('size_labelfont', 24), - groupnames=['options'], - name='Label fontsize', - info='Label fontsize.', - )) - - self.resultwidth = attrsman.add(cm.AttrConf('resultwidth', kwargs.get('resultwidth', 10.0), + self.resultwidth = attrsman.add(cm.AttrConf('resultwidth', kwargs.get('resultwidth', 4.0), groupnames=['options'], name='Result width', unit='m', @@ -381,7 +837,7 @@ info='Length of arrowhead on result map.', )) - self.is_widthvalue = attrsman.add(cm.AttrConf('is_widthvalue', kwargs.get('is_widthvalue', False), + self.is_widthvalue = attrsman.add(cm.AttrConf('is_widthvalue', kwargs.get('is_widthvalue', True), groupnames=['options'], name='Value width?', info='If True, the arrow width of the graphical representation is proportional to the result value.', @@ -399,13 +855,13 @@ info='If True, value range is set manually, otherwise value range is adjusted according to values.', )) - self.value_range_min = attrsman.add(cm.AttrConf('value_range_min', kwargs.get('value_range_min', 0.0), + self.value_range_min = attrsman.add(cm.AttrConf('value_range_min', kwargs.get('value_range_min', 1.0), groupnames=['options'], name='Min. value range', info='Minimum value range, if manual value range is selected.', )) - self.value_range_max = attrsman.add(cm.AttrConf('value_range_max', kwargs.get('value_range_max', 1.0), + self.value_range_max = attrsman.add(cm.AttrConf('value_range_max', kwargs.get('value_range_max', 40.0), groupnames=['options'], name='Max. value range', info='Maximum value range, if manual value range is selected.', @@ -426,42 +882,37 @@ info='Fill color of result arrows in graphical representation.', )) - self.alpha_results = attrsman.add(cm.AttrConf('alpha_results', kwargs.get('alpha_results', 0.8), + self.valuelabel = attrsman.add(cm.AttrConf('valuelabel', kwargs.get('valuelabel', ''), + groupnames=['options'], + name='Value label', + info='Label of results, as shown in the plot. Leave blank for default values.', + )) + + self.alpha_results = attrsman.add(cm.AttrConf('alpha_results', kwargs.get('alpha_results', 0.5), groupnames=['options'], name='Result transparency', - info='Transparency of result arrows in graphical representation.', + info='Transparency of result objects in graphical representation.', )) - self.printformat = attrsman.add(cm.AttrConf('printformat', kwargs.get('printformat', '%.1f'), - choices=OrderedDict([ - ('Show no values', ''), - ('x', '%.d'), - ('x.x', '%.1f'), - ('x.xx', '%.2f'), - ('x.xxx', '%.3f'), - ('x.xxxx', '%.4f'), - ]), - groupnames=['options'], - name='Label formatting', - info='Print formatting of value label in graphical representation.', - )) - - self.color_label = attrsman.add(cm.AttrConf('color_label', kwargs.get('color_label', np.array([0, 0, 0, 1], dtype=np.float32)), - groupnames=['options'], - perm='wr', - metatype='color', - name='Label color', - info='Color of value label in graphical representation.', - )) - + def add_networkoptions(self, **kwargs): + """ + Network plot options + """ + attrsman = self.get_attrsman() self.is_show_network = attrsman.add(cm.AttrConf('is_show_network', kwargs.get('is_show_network', True), - groupnames=['options'], + groupnames=['options', 'network'], name='Show network', info='Shows a schematic network in the background.', )) + self.is_show_connections = attrsman.add(cm.AttrConf('is_show_connections', kwargs.get('is_show_connections', False), + groupnames=['options', 'network'], + name='Show network-connections', + info='Shows connections between edges in the network.', + )) + self.color_network = attrsman.add(cm.AttrConf('color_network', kwargs.get('color_network', np.array([0.8, 0.8, 0.8, 0.8], dtype=np.float32)), - groupnames=['options'], + groupnames=['options', 'network'], perm='wr', metatype='color', name='Network color', @@ -469,26 +920,39 @@ )) self.color_nodes = attrsman.add(cm.AttrConf('color_nodes', kwargs.get('color_nodes', np.array([1, 1, 1, 1], dtype=np.float32)), - groupnames=['options'], + groupnames=['options', 'network'], perm='wr', metatype='color', name='Nodes color', info='Color of simplified nodes (or juctions in the background.', )) self.alpha_net = attrsman.add(cm.AttrConf('alpha_net', kwargs.get('alpha_net', 0.5), - groupnames=['options'], + groupnames=['options', 'network'], name='Net transparency', info='Transparency of network (edges and nodes) in graphical representation.', )) + self.is_show_maps = attrsman.add(cm.AttrConf('is_show_maps', kwargs.get('is_show_maps', False), + groupnames=['options', 'network'], + name='Show map?', + info='If True, shows map as background in graphical representation. This feature requires that maps have been previously downloaded.', + )) + + self.alpha_maps = attrsman.add(cm.AttrConf('alpha_maps', kwargs.get('alpha_maps', 0.5), + groupnames=['options', 'network'], + name='Map transparency', + info='Transparency of background maps in graphical representation.', + )) - self.is_show_facilities = attrsman.add(cm.AttrConf('is_show_facilities', kwargs.get('is_show_facilities', True), - groupnames=['options'], + def add_facilityoptions(self, **kwargs): + attrsman = self.get_attrsman() + self.is_show_facilities = attrsman.add(cm.AttrConf('is_show_facilities', kwargs.get('is_show_facilities', False), + groupnames=['options', 'facilities'], name='Show facilities', info='Shows a schematic facilities (buildings, parks, etc.) in the background.', )) self.color_facilities = attrsman.add(cm.AttrConf('color_facilities', kwargs.get('color_facilities', np.array([1, 1, 1, 1], dtype=np.float32)), - groupnames=['options'], + groupnames=['options', 'facilities'], perm='wr', metatype='color', name='Facilities color', @@ -496,19 +960,140 @@ )) self.alpha_facilities = attrsman.add(cm.AttrConf('alpha_facilities', kwargs.get('alpha_facilities', 0.5), - groupnames=['options'], + groupnames=['options', 'facilities'], name='Facility transparency', info='Transparency of facilities in graphical representation.', )) self.color_borders = attrsman.add(cm.AttrConf('color_borders', kwargs.get('color_borders', np.array([0.7, 0.7, 0.7, 0.8], dtype=np.float32)), - groupnames=['options'], + groupnames=['options', 'facilities'], perm='wr', metatype='color', - name='Border color', + name='Facility border color', info='Facility border (or building walls) color of schematic facilities in the background.', )) + def add_zoneoptions(self, **kwargs): + attrsman = self.get_attrsman() + self.is_show_zones = attrsman.add(cm.AttrConf('is_show_zones', kwargs.get('is_show_zones', False), + groupnames=['options', 'zones'], + name='Show Zones', + info='Show zone polygons.', + )) + + self.color_zones = attrsman.add(cm.AttrConf('color_zones', kwargs.get('color_zones', np.array([0.2, 0.8, 0.2, 1.0], dtype=np.float32)), + groupnames=['options', 'zones'], + perm='wr', + metatype='color', + name='Zone color', + info='Fill color of Zone.', + )) + + self.alpha_zones = attrsman.add(cm.AttrConf('alpha_zones', kwargs.get('alpha_zones', 0.1), + groupnames=['options', 'zones'], + name='Zone transparency', + info='Transparency of color of zones.', + )) + + self.color_zoneborders = attrsman.add(cm.AttrConf('color_zoneborders', kwargs.get('color_zoneborders', np.array([0.0, 0.7, 0.0, 1.0], dtype=np.float32)), + groupnames=['options', 'zones'], + perm='wr', + metatype='color', + name='Zone border color', + info='Color of zone border.', + )) + + def add_plotoptions_lineplot(self, is_marker_only=False, **kwargs): + """ + These are plotoptions for y over x oriented graphs. + """ + attrsman = self.get_attrsman() + + if not is_marker_only: + self.color_line = attrsman.add(cm.AttrConf('color_line', kwargs.get('color_line', np.array([1, 0, 0, 1], dtype=np.float32)), + groupnames=['options'], + perm='wr', + metatype='color', + name='Line color', + info='Color of line in various diagrams.', + )) + + self.width_line = attrsman.add(cm.AttrConf('width_line', kwargs.get('width_line', 2), + groupnames=['options'], + perm='wr', + name='Line width', + info='Width of plotted lines.', + )) + + self.style_line = attrsman.add(cm.AttrConf('style_line', kwargs.get('style_line', '-'), + choices=LINESTYLES, + groupnames=['options'], + name='Line Style', + info='Line styles used for plots.', + )) + + self.alpha_line = attrsman.add(cm.AttrConf('alpha_line', kwargs.get('alpha_line', 0.9), + groupnames=['options'], + name='Line transparency', + info='Line transparency used for plots.', + )) + + if is_marker_only: + style_marker_default = 'o' + else: + style_marker_default = 'o' + + self.style_marker = attrsman.add(cm.AttrConf('style_marker', kwargs.get('style_marker', style_marker_default), + choices=MARKERSTYLES, + groupnames=['options'], + name='Marker Style', + info='Marker style used for plots.', + )) + + self.color_marker = attrsman.add(cm.AttrConf('color_marker', kwargs.get('color_marker', np.array([0, 0, 1, 1], dtype=np.float32)), + groupnames=['options'], + perm='wr', + metatype='color', + name='Marker color', + info='Color of marker in plot.', + )) + + self.size_marker = attrsman.add(cm.AttrConf('size_marker', kwargs.get('size_marker', 16), + groupnames=['options'], + perm='wr', + name='Marker size', + info='Size of marker in plot.', + )) + + self.xlabel = attrsman.add(cm.AttrConf('xlabel', kwargs.get('xlabel', ''), + groupnames=['options'], + name='X label', + info='X-axis label text, if blank then default values are used.', + )) + + self.ylabel = attrsman.add(cm.AttrConf('ylabel', kwargs.get('ylabel', ''), + groupnames=['options'], + name='Y label', + info='Y-axis label text, if blank then default values are used.', + )) + self.add_plotoptions_base(**kwargs) + + def add_plotoptions_mapbase(self, **kwargs): + """ + These are all necessary option to plot whatever on a map. + """ + attrsman = self.get_attrsman() + self.unit_mapscale = attrsman.add(cm.AttrConf('unit_mapscale', kwargs.get('unit_mapscale', 'm'), + groupnames=['options', 'network'], + choices=['m', 'km'], + mapscales={'m': 1.0, 'km': 0.001}, + name='Unit', + info='Unit used for map.', + )) + + def add_plotoptions_base(self, **kwargs): + attrsman = self.get_attrsman() + self.axis = None self.color_background = attrsman.add(cm.AttrConf('color_background', kwargs.get('color_background', np.array([1, 1, 1, 1], dtype=np.float32)), groupnames=['options'], perm='wr', @@ -517,25 +1102,57 @@ info='Background color of schematic network in the background.', )) - self.is_show_maps = attrsman.add(cm.AttrConf('is_show_maps', kwargs.get('is_show_maps', False), - groupnames=['options'], - name='Show map?', - info='If True, shows map as background in graphical representation. This feature requires that maps have been previously downloaded.', - )) - - self.alpha_maps = attrsman.add(cm.AttrConf('alpha_maps', kwargs.get('alpha_maps', 0.5), - groupnames=['options'], - name='Map transparency', - info='Transparency of background maps in graphical representation.', - )) - self.is_grid = attrsman.add(cm.AttrConf('is_grid', kwargs.get('is_grid', False), groupnames=['options'], name='Show grid?', info='If True, shows a grid on the graphical representation.', )) - self.axis = None + self.is_show_title = attrsman.add(cm.AttrConf('is_show_title', kwargs.get('is_show_title', True), + groupnames=['options'], + name='Show title', + info='Shows title on top of figure.', + )) + + self.title = attrsman.add(cm.AttrConf('title', kwargs.get('title', ''), + groupnames=['options'], + name='Title', + info='Title text, if blank then default values are used.', + )) + + self.size_titlefont = attrsman.add(cm.AttrConf('size_titlefont', kwargs.get('size_titlefont', 16), + groupnames=['options'], + name='Title fontsize', + info='Title fontsize.', + )) + + self.size_labelfont = attrsman.add(cm.AttrConf('size_labelfont', kwargs.get('size_labelfont', 14), + groupnames=['options'], + name='Label fontsize', + info='Label fontsize.', + )) + + self.printformat = attrsman.add(cm.AttrConf('printformat', kwargs.get('printformat', ''), + choices=OrderedDict([ + ('Show no values', ''), + ('x', '%.d'), + ('x.x', '%.1f'), + ('x.xx', '%.2f'), + ('x.xxx', '%.3f'), + ('x.xxxx', '%.4f'), + ]), + groupnames=['options'], + name='Label formatting', + info='Print formatting of value label in graphical representation.', + )) + + self.color_label = attrsman.add(cm.AttrConf('color_label', kwargs.get('color_label', np.array([0, 0, 0, 1], dtype=np.float32)), + groupnames=['options'], + perm='wr', + metatype='color', + name='Label color', + info='Color of value label in graphical representation.', + )) def add_save_options(self, **kwargs): @@ -548,7 +1165,7 @@ self.figformat = attrsman.add(cm.AttrConf('figformat', kwargs.get('figformat', 'png'), groupnames=['options'], - choices=['png', 'pdf', 'jpg'], + choices=['png', 'pdf', 'jpg', 'svg'], name='Graphics format', info='Format of saved graphic.', )) @@ -601,6 +1218,8 @@ ) def do(self): + """"This method calls the show method which should be overriden + by to execute class specific plot actions.""" # print 'do',self.edgeattrname self.show() return True @@ -609,8 +1228,11 @@ plt.subplots_adjust(left=0.1, right=0.9, top=0.9, bottom=0.1) def save_fig(self, figname): + rootfilepath = self.get_scenario().get_rootfilepath() - plt.savefig("%s_%s.%s" % (rootfilepath, figname, self.figformat), format=self.figformat, + filepath = "%s_%s.%s" % (rootfilepath, figname, self.figformat) + print 'save_fig', filepath + plt.savefig(filepath, format=self.figformat, dpi=self.resolution, # orientation='landscape', orientation='portrait', @@ -697,80 +1319,272 @@ bincenters = 0.5*(bins0[1:]+bins0[:-1]) return bincenters - def plot_results_on_map(self, axis, ids, values, title='', valuelabel=''): - edgesresults = self.get_edgeresults() - net = self.parent.get_scenario().net - axis.set_axis_bgcolor(self.color_background) - if self.is_show_network: - plot_net(axis, net, color_edge=self.color_network, width_edge=2, - color_node=self.color_nodes, alpha=self.alpha_net) - - if self.is_show_facilities: - facilities = self.parent.get_scenario().landuse.facilities - plot_facilities(axis, facilities, color_building=self.color_facilities, - color_outline=self.color_borders, - width_line=2, alpha=self.alpha_facilities, - ) - if self.is_show_maps: - plot_maps(axis, self.parent.get_scenario().landuse.maps, alpha=self.alpha_maps) + def plot_results_on_map(self, axis, ids_edgeres=None, values=[], + ids_edge=None, + title='', valuelabel='', + is_connection_results=False, ids_connectionres=None, ids_connection=None): + + # axis, ids, resultattrconf[ids] , title, valuelabel = resultattrconf.format_symbol() + + if self.valuelabel != "": + valuelabel = self.valuelabel + + if is_connection_results: + if ids_connection is None: + ids_connection = self.get_connectionresults().ids_connection[ids_connectionres] + else: + if ids_edge is None: + ids_edge = self.get_edgeresults().ids_edge[ids_edgeres] + + net = self.get_scenario().net + + unit = self.unit_mapscale + mapscale = self.get_attrsman().get_config('unit_mapscale').mapscales[unit] + # print ' unit',unit + # print ' mapscale',mapscale + #xticks =axis.get_xticks() + #yticks =axis.get_yticks() + # print 'xticks',xticks + # print 'yticks',yticks + self.plot_net(axis, mapscale=mapscale, unit=unit, is_configure=False) if self.is_value_range: value_range = (self.value_range_min, self.value_range_max) else: value_range = None - if len(ids > 0): + if is_connection_results: if self.plottype == 'arrows': # = ['Arrows','Polygons'] - plot_edgevalues_arrows(axis, ids, - edgesresults.ids_edge, - values, - width_max=self.resultwidth, - alpha=self.alpha_results, - printformat=self.printformat, - color_outline=self.color_outline, - color_fill=self.color_fill, - color_label=self.color_label, - is_antialiased=True, - is_fill=self.is_colorvalue, - is_widthvalue=self.is_widthvalue, - length_arrowhead=self.length_arrowhead, - fontsize=self.size_labelfont, - valuelabel=valuelabel, - value_range=value_range, - ) + plot_connectionvalues_arrows(axis, + # ids, + # edgesresults.ids_edge, + ids_connection=ids_connection, + values=values, + connections=net.connections, + net=net, + width_max=self.resultwidth, + alpha=self.alpha_results, + printformat=self.printformat, + color_outline=self.color_outline, + color_fill=self.color_fill, + color_label=self.color_label, + is_antialiased=True, + is_fill=self.is_colorvalue, + is_widthvalue=self.is_widthvalue, + length_arrowhead=self.length_arrowhead, + fontsize=self.size_labelfont, + valuelabel=valuelabel, + value_range=value_range, + mapscale=mapscale) elif self.plottype == 'polygons': - plot_edgevalues_lines(axis, ids, - edgesresults.ids_edge, - values, # values for result ids - width_max=self.resultwidth, - alpha=self.alpha_results, - printformat=self.printformat, - color_outline=self.color_outline, - color_fill=self.color_fill, - color_label=self.color_label, - is_antialiased=True, - is_fill=self.is_colorvalue, - is_widthvalue=self.is_widthvalue, - length_arrowhead=self.length_arrowhead, - fontsize=self.size_labelfont, - valuelabel=valuelabel, - value_range=value_range, - ) + plot_connectionvalues_lines(axis, + # ids, + # edgesresults.ids_edge, + ids_connection=ids_connection, + values=values, + connections=net.connections, + net=net, + width_max=self.resultwidth, + alpha=self.alpha_results, + printformat=self.printformat, + color_outline=self.color_outline, + color_fill=self.color_fill, + color_label=self.color_label, + is_antialiased=True, + is_fill=self.is_colorvalue, + is_widthvalue=self.is_widthvalue, + length_arrowhead=self.length_arrowhead, + fontsize=self.size_labelfont, + valuelabel=valuelabel, + value_range=value_range, + mapscale=mapscale) + else: + if len(ids_edge) > 0: + if self.plottype == 'arrows': # = ['Arrows','Polygons'] + plot_edgevalues_arrows(axis, + # ids, + # edgesresults.ids_edge, + ids_edge=ids_edge, + values=values, + edges=net.edges, + width_max=self.resultwidth, + alpha=self.alpha_results, + printformat=self.printformat, + color_outline=self.color_outline, + color_fill=self.color_fill, + color_label=self.color_label, + is_antialiased=True, + is_fill=self.is_colorvalue, + is_widthvalue=self.is_widthvalue, + length_arrowhead=self.length_arrowhead, + fontsize=self.size_labelfont, + valuelabel=valuelabel, + value_range=value_range, + mapscale=mapscale) + elif self.plottype == 'polygons': + plot_edgevalues_lines(axis, + # ids, + # edgesresults.ids_edge, + ids_edge=ids_edge, + values=values, + edges=net.edges, + width_max=self.resultwidth, + alpha=self.alpha_results, + printformat=self.printformat, + color_outline=self.color_outline, + color_fill=self.color_fill, + color_label=self.color_label, + is_antialiased=True, + is_fill=self.is_colorvalue, + is_widthvalue=self.is_widthvalue, + length_arrowhead=self.length_arrowhead, + fontsize=self.size_labelfont, + valuelabel=valuelabel, + value_range=value_range, + mapscale=mapscale) + + self.configure_map(axis, title, unit=unit) + + def configure_map(self, axis, title=None, unit='m'): if self.is_show_title: + if self.title != "": + title = self.title + axis.set_title(title, fontsize=self.size_titlefont) axis.axis('equal') # ax.legend(loc='best',shadow=True) axis.grid(self.is_grid) - axis.set_xlabel('West-East [m]', fontsize=self.size_labelfont) - axis.set_ylabel('South-North [m]', fontsize=self.size_labelfont) + axis.set_xlabel('West-East ['+unit+']', fontsize=self.size_labelfont) + axis.set_ylabel('South-North ['+unit+']', fontsize=self.size_labelfont) axis.tick_params(axis='x', labelsize=int(0.8*self.size_labelfont)) axis.tick_params(axis='y', labelsize=int(0.8*self.size_labelfont)) + + # get borders right, this seems to work + plt.subplots_adjust(left=0.12, bottom=0.1, right=0.86, top=0.9, wspace=0.2, hspace=0.2) + # show_plot() #x_min,y_min,x_max,y_max = net.get_boundaries(is_netboundaries = True) # axis.set_autoscaley_on(False) # axis.set_xlim([x_min,x_max]) # axis.set_ylim([y_min,y_max]) + + def plot_net(self, axis=None, title="", unit='', mapscale=None, is_configure=True): + print 'plot_net mapscale', mapscale + if mapscale is None: + unit = self.unit_mapscale + mapscale = self.get_attrsman().get_config('unit_mapscale').mapscales[unit] + + if axis is None: + axis = init_plot() + + if hasattr(self, 'is_show_network'): + if self.is_show_network: + net = self.get_scenario().net + plot_net(axis, net, color_edge=self.color_network, width_edge=2, + color_node=self.color_nodes, alpha=self.alpha_net, is_show_connections=self.is_show_connections, mapscale=mapscale) + + if hasattr(self, 'is_show_facilities'): + if self.is_show_facilities: + facilities = self.get_scenario().landuse.facilities + plot_facilities(axis, facilities, color_building=self.color_facilities, + color_outline=self.color_borders, + width_line=2, alpha=self.alpha_facilities, + mapscale=mapscale) + if hasattr(self, 'is_show_maps'): + if self.is_show_maps: + plot_maps(axis, self.get_scenario().landuse.maps, alpha=self.alpha_maps, mapscale=mapscale) + + if hasattr(self, 'is_show_zones'): + if self.is_show_zones: + zones = self.get_scenario().landuse.zones + plot_zones(axis, zones, color_zone=self.color_zones, + color_outline=self.color_zoneborders, + width_line=2, alpha=self.alpha_zones, + mapscale=mapscale) + if is_configure: + self.configure_map(axis, title=title, unit=unit) + + def plot_node_results_on_map(self, axis, ids_noderes=None, values=[], + ids_node=None, + title='', valuelabel='', + is_node_results=False, ): + + if ids_node is None: + ids_node = self.get_noderesults().ids_node[ids_noderes] + + net = self.get_scenario().net + + unit = self.unit_mapscale + mapscale = self.get_attrsman().get_config('unit_mapscale').mapscales[unit] + self.plot_net(axis, mapscale=mapscale, unit=unit, is_configure=False) + + if self.is_value_range: + value_range = (self.value_range_min, self.value_range_max) + else: + value_range = None + + if is_node_results: + plot_nodevalues(axis, + # ids, + # edgesresults.ids_edge, + ids_node=ids_node, + values=values, + nodes=net.nodes, + ## width_max = self.resultwidth, + alpha=self.alpha_results, + ## printformat = self.printformat, + ## color_outline = self.color_outline, + ## color_fill = self.color_fill, + ## color_label = self.color_label, + ## is_antialiased = True, + is_fill=self.is_colorvalue, + ## is_widthvalue = self.is_widthvalue, + ## length_arrowhead = self.length_arrowhead, + fontsize=self.size_labelfont, + valuelabel=valuelabel, + value_range=value_range, + net=net + ) + + self.configure_map(axis, title, unit=unit) + + def plot_point_results_on_map(self, net, axis, x_coords, y_coords, values=[], + title='', valuelabel='', + ): + + unit = self.unit_mapscale + mapscale = self.get_attrsman().get_config('unit_mapscale').mapscales[unit] + self.plot_net(axis, mapscale=mapscale, unit=unit, is_configure=False) + + if self.is_value_range: + value_range = (self.value_range_min, self.value_range_max) + else: + value_range = None + + plot_pointvalues(axis, + # ids, + # edgesresults.ids_edge, + x_coords=x_coords, + y_coords=y_coords, + values=values, + width_max=self.resultwidth, + alpha=self.alpha_results, + ## printformat = self.printformat, + ## color_outline = self.color_outline, + ## color_fill = self.color_fill, + ## color_label = self.color_label, + ## is_antialiased = True, + is_fill=self.is_colorvalue, + is_widthvalue=self.is_widthvalue, + ## length_arrowhead = self.length_arrowhead, + fontsize=self.size_labelfont, + valuelabel=valuelabel, + value_range=value_range, + net=net + ) + + self.configure_map(axis, title, unit=unit) diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/misc/shapefile.py sumo-1.12.0/tools/contributed/sumopy/coremodules/misc/shapefile.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/misc/shapefile.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/misc/shapefile.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file shapefile.py # @author Joerg Schweizer -# @date +# @date 2012 """ shapefile.py diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/misc/shapeformat.py sumo-1.12.0/tools/contributed/sumopy/coremodules/misc/shapeformat.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/misc/shapeformat.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/misc/shapeformat.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file shapeformat.py # @author Joerg Schweizer -# @date +# @date 2012 import time @@ -191,15 +191,15 @@ shapefilepath = os.path.join(dirname, basename) - projparams = '' projfilepath = shapefilepath+'.prj' + proj4 = '' if not os.path.isfile(projfilepath): projfilepath = shapefilepath+'.PRJ' if os.path.isfile(projfilepath): prj_file = open(projfilepath, 'r') prj_txt = prj_file.read() - proj4 = '' + if IS_GDAL: srs = osr.SpatialReference() if srs.ImportFromWkt(prj_txt): @@ -276,115 +276,185 @@ class ShapefileImporter(Process): - def __init__(self, filepath, - coordsconfig, - map_attrconfig2shapeattr=None, - attrconfigs=None, - ident='shapefileimporter', parent=None, - name='Shapefile importer', - info='Import of shape files', + def __init__(self, ident='shapefileimporter', parent=None, + name='Shape file importer', + filepath='', + coordsattr='', + attrnames_to_shapeattrs={}, + info='Import of shape files in parent datastructure.', logger=None, **kwargs): - self._filepath = filepath - self._sf = get_shapefile(filepath) - projparams_shape = get_proj4_from_shapefile(filepath) - projparams_target_default = self.guess_targetproj() - print 'ShapefileImporter.__init__', filepath # ,projparams_target_default, projparams_shape self._init_common(ident, parent=parent, name=name, logger=logger, - info='Import workouts and GPS points of a European cycling challange.', + info=info, ) attrsman = self.set_attrsman(cm.Attrsman(self)) - # if projparams_target == '': - # projparams_target = '' - # is_guess_targetproj = True - # is_use_shapeproj = False - - #projparams_shape = projparams_shapefile - - self.make_fieldinfo() - - # self.id_mode = attrsman.add(am.AttrConf('id_mode', modechoices['bicycle'], - # groupnames = ['options'], - # choices = modechoices, - # name = 'Mode', - # info = 'Transport mode to be matched.', - # )) - - self.filepath = attrsman.add( - cm.AttrConf('filepath', filepath, - groupnames=['parameters'], - perm='r', - name='Shape file', - wildcards='Shape file (*.shp)|*.shp', - metatype='filepath', - info="""File path of shape file.""", - )) + self.filepath = attrsman.add(cm.AttrConf('filepath', filepath, + groupnames=['options'], + perm='rw', + name='Shape file', + wildcards='Shape file (*.shp)|*.shp|All files (*.*)|*.*', + metatype='filepath', + info="""File path of shape file. Note that only the file with the extention ".shp" needs to be selected. Attention: all file extensions must be in small letters, for example .shp .dbf, shx, etc""", + )) + + # print 'self.filepath',self.filepath + attrsman_parent = parent.get_attrsman() + self._coordsconfig = attrsman_parent.get_config(coordsattr) + + for attrname, shapeattr_default in attrnames_to_shapeattrs.iteritems(): + config = attrsman_parent.get_config(attrname) + fieldname = 'fieldname_'+attrname + setattr(self, fieldname, + attrsman.add(cm.AttrConf(fieldname, shapeattr_default, + groupnames=['options', 'field names'], + perm='rw', + attrname_orig=attrname, + name='Field for '+config.get_name(), + info='Field name for the following attribute: '+config.get_info(), + ))) - self.projparams_shape = attrsman.add(cm.AttrConf('projparams_shape', projparams_shape, - groupnames=['parameters', ], + self.projparams_shape = attrsman.add(cm.AttrConf('projparams_shape', kwargs.get("projparams_shape", ''), + groupnames=['options', ], perm='rw', name='Shape projection', - info='Projection4 parameters of shape data.', + info='Projection4 parameters of shape data. If blank then shape file projection is used or if not present, projection will be guessed from shape coordinates.', )) - self.is_guess_targetproj = attrsman.add(cm.AttrConf('is_guess_targetproj', kwargs.get("is_guess_targetproj", True), - groupnames=['parameters', ], - perm='r', - name='Guess target projection?', - info='If selected, target projection will be guessed based on coordinates of the shapefile.', - )) - - self.projparams_target = attrsman.add(cm.AttrConf('projparams_target', kwargs.get("projparams_target", projparams_target_default), - groupnames=['parameters', ], - perm='r', - name='Target projection', - info='Projection4 parameters of target, where the coordinates are imported. These are typically the scenario coordinates.', - )) + # self.projparams_target = attrsman.add(cm.AttrConf( 'projparams_target', kwargs.get("projparams_target",''), + # groupnames = ['options',], + # perm='rw', + # name = 'Target projection', + # info = 'Projection4 parameters of target, where the coordinates are imported. These are typically the scenario coordinates.', + # )) + self._projparams_target = kwargs.get("projparams_target", '') self.is_use_shapeproj = attrsman.add(cm.AttrConf('is_use_shapeproj', kwargs.get("is_use_shapeproj", False), - groupnames=['parameters', ], - perm='r', + groupnames=['options', ], + perm='rw', name='Use shapefile projection?', info='If selected, projection in shape file will be used to interpret projection. If not selected, target projection will be used.', )) self.is_use_targetproj = attrsman.add(cm.AttrConf('is_use_targetproj', kwargs.get("is_use_targetproj", True), - groupnames=['parameters', ], - perm='r', + groupnames=['options', ], + perm='rw', name='Use target projection?', info='If selected, target will be used to interpret projection.', )) - self.is_autoffset = attrsman.add(cm.AttrConf('is_autoffset', kwargs.get("is_autoffset", True), - groupnames=['parameters', ], - perm='r', + self.is_probe_offset = attrsman.add(cm.AttrConf('is_probe_offset', kwargs.get("is_probe_offset", False), + groupnames=['options', ], + perm='rw', + name='Probe offset?', + info="""With probe offset, a specific coordinate from the shap-map and the target-map will be used to calculate the offset. + This requires the coordinates of a dedicated point of the shape file and of the target. + This method can be used if there is an unknon offset in the shape map coordinate system. + """, + )) + + self.x_probe_shape = attrsman.add(cm.AttrConf('x_probe_shape', kwargs.get("x_probe_shape", 0.0), + groupnames=['options', ], + perm='rw', + name='Probed x coord of shape', + unit='m', + info='Probed x coord of shape-map.', + )) + + self.y_probe_shape = attrsman.add(cm.AttrConf('y_probe_shape', kwargs.get("y_probe_shape", 0.0), + groupnames=['options', ], + perm='rw', + name='Probed y coord shape', + unit='m', + info='Probed y coord of shape-map.', + )) + + self.x_probe_target = attrsman.add(cm.AttrConf('x_probe_target', kwargs.get("x_probe_target", 0.0), + groupnames=['options', ], + perm='rw', + name='Probed x coord of target', + unit='m', + info='Probed x coord of target-map.', + )) + + self.y_probe_target = attrsman.add(cm.AttrConf('y_probe_target', kwargs.get("y_probe_target", 0.0), + groupnames=['options', ], + perm='rw', + name='Probed y coord target', + unit='m', + info='Probed y coord of target-map.', + )) + + self.is_autoffset = attrsman.add(cm.AttrConf('is_autoffset', kwargs.get("is_autoffset", False), + groupnames=['options', ], + perm='rw', name='Auto offset?', info='If selected, offset will be determined automatically.', )) - self.offset = attrsman.add(cm.AttrConf('offset', kwargs.get("offset", np.array([0.0, 0.0, 0.0], dtype=np.float32)), - groupnames=['parameters', ], - perm='r', - name='Offset', - info='Network offset in WEP coordinates', - )) - - self._coordsconfig = coordsconfig - - if map_attrconfig2shapeattr is None: - # generate attrconfs with group 'options' - # and default attrconfmap - self._map_attrconfig2shapeattr = {} + # self.offset = attrsman.add(cm.AttrConf( 'offset', kwargs.get("offset",np.array([0.0,0.0,0.0],dtype = np.float32)), + # groupnames = ['options',], + # perm='r', + # name = 'Offset', + # unit = 'm', + # info = 'Network offset in WEP coordinates', + # )) + + self._offset = kwargs.get("offset", np.array([0.0, 0.0, 0.0], dtype=np.float32)) + + self.is_limit_to_boundaries = attrsman.add(cm.AttrConf('is_limit_to_boundaries', kwargs.get("is_limit_to_boundaries", True), + groupnames=['options', ], + perm='rw', + name='Limit to boundaries?', + info='Import only shapes that fit into the given boundaries.', + )) + + # self.boundaries = attrsman.add(cm.AttrConf( 'boundaries',kwargs.get('boundaries',np.array([0.0,0.0,0.0,0.0],dtype = np.float32)) , + # groupnames = ['options',], + # perm='r', + # name = 'Boundaries', + # unit = 'm', + # info = 'Area limiting boundaries', + # )) + self.boundaries = kwargs.get('boundaries', np.array([0.0, 0.0, 0.0, 0.0], dtype=np.float32)) + # if map_attrconfig2shapeattr is None: + # # generate attrconfs with group 'options' + # # and default attrconfmap + # self._map_attrconfig2shapeattr = {} + # + # else: + # self._map_attrconfig2shapeattr = map_attrconfig2shapeattr + + def inboundaries(self, points, x_border=0.0, y_border=0.0): + """ + Tests if the given points are in + the boundaries. - else: - self._map_attrconfig2shapeattr = map_attrconfig2shapeattr + Returns a binary vector with one element for each point + If an element is True then the corrisponding + point in within the networks bounding box. + Otherwise the point is outside. + Elevation is ignored. + Format of points: + [[x1,y1,z1],[x2,y2,z2],...] + + + + """ + # print 'inboundaries' + # print ' self',self.boundaries + # print ' points',type(points),points + # print ' return',( (self.boundaries[2] >= BB[0]) & (self.boundaries[0] <= BB[2]) & + # (self.boundaries[3] >= BB[1]) & (self.boundaries[1] <= BB[3]) ) + + return ((self.boundaries[2]-x_border >= points[:, 0]) & (self.boundaries[0]+x_border <= points[:, 0]) & + (self.boundaries[3]-y_border >= points[:, 1]) & (self.boundaries[1]+y_border <= points[:, 1])) def make_fieldinfo(self): @@ -396,43 +466,49 @@ self._fieldinfo[attrname] = (ind_field-1, default, dtype, digits_fraction) def get_projections(self): + print 'get_projections IS_PROJ', IS_PROJ + print 'self.projparams_shape', self.projparams_shape, 'self._projparams_target', self._projparams_target + + proj_shape = None + proj_target = None - proj1 = None - proj2 = None + if self.is_use_shapeproj & (self.projparams_shape == ''): + print ' no shape projection given' + self.projparams_shape = get_proj4_from_shapefile(self.filepath) + print ' from prj file projparams_shape', self.projparams_shape + if self.projparams_shape == '': + # no results from shapefile info, let's try to guess + self.projparams_shape = self.guess_shapeproj() + print ' from guessing projparams_shape', self.projparams_shape - if self.is_guess_targetproj: - self.projparams_target = self.guess_targetproj() + # if self.is_guess_targetproj: + # self.projparams_target = self.guess_targetproj() # print 'get_projections' # print ' projparams_shape',self.projparams_shape # print ' projparams_target',self.projparams_target if IS_PROJ: - try: - proj_shape = pyproj.Proj(self.projparams_shape) - except: - proj_shape = None - - try: - proj_target = pyproj.Proj(self.projparams_target) - except: - proj_target = None - - if self.is_use_targetproj & (proj_target is not None): - if (self.is_use_shapeproj) & (proj_shape is not None): - proj1 = proj_shape - proj2 = proj_target - else: - proj1 = proj_target + if self.is_use_shapeproj: - elif (self.is_use_shapeproj) & (proj_shape is not None): - proj1 = proj_shape + try: + print ' use projparams_shape =*%s*' % self.projparams_shape, type(str(self.projparams_shape)), pyproj.Proj(str(self.projparams_shape)) + proj_shape = pyproj.Proj(str(self.projparams_shape)) + except: + proj_shape = None + + if self.is_use_targetproj: + try: + print ' use projparams_target =*%s*' % self._projparams_target, type(str(self._projparams_target)), pyproj.Proj(str(self._projparams_target)) + proj_target = pyproj.Proj(str(self._projparams_target)) + except: + proj_target = None - return proj1, proj2, self.offset + return proj_shape, proj_target, self._offset else: # no projection available return None, None, self.offset - def guess_targetproj(self): + def guess_shapeproj(self): shapes = self._sf.shapes() #shapetype = shapes[3].shapeType shape_rec = self._sf.shapeRecord(0) @@ -440,73 +516,116 @@ return guess_utm_from_coord(points[0]) def _get_attrconfs_shapeinds(self): + attrsman_parent = self.parent.get_attrsman() attrconfs = [] shapeinds = [] - for attrconf, shapeattrname in self._map_attrconfig2shapeattr.iteritems(): - attrconfs.append(attrconf) - shapeinds.append(self._fieldinfo[shapeattrname][0]) + + for fieldconf in self.get_attrsman().get_group('field names'): + + shapeattrname = fieldconf.get_value() + attrconf = attrsman_parent.get_config(fieldconf.attrname_orig) + + if self._fieldinfo.has_key(shapeattrname): + attrconfs.append(attrconf) + shapeinds.append(self._fieldinfo[shapeattrname][0]) + + # for attrconf, shapeattrname in self._map_attrconfig2shapeattr.iteritems(): + # attrconfs.append(attrconf) + # shapeinds.append(self._fieldinfo[shapeattrname][0]) return attrconfs, shapeinds def is_ready(self): return True def import_shapes(self): + print 'import_shapes' shapes = self._sf.shapes() shapetype = shapes[3].shapeType records = self._sf.records() n_records = len(records) if n_records == 0: - return False + return [], 0 + + proj_shape, proj_target, offset_target = self.get_projections() + + # print ' proj_shape',proj_shape,'proj_target',proj_target + if self.is_use_shapeproj & (proj_shape is None): + print 'WARNING: import_shapes, no shape projection' + return [], 0 + if self.is_use_targetproj & (proj_target is None): + print 'WARNING: import_shapes, no target projection' + return [], 0 + + offset = np.array([0.0, 0.0, 0.0], dtype=np.float32) - proj_shape, proj_target, offset = self.get_projections() + if self.is_probe_offset: + offset[0:2] = (+self.x_probe_target-self.x_probe_shape, self.y_probe_target-self.y_probe_shape) - if proj_shape is None: - return [] + elif not self.is_autoffset: + offset[0:2] = offset_target - if self.is_autoffset: - offset = np.array([0.0, 0.0, 0.0], dtype=np.float32) + # print ' x_probe_target',self.x_probe_target,'x_probe_shape',self.x_probe_shape + # print ' y_probe_target',self.y_probe_target,'y_probe_shape',self.y_probe_shape + # print ' offset',offset + # print ' offset_target',offset_target coordsconfig = self._coordsconfig ids = coordsconfig.get_manager().add_rows(n_records) - print 'import_shape n_records', n_records, shapetype + print ' n_records', n_records, shapetype - if shapetype == 3: + if (shapetype == 3) | (shapetype == 5): # poliline = 3, polygon = 5 for ind_rec, id_attr in zip(xrange(n_records), ids): - print ' ind_rec', ind_rec + # print ' ind_rec',ind_rec,'id_attr',id_attr shape_rec = self._sf.shapeRecord(ind_rec) points = shape_rec.shape.points - print ' points', points + # print ' points',points n_points = len(points) shape = np.zeros((n_points, 3), dtype=np.float32) + offset - if proj_target is not None: + if self.is_use_targetproj & self.is_use_shapeproj: for ind, point in zip(xrange(n_points), points): shape[ind, 0:2] += np.array(pyproj.transform(proj_shape, proj_target, point[0], point[1])) - else: + + elif self.is_use_targetproj: + for ind, point in zip(xrange(n_points), points): + shape[ind, 0:2] += proj_target(point[0], point[1]) + + elif self.is_use_shapeproj: for ind, point in zip(xrange(n_points), points): shape[ind, 0:2] += proj_shape(point[0], point[1]) + else: # no projection + for ind, point in zip(xrange(n_points), points): + shape[ind, 0:2] += (point[0], point[1]) + coordsconfig[id_attr] = list(shape) + # print ' coords=',coordsconfig[id_attr] elif shapetype == 1: for ind_rec, id_attr in zip(xrange(n_records), ids): - print ' ind_rec', ind_rec, id_attr + # print ' ind_rec',ind_rec,id_attr shape_rec = self._sf.shapeRecord(ind_rec) points = shape_rec.shape.points - print ' points', points + # print ' points',points n_points = len(points) vert = offset.copy() point = points[0] - if proj_target is not None: + if self.is_use_targetproj & self.is_use_shapeproj: x, y = pyproj.transform(proj_shape, proj_target, point[0], point[1]) # print ' x,y',x,y vert[0:2] += [x, y] #shape[0:2] = pyproj.transform(proj_shape, proj_target ,point[0], point[1]) - else: + elif self.is_use_targetproj: + x, y = proj_target(point[0], point[1]) + vert[0:2] += [x, y] + + elif self.is_use_shapeproj: x, y = proj_shape(point[0], point[1]) # print ' x,y',x,y vert[0:2] += [x, y] #vert[0:2] = proj_shape(point[0], point[1]) + else: # no projection + vert[0:2] += [point[0], point[1]] # print ' vert',vert coordsconfig[id_attr] = vert @@ -518,94 +637,71 @@ # print ' x_min,y_min,z_min',x_min,y_min,z_min coordsconfig.set_value(coords-np.min(coords, 0)) - # - return ids + + # print ' coords=',coordsconfig.get_value() + return ids, shapetype def do(self): print self.ident+'.do' #fields = self._sf.fields #records = self._sf.records() + + if os.path.isfile(self.filepath): + self._sf = get_shapefile(self.filepath) + + else: + return 'WARNING: shape file not found', self.filepath + return False + + self.make_fieldinfo() + attrconfs, shapeinds = self._get_attrconfs_shapeinds() # import shape info - ids = self.import_shapes() + ids, shapetype = self.import_shapes() + + if len(ids) == 0: + print 'WARNING: import_shapes failed' + return False n_attrs = len(attrconfs) n_records = len(ids) # import no attributes from table if (n_attrs == 0) | (n_records == 0): - return True # successfully imported no data + print 'WARNING: successfully imported no data' + return True shaperecords = self._sf.shapeRecord - print ' attrconfs', attrconfs - print ' shapeinds', shapeinds - print ' fieldinfo', self._fieldinfo + # print ' attrconfs',attrconfs + # print ' shapeinds',shapeinds + # print ' fieldinfo',self._fieldinfo - # return True + self.import_data(shaperecords, ids, attrconfs, shapeinds) - return self.import_data(shaperecords, ids, attrconfs, shapeinds) + # check if shapes are inside network boundary + if self.is_limit_to_boundaries: - def import_data(self, shaperecords, ids, attrconfs, shapeinds): - - n_records = len(ids) + if shapetype == 1: # shape are points + ids_outside = ids[np.logical_not(self.inboundaries(self._coordsconfig[ids]))] - values_invalid = ['NULL', '\n'] - for ind_rec, id_attr in zip(xrange(n_records), ids): - shape_rec = shaperecords(ind_rec) - - # print ' shape_rec',id_attr,shape_rec.record - # use first field as id, but will also be a regular attribute - #id_egde = shape_rec.record[0] - #attrrow = {} - # print '\n id_egde',id_egde - for ind_sfield, attrconf in zip(shapeinds, attrconfs): - # for i,field in zip(xrange(n),fields[1:]): - val = shape_rec.record[ind_sfield] - # print ' ind_sfield',ind_sfield,'attrname',attrconf.attrname,'type',type(val),'>>%s<<'%(repr(val)) - if val not in values_invalid: - attrconf[id_attr] = val + else: + # polygon type shape + ids_outside = [] + for id_shape, shape in zip(ids, self._coordsconfig[ids]): + # print ' before bcheck:shape',shape + if not np.any(self.inboundaries(np.array(shape, dtype=np.float32))): + ids_outside.append(id_shape) + print ' ids_outside', ids_outside + self.parent.del_rows(ids_outside) -class OxNodesImporter(ShapefileImporter): - def __init__(self, filepath, oximporter, **kwargs): - net = oximporter.get_scenario().net - ShapefileImporter.__init__(self, filepath, - net.nodes.coords, - parent=oximporter, - map_attrconfig2shapeattr={ - net.nodes.ids_sumo: 'osmid', - net.nodes.types: 'highway'}, - #logger = kwargs['logger'], - **kwargs) + return True def import_data(self, shaperecords, ids, attrconfs, shapeinds): - net = self.parent.get_scenario().net - nodetypes = net.nodes.types - typemap = nodetypes.choices - - sep = ';' - # "priority":0, - # "traffic_light":1, - # "right_before_left":2, - # "unregulated":3, - # "priority_stop":4, - # "traffic_light_unregulated":5, - # "allway_stop":6, - # "rail_signal":7, - # "zipper":8, - # "traffic_light_right_on_red":9, - # "rail_crossing":10, - # "dead_end":11, - - map_shapetype_sumotype = { - 'motorway_junction': typemap['zipper'], - 'crossing': typemap['rail_crossing'], - 'traffic_signals': typemap['traffic_light'], - } - + print 'import_data' n_records = len(ids) - + objecttype = np.dtype(np.object) # np.dtype(np.zeros(1,dtype = np.object)) values_invalid = ['NULL', '\n'] for ind_rec, id_attr in zip(xrange(n_records), ids): shape_rec = shaperecords(ind_rec) @@ -618,287 +714,19 @@ for ind_sfield, attrconf in zip(shapeinds, attrconfs): # for i,field in zip(xrange(n),fields[1:]): val = shape_rec.record[ind_sfield] - if attrconf == nodetypes: - elements = val.split(sep) - for element in elements: - if element in map_shapetype_sumotype: - nodetypes[id_attr] = map_shapetype_sumotype[element] - break - - else: - # map_shapetype_sumotype - # print ' ind_sfield',ind_sfield,'attrname',attrconf.attrname,'type',type(val),'>>%s<<'%(repr(val)) - - if val not in values_invalid: - attrconf[id_attr] = val - - -class OxEdgesImporter(ShapefileImporter): - def __init__(self, filepath, oximporter, **kwargs): - net = oximporter.get_scenario().net - ShapefileImporter.__init__(self, filepath, - net.edges.shapes, - parent=oximporter, - map_attrconfig2shapeattr={\ - # net.edges.ids_sumo:'osmid', - # net.edges.types:'highway', - # net.edges.nums_lanes:'lanes', - net.edges.lengths: 'length', - net.edges.widths: 'width', - net.edges.names: 'name', - }, - **kwargs) - - # self._map_shapeattr_func = {\ - # 'to':self.set_tonode, - # 'from':self.set_fromnode, - # 'maxspeed':self.set_speed_max, - # } - - def import_shapes(self): - - shapes = self._sf.shapes() - shapetype = shapes[3].shapeType - records = self._sf.records() - n_records = len(records) - if n_records == 0: - return False - - proj_shape, proj_target, offset = self.get_projections() - - if proj_shape is None: - return False - - if self.is_autoffset: - offset = np.array([0.0, 0.0, 0.0], dtype=np.float32) - - coordsconfig = self._coordsconfig - ids = coordsconfig.get_manager().add_rows(n_records) - print 'import_shape n_records', n_records, shapetype - - if shapetype == 3: - for ind_rec, id_attr in zip(xrange(n_records), ids): - print ' ind_rec', ind_rec - shape_rec = self._sf.shapeRecord(ind_rec) - points = shape_rec.shape.points - print ' points', points - n_points = len(points) - shape = np.zeros((n_points, 3), dtype=np.float32) + offset - if proj_target is not None: - for ind, point in zip(xrange(n_points), points): - shape[ind, 0:2] += np.array(pyproj.transform(proj_shape, proj_target, point[0], point[1])) - else: - for ind, point in zip(xrange(n_points), points): - shape[ind, 0:2] += proj_shape(point[0], point[1]) - - coordsconfig[id_attr] = list(shape) - - elif shapetype == 1: - for ind_rec, id_attr in zip(xrange(n_records), ids): - print ' ind_rec', ind_rec, id_attr - shape_rec = self._sf.shapeRecord(ind_rec) - points = shape_rec.shape.points - print ' points', points - n_points = len(points) - vert = offset.copy() - point = points[0] - if proj_target is not None: - x, y = pyproj.transform(proj_shape, proj_target, point[0], point[1]) - # print ' x,y',x,y - vert[0:2] += [x, y] - #shape[0:2] = pyproj.transform(proj_shape, proj_target ,point[0], point[1]) - else: - x, y = proj_shape(point[0], point[1]) - # print ' x,y',x,y - vert[0:2] += [x, y] - #vert[0:2] = proj_shape(point[0], point[1]) - - # print ' vert',vert - coordsconfig[id_attr] = vert - - if self.is_autoffset: - coords = coordsconfig.get_value() - - x_min, y_min, z_min = np.min(coords, 0) - # print ' x_min,y_min,z_min',x_min,y_min,z_min - - coordsconfig.set_value(coords-np.min(coords, 0)) - # - return ids - - def make_structure(self): - """ - Make a dictionary self._structure - with shape row index as key - and lane data as value. - Lane data has the following format: - ([]) - - """ - net = self.parent.get_scenario().net - fieldinfo = self._fieldinfo - - ind_highway = fieldinfo['highway'] - ind_oneway = fieldinfo['oneway'] - ind_lanes = fieldinfo['lanes'] - ind_maxspeed = fieldinfo['maxspeed'] - - shapes = self._sf.shapes() - shapetype = shapes[3].shapeType - records = self._sf.records() - n_records = len(records) - if n_records == 0: - return False - for ind_rec, id_attr in zip(xrange(n_records), ids): - pass - - def do(self): - print self.ident+'.do' - #fields = self._sf.fields - #records = self._sf.records() - attrconfs, shapeinds = self._get_attrconfs_shapeinds() - - # import shape info - ids = self.import_shapes() - - n_attrs = len(attrconfs) - n_records = len(ids) - - # import no attributes from table - if (n_attrs == 0) | (n_records == 0): - return True # successfully imported no data - shaperecords = self._sf.shapeRecord - - print ' attrconfs', attrconfs - print ' shapeinds', shapeinds - print ' fieldinfo', self._fieldinfo - - # return True - - return self.import_data(shaperecords, ids, attrconfs, shapeinds) - - def import_data(self, shaperecords, ids, attrconfs, shapeinds): - net = self.parent.get_scenario().net - fieldinfo = self._fieldinfo - - #funcs = [] - #funcshapeinds = [] - - # for attrconf, func in self._map_shapeattr_func.iteritems(): - # funcs.append(attrconf) - # shapeinds.append(self._fieldinfo[shapeattrname][0]) - - ind_from = fieldinfo['from'] - ind_to = fieldinfo['to'] - ind_highway = fieldinfo['highway'] - ind_oneway = fieldinfo['oneway'] - ind_lanes = fieldinfo['lanes'] - ind_maxspeed = fieldinfo['maxspeed'] - - n_records = len(ids) - ids_fromnode = net.edges.ids_fromnode - ids_tonode = net.edges.ids_tonode - speeds_max = net.edges.speeds_max - nums_lanes = net.edges.nums_lanes - - nodemap = net.nodes.get_indexmap() - sep = ';' - sepc = ',' - values_invalid = ['NULL', '\n'] - for ind_rec, id_edge in zip(xrange(n_records), ids): - shape_rec = shaperecords(ind_rec) - for ind_sfield, attrconf in zip(shapeinds, attrconfs): - # for i,field in zip(xrange(n),fields[1:]): - val = shape_rec.record[ind_sfield] + # print ' ind_sfield',ind_sfield,'attrname',attrconf.attrname,'type',type(val),'>>%s<<'%(repr(val)) ,attrconf.get_value().dtype,attrconf.get_value().dtype is objecttype if val not in values_invalid: - attrconf[id_edge] = val - - ids_fromnode[id_edge] = nodemap[shape_rec[ind_from]] - ids_tonode[id_edge] = nodemap[shape_rec[ind_from]] - - val = shape_rec[ind_maxspeed] - if val not in values_invalid: - speeds_max[id_edge] = float(val)/3.6 - - val = shape_rec[ind_lanes] - n_lanes = 1 - if val.isdigit(): - n_lanes = int(val) - - elif val not in values_invalid: - lanedata = shape_rec[val].split(sep) - if len(lanedata) > 0: - pass - - return True - - -class OxImporter(Process): - def __init__(self, scenario, - nodeshapefilepath, edgeshapefilepath, polyshapefilepath, - ident='oximporter', - name='OSMnx importer', - info='Import of network imported with the help of osmnx.', - logger=None, **kwargs): - - print 'OxImporter.__init__' - - self._init_common(ident, - parent=scenario, - name=name, - logger=logger, - info=info, - ) - - attrsman = self.set_attrsman(cm.Attrsman(self)) - - # self.id_mode = attrsman.add(am.AttrConf('id_mode', modechoices['bicycle'], - # groupnames = ['options'], - # choices = modechoices, - # name = 'Mode', - # info = 'Transport mode to be matched.', - # )) - - self.nodeshapefilepath = attrsman.add( - cm.AttrConf('nodeshapefilepath', nodeshapefilepath, - groupnames=['options'], - perm='r', - name='Node shape file', - wildcards='Node Shape file (*.shp)|*.shp', - metatype='filepath', - info="""File path of node shape file.""", - )) - - # def import_xnet(net, nodeshapefilepath, edgeshapefilepath, polyshapefilepath): - #import_nodeshapes(net, nodeshapefilepath) - - def get_scenario(self): - return self.parent - - def do(self): - print self.ident+'.do' - - projparams_target = self.parent.net.get_projparams() - if projparams_target in ("", "!"): - # net has no valid projection - projparams_target = "" - is_guess_targetproj = True - else: - is_guess_targetproj = True + if attrconf.get_value().dtype is objecttype: + # print ' if destination is object then force to string' + if type(val) in cm.NUMERICTYPES: + # this is to avoid floats as object type + attrconf[id_attr] = str(int(val)) + else: + attrconf[id_attr] = str(val) + # print ' type=',type(attrconf[id_attr]) + else: + attrconf[id_attr] = val - OxNodesImporter(self.nodeshapefilepath, self, - projparams_target=projparams_target, - is_guess_targetproj=is_guess_targetproj, - logger=self.get_logger(), - ).do() - - # ShapefileImporter( self.nodeshapefilepath, - # self.parent.net.nodes.coords, - # map_attrconfig2shapeattr = {}, - # projparams_target = projparams_target, - # is_guess_targetproj = is_guess_targetproj, - # logger = self.get_logger(), - # ).do() return True @@ -1158,9 +986,21 @@ else: self.filepath.set_value(filepath) + basefilepath = self.get_basefilepath(filepath) + print 'import_shapefile *%s*' % (basefilepath), type(str(basefilepath)) + sf = shapefile.Reader(str(basefilepath)) + + shapes = sf.shapes() + self.shapetype = shapes[3].shapeType + fields = sf.fields + records = sf.records() + if projparams == None: # here we could guess from shapes - projparams = "+init=EPSG:23032" + #projparams ="+init=EPSG:23032" + shape_rec = sf.shapeRecord(0) + points = shape_rec.shape.points + projparams = guess_utm_from_coord(points[0]) if projparams_target != None: proj_target = pyproj.Proj(projparams_target) @@ -1176,14 +1016,6 @@ proj_target = None proj_shape = None - print 'import_shapefile *%s*' % (basefilepath), type(str(basefilepath)) - sf = shapefile.Reader(str(basefilepath)) - - shapes = sf.shapes() - self.shapetype = shapes[3].shapeType - fields = sf.fields - records = sf.records() - attrnames = [] for field in fields[1:]: attrnames.append(self.add_field(field)) @@ -1383,3 +1215,57 @@ shapedata.adjust_fieldlength() shapedata.export_shapefile() return True + + +def zones_to_shapefile(zones, filepath, dataname='zonedata', + is_access=True, parent=None, log=None): + """ + Export network edges to shapefile. + """ + net = zones.parent.facilities.get_net() + shapedata = Shapedata(parent, dataname, name='Facilities shape data', + filepath=filepath, + shapetype=SHAPETYPES['PolyLine'], + projparams_shape=net.get_projparams(), + offset=net.get_offset(), log=log) + + #attrname, ftype, flen, fdigit = field + attrlist = [ + ('id', 'id', 'ID_ZON', 'N', 32, 0), + # ~ ('names_extended','id','ID_NAM','N',32,0), + ('ids_landusetype', 'id', 'ID_LANTYPE', 'N', 12, 5), + ('areas', 'id', 'AREAS', 'N', 12, 5), + + # ('n_edges','id','N_EDGES','N',12,5), + # ('share_roads_surface','id','SH_ROAD_SURF','N',12,5), + # ('share_exclusive_cyclingroads','id','SHARE_EXCL_BIKE','N',12,5), + # ('av_priority_roads','id','AV_ROAD_PRI','N',12,5), + # ('density_intersection','id','DENS_INTER','N',12,5), + # ('density_trafficlight','id','DENS_TL','N',12,5), + # ('share_facilities','id','SHARE_FAC','N',12,5), + # ('share_residential','id','SHARE_RES','N',12,5), + # ('share_commercial','id','SHARE_COM','N',12,5), + # ('share_industrial','id','SHARE_IND','N',12,5), + # ('share_leisure','id','SHARE_LEI','N',12,5), + # ('entropies','id','ENTROPY','N',12,5), + ] + + print 'zones_to_shapefile', filepath + + for attr in attrlist: + shapedata.add_field(attr[2:]) + + ids_zon = zones.get_ids() + + ids_shape = shapedata.add_rows(len(ids_zon)) + # print ' shapedata.ID_ARC',shapedata.ID_ARC,'dir',dir(shapedata.ID_ARC) + shapedata.ID_ZON[ids_shape] = ids_zon + shapedata.shapes[ids_shape] = zones.shapes[ids_zon] + # ~ shapedata.ID_ZON[ids_shape] = ids_zon + for netattrname, gettype, shapeattrname, x1, x2, x3 in attrlist: + if netattrname not in ('id',): + getattr(shapedata, shapeattrname)[ids_shape] = getattr(zones, netattrname)[ids_zon] + + # ~ shapedata.adjust_fieldlength() + shapedata.export_shapefile() + return True diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/modules_common.py sumo-1.12.0/tools/contributed/sumopy/coremodules/modules_common.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/modules_common.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/modules_common.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,8 +14,8 @@ # @file modules_common.py # @author Joerg Schweizer -# @date +# @date 2012 import os -COREMODULEDIRPATH = os.path.dirname(os.path.abspath(__file__)) +COREMODULEDIRPATH = os.path.dirname(os.path.abspath(__file__)) \ No newline at end of file Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/tools/contributed/sumopy/coremodules/network/images/icon_mpl.png and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/tools/contributed/sumopy/coremodules/network/images/icon_mpl.png differ Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/tools/contributed/sumopy/coremodules/network/images/icon_sumo_24px.png and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/tools/contributed/sumopy/coremodules/network/images/icon_sumo_24px.png differ Binary files /tmp/tmprigj2fc3/GY_DcneaCx/sumo-1.11.0/tools/contributed/sumopy/coremodules/network/images/icon_sumo_32px.png and /tmp/tmprigj2fc3/7Zrpxtg6R_/sumo-1.12.0/tools/contributed/sumopy/coremodules/network/images/icon_sumo_32px.png differ diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/network/__init__.py sumo-1.12.0/tools/contributed/sumopy/coremodules/network/__init__.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/network/__init__.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/network/__init__.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file __init__.py # @author Joerg Schweizer -# @date +# @date 2012 __version__ = "0.0" diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/network/netconvert.py sumo-1.12.0/tools/contributed/sumopy/coremodules/network/netconvert.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/network/netconvert.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/network/netconvert.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file netconvert.py # @author Joerg Schweizer -# @date +# @date 2012 import os import subprocess @@ -25,7 +25,7 @@ import agilepy.lib_base.xmlman as xm from agilepy.lib_base.processes import Process, CmlMixin -from agilepy.lib_base.misc import filepathlist_to_filepathstring, filepathstring_to_filepathlist +from agilepy.lib_base.misc import filepathlist_to_filepathstring, filepathstring_to_filepathlist, ff class NetConvertMixin(CmlMixin, Process): @@ -103,6 +103,11 @@ info='SUMO Net file in XML format.', ) + # will be confugured later, but necessary if not configured + self.select_edges_by_access = '' + self.typefilepath = '' + self.is_import_ptstops = False + def init_options_edge(self, **kwargs): self.add_option('n_lanes_default', kwargs.get('n_lanes_default', 1), groupnames=['options', 'edges'], @@ -132,6 +137,14 @@ info='The default speed on an edge.', is_enabled=lambda self: self.edgespeed_default > 0, ) + self.add_option('dist_join_tram_edged', kwargs.get('dist_join_tram_edged', -1.0), + groupnames=['options', 'edges'], + cml='--edges.join-tram-dist', + perm='rw', + name='Tram edge join dist.', + info='When this option is set (values between 1.0 and 2.0 are recommended), overlapping OSM elements, whereby one has Tram access, will be converted to road lanes with shared permissions. Negative value makes ignoring this option.', + is_enabled=lambda self: self.edgespeed_default > 0, + ) choices_priority = {} for i in range(11): @@ -149,22 +162,6 @@ ) def init_options_edgetype(self, **kwargs): - typefilepath = kwargs.get('typefilepath', None) - if typefilepath is None: - typefilepath = os.path.abspath(os.path.join(os.path.dirname( - os.path.abspath(__file__)), '..', '..', 'typemap', 'osmNetconvert.typ.xml')) - self.add_option('typefilepath', typefilepath, - groupnames=['options'], - cml='--type-files', - perm='rw', - name='Type files', - wildcards='Typemap XML files (*.typ.xml)|*.typ.xml', - metatype='filepaths', - info="""Typemap XML files. In these file, - OSM road types are mapped to edge and lane parameters such as width, - speeds, etc. These parameters are used as defaults in absents of explicit OSM attributes. - Use osmNetconvert.typ.xml as a base and additional type file to meet specific needs.""", - ) modesset = set(self.parent.modes.names.get_value()) modesset_pt_rail = set(["rail_urban", "rail", "rail_electric"]) @@ -181,6 +178,7 @@ "ordinary roads+rails+bikeways+footpath": ','.join(modesset.difference(modesset_pt_road | modesset_motorized | modesset_pt_rail | set(['bicycle']) | set(['pedestrian']))), "all ways": "" } + # print ' access_to_vtypes=',access_to_vtypes self.add_option('select_edges_by_access', roadtypes_to_disallowed_vtypes[kwargs.get('roadtypes', 'ordinary roads+bikeways')], groupnames=['options', 'edges'], @@ -192,6 +190,22 @@ is_enabled=lambda self: self.select_edges_by_access != "", ) + typefilepath = kwargs.get('typefilepath', "") + # if typefilepath is None: + # typefilepath = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)),'..','..','typemap','osmNetconvert.typ.xml')) + self.add_option('typefilepath', typefilepath, + groupnames=['options'], + cml='--type-files', + perm='rw', + name='Type files', + wildcards='Typemap XML files (*.typ.xml)|*.typ.xml', + metatype='filepaths', + info="""Typemap XML files. In these file, + OSM road types are mapped to edge and lane parameters such as width, + speeds, etc. These parameters are used as defaults in absents of explicit OSM attributes. + If left blank the typemaps are determined by the access type choice (recommended).""", + ) + self.add_option('is_remove_isolated_edges', kwargs.get('is_remove_isolated_edges', True), groupnames=['options', 'edges'], cml='--remove-edges.isolated', @@ -410,10 +424,10 @@ perm='rw', name='Allow entering multilane roundabout', info='Allow driving onto a multi-lane road at roundabouts if there are foes (arriving vehicles) on other lanes.', - is_enabled=lambda self: self.is_roundabouts_guess, + #is_enabled = lambda self: self.is_roundabouts_guess, ) - # --lefthand Assumes left-hand traffic on the network; default: false + # --lefthand Assumes left-hand traffic on the network; default: false self.add_option('is_no_left_connections', kwargs.get('is_no_left_connections', False), groupnames=['options', 'topology'], cml='--no-left-connections', @@ -524,6 +538,94 @@ is_enabled=lambda self: self.is_guess_crossings, ) + def init_options_ptlines(self, **kwargs): + attrsman = self.get_attrsman() + + self.is_import_ptlines = attrsman.add(cm.AttrConf('is_import_ptlines', kwargs.get('is_import_ptlines', False), + groupnames=['options', 'ptstops'], + perm='rw', + name='Import PT lines?', + info='Should PT lines be imported?', + )) + + self.add_option('is_cleanup_ptline', kwargs.get('is_cleanup_ptstops', True), + groupnames=['options', 'ptline'], + cml='--ptline-clean-up', + perm='rw', + name='PT line cleanup', + info='Clean-up pt stops that are not served by any line', + is_enabled=lambda self: self.is_import_ptstops, + ) + + def init_options_ptstops(self, **kwargs): + + attrsman = self.get_attrsman() + self.is_import_ptstops = attrsman.add(cm.AttrConf('is_import_ptstops', kwargs.get('is_import_stops', False), + groupnames=['options', 'ptstops'], + perm='rw', + name='Import PT stops?', + info='Should PT stops be imported?', + )) + + self.add_option('dist_search_footway_access_ptstops', kwargs.get('dist_search_footway_access_ptstops', 20.0), + groupnames=['options', 'ptstops'], + cml='--osm.stop-output.footway-access-distance', + perm='rw', + unit='m', + name='Search dist. PT stop footway access', + info='The search radius for finding suitable road accesses for rail stops', + is_enabled=lambda self: self.is_import_ptstops, + ) + + self.add_option('n_footway_accesses_max', kwargs.get('n_footway_accesses_max', 10), + groupnames=['options', 'ptstops'], + cml='--osm.stop-output.footway-max-accesses', + perm='rw', + name='Maximum number of footway accesses', + info='The maximum roud accesses registered per rail stops', + is_enabled=lambda self: self.is_import_ptstops, + ) + + self.add_option('lenght_default_ptstops', kwargs.get('lenght_default_ptstops', 20.0), + groupnames=['options', 'ptstops'], + cml='--osm.stop-output.length', + perm='rw', + unit='m', + name='Default length PT stops', + info='The default length of a public transport stop.', + is_enabled=lambda self: self.is_import_ptstops, + ) + + self.add_option('lenght_default_busstops', kwargs.get('lenght_default_busstops', 20.0), + groupnames=['options', 'ptstops'], + cml='--osm.stop-output.length.bus', + perm='rw', + unit='m', + name='Default length bus stops', + info='The default length of bus stops.', + is_enabled=lambda self: self.is_import_ptstops, + ) + + self.add_option('lenght_default_tramstops', kwargs.get('lenght_default_tramstops', 50.0), + groupnames=['options', 'ptstops'], + cml='--osm.stop-output.length.tram', + perm='rw', + unit='m', + name='Default length tram stops', + info='The default length of tram stops.', + is_enabled=lambda self: self.is_import_ptstops, + ) + + self.add_option('lenght_default_trainstops', kwargs.get('lenght_default_trainstops', 100.0), + groupnames=['options', 'ptstops'], + cml='--osm.stop-output.length.train', + perm='rw', + unit='m', + name='Default length train stops', + info='The default length of train stops.', + is_enabled=lambda self: self.is_import_ptstops, + ) + def init_options_geometry(self, **kwargs): self.add_option('is_geometry_split', kwargs.get('is_geometry_split', False), groupnames=['options', 'geometry'], @@ -678,6 +780,9 @@ # TLS Building Options: self.init_options_tls(**kwargs) + # PT stops + self.init_options_ptstops(**kwargs) + # topology self.init_options_topology(**kwargs) @@ -690,6 +795,42 @@ # other self.init_other(**kwargs) + def guess_typefilepath(self): + """Guesses typefiles from chosen road restrictions + """ + if 'SUMO_HOME' in os.environ: + typemapdir = os.path.join(os.environ['SUMO_HOME'], 'data', 'typemap') + + else: + print("No typemaps found. Please declare environment variable 'SUMO_HOME'") + return + + typemapfilenames = ['osmNetconvert'] + if typemapdir != "": + if self.select_edges_by_access == 'ordinary roads+bikeways': + typemapfilenames.append('osmNetconvertBicycle') + elif self.select_edges_by_access == 'roads+bikeways+footpath': + typemapfilenames.append('osmNetconvertBicycle') + typemapfilenames.append('osmNetconvertPedestrians') + elif self.select_edges_by_access == 'ordinary roads+rails': + typemapfilenames.append('osmNetconvertExtraRail') + typemapfilenames.append('osmNetconvertBidiRail') + elif self.select_edges_by_access == 'ordinary roads+rails+bikeways': + typemapfilenames.append('osmNetconvertExtraRail') + typemapfilenames.append('osmNetconvertBidiRail') + typemapfilenames.append('osmNetconvertBicycle') + elif self.select_edges_by_access == 'ordinary roads+rails+bikeways+footpath': + typemapfilenames.append('osmNetconvertExtraRail') + typemapfilenames.append('osmNetconvertBidiRail') + typemapfilenames.append('osmNetconvertBicycle') + typemapfilenames.append('osmNetconvertPedestrians') + + for typemapfilename in typemapfilenames: + if self.typefilepath == "": + self.typefilepath = os.path.join(typemapdir, typemapfilename+'.typ.xml') + else: + self.typefilepath += ','+os.path.join(typemapdir, typemapfilename+'.typ.xml') + def update_params(self): """ Make all parameters consistent. @@ -700,15 +841,26 @@ def do(self): self.update_params() + net = self.parent cml = self.get_cml() + if self.typefilepath == '': + self.guess_typefilepath() + if self.is_import_ptstops: + ptstopfilepath = net.get_rootfilepath()+'.ptstop.xml' + cml += ' --ptstop-output '+ff(ptstopfilepath) # print 'SumonetImporter.do',cml self.run_cml(cml) if self.status == 'success': print ' Netconvert done.' if os.path.isfile(self.netfilepath): - # print ' sumo.net.xml exists, start generation of xml files' - self.parent.import_netxml(self.netfilepath) + print ' sumo.net.xml exists, start generation of xml files' + net.import_netxml(self.netfilepath) + if self.is_import_ptstops: + if os.path.isfile(ptstopfilepath): + print ' ptfilepath exists, start importing ptstops' + net.ptstops.import_sumostops(ptstopfilepath) + # print ' import in sumopy done.' return True return False diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/network/netgenerate.py sumo-1.12.0/tools/contributed/sumopy/coremodules/network/netgenerate.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/network/netgenerate.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/network/netgenerate.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file netgenerate.py # @author Joerg Schweizer -# @date +# @date 2012 import subprocess import os diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/network/network_editor.py sumo-1.12.0/tools/contributed/sumopy/coremodules/network/network_editor.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/network/network_editor.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/network/network_editor.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,9 +14,12 @@ # @file network_editor.py # @author Joerg Schweizer -# @date +# @date 2012 +import numpy as np +from coremodules.network.network import MODES +from agilepy.lib_wx.ogleditor import * import os import sys import wx @@ -34,11 +37,8 @@ SUMOPYDIR = os.path.join(APPDIR, '..', '..') sys.path.append(os.path.join(SUMOPYDIR)) -import numpy as np -from agilepy.lib_wx.ogleditor import * #from agilepy.lib_wx.mainframe import AgileMainframe -from coremodules.network.network import MODES #( ident_drawob, DrawobjClass, netattrname, layer ) @@ -571,6 +571,117 @@ self._update_colorvbo() +class RoundaboutDrawings(Circles): + def __init__(self, ident, nodes, parent, **kwargs): + + Circles.__init__(self, ident, parent, name='Roundabout drawings', + is_parentobj=False, + is_fill=False, # Fill objects, + is_outline=True, # show outlines + n_vert=21, # default number of vertex per circle + linewidth=3, + **kwargs) + + self.delete('centers') + self.delete('radii') + + self.add(cm.AttrConf('color_default', np.array([148.0, 83.8, 244.0, 255.0], np.float32)/255.0, + groupnames=['options', 'default color'], + metatype='color', + perm='wr', + name='Default color', + info='Default roundabout color.', + )) + + self.set_netelement(nodes) + + def get_netelement(self): + return self._roundabouts + + def get_centers_array(self): + + n = len(self._inds_map) + # print 'get_centers_array' ,n + coords_roundabout = np.zeros((n, 3), dtype=np.float32) + nodes = self._roundabouts.parent.nodes + for ind, ids_node in zip(np.arange(n, dtype=np.int32), self._roundabouts.ids_nodes.get_value()[self._inds_map]): + # print ' ids_node',ids_node,nodes.coords[ids_node] + coords_roundabout[ind] = np.mean(nodes.coords[ids_node], 0) + + # for ind, coords_node in zip(np.arange(n, dtype = np.int32), nodes.coords[self._roundabouts.ids_nodes.get_value()[self._inds_map]]): + # coords_roundabout[ind] = np.mean(coords_node,0) + + # print ' coords_roundabout',coords_roundabout + return coords_roundabout + + def get_radii_array(self): + + n = len(self._inds_map) + # print 'get_radii_array',n + radii_roundabout = np.zeros((n), dtype=np.float32) + nodes = self._roundabouts.parent.nodes + for ind, center, ids_node in zip(np.arange(n, dtype=np.int32), self.get_centers_array(), self._roundabouts.ids_nodes.get_value()[self._inds_map]): + # print ' ',ind,'center',center + # print ' coords',nodes.coords[ids_node] + # print ' R^2',np.sum( (nodes.coords[ids_node]-center)**2,1) + # print ' R',np.sqrt(np.sum( (nodes.coords[ids_node]-center)**2,1)) + # print ' R_min',np.min(np.sqrt(np.sum( (nodes.coords[ids_node]-center)**2,1) )) + radii_roundabout[ind] = 0.9*np.min(np.sqrt(np.sum((nodes.coords[ids_node]-center)**2, 1))) + # print ' radii_roundabout',radii_roundabout + return radii_roundabout + + def is_tool_allowed(self, tool, id_drawobj=-1): + """ + Returns True if this tool can be applied to this drawobj. + Optionally a particular drawobj can be specified with id_drawobj. + """ + # basic tools: + return tool.ident not in ['configure', 'select_handles', 'move', 'stretch'] + # return tool.ident not in ['delete','stretch'] + + def del_elem(self, _id, is_update=True): + self.del_row(_id) + self._roundabouts.del_row(_id) + # this is a bit awkward...could be done more transparently + self._inds_map = self._roundabouts.get_inds(self._roundabouts.get_ids()) + if is_update: + self._update_vertexvbo() + self._update_colorvbo() + + def set_netelement(self, roundabouts): + # print 'set_nodes' + self._roundabouts = roundabouts + # if len(self)>0: + # self.del_rows(self.get_ids()) + self.clear_rows() + + ids = self._roundabouts.get_ids() + n = len(ids) + + self._inds_map = self._roundabouts.get_inds(ids) + + # print 'color_node_default',self.color_node_default.value + # print 'colors\n', np.ones((n,1),np.int32)*self.color_node_default.value + # print ' dtypes', self.color_node_default.value.dtype, np.ones((n,1),np.float32).dtype + # print ' dtypes colors_highl', self.colors_highl.value.dtype,self._get_colors_highl(np.ones((n,1),np.float32)*self.color_node_default.value).dtype + # print ' colors',np.ones((n,1),np.float32)*self.color_node_default.value + # print ' dtypes ids',ids.dtype, self.get_ids().dtype + self.add_rows(ids=ids, + colors=np.ones((n, 1), np.float32)*self.color_default.value, + colors_highl=self._get_colors_highl(np.ones((n, 1), np.float32)*self.color_default.value), + #centers = self._nodes.coords[ids], + #radii = self._nodes.radii[ids], + ) + + self.update() + + def update(self, is_update=True): + + if is_update: + self._update_vertexvbo() + self._update_colorvbo() + + class EdgeDrawings(Polylines): def __init__(self, ident, edges, parent, **kwargs): @@ -1189,6 +1300,7 @@ ('nodedraws', NodeDrawings, 'nodes', 20), ('edgedraws', EdgeDrawings, 'edges', 10), ('lanedraws', LaneDrawings, 'lanes', 15), + ('roundaboutdraws', RoundaboutDrawings, 'roundabouts', 18), ('connectiondraws', ConnectionDrawings, 'connections', 25), ('crossingsdraws', CrossingDrawings, 'crossings', 30), ] diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/network/network.py sumo-1.12.0/tools/contributed/sumopy/coremodules/network/network.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/network/network.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/network/network.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,11 +14,21 @@ # @file network.py # @author Joerg Schweizer -# @date +# @date 2012 -# size limit at 1280x1280 -# http://maps.googleapis.com/maps/api/staticmap?size=500x500&path=color:0x000000|weight:10|44.35789,11.3093|44.4378,11.3935&format=GIF&maptype=satellite&scale=2 +from agilepy.lib_base.processes import Process, CmlMixin, P +from routing import get_mincostroute_edge2edges +import publictransportnet as pt +import netconvert +from agilepy.lib_base.geometry import * +from agilepy.lib_base.misc import filepathlist_to_filepathstring, filepathstring_to_filepathlist +import agilepy.lib_base.xmlman as xm +import agilepy.lib_base.arrayman as am +import agilepy.lib_base.classman as cm +from collections import OrderedDict +import numpy as np +import time import os import sys import subprocess @@ -33,21 +43,6 @@ SUMOPYDIR = os.path.join(APPDIR, '..', '..') sys.path.append(os.path.join(SUMOPYDIR)) -import time -import numpy as np -from collections import OrderedDict -import agilepy.lib_base.classman as cm -import agilepy.lib_base.arrayman as am -import agilepy.lib_base.xmlman as xm -from agilepy.lib_base.misc import filepathlist_to_filepathstring, filepathstring_to_filepathlist - -from agilepy.lib_base.processes import Process, CmlMixin, P - -from agilepy.lib_base.geometry import * - -import netconvert -import publictransportnet as pt - MODES = OrderedDict([ ("ignoring", 0), @@ -76,6 +71,7 @@ ("custom1", 23), ("custom2", 24), ("ship", 25), + ("rail_fast", 26) ]) ID_MODE_PED = MODES['pedestrian'] @@ -198,6 +194,7 @@ ("custom1", 100), ("custom2", 160), ("ship", 30), + ('rail_fast', 350), ]) for mode, speed_kmph in speeds_max_kmph.iteritems(): @@ -585,12 +582,32 @@ ident = 'connections' self._init_objman(ident=ident, parent=parent, name='Connections', xmltag=('connections', 'connection', None), + version=0.1, **kwargs) self._init_attributes() def _init_attributes(self): lanes = self.parent.lanes + nodes = self.parent.nodes + self.add_col(am.IdsArrayConf('ids_node', nodes, + groupnames=['state'], + name='ID node', + info='ID of the node on which the intersection is included.', + xmltag='Node', + )) + if self.get_version() < 0.1: + # this has been an error: before linktab was lanes!! + self.ids_node.set_linktab(nodes) + + self.add_col(am.ArrayConf('are_tls', False, + dtype=np.bool, + perm='rw', + name='TLS', + info=' is the connection part of a tls?.', + xmltag='tls', + )) + self.add_col(am.IdsArrayConf('ids_fromlane', lanes, groupnames=['state'], name='ID from-lane', @@ -638,6 +655,55 @@ xmltag='uncontrolled', )) + self.add_col(am.ArrayConf('turns_type', '', + dtype=np.object, + perm='rw', + name='Turn type', + info='Type of turn (left turn, right turn, crossing or U-turn.', + xmltag='turnsType', + )) + + self.add_col(am.ArrayConf('lengths', default=0.0, + dtype=np.float32, + groupnames=['results'], + symbol='L connection', + name='Length of the connection', + unnit='[m]', + info='Direct length between the start and the end of the intersection.', + )) + + self.add_col(am.ArrayConf('numbers_connections_at_node', default=0, + dtype=np.int32, + groupnames=['results'], + symbol='N conn at node', + name='number connections at node', + info='Number of connections within the node in which the connection is included. This indicates the complexity of the intersection in which the connection is included.', + )) + self.set_version(0.1) +# self.add_col(am.ArrayConf( 'are_right_turn', False, +# dtype=np.bool, +# perm='rw', +## name = 'right turn', +## info = 'if set to true, This connection is a right turn.', +## xmltag = 'uncontrolled', +# )) +## +# self.add_col(am.ArrayConf( 'are_crossing', False, +# dtype=np.bool, +# perm='rw', +## name = 'crossing', +## info = 'if set to true, This connection is a crossing.', +## xmltag = 'uncontrolled', +# )) +## +# self.add_col(am.ArrayConf( 'are_u_turn', False, +# dtype=np.bool, +# perm='rw', +## name = 'U turn', +## info = 'if set to true, This connection is an U-turn.', +## xmltag = 'uncontrolled', +# )) + def make(self, **kwargs): return self.add_row(ids_fromlane=kwargs['id_fromlane'], ids_tolane=kwargs['id_tolane'], @@ -647,6 +713,106 @@ are_uncontrolled=kwargs.get('is_uncontrolled', None), ) + def analyze_connections(self, **kwargs): + + print 'Analyze connections' + + network = self.parent + edges = network.edges + lanes = network.lanes + nodes = network.nodes + connections = network.connections + ids_connections = connections.get_ids() + ids_node = nodes.get_ids() + nodes.n_connections[ids_node] = 0 + for connection in ids_connections: + incoming_lane = connections.ids_fromlane[connection] + outgoing_lane = connections.ids_tolane[connection] + incoming_edge = lanes.ids_edge[incoming_lane] + outgoing_edge = lanes.ids_edge[outgoing_lane] + node = edges.ids_tonode[incoming_edge] + + # id node + connections.ids_node[connection] = node + if nodes.types[node] == 1 or nodes.types[node] == 5 or nodes.types[node] == 9: + connections.are_tls[connection] = True + + incoming_edge_shape = edges.shapes[incoming_edge] + outgoing_edge_shape = edges.shapes[outgoing_edge] + #coord_node = nodes.coords[node] + coord_incoming_last = incoming_edge_shape[-1] + coord_incoming_penultimate = incoming_edge_shape[-2] + coord_outgoing_first = outgoing_edge_shape[0] + coord_outgoing_second = outgoing_edge_shape[1] + print 'connection', connection + # print 'coord_node:',coord_node, 'coord_incoming:',coord_incoming, 'coord_outgoing:',coord_outgoing + azimut_incoming = self.get_azimut(coord_incoming_last, coord_incoming_penultimate) + azimut_outgoing = self.get_azimut(coord_outgoing_first, coord_outgoing_second) + # print 'azimut_incoming:', azimut_incoming, 'azimut_outgoing:' ,azimut_outgoing + diff_azimut = azimut_outgoing-azimut_incoming + # print 'diff_azimut:', diff_azimut + + # Observe the penultimate and last shape point of the incoming edge related to a + # connection, and the first and second point of the outgoing edge. Succesively, evaluate + # the typology of turn basing on the angle formed: + # Crossing: maximum deviation of pi/4 between concordant direction of incoming and outgoing edges + # U-turn:maximum deviation of pi/18 between discordant direction of incoming and outgoing edges + # Left turn + # Right turn + if np.pi*3/4 <= np.absolute(diff_azimut) and np.absolute(diff_azimut) <= np.pi*5/4: + connections.turns_type[connection] = 'crossing' + print 'crossing' + nodes.n_left_turns[node] += 1 + elif np.absolute(diff_azimut) <= np.pi/18 or np.absolute(diff_azimut) >= np.pi*35/18: + connections.turns_type[connection] = 'u_turn' + print 'u_turn' + nodes.n_right_turns[node] += 1 + elif (-3*np.pi/4 < diff_azimut and diff_azimut < -np.pi/18) or (5*np.pi/4 < diff_azimut and diff_azimut < np.pi*35/18): + connections.turns_type[connection] = 'right_turn' + print 'right turn' + nodes.n_crossings[node] += 1 + elif (np.pi/18 < diff_azimut and diff_azimut < 3*np.pi/4) or (-np.pi*35/18 < diff_azimut and diff_azimut < -5*np.pi/4): + connections.turns_type[connection] = 'left_turn' + print 'left turn' + nodes.n_u_turns[node] += 1 + + init_point = incoming_edge_shape[-1] + final_point = outgoing_edge_shape[0] + # Length + connections.lengths[connection] = np.sqrt((init_point[0] - final_point[0])**2 + + (init_point[1] - final_point[1])**2) + nodes.n_connections[node] += 1 + # Connections at node + for connection in ids_connections: + node = connections.ids_node[connection] + connections.numbers_connections_at_node[connection] = nodes.n_connections[node] + + return True + + def get_azimut(self, point1, point2): + # point1 = [x1,y1], point2 = [x2,y2]. Return the azimut of the second + # point, respect to the first one, considered as the center. + + x_nod = point1[0] + y_nod = point1[1] + x_inc = point2[0] + y_inc = point2[1] + + if (x_inc-x_nod) >= 0 and (y_inc-y_nod) > 0: + azimut_incoming = np.arctan((x_inc-x_nod)/(y_inc-y_nod)) + elif (x_inc-x_nod) > 0 and (y_inc-y_nod) <= 0: + azimut_incoming = np.pi/2 + np.arctan((y_nod-y_inc)/(x_inc-x_nod)) + elif (x_inc-x_nod) <= 0 and (y_inc-y_nod) < 0: + azimut_incoming = np.pi + np.arctan((x_nod-x_inc)/(y_nod-y_inc)) + elif (x_inc-x_nod) < 0 and (y_inc-y_nod) >= 0: + azimut_incoming = np.pi*3/2 + np.arctan((y_inc-y_nod)/(x_nod-x_inc)) + else: + print 'Warning, the two points are the same' + # print point1, point2 + azimut_incoming = 0 + + return azimut_incoming + def multimake(self, ids_fromlane=[], ids_tolane=[], **kwargs): n = len(ids_fromlane) @@ -856,13 +1022,17 @@ width = kwargs.get('width', -1) speed_max = kwargs.get('speed_max', -1) ids_modes_allow = kwargs.get('ids_modes_allow', []) + id_mode = kwargs.get('id_mode', -1) is_sidewalk_edge = False is_sidewalk = False - if len(ids_modes_allow) > 0: - id_mode = ids_modes_allow[0] # pick first as major mode + if id_mode != -1: + id_mode = id_mode else: - id_mode = -1 # no mode specified + if len(ids_modes_allow) > 0: + id_mode = ids_modes_allow[0] # pick first as major mode + else: + id_mode = -1 # no mode specified if index == 0: width_sidewalk_edge = edges.widths_sidewalk[id_edge] @@ -915,14 +1085,17 @@ Recalculate shape of all lanes contained in edge id_edge based on the shape information of this edge. """ + # #lanes = self.get_lanes() edges = self.parent.edges + ids_lane = edges.ids_lanes[id_edge] + print 'reshape_edgelanes id_edge', id_edge, 'id_edge_sumo', edges.ids_sumo[id_edge], len(ids_lane) shape = np.array(edges.shapes[id_edge], np.float32) - # print 'reshape: edgeshape id_edge,ids_lane=',id_edge,ids_lane + # print 'reshape: edgeshape id_edge %d ids_edge_sumo %s'%( id_edge,edges.ids_sumo[id_edge]),'ids_lane=',ids_lane # print ' shape =',shape n_lanes = len(ids_lane) n_vert = len(shape) @@ -965,7 +1138,53 @@ self.shapes.set_modified(True) + def get_laneindexes_allowed(self, ids_lane, id_mode): + # print 'get_laneindex_allowed',ids_lane, id_mode + # check ignoring mode and give it the first non pedestrian only lane + indexes = [] + if id_mode == MODES["ignoring"]: + ind = 0 + while is_cont & (ind < len(ids_lane)): + id_lane = ids_lane[ind] + if len(self.ids_modes_allow[id_lane]) > 0: + if MODES["pedestrian"] not in self.ids_modes_allow[id_lane]: + indexes.append(ind) + + else: + indexes.append(ind) + ind += 1 + print 'WARNING: ignoring mode has no access on footpath' + return [] + + # return len(ids_lane)-1 + + is_cont = True + ind = 0 + while is_cont & (ind < len(ids_lane)): + # print ' ',ind,len(self.ids_modes_allow[id_lane]),len(self.ids_modes_disallow[id_lane]),id_mode in self.ids_modes_allow[id_lane],id_mode in self.ids_modes_disallow[id_lane] + id_lane = ids_lane[ind] + if len(self.ids_modes_allow[id_lane]) > 0: + if id_mode in self.ids_modes_allow[id_lane]: + indexes.append(ind) + + elif len(self.ids_modes_disallow[id_lane]) > 0: + if id_mode in self.ids_modes_disallow[id_lane]: + pass + else: + indexes.append(ind) + else: + # no restrictions + indexes.append(ind) + ind += 1 + + return indexes + def get_laneindex_allowed(self, ids_lane, id_mode): + """ + Returns laneindex where mode id_mode is allowed. + The index points to one of the given lane IDs, which + are assumed to be IDs of the same edge. + """ # print 'get_laneindex_allowed',ids_lane, id_mode # check ignoring mode and give it the first non pedestrian only lane if id_mode == MODES["ignoring"]: @@ -1017,33 +1236,86 @@ if id_mode in self.ids_modes_disallow[id_lane]: self.ids_modes_disallow[id_lane].remove(id_lane) - def get_laneindex_allowed_old(self, ids_lane, id_mode): - is_cont = True - ind = 0 - n_lane = len(ids_lane) - while is_cont & (ind < n_lane): - id_lane = ids_lane[ind] - if len(self.ids_modes_allow[id_lane]) > 0: - if id_mode in self.ids_modes_allow[id_lane]: - return ind - else: - ind += 1 + def get_accesslevel_lanes(self, ids_lane, id_mode): + """ + Returns a vector corrisponding to the dimension of ids_lane, + where each element indicates whether mode id_mode has access: + -1 = No access + 0 = all modes can access + 1 = mode can access with a restricted number of other modes + 2 = exclusive access for id_mode + """ + + #is_blocked = False + # print ' ids_modes_allow',self.ids_modes_allow.get_value() + accesses = np.zeros(len(ids_lane), dtype=np.int32) + is_mode_only = False + is_mode_mixed = False + is_modes_all = False + + for i, id_lane, ids_modes_allow, ids_modes_disallow in zip(xrange(len(ids_lane)), ids_lane, self.ids_modes_allow[ids_lane], self.ids_modes_disallow[ids_lane]): + is_mode_only = False + is_mode_mixed = False + is_modes_all = False + + if ids_modes_allow is None: + ids_modes_allow = [] + if ids_modes_disallow is None: + ids_modes_disallow = [] + + # if id_lane == 33520: + # print ' ids_modes_allow',ids_modes_allow,'ids_modes_disallow',ids_modes_disallow,'id_mode',id_mode,id_mode in ids_modes_allow + + if len(ids_modes_allow) == 0: + # no allow information, so look for disallowed + + if len(ids_modes_disallow) == 0: + # no access information: all are allowed + is_modes_all = True + #is_access = True + + elif id_mode not in ids_modes_disallow: + # mode is not disallowed, so it is allowed with others + # but we opt for mixed mode only if explicitely allowed, + # and not selectively forbidden + #is_mode_mixed = True + is_modes_all = True + #is_access = True + + elif len(ids_modes_allow) == 1: + if id_mode == ids_modes_allow[0]: + # found exclusive access + is_mode_only = True + #is_access = True + + elif id_mode in ids_modes_allow: + # mode is allowed together with others + is_mode_mixed = True + #is_access = True + + if is_mode_only: + a = 2 + + elif is_mode_mixed: + a = 1 + + elif is_modes_all: + a = 0 - elif len(self.ids_modes_disallow[id_lane]) > 0: - if id_mode in self.ids_modes_disallow[id_lane]: - ind += 1 - else: - return ind else: - # no restrictions - return ind + a = -1 - # no unrestricted lane found - return -1 # not allowed on either lane + accesses[i] = a + # if (41824 in ids_lane)|((41826 in ids_lane)): + # print 'get_accesslevel',ids_lane,'accesslevel=',a + # for id_lane, ids_modes_allow, ids_modes_disallow in zip(ids_lane,self.ids_modes_allow[ids_lane], self.ids_modes_disallow[ids_lane]): + # print ' id_lane',id_lane,'ids_modes_allow',ids_modes_allow,'ids_modes_disallow',ids_modes_disallow + + return accesses def get_accesslevel(self, ids_lane, id_mode): """ - Returns access level of mode on lanes ids_lane: + Returns access level of mode on lanes ids_lane, which are supposed to reside on the same edge: -1 = No access 0 = all modes can access 1 = mode can access with a restricted number of other modes @@ -1056,67 +1328,114 @@ #is_blocked = False # print ' ids_modes_allow',self.ids_modes_allow.get_value() for id_lane, ids_modes_allow, ids_modes_disallow in zip(ids_lane, self.ids_modes_allow[ids_lane], self.ids_modes_disallow[ids_lane]): - # print ' ids_modes_allow',ids_modes_allow,'ids_modes_disallow',ids_modes_disallow,'id_lane',id_lane + if ids_modes_allow is None: ids_modes_allow = [] if ids_modes_disallow is None: ids_modes_disallow = [] - n_allow = len(ids_modes_allow) - #n_disallow = len(ids_modes_disallow) + # if id_lane == 33520: + # print ' ids_modes_allow',ids_modes_allow,'ids_modes_disallow',ids_modes_disallow,'id_mode',id_mode,id_mode in ids_modes_allow - if n_allow == 0: - is_mode_only = False - is_modes_all = True - is_blocked = id_mode in ids_modes_disallow - - elif n_allow == 1: - # if id_mode == ids_modes_allow[0]: - # is_mode_only = True - # else: - # is_blocked = True - # break - is_mode_only = id_mode == ids_modes_allow[0] - is_blocked = (id_mode in ids_modes_disallow) | (not(is_mode_only)) + if len(ids_modes_allow) == 0: + # no allow information, so look for disallowed - else: - is_mode_only = False - #is_blocked &= id_mode in ids_modes_disallow - is_blocked = (id_mode not in ids_modes_allow) | (id_mode in ids_modes_disallow) - - # print ' is_blocked',is_blocked,'is_modes_all',is_modes_all,'is_mode_only',is_mode_only - if not is_blocked: - # means access has been found + if len(ids_modes_disallow) == 0: + # no access information: all are allowed + is_modes_all = True + #is_access = True + + elif id_mode not in ids_modes_disallow: + # mode is not disallowed, so it is allowed with others + # but we opt for mixed mode only if explicitely allowed, + # and not selectively forbidden + #is_mode_mixed = True + is_modes_all = True + #is_access = True + + elif len(ids_modes_allow) == 1: + if id_mode == ids_modes_allow[0]: + # found exclusive access + is_mode_only = True + #is_access = True + + elif id_mode in ids_modes_allow: + # mode is allowed together with others + is_mode_mixed = True + #is_access = True + + if is_mode_only: + # exclusive access has been found, cannot get better break - # print ' Final: is_blocked',is_blocked,'is_modes_all',is_modes_all,'is_mode_only',is_mode_only - if is_blocked: # & (not is_mode_only)&(not is_modes_all): - a = -1 - # print ' accesslevel=',a - return a - # return -1 + # no allow info? + # if (ids_modes_allow is None) | (ids_modes_allow == []): + # # no disallow info? + # if (ids_modes_disallow is None) | (ids_modes_disallow == []): + # # if is_mode_only: a = 2 - # return 2 + + elif is_mode_mixed: + a = 1 elif is_modes_all: a = 0 - # return 0 else: - a = 1 - # return 1 + a = -1 + + # if (41824 in ids_lane)|((41826 in ids_lane)): + # print 'get_accesslevel',ids_lane,'accesslevel=',a + # for id_lane, ids_modes_allow, ids_modes_disallow in zip(ids_lane,self.ids_modes_allow[ids_lane], self.ids_modes_disallow[ids_lane]): + # print ' id_lane',id_lane,'ids_modes_allow',ids_modes_allow,'ids_modes_disallow',ids_modes_disallow + + return a + + def get_accesslevel_bikecontrary_special(self, id_lane): + """ + Returns access level of mode on lanes ids_lane: + -2 = contrary sense for bike + + """ + # print 'get_accesslevel',ids_lane + is_mode_only = False + is_mode_mixed = False + is_modes_all = False + is_mode_not_allowed = False + #is_blocked = False + # print ' ids_modes_allow',self.ids_modes_allow.get_value() + ids_modes_allow = self.ids_modes_allow[id_lane] + ids_modes_disallow = self.ids_modes_disallow[id_lane] + id_mode_main = self.ids_mode[id_lane] + a = 0 + if id_mode_main == self.parent.modes.get_id_mode("passenger") and self.parent.modes.get_id_mode("bicycle") in ids_modes_allow and self.parent.modes.get_id_mode("pedestrian") in ids_modes_allow and self.parent.modes.get_id_mode("passenger") not in ids_modes_allow: + is_mode_not_allowed = True + # no allow info? + # if (ids_modes_allow is None) | (ids_modes_allow == []): + # # no disallow info? + # if (ids_modes_disallow is None) | (ids_modes_disallow == []): + # # + + if is_mode_not_allowed: + a = -2 + # if (41824 in ids_lane)|((41826 in ids_lane)): + # print 'get_accesslevel',ids_lane,'accesslevel=',a + # for id_lane, ids_modes_allow, ids_modes_disallow in zip(ids_lane,self.ids_modes_allow[ids_lane], self.ids_modes_disallow[ids_lane]): + # print ' id_lane',id_lane,'ids_modes_allow',ids_modes_allow,'ids_modes_disallow',ids_modes_disallow - # print ' accesslevel=',a return a def get_coord_from_pos(self, id_lane, pos): return get_coord_on_polyline_from_pos(self.shapes[id_lane], pos) def get_sumoinfo_from_id_lane(self, id_lane): - id_sumo_edge = self.parent.edges.ids_sumo[self.ids_edge[id_lane]] - return id_sumo_edge+'_'+str(self.indexes[id_lane]) + if id_lane >= 0: + id_sumo_edge = self.parent.edges.ids_sumo[self.ids_edge[id_lane]] + return id_sumo_edge+'_'+str(self.indexes[id_lane]) + else: + return 5 class Roundabouts(am.ArrayObjman): @@ -1142,6 +1461,16 @@ xmltag='nodes', )) + def convert_to_zipper(self): + """ + Coverts all roundabout nodes to zipper nodes. + This makes traffic at roundabouts a lot smoother. + """ + ids = self.get_ids() + nodes = self.parent.nodes + for id_round, ids_node in zip(ids, self.ids_nodes[ids]): + nodes.types[ids_node] = 8 # "zipper":8, + def multimake(self, ids_nodes=[], **kwargs): n = len(ids_nodes) return self.add_rows(n=n, @@ -1187,6 +1516,36 @@ xmltag='numLanes', )) + self.add_col(am.NumArrayConf('average_slopes', 0., + dtype=np.float32, + ## groupnames = ['state'], + perm='rw', + name='Average slope', + ## unit = '', + info='Average slope of the edge.', + xmltag='average_slopes', + )) + + self.add_col(am.NumArrayConf('positive_climbs', 0., + dtype=np.float32, + ## groupnames = ['state'], + perm='rw', + name='Positive climbs', + unit='m', + info='Total positive difference in altitude.', + xmltag='positive_climbs', + )) + + self.add_col(am.NumArrayConf('negative_climbs', 0., + dtype=np.float32, + ## groupnames = ['state'], + perm='rw', + name='Negative climbs', + unit='m', + info='Total negative difference in altitude.', + xmltag='negative_climbs', + )) + self.add_col(am.NumArrayConf('speeds_max', 50.0/3.6, dtype=np.float32, groupnames=['state'], @@ -1214,6 +1573,15 @@ info='Edge length.', xmltag='length ', )) + + self.add_col(am.ArrayConf('edge_typology', '', + dtype=np.object, + perm='rw', + name='Type', + info='edge typology.', + xmltag='pass', + )) + if self.get_version() < 0.3: self.lengths.set_xmltag('length') # self.lengths.set_xmltag(None) @@ -1239,10 +1607,15 @@ xmltag='shape', )) + # update + if hasattr(self, 'types_spread'): + self.types_spread.choices["roadCenter"] = 2 + self.add_col(am.ArrayConf('types_spread', 0, choices={ "right": 0, "center": 1, + "roadCenter": 2, }, dtype=np.int32, perm='rw', @@ -1369,10 +1742,12 @@ return MODES["pedestrian"] in self.parent.lanes.ids_modes_allow[self.ids_lanes[id_edge][0]] def get_fstar(self, is_return_lists=False, is_return_arrays=False, - is_ignor_connections=False): + is_ignor_connections=False, + id_mode=None + ): """ Returns the forward star graph of the network as dictionary: - fstar[id_fromedge] = set([id_toedge1, id_toedge2,...]) + fstar[id_edge] = set([id_toedge1, id_toedge2,...]) if is_return_lists = True then a list of edges is the value of fstar @@ -1384,29 +1759,74 @@ are considered, disregarding the actual connections """ + print 'get_fstar id_mode', id_mode, 'is_return_lists', is_return_lists, 'is_return_arrays', is_return_arrays #ids_edge = self.get_ids() #fstar = np.array(np.zeros(np.max(ids_edge)+1, np.obj)) fstar = {} + connections = self.parent.connections + lanes = self.parent.lanes + inds_con = connections.get_inds() if is_ignor_connections: # here we ignore connections and look at the # outgoing edges of node database - ids_outgoing = self.parent.nodes.ids_outgoing - ids = self.get_ids() - for id_edge, id_tonode in zip(ids, self.ids_tonode[ids]): - ids_edge_outgoing = ids_outgoing[id_tonode] - if ids_edge_outgoing is not None: - fstar[id_edge] = set(ids_edge_outgoing) - else: - fstar[id_edge] = set() + if 1: # id_mode is None: + # not even mode is checked + ids_outgoing = self.parent.nodes.ids_outgoing + ids = self.get_ids() + for id_edge, id_tonode in zip(ids, self.ids_tonode[ids]): + ids_edge_outgoing = ids_outgoing[id_tonode] + if ids_edge_outgoing is not None: + fstar[id_edge] = set(ids_edge_outgoing) + else: + fstar[id_edge] = set() + + # else:# actually the get_times or get_distance method should eliminate not accessible edges + # check also if id_mode has access at both ends of each connection + # ids_lane = lanes.get_ids() + # has_access = np.zeros(np.max(ids_lane)+1, dtype = np.bool) + # ids_fromedge = list(set(lanes.ids_edge[ids_lane[lanes.get_accesslevel_lanes(ids_lane, id_mode) > -1]])) + # for id_edge, id_tonode in zip(ids_fromedge,self.ids_tonode[ids_fromedge]): + # ids_edge_outgoing = ids_outgoing[id_tonode] + # if ids_edge_outgoing is not None: + # fstar[id_edge] = set() + # for id_edge in ids_edge_outgoing + # if + # fstar[id_edge].add(id_toedge) + # else: + # fstar[id_edge] = set() + else: # here we check actual connections # this is important if correct turns are desired # for exampole in car routing - connections = self.parent.connections - lanes = self.parent.lanes - inds_con = connections.get_inds() - ids_fromedge = lanes.ids_edge[connections.ids_fromlane.get_value()[inds_con]] - ids_toedge = lanes.ids_edge[connections.ids_tolane.get_value()[inds_con]] + + if id_mode is None: + # check connection but do not check accessibility + + ids_fromedge = lanes.ids_edge[connections.ids_fromlane.get_value()[inds_con]] + ids_toedge = lanes.ids_edge[connections.ids_tolane.get_value()[inds_con]] + + else: + # check also if id_mode has access at both ends of each connection + ids_lane = lanes.get_ids() + has_access = np.zeros(np.max(ids_lane)+1, dtype=np.bool) + # this is quite slow, because get_accesslevel is slow + # TODO: substitute by a simpler accesslevel checker + has_access[ids_lane] = lanes.get_accesslevel_lanes(ids_lane, id_mode) > -1 + + ids_fromlane_all = connections.ids_fromlane.get_value()[inds_con] + ids_tolane_all = connections.ids_tolane.get_value()[inds_con] + # if 1:# debug + # id_edge_test = 48891 + # edges = self + # + # for id_fromlane, id_tolane, has_access_fromlane, has_access_tolane in zip(ids_fromlane_all, ids_tolane_all, has_access[ids_fromlane_all], has_access[ids_tolane_all]): + # is_valid = has_access_fromlane & has_access_tolane + # print ' id_fromedge',edges.ids_sumo[lanes.ids_edge[id_fromlane]],has_access_fromlane,'id_toedge',edges.ids_sumo[lanes.ids_edge[id_tolane]],has_access_tolane,'valid',is_valid + + inds_valid = np.flatnonzero(np.logical_and(has_access[ids_fromlane_all], has_access[ids_tolane_all])) + ids_fromedge = lanes.ids_edge[ids_fromlane_all[inds_valid]] + ids_toedge = lanes.ids_edge[ids_tolane_all[inds_valid]] for id_edge in self.get_ids(): fstar[id_edge] = set() @@ -1421,13 +1841,14 @@ fstar[id_edge] = np.array(ids_toedges, dtype=np.int32) else: fstar[id_edge] = ids_toedges + # print ' fstar',fstar return fstar def get_bstar(self, is_return_lists=False, is_return_arrays=False, - is_ignor_connections=False): + is_ignor_connections=False, id_mode=None): """ Returns the backward star graph of the network as dictionary: - fstar[id_fromedge] = set([id_fromedge1, id_fromedge2,...]) + bstar[id_edge] = set([id_fromedge1, id_fromedge2,...]) if is_return_lists = True then a list of edges is the value of bstar @@ -1473,6 +1894,7 @@ for id_edge in self.get_ids(): ids_fromedges = list(bstar[id_edge]) if is_return_arrays: + # the intermediate step set-> list->array is required! bstar[id_edge] = np.array(ids_fromedges, dtype=np.int32) else: bstar[id_edge] = ids_fromedges @@ -1507,7 +1929,83 @@ accesslevels[id_edge] = get_accesslevel(ids_lane, id_mode) return accesslevels - def get_distances(self, id_mode=0, is_check_lanes=False): + def get_max_connected(self, ids_edge=None, id_mode=None, is_bidir=True, + speed_max=None, + modeconst_excl=0.0, modeconst_mix=0.0, + weights=None, fstar=None): + """ + Returns a list with the maximum possible number of connected edges. + + If list ids_edge with edge IDs is provided then the maximum number of connected + edges are withing the given list. + + If id_mode is given the only edges with access to this mode are considered. + + If is_bidir is True then also the back-ward connectivity is berified, + this means the returned edges are connected in both directions. + """ + # print 'get_max_connected id_mode',id_mode,'ids_edge',ids_edge + + if ids_edge is None: + ids_edge = self.get_ids() + + if id_mode is not None: + ids_edge = ids_edge[self.get_accesslevels(id_mode)[ids_edge] >= 0] + + if weights is None: + weights = self.get_times(id_mode=id_mode, is_check_lanes=True, + speed_max=speed_max, + modeconst_excl=modeconst_excl, + modeconst_mix=modeconst_mix) + if fstar is None: + fstar = self.get_fstar(is_ignor_connections=False, id_mode=id_mode) + + n_edge = len(ids_edge) # total number of accessible edges + + is_continue = True + + ids_edge_unreached_set = set(ids_edge) + n_reached_max = 0 + n_edge_unreached = len(ids_edge_unreached_set) + ids_edges_reachable_max = np.zeros(0, dtype=np.int32) + # print ' n_edge_unreached',n_edge_unreached + while is_continue & (n_edge_unreached > 0): + id_edge_start = ids_edge_unreached_set.pop() + ids_edge_unreached = np.array(list(ids_edge_unreached_set), dtype=np.int32) + # print ' check id_edge_start',id_edge_start,'ids_edge_unreached',ids_edge_unreached + costs, routes = get_mincostroute_edge2edges( + id_edge_start, ids_edge_unreached, + weights=weights, + fstar=fstar, + ) + # print ' costs',costs + # print ' routes',routes + ids_edge_reached = ids_edge_unreached[np.array(costs, dtype=np.int32) >= 0] + n_reached = len(ids_edge_reached) + + ids_edge_unreached_set.symmetric_difference_update(ids_edge_reached) + n_edge_unreached = len(ids_edge_unreached_set) + # important: add the start edge to the reached edges + ids_edge_reached = np.concatenate(([id_edge_start], ids_edge_reached)) + if n_reached > n_reached_max: + n_reached_max = n_reached + ids_edges_reachable_max = ids_edge_reached.copy() + + # if the number of yet unreached edges is greater than + # the found maximum reachable number of edges (n_reached_max with a specific start edge) + # then there is still a chance to find a better start edge, + # beating the current maximum of n_reached_max reached edge + is_continue = n_edge_unreached > n_reached_max + + if is_bidir: + # call same fuction with ids_edges_reachable_max as target sets + ids_edges_reachable_max = self.get_max_connected(ids_edge=ids_edges_reachable_max, + id_mode=id_mode, is_bidir=False, + weights=weights, fstar=fstar) + + return ids_edges_reachable_max + + def get_distances(self, id_mode=0, is_check_lanes=False, is_precise=True, modeconst_excl=0.0, modeconst_mix=0.0): """ Returns distances for all edges. The returned array represents the distance that corresponds to @@ -1517,9 +2015,9 @@ the respective mode is allowed. If not allowed on a particular edge, - then the respective edge distance is negative. + then the respective edge distance is nan. """ - # print 'get_distances id_mode,is_check_lanes,speed_max',id_mode,is_check_lanes,speed_max + print 'get_distances id_mode,is_check_lanes,speed_max', id_mode, is_check_lanes, is_precise ids_edge = self.get_ids() dists = np.zeros(np.max(ids_edge)+1, np.float32) #speeds = self.speeds_max[ids_edge] @@ -1530,28 +2028,55 @@ # elif id_mode is not None: # # limit allowed speeds with max speeds of mode # speeds = np.clip(speeds, 0.0, self.parent.modes.speeds_max[id_mode]) + if not is_precise: + radii = self.ids_fromnode.get_linktab().radii + dists[ids_edge] = radii[self.ids_fromnode[ids_edge]] + \ + self.lengths[ids_edge] + radii[self.ids_tonode[ids_edge]] + else: + coords = self.parent.nodes.coords + + for id_edge, shape, coord_fromnode, coord_tonode in zip( + ids_edge, self.shapes[ids_edge], + coords[self.ids_fromnode[ids_edge]], + coords[self.ids_tonode[ids_edge]]): + # print ' id_edge',id_edge,'len %.1f'%(self.lengths[id_edge]),'d_from %.2f'%(np.sqrt(np.sum( (shape[0]-coord_fromnode)**2 )) ),'d_to %.2f'%(np.sqrt(np.sum((shape[-1]-coord_tonode)**2)) ) + dists[id_edge] = np.sum((shape[0]-coord_fromnode)**2) + np.sum((shape[-1]-coord_tonode)**2) + #dists[id_edge] += np.sum((shape[-1]-coord_tonode)**2) + + # for id_edge, dist2, length in zip(ids_edge, dists[ids_edge], self.lengths[ids_edge]): + # print ' id_edge',id_edge,'len %.1f'%(self.lengths[id_edge]),'d_node %.2f'%(np.sqrt(dist2)) + + dists[ids_edge] = np.sqrt(dists[ids_edge])+self.lengths[ids_edge] - radii = self.ids_fromnode.get_linktab().radii - dists[ids_edge] = radii[self.ids_fromnode[ids_edge]] + self.lengths[ids_edge] + radii[self.ids_tonode[ids_edge]] ids_lanes = self.ids_lanes if is_check_lanes & (id_mode > 0): # mode 0 can pass everywhere - get_laneindex_allowed = self.parent.lanes.get_laneindex_allowed - has_noaccess = -1 + #get_laneindex_allowed = self.parent.lanes.get_laneindex_allowed + get_accesslevel = self.parent.lanes.get_accesslevel + has_noaccess = np.nan for id_edge in ids_edge: - if get_laneindex_allowed(ids_lanes[id_edge], id_mode) == has_noaccess: + if get_accesslevel(ids_lanes[id_edge], id_mode) == -1: dists[id_edge] = has_noaccess - #ind = get_laneindex_allowed(ids_lanes[id_edge], id_mode) - # print ' check id_edge, ind',id_edge, ind - # if ind<0: - # dists[id_edge] = ind # =-1 + accesslevel = get_accesslevel(ids_lanes[id_edge], id_mode) + if accesslevel == -1: + dists[id_edge] = has_noaccess + elif accesslevel == 2: + dists[id_edge] = max(dists[id_edge] + modeconst_excl, 0) + elif accesslevel == 1: + dists[id_edge] = max(dists[id_edge] + modeconst_mix, 0) return dists - def get_times(self, id_mode=0, is_check_lanes=False, speed_max=None, + # def get_times_accumulated(self, id_edge_target, id_mode, timeout = np.inf, edgetimes = None, bstar = None): + # """ + # Returns accumulated edge times for each edge in the network that can reach + # target edge id_edge_target with mode id_mode + # """ + + def get_times(self, id_mode=None, is_check_lanes=False, speed_max=None, modeconst_excl=0.0, modeconst_mix=0.0, ): """ - Returns freeflow travel times for all edges..radii + Returns freeflow travel times for all edges The returned array represents the travel time that corresponds to edge IDs. @@ -1559,7 +2084,7 @@ the respective mode is allowed. If not allowed on a particular edge, - then the respective edge travel time is negative. + then the respective edge travel time is nan. modeconst_excl and modeconst_mix are constants added to the time if the respective edge provides exclusive or reserver mixed @@ -1583,13 +2108,13 @@ if is_check_lanes & (id_mode > 0): # mode 0 can pass everywhere #get_laneindex_allowed = self.parent.lanes.get_laneindex_allowed get_accesslevel = self.parent.lanes.get_accesslevel - invalid = -1 + invalid = np.nan #ids_edge = self.get_ids() #accesslevels = np.zeros(np.max(ids_edge)+1, np.int8) for id_edge, ids_lane in zip(ids_edge, self.ids_lanes[ids_edge]): #accesslevels[id_edge] = get_accesslevel(ids_lane, id_mode) accesslevel = get_accesslevel(ids_lane, id_mode) - if accesslevel == invalid: + if accesslevel == -1: times[id_edge] = invalid elif accesslevel == 2: times[id_edge] = max(times[id_edge] + modeconst_excl, 0) @@ -1806,6 +2331,7 @@ self._segvertexinds = np.array(vertexinds, np.int32) def get_dist_point_to_edge(self, p, id_edge, + is_ending=True, is_detect_initial=False, is_detect_final=False, is_return_segment=False): @@ -1823,7 +2349,7 @@ y2 = vertices[inds_seg, 1, 1] dists2 = get_dist_point_to_segs(p[0:2], x1, y1, x2, y2, - is_ending=True, + is_ending=is_ending, is_detect_initial=is_detect_initial, is_detect_final=is_detect_final ) @@ -1845,7 +2371,10 @@ else: return np.sqrt(dists2[ind_min]) - def get_closest_edge(self, p, is_get2=False): + def get_closest_edge(self, p, is_get2=False, n_best=0, d_max=np.inf, + is_ending=True, is_detect_initial=False, + is_detect_final=False, + accesslevels=None): """ Returns edge id which is closest to point p. Requires execution of make_segment_edge_map @@ -1867,11 +2396,39 @@ # print ' x1', x1 # print ' x2', x2 #halfwidths = 0.5*self.get_widths_array()[self._polyinds] - d2 = get_dist_point_to_segs(p[0:2], x1, y1, x2, y2, is_ending=True) - # print ' min(d2)=',np.min(d2),'argmin=',np.argmin(d2),self.get_ids(self._edgeinds[np.argmin(d2)]) - if not is_get2: - return self.get_ids(self._edgeinds[np.argmin(d2)]) - else: + d2 = get_dist_point_to_segs(p[0:2], x1, y1, x2, y2, is_ending=is_ending, + is_detect_initial=is_detect_initial, + is_detect_final=is_detect_final) + + if is_detect_initial | is_detect_final | (not np.isinf(d_max)): + # there may be nans if not projecting, replace by inf + #inds_valid = np.logical_not(np.isnan(d2)) + + # print ' ids_edge in range',set(self.get_ids(self._edgeinds[d2 < d_max**2]).tolist()) + # if 0: + # ind_range = d2 < d_max**2 + # l=[] + # for d, id_edge in zip(np.sqrt(d2[ind_range]), self.get_ids(self._edgeinds[ind_range]) ): + # l.append((d, id_edge)) + # l.sort() + # for d, id_edge in l: + # print ' d',d,'id_edge',id_edge + + d2[d2 > d_max**2] = np.inf + d2[np.isnan(d2)] = np.inf + + #inds_valid = ( d2 -1: + ids_min = [id_edge_min] + else: + ids_min = [] + else: + ids_min = [id_edge_min] + else: + # print ' dist2_min',dist2_min,np.isinf(dist2_min) + return [], [] + + # print ' min(d)=',np.sqrt(np.min(d2)),'argmin=',np.argmin(d2),'id_edge=',self.get_ids(self._edgeinds[np.argmin(d2)]) + is_cont = True + while is_cont: + d2[ind] = np.inf + ind = np.argmin(d2) + dist2_min = d2[ind] + id_edge = self.get_ids(self._edgeinds[ind]) + # print ' check id_edge',id_edge + if np.isinf(dist2_min): + is_cont = False + elif id_edge not in ids_min: + # print ' min(d)=',np.sqrt(np.min(d2)),'argmin=',np.argmin(d2),'id_edge=',self.get_ids(self._edgeinds[np.argmin(d2)]) + #dist2_min = d2[ind] + if accesslevels is not None: + # print ' id_edge_min',id_edge,'dists_min',np.sqrt(dists2_min),accesslevels[id_edge] + if accesslevels[id_edge] > -1: + dists2_min.append(dist2_min) + ids_min.append(id_edge) + else: + dists2_min.append(dist2_min) + ids_min.append(id_edge) + + if len(dists2_min) == n_best: + is_cont = False + # print ' found ids_edge',ids_min + return ids_min, np.sqrt(dists2_min) + + else: + return self.get_ids(self._edgeinds[np.argmin(d2)]) + def get_ids_edge_from_inds_seg(self, inds_seg): return self.get_ids(self._edgeinds[inds_seg]) @@ -1922,6 +2528,50 @@ self.parent.roundabouts.write_xml(fd, indent=indent, is_print_begin_end=False) fd.write(xm.end('edges')) fd.close() + return True + + def export_edgeweights_xml(self, filepath=None, weights=None, time_begin=0, time_end=3600, ident='w1', encoding='UTF-8'): + print 'export_edgeweights_xml', time_begin, time_end, 'filepath', filepath + # + # + # + # + # + # + # + if filepath is None: + filepath = self.parent.parent.get_rootfilepath()+'.weight.xml' + + try: + fd = open(filepath, 'w') + except: + print 'WARNING in export_edgeweights_xml: could not open', filepath + return '' + + if weights is None: + weights = self.get_times() + + fd.write('\n' % encoding) + indent = 0 + fd.write(xm.begin('meandata', indent)) + fd.write(xm.start('interval', indent+4)) + fd.write(xm.num('begin', time_begin)) + fd.write(xm.num('end', time_end)) + fd.write(xm.num('id', ident)) + fd.write(xm.stop()) + + ids_edge = self.get_ids() + for id_edge_sumo, weight in zip(self.ids_sumo[ids_edge], weights[ids_edge]): + fd.write(xm.start('edge', indent+6)) + fd.write(xm.num('id', id_edge_sumo)) + fd.write(xm.num('traveltime', weight)) + fd.write(xm.stopit()) + + fd.write(xm.end('interval', indent+4)) + fd.write(xm.end('meandata', indent)) + + fd.close() + return filepath def update(self, ids=None, is_update_lanes=False): print 'Edges.update' @@ -2068,6 +2718,82 @@ if is_corrected: self.update(is_update_lanes=True) + def analyze_edges(self, **kwargs): + # TODO: this should feed into a temporary field + print 'Analyze edges' + # individuate edge typologies (pedestrian, bike lane, bike/pedestrian, + # one-way road, 2-way road) + network = self.parent + modes = network.modes + edges = network.edges + lanes = network.lanes + ids_edge = edges.get_ids() + pedestrian_edges = [] + cycling_edges = [] + ids_lanes = edges.ids_lanes[ids_edge] + # check edges with only a pedestrian lane + cycling_ped_edges = [] + id_bike = modes.get_id_mode("bicycle") + id_ped = modes.get_id_mode("pedestrian") + for id_edge, id_lanes in zip(ids_edge, ids_lanes): + if len(lanes.ids_mode[id_lanes]) == 1: + if lanes.ids_mode[id_lanes] == [id_ped]: + pedestrian_edges.append(id_edge) + print 'edge', id_edge, 'ped' + if lanes.ids_mode[id_lanes] == [id_bike]: + cycling_edges.append(id_edge) + print 'edge', id_edge, 'cycl' + edges.edge_typology[pedestrian_edges] = 'Pedestrian' + edges.edge_typology[cycling_edges] = 'bike lane' + + for no_car_edge in pedestrian_edges: + ids_edge = ids_edge[(ids_edge != no_car_edge)] + for no_car_edge in cycling_edges: + ids_edge = ids_edge[(ids_edge != no_car_edge)] + + ids_lanes = edges.ids_lanes[ids_edge] + + for id_edge, id_lanes in zip(ids_edge, ids_lanes): + if len(lanes.ids_modes_allow[id_lanes][0]) == 2 and len(id_lanes) == 1: + if id_bike in np.array(lanes.ids_modes_allow[id_lanes][0]) and id_ped in np.array(lanes.ids_modes_allow[id_lanes][0]): + cycling_ped_edges.append(id_edge) + print 'edge', id_edge, 'cycl_ped' + elif len(id_lanes) == 2: + if lanes.ids_mode[id_lanes[0]] == id_bike and lanes.ids_mode[id_lanes[1]] == id_ped: + cycling_ped_edges.append(id_edge) + print 'edge', id_edge, 'cycl_ped' + if lanes.ids_mode[id_lanes[0]] == id_ped and lanes.ids_mode[id_lanes[1]] == id_bike: + cycling_ped_edges.append(id_edge) + print 'edge', id_edge, 'cycl_ped' + + edges.edge_typology[cycling_ped_edges] = 'Bike/Pedestrian' + ids_edge_car = ids_edge + for no_car_edge in cycling_ped_edges: + ids_edge_car = ids_edge_car[(ids_edge_car != no_car_edge)] + + ids_fromnode_car = edges.ids_fromnode[ids_edge_car] + ids_tonode_car = edges.ids_tonode[ids_edge_car] + for id_edge, id_tonode, id_fromnode in zip(ids_edge_car, ids_tonode_car, ids_fromnode_car): + edges.edge_typology[id_edge] = '2-way road' + ids_fromnode_car2 = ids_fromnode_car[(ids_tonode_car == id_fromnode)] + if id_tonode not in ids_fromnode_car2: + edges.edge_typology[id_edge] = '1-way road' + +## ids_fromnode_bike = edges.ids_fromnode[cycling_edges] +## ids_tonode_bike = edges.ids_tonode[cycling_edges] +# for id_edge, id_tonode, id_fromnode in zip(cycling_edges, ids_tonode_bike, ids_fromnode_bike): +## edges.edge_typology[id_edge] = '2-way bike lane' +## ids_fromnode_bike2 = ids_fromnode_bike[(ids_tonode_bike == id_fromnode)] +# if id_tonode not in ids_fromnode_bike2: +## edges.edge_typology[id_edge] = '1-way bike lane' + +# for id_edge2, id_tonode2, id_fromnode2 in zip(ids_edge, ids_tonode2, ids_fromnode2): +# if id_tonode2 == id_fromnode: +# if id_fromnode2 == id_tonode: +## edges.are_one_way[id_edge] = False + + return True + class Nodes(am.ArrayObjman): # http://www.sumo.dlr.de/userdoc/Networks/Building_Networks_from_own_XML-descriptions.html#Node_Descriptions @@ -2183,6 +2909,46 @@ xmltag='keepClear', )) + self.add_col(am.ArrayConf('n_connections', default=0, + dtype=np.int32, + groupnames=['results'], + symbol='N conn at node', + name='number connections at node', + info='Number of connections at node. This indicate the compexity of the intersection', + )) + + self.add_col(am.ArrayConf('n_left_turns', default=0, + dtype=np.int32, + groupnames=['results'], + symbol='N left turns at node', + name='number left turns at node', + info='Number of left turns at node', + )) + + self.add_col(am.ArrayConf('n_right_turns', default=0, + dtype=np.int32, + groupnames=['results'], + symbol='N right turn at node', + name='number right turn at node', + info='Number of right turn at node.', + )) + + self.add_col(am.ArrayConf('n_crossings', default=0, + dtype=np.int32, + groupnames=['results'], + symbol='N crossings at node', + name='number crossings at node', + info='Number of crossings at node.', + )) + + self.add_col(am.ArrayConf('n_u_turns', default=0, + dtype=np.int32, + groupnames=['results'], + symbol='N u-turns at node', + name='number u-turns at node', + info='Number of u-turns at node. ', + )) + def set_edges(self, edges): self.add_col(am.IdlistsArrayConf('ids_incoming', edges, @@ -2319,7 +3085,7 @@ fd.write(xm.stopit()) ids = self.get_ids() - for _id, is_costum_shape in zip(ids, self.are_costum_shape[ids]): + for _id, is_costum_shape in zip(ids, self.are_costum_shape[ids]): fd.write(xm.start(xmltag_item, indent+2)) # print ' make tag and id',_id @@ -2663,6 +3429,32 @@ # else: # return False + def in_boundaries(self, points, x_border=0.0, y_border=0.0): + """ + Tests if the given points are in + the network boundaries. + + Returns a binary vector with one element for each point + If an element is True then the corrisponding + point in within the networks bounding box. + Otherwise the point is outside. + Elevation is ignored. + Format of points: + [[x1,y1,z1],[x2,y2,z2],...] + + + + Returns False otherwise + """ + # print 'intersects_boundaries' + # print ' self',self._boundaries + # print ' BB',BB + # print ' return',( (self._boundaries[2] >= BB[0]) & (self._boundaries[0] <= BB[2]) & + # (self._boundaries[3] >= BB[1]) & (self._boundaries[1] <= BB[3]) ) + + return ((self._boundaries[2]-x_border >= points[:, 0]) & (self._boundaries[0]+x_border <= points[:, 0]) & + (self._boundaries[3]-y_border >= points[:, 1]) & (self._boundaries[1]+y_border <= points[:, 1])) + def get_projparams(self): return self._projparams @@ -2702,8 +3494,8 @@ self.modes.add_default() # do other cleanup jobs - def call_netedit(self, filepath=None, is_maps=False, is_poly=True): - + def call_netedit(self, filepath=None, is_maps=False, is_poly=True, command='netedit'): + print 'call_netedit' #filepath = self.export_netxml(filepath) if filepath is None: filepath = self.get_filepath() @@ -2724,7 +3516,7 @@ addfilepath = self.export_addxml(is_ptstops=True, is_poly=False) if addfilepath is not False: - option_addfiles_in = ' --sumo-additionals-file '+filepathlist_to_filepathstring(addfilepath) + option_addfiles_in = ' --additional-files '+filepathlist_to_filepathstring(addfilepath) else: option_addfiles_in = '' @@ -2734,7 +3526,7 @@ #+ ' --sumo-net-file ' + filepathlist_to_filepathstring(filepath) - cml = 'netedit --ignore-errors.edge-type'\ + cml = command+' --ignore-errors.edge-type'\ + ' --node-files '+filepathlist_to_filepathstring(filepath_nodes)\ + ' --edge-files '+filepathlist_to_filepathstring(filepath_edges)\ + ' --connection-files '+filepathlist_to_filepathstring(filepath_connections)\ @@ -2751,18 +3543,19 @@ # print ' pid = ',proc.pid proc.wait() if proc.returncode == 0: - print ' netedit:success' + print ' ', command, ':success' return self.import_netxml() # return self.import_xml() # use if netedit exports to plain xml files else: - print ' netedit:error' + print ' ', command, ':error' return False else: print ' netconvert:error' return False def call_sumogui(self, filepath=None, is_maps=True, is_poly=True): + print 'call_sumogui', filepath, is_maps, is_poly if filepath is None: filepath = self.get_filepath() @@ -2774,13 +3567,18 @@ elif len(names) <= 2: rootname = names[0] - configfilepath = self.write_guiconfig(rootname, dirname, is_maps) + if not os.path.isfile(filepath): + filepath, delta = self.export_netxml(filepath, is_return_delta=True) + else: + delta = self._get_delta_netconvert(filepath) + + configfilepath = self.write_guiconfig(rootname, dirname, is_maps, delta=delta) #addfilepath = self.export_addxml(is_ptstops = True, is_poly = True) stopfilepath = self.ptstops.export_sumoxml() - if is_poly: - polyfilepath = self.parent.landuse.export_polyxml() + if is_poly & (not is_maps): + polyfilepath = self.parent.landuse.export_polyxml(delta=delta) else: polyfilepath = None @@ -2813,7 +3611,21 @@ proc.wait() return proc.returncode - def write_guiconfig(self, rootname=None, dirname=None, is_maps=False): + def _get_delta_netconvert(self, netfilepath): + """ + This is a workaround for a bug in netconvert!! + Returns a delta between current bounding box and the netfile + generated by netconvert. + Delta is a 3 dim vector (x,y,z) + """ + bbox = self._get_bbox_from_netfile(netfilepath) + delta_bb = self._boundaries-bbox + delta = np.zeros(3, dtype=np.float32) + delta[:2] = delta_bb[:2] + # print ' delta_bb',delta_bb,'return',delta + return delta + + def write_guiconfig(self, rootname=None, dirname=None, is_maps=False, delta=np.zeros(3, dtype=np.float32)): # check if there are maps maps = None @@ -2836,7 +3648,7 @@ if line.count('') == 1: fd_config.write(line) if is_maps & (maps is not None): - maps.write_decals(fd_config, indent=12) + maps.write_decals(fd_config, indent=12, delta=delta) else: fd_config.write(line) @@ -2892,7 +3704,7 @@ #xmltag, xmltag_item, attrname_id = self.xmltag fd.write('\n' % encoding) indent = 0 - #fd.write(xm.begin('routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://sumo.sf.net/xsd/routes_file.xsd"',indent)) + #fd.write(xm.begin('routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.sf.net/xsd/routes_file.xsd"',indent)) fd.write(xm.begin('additional', indent)) @@ -2907,7 +3719,7 @@ fd.write(xm.start('location', indent+2)) # print ' groups:',self.parent.net.get_attrsman().get_groups() for attrconfig in self.get_attrsman().get_group('location'): - # print ' locationconfig',attrconfig.attrname + # print ' locationconfig',attrconfig.attrname attrconfig.write_xml(fd) fd.write(xm.stopit()) @@ -2945,7 +3757,7 @@ return filepath_edges, filepath_nodes, filepath_connections, filepath_tlss - def export_netxml(self, filepath=None, is_export_tlss=True, is_netconvert=True): + def export_netxml(self, filepath=None, is_export_tlss=True, is_netconvert=True, is_return_delta=False): # now create rootfilepath in order to export first # the various xml file , then call netconvert @@ -2958,6 +3770,7 @@ #cml = 'netconvert --verbose --ignore-errors.edge-type' cml = 'netconvert --ignore-errors.edge-type'\ + + ' --ignore-errors.connections'\ + ' --node-files '+filepathlist_to_filepathstring(filepath_nodes)\ + ' --edge-files '+filepathlist_to_filepathstring(filepath_edges)\ + ' --connection-files '+filepathlist_to_filepathstring(filepath_connections)\ @@ -2973,13 +3786,49 @@ proc.wait() if proc.returncode == 0: print ' success' - return filepath + if is_return_delta: + delta = self._get_delta_netconvert(filepath) + + return filepath, delta + else: + return filepath else: print ' success' return '' else: return '' + def _get_bbox_from_netfile(self, filepath): + f = open(filepath, 'r') + is_cont = True + line = f.readline() + # print 'line:',line + # If the file is not empty keep reading one line + # at a time, till the file is empty + while (len(line) > 0) & is_cont: + data = line.strip().split(' ') + is_cont = data[0] != ' self.duration_min: + program.durations_min[id_phase] = (1.0-0.01*self.variation_max)*float(duration) + program.durations_max[id_phase] = (1.0+0.01*self.variation_max)*float(duration) + + return True + + class TlsGenerator(netconvert.NetConvertMixin): def __init__(self, net, logger=None, **kwargs): print 'TlsGenerate.__init__' @@ -104,8 +178,7 @@ edges.ids_tonode[ids_edge], edges.speeds_max[ids_edge], ): - print ' is_major_road', id_edge, self.is_major_road( - priority, n_lanes, speed_max), id_edge not in ids_edges_major + print ' is_major_road', id_edge, self.is_major_road(priority, n_lanes, speed_max), id_edge not in ids_edges_major if self.is_major_road(priority, n_lanes, speed_max): if id_edge not in ids_edges_major: #dist = 0 @@ -269,8 +342,7 @@ # detect incoming edges # ,not is_ped_edge,'not from TLS',edges.ids_fromnode[id_edge] not in ids_nodes_tls - print ' is external', edges.ids_fromnode[ - id_edge] not in ids_nodes_tls, 'is_cycle_edge', is_cycle_edge, 'is_major', id_edge in edges_major, 'is_noped' + print ' is external', edges.ids_fromnode[id_edge] not in ids_nodes_tls, 'is_cycle_edge', is_cycle_edge, 'is_major', id_edge in edges_major, 'is_noped' if edges.ids_fromnode[id_edge] not in ids_nodes_tls: # from node is not part of the TLS # so it comes from external @@ -439,8 +511,7 @@ dists_to < dist_intercheck, (ids_connodes == id_node), (ids_conedges_from != id_edge_from), inds): - print ' id_con:%d d_from %.2f, d_to %.2f' % ( - id_con1, df, dt), df < dist_intercheck, dt < dist_intercheck, id_node1 == id_node, id_edge1 != id_edge_from, crit + print ' id_con:%d d_from %.2f, d_to %.2f' % (id_con1, df, dt), df < dist_intercheck, dt < dist_intercheck, id_node1 == id_node, id_edge1 != id_edge_from, crit # print ' vf',vf,'vt',vt,'cent',cent,cent-vt dists_fromcon_node[id_con] = np.array(dists_from[inds], dtype=np.int32) @@ -453,8 +524,7 @@ if 1: # debug print ' show conflicts:', len(inds_cons_conflict) for id_con_tls, inds_con_conflict, id_connode in zip(ids_con_tls, inds_cons_conflict.values(), ids_connodes): - print ' id_connode:%d id_con:%d' % ( - id_connode, id_con_tls), 'ids_conf', ids_con_tls[inds_con_conflict] + print ' id_connode:%d id_con:%d' % (id_connode, id_con_tls), 'ids_conf', ids_con_tls[inds_con_conflict] # print ' id_node %d, id_con %d confl:'%(id_node,id_con) # print ' ids_con_conflict',ids_con_tls[inds_con_conflict] @@ -561,8 +631,7 @@ weights=costs_bike, fstar=fstar) for id_outgoing_tls in ids_outgoing_bike_tls: # +ids_outgoing_tls+ids_outgoing_major_tls: - print ' bike route from %d to %d' % ( - id_incoming_tls, id_outgoing_tls), 'can route?', (id_incoming_tls in D) & (id_outgoing_tls in D) + print ' bike route from %d to %d' % (id_incoming_tls, id_outgoing_tls), 'can route?', (id_incoming_tls in D) & (id_outgoing_tls in D) if (id_incoming_tls in D) & (id_outgoing_tls in D): # avoid route with turnaround @@ -675,8 +744,7 @@ inds_con_route |= (lanes.ids_edge[ids_fromlane_tls] == id_edge_from) & ( lanes.ids_edge[ids_tolane_tls] == id_edge_to) - print ' id_node,prio', id_node, prio, id_node in nodes_tls, 'n_cons_route', len( - np.flatnonzero(inds_con_route)) + print ' id_node,prio', id_node, prio, id_node in nodes_tls, 'n_cons_route', len(np.flatnonzero(inds_con_route)) # make phase for ids_edges if prio != -1: @@ -730,8 +798,7 @@ i_route] #inds_cons_conflict_group = inds_cons_conflict.copy() - print ' Check group', i_group, 'for ind_tlsroute', ind_tlsroute, 'c=%.1f' % routes_tls_cost[ - ind_tlsroute] + print ' Check group', i_group, 'for ind_tlsroute', ind_tlsroute, 'c=%.1f' % routes_tls_cost[ind_tlsroute] # print ' inds_cons_conflict',inds_cons_conflict # check whether there are other, compatible @@ -746,8 +813,7 @@ # no phase group associated with ind_tlsroute2, inds_con_route2, prio2, inds_cons_conflict_route2, inds_cons_merge_route2 = routeconnectordata[ j_route] - print ' check with ind_tlsroute2', ind_tlsroute2, np.any( - inds_cons_conflict_route2 & inds_con_route), np.any(inds_cons_conflict_route & inds_con_route2) + print ' check with ind_tlsroute2', ind_tlsroute2, np.any(inds_cons_conflict_route2 & inds_con_route), np.any(inds_cons_conflict_route & inds_con_route2) # print ' c',inds_con_route # print ' x',inds_cons_conflict_route2 if (not np.any(inds_cons_conflict_route2 & inds_alloc_group)) & (not np.any(inds_confict_group & inds_con_route2)): @@ -804,6 +870,10 @@ phasepriorities = [] # print '\n **inds_cons_conflict',inds_cons_conflict + if len(phasegroups) == 0: + print ' WARNING: a TLS without signal groups. Abandone.' + return + for i_group, inds_alloc_groups, inds_confict_groups, inds_merge_groups, prio_group in zip(xrange(max(phasegroups)+1), inds_alloc_groups, inds_confict_groups, inds_merge_groups, prios_group): print ' allocate slots for group', i_group phaseallocations.append(inds_alloc_groups) @@ -873,8 +943,7 @@ if 1: # go though all nodes of this TLS for id_node, nodeattrs in nodes_tls.iteritems(): - print ' safecheck id_node', id_node, 'is_crossing', nodeattrs[ - 'is_crossing'], 'is_cycleped', nodeattrs['is_cycleped'] + print ' safecheck id_node', id_node, 'is_crossing', nodeattrs['is_crossing'], 'is_cycleped', nodeattrs['is_cycleped'] #nodeattrs['is_cycleped'] = is_cycleped # nodeattrs['is_crossing'] = @@ -890,8 +959,7 @@ for id_edge_from in nodeattrs['ids_cycleped_incoming']: # nodes.ids_incoming[id_node]: for id_edge_to in nodeattrs['ids_cycleped_outgoing']: - print ' safecheck cycleped from edge %d to edge %d id_edge' % ( - id_edge_from, id_edge_to) + print ' safecheck cycleped from edge %d to edge %d id_edge' % (id_edge_from, id_edge_to) # connector index vector with all connectors for this edge @@ -983,8 +1051,7 @@ inds_noconf = phaseconflicts[i] == 0 inds_noconf_last = phaseconflicts[i-1] == 0 - print ' safecheck phase', i, 'inds_noconf', inds_noconf[ - ind_con], 'inds_noconf_last', inds_noconf_last[ind_con] + print ' safecheck phase', i, 'inds_noconf', inds_noconf[ind_con], 'inds_noconf_last', inds_noconf_last[ind_con] if inds_noconfmerge[ind_con]: # no red at ind_con @@ -999,8 +1066,7 @@ # ambiguous cons = green cons inds & inds where cons should be red inds_con_ambiqu = inds_noconf & (inds_con_confcheck > 0) & are_enabeled - print ' inds_con_ambiqu', ids_con_tls[inds_con_ambiqu], 'resolve ambig', (inds_noconf_last[ind_con]) & np.any( - inds_con_ambiqu) + print ' inds_con_ambiqu', ids_con_tls[inds_con_ambiqu], 'resolve ambig', (inds_noconf_last[ind_con]) & np.any(inds_con_ambiqu) # any ambiguous connector found? if np.any(inds_con_ambiqu): @@ -1296,8 +1362,7 @@ id_fromlane = ids_fromlane_tls[ind_con_block] is_disabled = not are_enabeled[ind_con_block] - print 'block_connection id %d id_fromlane %d' % (ids_con_tls[ind_con_block], id_fromlane), 'nocycleped', lanes.ids_mode[ids_fromlane_tls[ - ind_con_block]] not in self.ids_cycleped, 'slot', slots[ind_con_block], 'L=%dm' % edges.lengths[lanes.ids_edge[id_fromlane]], + print 'block_connection id %d id_fromlane %d' % (ids_con_tls[ind_con_block], id_fromlane), 'nocycleped', lanes.ids_mode[ids_fromlane_tls[ind_con_block]] not in self.ids_cycleped, 'slot', slots[ind_con_block], 'L=%dm' % edges.lengths[lanes.ids_edge[id_fromlane]], if (slots[ind_con_block] > 0) | is_disabled: # ind_con_block has already been tuned to red @@ -1500,8 +1565,7 @@ return for id_edge, length, id_edgenode in zip(ids_edge, edges.lengths[ids_edge], edges.ids_fromnode[ids_edge]): - print ' check in id_edge', id_edge, dist + \ - length, dist_tls_max, (dist+length < dist_tls_max), (length < self.dist_tls_internode_max) + print ' check in id_edge', id_edge, dist+length, dist_tls_max, (dist+length < dist_tls_max), (length < self.dist_tls_internode_max) if (dist+length < dist_tls_max) & (length < self.dist_tls_internode_max): if id_edgenode not in nodes_tls: self.init_tlsnode(id_edgenode, nodes_tls) @@ -1546,7 +1610,7 @@ # ids_edges_major.add(id_edge_next) if len(route) == 0: - return [] + return [], [] if not is_check_angle: angle_max = np.inf @@ -1580,7 +1644,7 @@ edges.speeds_max[ids_edge], ): - # determine direction vector of start of current edge shape + # determine direction vector of start of current edge shape p02 = shape_curr[0][:2] p12 = shape_curr[1][:2] dir2 = p12-p02 @@ -1588,15 +1652,14 @@ # determine angle change angle = get_diff_angle_clockwise(dir1, dir2) angle_abs = min(angle, 2*np.pi-angle) - print ' id_edge:%d, angle_abs:%.1f, angle_max: %.1f' % ( - id_edge, angle_abs/np.pi*180, angle_max/np.pi*180), id_fromnode in nodes_tls, (angle_abs < angle_max) + print ' id_edge:%d, angle_abs:%.1f, angle_max: %.1f' % (id_edge, angle_abs/np.pi*180, angle_max/np.pi*180), id_fromnode in nodes_tls, (angle_abs < angle_max) if id_fromnode in nodes_tls: - # route is still in TLS + # route is still in TLS p01 = shape_curr[-2][:2] p11 = shape_curr[-1][:2] dir1 = p11-p01 if (angle_abs < angle_max): - # route is straigt enough + # route is straigt enough ind_route += 1 # determine direction vector of end of current edge shape @@ -1606,7 +1669,7 @@ # route is not straight and will be split. # put old route in list and start a new route if len(newroute) >= n_edges_min: - # route should contain at least n_edges_min edges + # route should contain at least n_edges_min edges newroutes.append(newroute) routecosts.append(self.get_routecost(newroute)) @@ -1886,21 +1949,29 @@ info='Operate only on edges up to this number of lanes. Note that footpath is also a lane.', )) - self.id_mode_bike = MODES["bicycle"] - self.id_mode_ped = MODES["pedestrian"] - #self.id_mode_ped = MODES["delivery"] + net = self.parent + modes = net.modes + self.id_mode_bike = modes.get_id_mode("bicycle") + self.id_mode_ped = modes.get_id_mode("pedestrian") + #self.id_mode_ped = modes.get_id_mode("delivery") - self.ids_modes_tocomplete = set([MODES["pedestrian"], MODES["delivery"], MODES["bus"]]) + self.ids_modes_tocomplete = set( + [modes.get_id_mode("pedestrian"), modes.get_id_mode("delivery"), modes.get_id_mode("bus")]) def do(self): print 'BikenetworkCompleter.do' edges = self.parent.edges nodes = self.parent.nodes lanes = self.parent.lanes + modes = self.parent.modes connections = self.parent.connections + roundabouts = self.parent.roundabouts ids_edge = edges.get_ids() allow_cycloped = [self.id_mode_bike, self.id_mode_ped] ids_edge_update = [] + nodeset_roundabouts = set([]) + for ids_node in roundabouts.ids_nodes[roundabouts.get_ids()]: + nodeset_roundabouts.update(ids_node) for id_edge, id_sumo, type_spread, shape, \ n_lanes, ids_lane, priority, id_fromnode, id_tonode\ @@ -1915,7 +1986,9 @@ edges.ids_tonode[ids_edge], ): - if (n_lanes <= self.n_lanes_max) & (priority <= self.priority_max): + if (n_lanes <= self.n_lanes_max) & (priority <= self.priority_max)\ + & (id_fromnode not in nodeset_roundabouts)\ + & (id_tonode not in nodeset_roundabouts): # a footpath ha been made accessible for bikes # check if footpath is a on-way ids_incoming = nodes.ids_incoming[id_fromnode] @@ -1942,7 +2015,7 @@ ids_edge_update.append(id_edge) if is_oneway: # slow: edges.is_oneway(id_edge): - # print ' add opposite edge with same properties ids_modes_allow',ids_modes_allow + # print ' add opposite edge with same properties ids_modes_allow',ids_modes_allow edges.types_spread[id_edge] = 0 # right spread #edges.widths[id_edge] = 0.5*lanewidths lanes.widths[id_lane] = 0.5*lanewidths @@ -1966,6 +2039,7 @@ width=0.5*lanewidths, speed_max=self.speed_max_bike, ids_modes_allow=ids_modes_allow) +# id_mode = modes.get_id_mode("army")) edges.ids_lanes[id_edge_opp] = [id_lane_opp] ids_edge_update.append(id_edge_opp) @@ -2000,6 +2074,7 @@ width=self.width_bikelane_opp, speed_max=self.speed_max_bike_opp, ids_modes_allow=allow_cycloped, + id_mode=modes.get_id_mode("passenger") ) edges.ids_lanes[id_edge_opp] = [id_lane_opp] @@ -2043,6 +2118,7 @@ width=self.width_bikelane_opp, speed_max=self.speed_max_bike_opp, ids_modes_allow=allow_cycloped, + id_mode=modes.get_id_mode("passenger") ) edges.ids_lanes[id_edge_opp] = [id_lane_opp] diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/network/networkxtools.py sumo-1.12.0/tools/contributed/sumopy/coremodules/network/networkxtools.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/network/networkxtools.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/network/networkxtools.py 2022-01-24 20:43:50.000000000 +0000 @@ -0,0 +1,3726 @@ +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. +# SUMOPy module +# Copyright (C) 2012-2021 University of Bologna - DICAM +# 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 networkxtools.py +# @author Joerg Schweizer +# @date 2012 + +from coremodules.network.network import MODES, ID_MODE_PED, ID_MODE_BIKE, ID_MODE_CAR +from coremodules.network.netconvert import * +from agilepy.lib_base.geometry import get_length_polypoints, get_dist_point_to_segs, get_diff_angle_clockwise +import pickle +import os +import json +from coremodules.misc.shapeformat import guess_utm_from_coord +from agilepy.lib_base.misc import filepathstring_to_filepathlist, filepathlist_to_filepathstring +from agilepy.lib_base.processes import Process +import agilepy.lib_base.xmlman as xm +import agilepy.lib_base.arrayman as am +import agilepy.lib_base.classman as cm +import numpy as np +from collections import OrderedDict +from copy import deepcopy +import sys +reload(sys) +sys.setdefaultencoding('utf8') + +try: + import networkx as nx + IS_NX = True +except: + IS_NX = False + + +try: + import pyproj +except: + from mpl_toolkits.basemap import pyproj + + +LANEATTRS_DEFAULT = {'is_rightside': False, 'is_leftside': False, 'n_lane': 0, + 'ids_modes_disallow': [], 'ids_modes_allow': [], + 'is_sidewalk': False, + } + +LANEATTRS = ('lane', 'track') + +YES_OR_DESIGNATED = ('yes', 'designated') + + +def load_objfile(filepath): + f = open(filepath, 'rb') + try: + f = open(filepath, 'rb') + except: + print 'WARNING in load_obj: could not open', filepath + return None + + # try: + # print ' pickle.load...' + obj = pickle.load(f) + f.close() + return obj + + +def print_attrs(attrs): + for key, val in attrs.iteritems(): + print ' %s=\t%s' % (key, val) + print + + +def get_loop(digraph, ids_node, ids_nodepairs=[], n_node_max=4): + print 'get_loop ids_node', ids_node + if (ids_node[-1] == ids_node[0]): + print ' success.' + return ids_nodepairs + elif (len(ids_node) == n_node_max): + print ' no loop reached.' + return [] + else: + id_node = ids_node[-1] + node = digraph.node[id_node] + node_to_dirind = node['node_to_dirind'] + id_nbnode = ids_node[-2] + # print ' node_to_dirind.keys()',node_to_dirind.keys(),node_to_dirind.has_key(id_nbnode) + + if node_to_dirind.has_key(id_nbnode): + ind = node['node_to_dirind'][id_nbnode] + else: + ind = node['node_to_dirind'][-id_nbnode] + + if ind+1 == len(node['node_to_dirind']): + ind = 0 + else: + ind += 1 + + id_nbnode_new = node['dirind_to_node'][ind] + if id_nbnode == id_nbnode_new: + print ' simple bidir return link' + return [] + + elif abs(id_nbnode_new) in ids_node[1:]: + print ' complex bidir return link' + return [] + + if id_nbnode_new < 0: + # print ' append',-id_nbnode_new + # entering neighbour + ids_node.append(-id_nbnode_new) + ids_nodepairs.append((-id_nbnode_new, id_node)) + else: + # exiting neighbour + # print ' append',id_nbnode_new + ids_node.append(id_nbnode_new) + ids_nodepairs.append((id_node, id_nbnode_new)) + + return get_loop(digraph, ids_node, ids_nodepairs, n_node_max) + + +class Road: + def __init__(self, element, parent): + # edges_osm[id_way]= {}#{'nodes':(element['nodes'][0],element['nodes'][1])}# not needed {'nodes': element['nodes']} + + self.parent = parent + + self._osmattrs = element.get('tags', {}) + self.ids_osmnode = element.get('nodes', []) + self.highway = self._osmattrs.get('highway', 'road') + # if element.has_key('tags'): + # self._attrs.update(element['tags']) + + # is_one is a scpecial one way detection + #self._is_oneway = self.is_oneway_osm() + # self.is_oneway_osm() + + #self._id_osm = id_osm + #osmattrs = self._osmattrs + # if not self._is_oneway: + # self._id_osm_opp = -id_osm + # else: + # self._id_osm_opp = -1 + + self._lanes = [] + self._lanes_opp = [] + self.make_oneway() + self.config() + self.make_lanestructure() + self.make_sumoattrs() + self.make_road() + # get from parent + # self._width_bikelane = 1.5 #m + # self.parent.width_sidewalk = 1.0 #m + #self._modes_reserved_lane = ['bus', 'taxi','emergency'] + + def config(self): + """ + Make defaults to be overridden + """ + print 'config' + # pass here either road type specific defaults + # or global defaults from parent process + + self.n_lane = self.parent.n_lane + self.id_mode = ID_MODE_CAR + self.lanewidth = self.parent.lanewidth + self.lanewidth_bike = self.parent.lanewidth_bike + self.lanewidth_bus = self.parent.lanewidth_bus + self.width_sidewalk = self.parent.width_sidewalk + #self.width_footpath = self.parent.width_footpath + + self.ids_modes_pt_shared = self.parent.ids_modes_pt_shared + self.ids_modes_bike = self.parent.ids_modes_bike + self.ids_modes_moped = self.parent.ids_modes_moped + self.ids_modes_allow = [] + self.ids_modes_disallow = [] + + self.make_speed(self.parent.speed_max) + self.speed_max_bus = self.parent.speed_max_bus + self.speed_max_bike = self.parent.speed_max_bike + self.speed_max_ped = self.parent.speed_max_ped + + def make_laneattrs_main(self): + self._laneattrs_main = {'speed_max': self.speed_max, + 'width': self.lanewidth, + 'ids_modes_allow': self.ids_modes_allow, + 'ids_modes_disallow': self.ids_modes_disallow, + # 'ids_mode': MODES["passenger"], + 'is_rightside': True, + 'is_leftside': False, + 'width_rightside': self.lanewidth, + 'is_sidewalk': False, + } + + def make_laneattrs_main_accessrestrict(self): + """Adds access restrictions to main lanes attributes + if specified in OSM attributes. + + Often residential roads have mode restrictions + on main lane. + """ + osmattrs = self._osmattrs + # give access to particular vehicle on main lane(s) + if osmattrs.get('bicycle', 'no') in YES_OR_DESIGNATED: + # if segregated, a separate bikeway will be created + # in make_bikewayattrs + if not osmattrs.get('segregated', '') == 'yes': + # add bikeaccess + ids_modes_allow = self._laneattrs_main['ids_modes_allow'] + + ids_allowed_set = deepcopy(self.ids_modes_bike) + for id_mode in ids_modes_allow: + if id_mode not in ids_allowed_set: + ids_allowed_set.append(id_mode) + + self._laneattrs_main['ids_modes_allow'] = ids_allowed_set + self._laneattrs_main['ids_modes_disallow'] = [] + + if osmattrs.get('psv', 'no') in YES_OR_DESIGNATED: + # add public transport access + ids_modes_allow = self._laneattrs_main['ids_modes_allow'] + ids_allowed_set = deepcopy(self.ids_modes_pt_shared) + for id_mode in ids_modes_allow: + if id_mode not in ids_allowed_set: + ids_allowed_set.append(id_mode) + + self._laneattrs_main['ids_modes_allow'] = ids_allowed_set + self._laneattrs_main['ids_modes_disallow'] = [] + + if osmattrs.get('moped', 'no') in YES_OR_DESIGNATED: + # add public transport access + ids_modes_allow = self._laneattrs_main['ids_modes_allow'] + ids_allowed_set = deepcopy(self.ids_modes_moped) + for id_mode in ids_modes_allow: + if id_mode not in ids_allowed_set: + ids_allowed_set.append(id_mode) + + self._laneattrs_main['ids_modes_allow'] = ids_allowed_set + self._laneattrs_main['ids_modes_disallow'] = [] + + def get_osmattr(self, key, is_int=False, is_float=False, default=None): + valstr = self._osmattrs.get(key, '') + if valstr.find(',') > -1: + v = valstr.split(',')[0] + elif valstr.find(';') > -1: + v = valstr.split(';')[0] + else: + v = valstr + if is_int: + try: + return int(v) + except: + return default + if is_float: + try: + return float(v) + except: + return default + + else: + return v + + def make_sumoattrs(self): + + osmattrs = self._osmattrs + print 'make_sumoattrs' + print_attrs(osmattrs) + #self._highway = osmattrs.get('highway','road') + + self.make_laneattrs_main() + self.make_sidewalkattrs() + self.make_buswayattrs() + self.make_bikewayattrs() + + def make_lanestructure(self): + osmattrs = self._osmattrs + + # use the one way declarations by osm + # for interpreting the correct number of lanes + is_oneway_osm = (osmattrs.get('oneway', 'no') == 'yes') | (osmattrs.get('junction', '') == 'roundabout') + + n_lane_forward_osm = -1 + n_lane_backward_osm = -1 + is_lanes_forward_rigid = False + is_lanes_backward_rigid = False + if osmattrs.has_key('lanes'): + # print ' total number of lanes provided n_lane_osm_str',osmattrs['lanes'] + n_lane_osm_str = osmattrs['lanes'] + # if type(n_lane_osm_str) in cm.STRINGTYPES: + if n_lane_osm_str.count(';') > 0: + n_lane_osm = 1 + for n_lane_osm_elem in n_lane_osm_str.split(';'): + if int(n_lane_osm_elem) > n_lane_osm: + n_lane_osm = int(n_lane_osm_elem) + elif n_lane_osm_str.count(',') > 0: + n_lane_osm = 1 + for n_lane_osm_elem in n_lane_osm_str.split(','): + if int(n_lane_osm_elem) > n_lane_osm: + n_lane_osm = int(n_lane_osm_elem) + else: + n_lane_osm = int(osmattrs['lanes']) + + if is_oneway_osm: + # in cas of oneway + n_lane_backward_osm = 0 + n_lane_forward_osm = n_lane_osm + is_lanes_forward_rigid = True + + else: + # in case of bidir + if osmattrs.has_key('lanes:forward'): + n_lane_forward_osm = int(osmattrs['lanes:forward']) + is_lanes_forward_rigid = True + if osmattrs.has_key('lanes:backward'): + n_lane_backward_osm = int(osmattrs['lanes:backward']) + is_lanes_backward_rigid = True + else: + n_lane_backward_osm = n_lane_osm-n_lane_forward_osm + # correct if necessary + if n_lane_backward_osm <= 0: + n_lane_backward_osm = 1 + n_lane_osm = n_lane_forward_osm+n_lane_backward_osm + + elif osmattrs.has_key('lanes:backward'): + n_lane_backward_osm = int(osmattrs['lanes:backward']) + n_lane_forward_osm = n_lane_osm-n_lane_backward_osm + is_lanes_backward_rigid = True + + # correct if necessary + if n_lane_forward_osm <= 0: + n_lane_forward_osm = 1 + n_lane_osm = n_lane_forward_osm+n_lane_backward_osm + + else: + # symmetric dist + if n_lane_osm < 2: + n_lane_osm = 2 + + n_lane_forward_osm = int(0.5*n_lane_osm+0.5) + n_lane_backward_osm = n_lane_forward_osm + else: + # no information on total of lanes + if is_oneway_osm: + # in cas of (declared) oneway + n_lane_backward_osm = 0 + if osmattrs.has_key('lanes:forward'): + n_lane_forward_osm = int(osmattrs['lanes:forward']) + is_lanes_forward_rigid = True + else: + n_lane_forward_osm = self.n_lane # default + else: + # bidir + if osmattrs.has_key('lanes:forward'): + n_lane_forward_osm = int(osmattrs['lanes:forward']) + is_lanes_forward_rigid = True + if osmattrs.has_key('lanes:backward'): + n_lane_backward_osm = int(osmattrs['lanes:backward']) + is_lanes_backward_rigid = True + else: + n_lane_backward_osm = self.n_lane # default + + elif osmattrs.has_key('lanes:backward'): + n_lane_backward_osm = int(osmattrs['lanes:backward']) + is_lanes_backward_rigid = True + n_lane_forward_osm = self.n_lane # default + + else: + # no lane information + n_lane_forward_osm = self.n_lane # default + n_lane_backward_osm = self.n_lane # default + + n_lane_osm = n_lane_forward_osm+n_lane_backward_osm + + self._is_lanes_backward_rigid = is_lanes_backward_rigid + self._is_lanes_forward_rigid = is_lanes_forward_rigid + + self._n_lane_forward_osm = n_lane_forward_osm + self._n_lane_backward_osm = n_lane_backward_osm + self._n_lane_osm = n_lane_osm + print ' lane numbers: n_lane_forward_osm=%d, n_lane_backward_osm=%d n_default=%d' % (n_lane_forward_osm, n_lane_backward_osm, self.n_lane), 'rigid fb', is_lanes_forward_rigid, is_lanes_backward_rigid + + def _get_access(self, access_str): + access_data = np.array(access_str.split('|'), dtype=np.object)[::-1] + return access_data == 'designated', access_data == 'no' + + def get_laneaccess(self, vname, is_opp=False): + if is_opp: + if self._is_lanes_backward_rigid: + osmattrs = self._osmattrs + access_str = osmattrs.get(vname+':lanes', '') + if access_str != '': + allowed, disallowed = self._get_access(access_str) + return allowed[:self._n_lane_backward_osm], disallowed[:self._n_lane_backward_osm] + + else: + access_str = osmattrs.get(vname+':lanes:backward', '') + if access_str != '': + allowed, disallowed = self._get_access(access_str) + return allowed, disallowed + + else: + return [], [] + + else: + return [], [] + + else: + if self._is_lanes_forward_rigid: + osmattrs = self._osmattrs + access_str = osmattrs.get(vname+':lanes', '') + if access_str != '': + allowed, disallowed = self._get_access(access_str) + return allowed[self._n_lane_backward_osm:], disallowed[self._n_lane_backward_osm:] + + else: + access_str = osmattrs.get(vname+':lanes:forward', '') + if access_str != '': + allowed, disallowed = self._get_access(access_str) + return allowed, disallowed + + else: + return [], [] + + else: + return [], [] + + def get_lanes(self, is_opp=False): + if is_opp: + return self._lanes + else: + return self._lanes_opp + + def make_road(self): + """ + Makes road lanes in both directions + """ + + #lanes = [] + #lanes_opp = [] + print ' realoneway', self.is_oneway() + + #self._lanes = [] + #self._lanes_opp = [] + + print ' Main Dir ^^^^^^^^^^^', self._is_lanes_forward_rigid, self._is_lanes_backward_rigid + if self._is_lanes_forward_rigid: + self.make_lanes_rigid(is_opp=False, n_lane_osm=self._n_lane_forward_osm) + else: + self.make_lanes(is_opp=False, n_lane_osm=self._n_lane_forward_osm) + + if not self.is_oneway(): + + print ' Opp Dir vvvvvvvvvvv' + if self._is_lanes_backward_rigid: + self.make_lanes_rigid(is_opp=True, n_lane_osm=self._n_lane_backward_osm) + else: + self.make_lanes(is_opp=True, n_lane_osm=self._n_lane_backward_osm) + + print ' id', id(self) + print ' len(self._lanes)', len(self._lanes) + print ' len(self._lanes_opp)', len(self._lanes_opp) + + def _get_speedinfo(self, speed_max_str): + speed_max_data = speed_max_str.split(' ') + if len(speed_max_data) == 1: + #speed_max_data = speed_max_data[0].split(';') + # TODO: here we could do a per lane assignment + return float(speed_max_data[0])/3.6 + else: + + # todo + # maxspeed=60 + # maxspeed=50 mph + # maxspeed=10 knots + unit = speed_max_data[1] + if unit == 'mph': + return float(speed_max_data[0])/3.6*1.609344 + + elif unit == 'knots': + return float(speed_max_data[0])/3.6*1.852 + + def make_speed(self, speed_max_default): + # estimate speed max in m/s + if self._osmattrs.has_key('maxspeed'): + speed_max_str = self._osmattrs['maxspeed'] + # print 'make_speed speed_max_str',speed_max_str + if speed_max_str.count(';') > 0: + speed_max = np.inf + for v_str in speed_max_str.split(';'): + v = self._get_speedinfo(v_str) + if v < speed_max: + speed_max = v + + else: + if speed_max_str.isdigit(): + speed_max = self._get_speedinfo(speed_max_str) + else: + speed_max = speed_max_default + else: + speed_max = speed_max_default + + self.speed_max = speed_max + + def _is_opposite(self, osmattrs, tag): + if osmattrs.has_key(tag): + elems = osmattrs[tag].split('_') + return elems[0] == 'opposite' + else: + return False + + def is_oneway(self): + return self._is_oneway + + def make_oneway(self): + # print 'make_oneway' + osmattrs = self._osmattrs + + if osmattrs.get('junction', '') == 'roundabout': + self._is_oneway = True + + elif osmattrs.has_key('oneway'): + if osmattrs['oneway'] == 'no': + self._is_oneway = False + + else: + if self._is_opposite(osmattrs, 'busway'): + self._is_oneway = False + + elif self._is_opposite(osmattrs, 'busway:right'): + self._is_oneway = False + + elif osmattrs.has_key('lanes:bus:backward'): + self._is_oneway = False + + elif osmattrs.has_key('trolley_wire:both'): + self._is_oneway = False + + elif osmattrs.has_key('lanes:psv:backward'): + self._is_oneway = False + + elif self._is_opposite(osmattrs, 'cycleway'): + self._is_oneway = False + + elif self._is_opposite(osmattrs, 'busway'): + self._is_oneway = False + + elif osmattrs.get('cycleway', '') == 'both': + self._is_oneway = False + + # elif osmattrs.get('busway','') == 'both': + # self._is_oneway = False + + # sidewalks on both sides go in the same direction + # elif osmattrs.get('sidewalk','') == 'both': + # self._is_oneway = False + + elif osmattrs.has_key('oneway:bicycle'): + if osmattrs['oneway:bicycle'] == 'no': + self._is_oneway = False + + else: + self._is_oneway = True + + else: + self._is_oneway = True + + else: + self._is_oneway = False + + # def remove_sidewalk(self, is_opp = True): + # """ + # Not in use! + # """ + # if is_opp: + # ind = 0 + # else: + # ind = 1 + # print 'remove_sidewalk',is_opp,self._sidewalkattrs[ind]['n_lane'],self._sidewalkattrs[ind]['n_lane']==0 + # if self._sidewalkattrs[ind]['n_lane']>0: + # self._sidewalkattrs[ind]['n_lane']=0 + # self.make_road() + + def has_sidewalks(self, is_opp=True): + if is_opp: + ind = 0 + else: + ind = 1 + return self._sidewalkattrs[ind]['n_lane'] > 0 + + def add_sidewalk(self, road, is_opp=False): + """ + Method to explicitely add sidewalks with the given road attributes + """ + osmattrs = self._osmattrs + + if is_opp: + ind = 0 + else: + ind = 1 + + print 'add_sidewalk', is_opp, self._sidewalkattrs[ind]['n_lane'], self._sidewalkattrs[ind]['n_lane'] == 0 + if self._sidewalkattrs[ind]['n_lane'] == 0: + self.make_sidewalk(is_opp=is_opp, is_rightside=True, width=road.lanewidth) + self.make_road() + + # if self._is_oneway: + # # generate sidewalks in both directions + # ind = 1 + # if self._sidewalkattrs[ind]['n_lane'] == 1: + # self.make_sidewalk(is_opp = False, is_rightside = False, width = road.lanewidth) + + def make_sidewalk(self, is_opp=False, is_rightside=True, + ids_modes_allow=[], width=1.0, n_lane=1): + + if is_opp: + ind = 0 + else: + ind = 1 + # !!!!foot=use_sidepath may be applied on the street + # to mark that sidewalks are mapped separately. + # Also, sidewalk=separate + + print 'make_sidewalk', ind, is_rightside + # needed to merge access? + self._sidewalkattrs[ind]['is_share'] = len(ids_modes_allow) > 0 + + ids_allowed_set = [ID_MODE_PED] + for id_mode in ids_modes_allow: + if id_mode not in ids_allowed_set: + ids_allowed_set.append(id_mode) + + self._sidewalkattrs[ind]['is_sidewalk'] = True + self._sidewalkattrs[ind]['ids_modes_allow'] = list(ids_allowed_set) + self._sidewalkattrs[ind]['ids_modes_disallow'] = [] + if is_rightside: + self._sidewalkattrs[ind]['is_rightside'] = True + self._sidewalkattrs[ind]['width_rightside'] = width + self._sidewalkattrs[ind]['n_lane'] += n_lane + # self._sidewalkattrs[ind]['is_leftside'] = False # no!? + else: + self._sidewalkattrs[ind]['is_leftside'] = True + self._sidewalkattrs[ind]['width_leftside'] = width + self._sidewalkattrs[ind]['n_lane'] += n_lane + # self._sidewalkattrs[ind]['is_rightside'] = False # no!? + + self._sidewalkattrs[ind]['speed_max'] = self.speed_max_ped + # print ' sidewalkattr=',self._sidewalkattrs[ind] + print_attrs(self._sidewalkattrs[ind]) + + def make_sidewalkattrs(self): + print 'make_sidewalkattrs' + + if self.get_priority() < 7: + return self.make_sidewalkattrs_smallroads() + else: + return self.make_sidewalkattrs_largeroads() + + def make_sidewalkattrs_largeroads(self): + print 'make_sidewalkattrs_largeroads' + + osmattrs = self._osmattrs + self._sidewalkattrs = (deepcopy(LANEATTRS_DEFAULT), + deepcopy(LANEATTRS_DEFAULT)) + + self._sidewalkattrs[0]['is_sidewalk'] = True + self._sidewalkattrs[1]['is_sidewalk'] = True + sidewalk = osmattrs.get('sidewalk', 'auto') + + if sidewalk not in ['no', 'none', 'auto']: + # there is a sidewalk, make sure there is at least one + + if osmattrs.has_key('sidewalk:width'): + width_left = float(osmattrs['sidewalk:width']) + width_right = width_left + + elif osmattrs.has_key('sidewalk:both:width'): + width_left = float(osmattrs['sidewalk:both:width']) + width_right = width_left + else: + width_left = float(osmattrs.get('sidewalk:left:width', self.width_sidewalk)) + width_right = float(osmattrs.get('sidewalk:right:width', self.width_sidewalk)) + + if osmattrs.get('oneway', 'no') == 'no': + # bidirecional + + if sidewalk == 'both': + self.make_sidewalk(is_opp=False, is_rightside=True, width=width_right) + self.make_sidewalk(is_opp=True, is_rightside=True, width=width_left) + + elif sidewalk == 'left': + self.make_sidewalk(is_opp=True, is_rightside=True, width=width_left) + + elif sidewalk == 'right': + self.make_sidewalk(is_opp=False, is_rightside=True, width=width_right) + + # elif osmattrs.get('junction','') == 'roundabout': + # self.make_sidewalk(is_opp = False, is_rightside = True, width = width_right) + + else: + # no indication means both + self.make_sidewalk(is_opp=False, is_rightside=True, width=width_right) + self.make_sidewalk(is_opp=True, is_rightside=True, width=width_left) + + else: + # oneway + if sidewalk == 'both': + # both sidewalks go in the same direction + self.make_sidewalk(is_opp=False, is_rightside=True, width=width_right) + self.make_sidewalk(is_opp=False, is_rightside=False, width=width_left) + + elif sidewalk == 'left': + self.make_sidewalk(is_opp=False, is_rightside=False, width=width_left) + + elif sidewalk == 'right': + self.make_sidewalk(is_opp=False, is_rightside=True, width=width_right) + + # no indication, no sidewalks + # else: + # # no indication means both + # self.make_sidewalk(is_opp = False, is_rightside = True, width = width_right) + # self.make_sidewalk(is_opp = False, is_rightside = False, width = width_left) + + else: + # sidewalk = 'auto' + # no indication, no sidewalks + pass + + # if no siedewalk width_sidewalk = -1 + #self.width_sidewalk = max(widths) + # print ' sidewalkattr='#,self._sidewalkattrs + # for attrs in self._sidewalkattrs: + # if attrs['n_lane']>0: + # print_attrs(attrs) + + def make_sidewalkattrs_smallroads(self): + print 'make_sidewalkattrs_smallroads' + osmattrs = self._osmattrs + self._sidewalkattrs = (deepcopy(LANEATTRS_DEFAULT), + deepcopy(LANEATTRS_DEFAULT)) + + self._sidewalkattrs[0]['is_sidewalk'] = True + self._sidewalkattrs[1]['is_sidewalk'] = True + sidewalk = osmattrs.get('sidewalk', 'auto') + + if sidewalk not in ['no', 'none', 'auto']: + # there is a sidewalk, make sure there is at least one + + if osmattrs.has_key('sidewalk:width'): + width_left = float(osmattrs['sidewalk:width']) + width_right = width_left + + elif osmattrs.has_key('sidewalk:both:width'): + width_left = float(osmattrs['sidewalk:both:width']) + width_right = width_left + else: + width_left = float(osmattrs.get('sidewalk:left:width', self.width_sidewalk)) + width_right = float(osmattrs.get('sidewalk:right:width', self.width_sidewalk)) + + if osmattrs.get('oneway', 'no') == 'no': + # bidirecional + + if sidewalk == 'both': + self.make_sidewalk(is_opp=False, is_rightside=True, width=width_right) + self.make_sidewalk(is_opp=True, is_rightside=True, width=width_left) + + elif sidewalk == 'left': + self.make_sidewalk(is_opp=True, is_rightside=True, width=width_left) + + elif sidewalk == 'right': + self.make_sidewalk(is_opp=False, is_rightside=True, width=width_right) + + else: + # no indication means both + self.make_sidewalk(is_opp=False, is_rightside=True, width=width_right) + self.make_sidewalk(is_opp=True, is_rightside=True, width=width_left) + + else: + # oneway + if sidewalk == 'both': + self.make_sidewalk(is_opp=False, is_rightside=True, width=width_right) + self.make_sidewalk(is_opp=False, is_rightside=False, width=width_left) + + elif sidewalk == 'left': + self.make_sidewalk(is_opp=False, is_rightside=False, width=width_left) + + elif sidewalk == 'right': + self.make_sidewalk(is_opp=False, is_rightside=True, width=width_right) + + elif osmattrs.get('junction', '') == 'roundabout': + self.make_sidewalk(is_opp=False, is_rightside=True, width=width_right) + + else: + # no indication means both + self.make_sidewalk(is_opp=False, is_rightside=True, width=width_right) + self.make_sidewalk(is_opp=False, is_rightside=False, width=width_left) + + elif sidewalk == 'auto': + # automatic sidewalk generation for residential roads + if self.is_oneway(): + + if osmattrs.get('junction', '') == 'roundabout': + print ' put a sidewalk around roundabouts, not inside' + self.make_sidewalk(is_opp=False, is_rightside=True, width=self.width_sidewalk) + else: + print ' put a sidewalk on both sides of the oneway' + self.make_sidewalk(is_opp=False, is_rightside=True, width=self.width_sidewalk) + self.make_sidewalk(is_opp=False, is_rightside=False, width=self.width_sidewalk) + else: + print ' put a sidewalk on both sides of the road' + self.make_sidewalk(is_opp=False, is_rightside=True, width=self.width_sidewalk) + self.make_sidewalk(is_opp=True, is_rightside=True, width=self.width_sidewalk) + + def make_bikelane(self, is_opp=False, is_rightside=True, + ids_modes_allow=[], width=1.5, n_lane=1): + print 'make_bikelane', is_opp, is_rightside, ids_modes_allow + if is_opp: + ind = 0 + else: + ind = 1 + + # needed to merge access? + self._bikewayattrs[ind]['is_share'] = len(ids_modes_allow) > 0 + + ids_allowed_set = deepcopy(self.ids_modes_bike) + for id_mode in ids_modes_allow: + if id_mode not in ids_allowed_set: + ids_allowed_set.append(id_mode) + + self._bikewayattrs[ind]['ids_modes_allow'] = list(ids_allowed_set) + self._bikewayattrs[ind]['ids_modes_disallow'] = [] + if is_rightside: + self._bikewayattrs[ind]['is_rightside'] = True + self._bikewayattrs[ind]['width_rightside'] = width + self._bikewayattrs[ind]['n_lane'] += n_lane + else: + self._bikewayattrs[ind]['is_leftside'] = True + self._bikewayattrs[ind]['width_leftside'] = width + self._bikewayattrs[ind]['n_lane'] += n_lane + + self._bikewayattrs[ind]['speed_max'] = self.speed_max_bike + + print_attrs(self._bikewayattrs[ind]) + + def make_bikewayattrs(self): + """ Returns a tuple with attribute dictionaries for bikeways + on left and right side of the road. + Dictionary with the following keys: + widths: is a tuple with sidewalk widths of left and right sidewalk. + if values are less than 0 means no sidewalk. + """ + print 'make_bikewayattrs' + self._bikewayattrs = (deepcopy(LANEATTRS_DEFAULT), + deepcopy(LANEATTRS_DEFAULT)) + + osmattrs = self._osmattrs + cycleway = osmattrs.get('cycleway', '') + cycleway_left = osmattrs.get('cycleway:left', '') + cycleway_right = osmattrs.get('cycleway:right', '') + + if osmattrs.has_key('cycleway:width'): + width_left = float(osmattrs['cycleway:width']) + width_right = width_left + + elif osmattrs.has_key('cycleway:both:width'): + width_left = float(osmattrs['cycleway:both:width']) + width_right = width_left + + else: + width_left = float(osmattrs.get('cycleway:left:width', self.lanewidth_bike)) + width_right = float(osmattrs.get('cycleway:right:width', self.lanewidth_bike)) + + if osmattrs.get('oneway', 'no') == 'no': + # cycle lanes on bidir road + + if cycleway in LANEATTRS: + self.make_bikelane(is_opp=False, width=width_right) + self.make_bikelane(is_opp=True, width=width_left) + return + + elif cycleway in OSMKEYS_SHARED: + self.make_bikelane(is_opp=False, ids_modes_allow=self.ids_modes_pt_shared, width=width_right) + self.make_bikelane(is_opp=True, ids_modes_allow=self.ids_modes_pt_shared, width=width_left) + return + + elif cycleway in OSMKEYS_SHARED_OPP: + self.make_bikelane(is_opp=False, width=width_right) + self.make_bikelane(is_opp=True, ids_modes_allow=self.ids_modes_pt_shared, width=width_left) + return + + cycleway = osmattrs.get('cycleway:both', '') + if cycleway in LANEATTRS: + self.make_bikelane(is_opp=False, width=width_right) + self.make_bikelane(is_opp=True, width=width_left) + return + + elif cycleway in OSMKEYS_SHARED: + self.make_bikelane(is_opp=False, ids_modes_allow=self.ids_modes_pt_shared, width=width_right) + self.make_bikelane(is_opp=True, ids_modes_allow=self.ids_modes_pt_shared, width=width_right) + return + + #cycleway = osmattrs.get('cycleway:left','') + if (cycleway_left != '') & (cycleway_right != ''): + # also both sides + if cycleway_left in LANEATTRS: + self.make_bikelane(is_opp=True, is_rightside=False, width=width_left) + elif cycleway_left in OSMKEYS_SHARED: + self.make_bikelane(is_opp=True, ids_modes_allow=self.ids_modes_pt_shared) + + if cycleway_right in LANEATTRS: + self.make_bikelane(is_opp=False, is_rightside=False, width=width_left) + elif cycleway_right in OSMKEYS_SHARED: + self.make_bikelane(is_opp=False, ids_modes_allow=self.ids_modes_pt_shared) + + # check left only + elif cycleway_left in LANEATTRS: + self.make_bikelane(is_opp=True, is_rightside=False, width=width_left) + return + + elif cycleway_left in OSMKEYS_SHARED: + self.make_bikelane(is_opp=True, ids_modes_allow=self.ids_modes_pt_shared) + # if osmattrs.get('bicycle','no') == 'yes': + # self.make_bikelane(is_opp = False, is_rightside = True,width = width_right) + + # check right only + elif cycleway_right in LANEATTRS: + self.make_bikelane(is_opp=False, is_rightside=True) + + elif cycleway_right == 'opposite_share_busway': + self.make_bikelane(is_opp=True, ids_modes_allow=self.ids_modes_pt_shared, width=width_left) + # if osmattrs.get('bicycle','no') == 'yes': + # self.make_bikelane(is_opp = False, is_rightside = True,width = width_right) + + # general bicycle tag if all from abive fails but share with pedestrians + # Moved to main lane attr except if segragated + elif (osmattrs.get('bicycle', 'no') in YES_OR_DESIGNATED) & (osmattrs.get('segregated', '') == 'yes'): + print ' check if there are cycle lanes already', self._bikewayattrs[0]['n_lane'] == 0, self._bikewayattrs[1]['n_lane'] == 0 + + if (self._bikewayattrs[0]['n_lane'] == 0) & (self._bikewayattrs[1]['n_lane'] == 0): + # no bikelanes in both dir + self.make_bikelane(is_opp=False, is_rightside=True, width=width_right) + self.make_bikelane(is_opp=True, is_rightside=True, width=width_left) + + else: + # cycle lanes on oneway road + + if cycleway in LANEATTRS: + + self.make_bikelane(is_opp=False) + + if osmattrs.get('oneway:bicycle', 'yes') in YES_OR_DESIGNATED: + self.make_bikelane(is_opp=True, width=width_left) + # else: + # self.make_bikelane(is_opp = False, width = width_right) + return + + elif cycleway == 'opposite': + self.make_bikelane(is_opp=True, is_rightside=True, width=width_left) + # if osmattrs.get('bicycle','no') == 'yes': + # self.make_bikelane(is_opp = False, is_rightside = True, width = width_right) + return + + elif cycleway == 'opposite_share_busway': + self.make_bikelane(is_opp=True, is_rightside=True, + ids_modes_allow=self.ids_modes_pt_shared, width=width_right) + # if osmattrs.get('bicycle','no') == 'yes': + # self.make_bikelane(is_opp = False, is_rightside = True,width = width_right) + return + + if cycleway == 'both': + # attention with this key a cycle lane in the opposite direction + # will be created as it makes no sense to have bikelanes + # in the smae direction on both sides + self.make_bikelane(is_opp=False, is_rightside=True, width=width_right) + self.make_bikelane(is_opp=True, is_rightside=True, width=width_left) + + elif cycleway_right in LANEATTRS: + self.make_bikelane(is_opp=False, width=width_right) + + elif cycleway_left in LANEATTRS: + self.make_bikelane(is_opp=False, is_rightside=False, width=width_right) + + elif cycleway_left == 'opposite_lane': + self.make_bikelane(is_opp=True, is_rightside=True, width=width_left) + # if osmattrs.get('bicycle','no') == 'yes': + # self.make_bikelane(is_opp = False, is_rightside = True,width = width_right) + + elif osmattrs.get('oneway:bicycle', '') == 'no': + self.make_bikelane(is_opp=True, is_rightside=False, width=width_right) + # if (osmattrs.get('bicycle','no') == 'yes'): + # # check if there are cycle lanes already + # if (self._bikewayattrs[1]['n_lane'] == 0): + # self.make_bikelane(is_opp = False, is_rightside = True, width = width_right) + + # Moved to main lane attr except segregated + elif (osmattrs.get('bicycle', 'no') in YES_OR_DESIGNATED) & (osmattrs.get('segregated', '') == 'yes'): + + print ' check if there are cycle lanes already', self._bikewayattrs[1]['n_lane'] == 0 + if (self._bikewayattrs[1]['n_lane'] == 0): + self.make_bikelane(is_opp=False, is_rightside=True, width=width_left) + + # print ' bikewayattrs='#,self._bikewayattrs + # for attrs in self._bikewayattrs: + # if attrs['n_lane']>0: + # print_attrs(attrs) + + def make_buslane(self, is_opp=False, is_rightside=True, + ids_modes_allow=[], width=3.5, n_lane=1): + print 'make_buslane', is_opp, is_rightside, width + if is_opp: + ind = 0 + else: + ind = 1 + + #self._buswayattrs[ind]['is_share'] = len(ids_modes_allow)>0 + + ids_allowed_set = deepcopy(self.ids_modes_pt_shared) + for id_mode in ids_modes_allow: + if id_mode not in ids_allowed_set: + ids_allowed_set.append(id_mode) + + self._buswayattrs[ind]['ids_modes_allow'] = list(ids_allowed_set) + self._buswayattrs[ind]['ids_modes_disallow'] = [] + + if is_rightside: + self._buswayattrs[ind]['is_rightside'] = True + self._buswayattrs[ind]['width_rightside'] = width + self._buswayattrs[ind]['n_lane'] += n_lane + else: + self._buswayattrs[ind]['is_leftside'] = True + self._buswayattrs[ind]['width_leftside'] = width + self._buswayattrs[ind]['n_lane'] += n_lane + # print ' buswayattr',self._buswayattrs[ind] + self._buswayattrs[ind]['speed_max'] = self.speed_max_bus + print_attrs(self._buswayattrs[ind]) + + def _get_psv_from_str(self, psv_str): + if psv_str.isdigit(): + return int(psv_str) + else: + if psv_str == 'yes': + return 1 + else: + return 0 + + def make_buswayattrs(self): + print 'make_buswayattrs' + self._buswayattrs = (deepcopy(LANEATTRS_DEFAULT), + deepcopy(LANEATTRS_DEFAULT)) + + osmattrs = self._osmattrs + + if osmattrs.has_key('busway:width'): + width_left = float(osmattrs['busway:width']) + width_right = width_left + + elif osmattrs.has_key('busway:both:width'): + width_left = float(osmattrs['busway:both:width']) + width_right = width_left + else: + width_left = float(osmattrs.get('busway:left:width', self.lanewidth_bus)) + width_right = float(osmattrs.get('busway:right:width', self.lanewidth_bus)) + + busway = osmattrs.get('busway', '') + + if busway is not "": + # busway scheme + if osmattrs.get('oneway', 'no') == 'no': + # bidir + print ' buslane bidir', busway + if busway == 'lane': + self.make_buslane(is_opp=False) + self.make_buslane(is_opp=True) + return + + elif busway in OSMKEYS_SHARED: + self.make_buslane(is_opp=False, ids_modes_allow=self.ids_modes_pt_shared, width=width_right) + self.make_buslane(is_opp=True, ids_modes_allow=self.ids_modes_pt_shared, width=width_left) + return + + busway = osmattrs.get('busway:both', '') + if busway == 'lane': + self.make_buslane(is_opp=False) + self.make_buslane(is_opp=True) + return + + elif busway in OSMKEYS_SHARED: + self.make_buslane(is_opp=False, ids_modes_allow=self.ids_modes_pt_shared, width=width_right) + self.make_buslane(is_opp=True, ids_modes_allow=self.ids_modes_pt_shared, width=width_left) + + # elif busway in OSMKEYS_SHARED_OPP : + # self.make_buslane(is_opp = True, ids_modes_allow = self.ids_modes_pt_shared) + + busway = osmattrs.get('busway:left', '') + if busway == 'lane': + self.make_buslane(is_opp=True, is_rightside=False, width=width_left) + + elif busway in OSMKEYS_SHARED: + self.make_buslane(is_opp=True, is_rightside=False, + ids_modes_allow=self.ids_modes_pt_shared, width=width_left) + + elif busway in OSMKEYS_SHARED_OPP: + self.make_buslane(is_opp=True, is_rightside=False, + ids_modes_allow=self.ids_modes_pt_shared, width=width_left) + + busway = osmattrs.get('busway:right', '') + if busway == 'lane': + self.make_buslane(is_opp=False) + + elif busway in OSMKEYS_SHARED: + self.make_buslane(is_opp=False, ids_modes_allow=self.ids_modes_pt_shared, width=width_right) + + elif busway in OSMKEYS_SHARED_OPP: + self.make_buslane(is_opp=True, ids_modes_allow=self.ids_modes_pt_shared, width=width_left) + + return + + else: + # cycle lanes on oneway road + print ' buslane oneway', busway, busway in ('opposite', 'opposite_lane') + if busway == 'lane': + self.make_buslane(is_opp=False, width=width_right) + + if osmattrs.get('oneway:bus', 'yes') == 'no': + self.make_buslane(is_opp=True, width=width_left) + return + + elif busway in ('opposite', 'opposite_lane'): + self.make_buslane(is_opp=True, is_rightside=False, width=width_left) + + elif busway == 'opposite_share_busway': + self.make_buslane(is_opp=True, is_rightside=False, + ids_modes_allow=self.ids_modes_pt_shared, width=width_left) + + elif self._osmattrs.get('busway:right', '') == 'lane': + self.make_buslane(is_opp=False, width=width_right) + + elif self._osmattrs.get('busway:left', '') == 'lane': + self.make_buslane(is_opp=False, is_rightside=False, width=width_right) + + elif self._osmattrs.get('busway:left', '') == 'opposite_lane': + self.make_buslane(is_opp=True, width=width_left) + + return + + elif osmattrs.has_key('lanes:psv'): + # lanes:psv=* scheme + if osmattrs.get('oneway', 'no') == 'no': + # bidir + psv = self._get_psv_from_str(osmattrs['lanes:psv']) + if psv/2 > 1: + self.make_buslane(is_opp=True, n_lane=psv/2, width=width_right) + self.make_buslane(is_opp=False, n_lane=psv/2, width=width_left) + else: + self.make_buslane(is_opp=False, n_lane=1, width=width_right) + + if osmattrs['lanes:psv'] == 'backward': + self.make_buslane(is_opp=True, n_lane=1, width=width_left) + elif osmattrs['lanes:psv'] == 'forward': + self.make_buslane(is_opp=False, n_lane=1, width=width_right) + + else: + # oneway + psv = self._get_psv_from_str(osmattrs['lanes:psv']) + self.make_buslane(is_opp=False, n_lane=psv, width=width_right) + return + + elif osmattrs.has_key('lanes:bus'): + # lanes:psv=* scheme + if osmattrs.get('oneway', 'no') == 'no': + # bidir + psv = self._get_psv_from_str(osmattrs['lanes:bus']) + if psv/2 > 1: + self.make_buslane(is_opp=True, n_lane=psv/2, width=width_right) + self.make_buslane(is_opp=False, n_lane=psv/2, width=width_left) + else: + self.make_buslane(is_opp=False, n_lane=1, width=width_right) + else: + # oneway + psv = self._get_psv_from_str(osmattrs['lanes:bus']) + self.make_buslane(is_opp=False, n_lane=psv, width=width_right) + return + + if osmattrs.has_key('lanes:psv:forward'): + psv = self._get_psv_from_str(osmattrs['lanes:psv:forward']) + self.make_buslane(is_opp=False, n_lane=psv, width=width_right) + + if osmattrs.has_key('lanes:psv:backward'): + psv = self._get_psv_from_str(osmattrs['lanes:psv:backward']) + self.make_buslane(is_opp=True, n_lane=psv, width=width_left) + + if osmattrs.has_key('lanes:bus:forward'): + n_lane = self._get_psv_from_str(osmattrs['lanes:bus:forward']) + self.make_buslane(is_opp=False, n_lane=n_lane, width=width_right) + + if osmattrs.has_key('lanes:bus:backward'): + n_lane = self._get_psv_from_str(osmattrs['lanes:bus:backward']) + self.make_buslane(is_opp=True, n_lane=n_lane, width=width_left) + + if osmattrs.get('oneway', 'no') == 'yes': + # special check of opposite bus lane + if osmattrs.has_key('trolley_wire:both') | osmattrs.has_key('trolley_wire:backward'): + # if way is oneway withot reserved access, + # but there are wires in both ways, + # then there is probably a reserved bus lane in opposite + # direction + if self._buswayattrs[0]['n_lane'] == 0: + self.make_buslane(is_opp=True, width=width_right) + + # NO! Moved to main lane attr + # if osmattrs.get('psv','no') in YES_OR_DESIGNATED: + # if osmattrs.get('oneway','no')=='no': + # self.make_buslane(is_opp = False, n_lane = 1,width = width_right) + # else: + # self.make_buslane(is_opp = False, n_lane = 1,width = width_right) + # self.make_buslane(is_opp = True,width = width_right) + # print ' buswayattrs=',self._buswayattrs + # for attrs in self._buswayattrs: + # if attrs['n_lane']>0: + # print_attrs(attrs) + + def get_priority(self, is_opp=False): + """ + Returns priority of road. + + To be overridden. + """ + if is_opp: + lanes = self._lanes_opp + else: + lanes = self._lanes + + speed_max = self.get_speed_max() + n_lane = len(lanes) + # is_residential =... + if n_lane == 0: + return 0 + + if n_lane == 1: + if speed_max < 11.0/3.6: + return 1 + elif speed_max <= 31.0/3.6: + return 2 + elif speed_max <= 51.0/3.6: + return 3 + else: + return 4 + + elif n_lane == 2: + if speed_max < 11.0/3.6: + return 4 + elif speed_max <= 31.0/3.6: + return 5 + elif speed_max <= 51.0/3.6: + return 6 + else: + return 7 + + elif n_lane == 3: + if speed_max < 11.0/3.6: + return 5 + elif speed_max <= 31.0/3.6: + return 6 + elif speed_max <= 51.0/3.6: + return 7 + elif speed_max <= 111.0/3.6: + return 8 + else: + return 9 + + elif n_lane > 3: + if speed_max < 11.0/3.6: + return 6 + elif speed_max <= 51.0/3.6: + return 7 + elif speed_max <= 91.0/3.6: + return 8 + elif speed_max <= 111.0/3.6: + return 9 + else: + return 10 + + def merge_laneattrs(self, laneattrs_dest, laneattrs_merge, is_rightside=False, is_leftside=False): + print 'merge_laneattrs' + # print ' laneattrs_dest',laneattrs_dest + # print ' laneattrs_merge',laneattrs_merge + #self._buswayattrs[ind]['ids_modes_allow'] = ids_allowed + #self._buswayattrs[ind]['width'] = width + #self._buswayattrs[ind]['is_rightside'] = is_rightside + # if laneattrs_merge['width']>laneattrs_dest['width']: + width_dest = 0.0 + if laneattrs_dest.has_key('width'): + width_dest = laneattrs_dest['width'] + else: + if is_rightside: + width_dest = laneattrs_dest['width_rightside'] + else: + width_dest = laneattrs_dest['width_leftside'] + + if laneattrs_merge.has_key('width'): + width_merge = laneattrs_merge['width'] + else: + if is_rightside: + width_merge = laneattrs_merge['width_rightside'] + else: + width_merge = laneattrs_merge['width_leftside'] + + # if width_dest laneattrs_merge['speed_max']: + laneattrs_dest['speed_max'] = laneattrs_merge['speed_max'] + + self.disallow_on_lane(laneattrs_dest, laneattrs_merge['ids_modes_disallow']) + self.allow_on_lane(laneattrs_dest, laneattrs_merge['ids_modes_allow']) + + def append_lane(self, lanes, laneattrs, is_rightside=False, is_leftside=False): + if is_rightside: + lanes.insert(0, deepcopy(laneattrs)) + lanes[0]['width'] = laneattrs['width_rightside'] + + elif is_leftside: + lanes.append(deepcopy(laneattrs)) + lanes[-1]['width'] = laneattrs['width_leftside'] + + def set_lane(self, lanes, laneattrs, ind): + lanes[ind] = deepcopy(laneattrs) + if not laneattrs.has_key('width'): + if laneattrs.has_key('width_rightside'): + lanes[ind]['width'] = laneattrs['width_rightside'] + else: + lanes[ind]['width'] = laneattrs['width_rightside'] + + def disallow_on_lane(self, laneattrs, ids_disallow): + # print 'disallow_on_lane ids_disallow',ids_disallow + for id_disallow in ids_disallow: + if id_disallow in laneattrs['ids_modes_allow']: + laneattrs['ids_modes_allow'].remove(id_disallow) + + if len(laneattrs['ids_modes_allow']) == 0: + for id_disallow in ids_disallow: + if id_disallow not in laneattrs['ids_modes_disallow']: + laneattrs['ids_modes_disallow'].append(id_disallow) + else: + laneattrs['ids_modes_disallow'] = [] + + def allow_on_lane(self, laneattrs, ids_allow): + laneattrs['ids_modes_disallow'] = [] + + for id_allow in ids_allow: + if id_allow not in laneattrs['ids_modes_allow']: + laneattrs['ids_modes_allow'].append(id_allow) + + def make_lanes_rigid(self, is_opp=False, n_lane_osm=0): + print 'make_lanes_rigid', is_opp, n_lane_osm + osmattrs = self._osmattrs + + if is_opp: + ind = 0 + if self._is_oneway: + self._lanes_opp = [] + return False + else: + ind = 1 + + lanes = [] + for i in range(n_lane_osm): + lanes.append(deepcopy(self._laneattrs_main)) + + # if is_lanes_rigid: + # # respect given lane numbers for main modes, except footpath + # pass + # else: + + # do busways + attrs = self._buswayattrs[ind] + + if attrs['n_lane'] > 0: + print ' busways n_lane', attrs['n_lane'] + + n_lane = len(lanes) + + allowed, disallowed = self.get_laneaccess('bus', is_opp=is_opp) + if len(allowed) == 0: + allowed, disallowed = self.get_laneaccess('psv', is_opp=is_opp) + + n_allow = len(allowed) + if n_allow > 0: + for i, a, d in zip(xrange(n_allow), allowed, disallowed): + if ind < n_lane: + if a & (i < n_lane): + self.set_lane(lanes, attrs, i) + if d: + self.disallow_on_lane(lanes[i], attrs['ids_modes_disallow']) + + else: + n_lane_assig = attrs['n_lane'] + for i in range(n_lane): + if n_lane_assig > 0: + if attrs['is_rightside']: + self.merge_laneattrs(lanes[i], attrs, is_rightside=True) + n_lane_assig -= 1 + + if attrs['is_leftside']: + self.merge_laneattrs(lanes[n_lane-i-1], attrs, is_leftside=True) + n_lane_assig -= 1 + + # do bikeways + attrs = self._bikewayattrs[ind] + if attrs['n_lane'] > 0: + print ' bikeways n_lane', attrs['n_lane'] + + n_lane = len(lanes) + + allowed, disallowed = self.get_laneaccess('bicycle', is_opp=is_opp) + + n_allow = len(allowed) + if n_allow > 0: + for i, a, d in zip(xrange(n_allow), allowed, disallowed): + if i < n_lane: + if a & i < n_lane: + self.set_lane(lanes, attrs, i) + if d: + self.disallow_on_lane(lanes[i], attrs['ids_modes_disallow']) + + else: + n_lane_assig = attrs['n_lane'] + for i in range(n_lane): + if n_lane_assig > 0: + if attrs['is_rightside']: + self.merge_laneattrs(lanes[i], attrs, is_rightside=True) + n_lane_assig -= 1 + + if attrs['is_leftside']: + self.merge_laneattrs(lanes[n_lane-i-1], attrs, is_leftside=True) + n_lane_assig -= 1 + + # do sidewalks + attrs = self._sidewalkattrs[ind] + if attrs['n_lane'] > 0: + print ' sidewalks n_lane', attrs['n_lane'] + n_lane_assig = attrs['n_lane'] + n_lane = len(lanes) + # sidewalks are not considered lanes in osm + # so we append/prepend them + while n_lane_assig > 0: + if attrs['is_rightside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[0], attrs, is_rightside=True) + else: + self.append_lane(lanes, attrs, is_rightside=True) + n_lane_assig -= 1 + if attrs['is_leftside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[-1], attrs, is_leftside=True) + else: + self.append_lane(lanes, attrs, is_leftside=True) + n_lane_assig -= 1 + + # disallow pedestrians on other lanes + # + for laneattrs in lanes: + if ID_MODE_PED not in laneattrs['ids_modes_allow']: + self.disallow_on_lane(laneattrs, [ID_MODE_PED]) + + if is_opp: + self._lanes_opp = lanes + else: + self._lanes = lanes + print ' created %d lanes' % len(lanes) + # print ' lanes', lanes + for laneattrs in lanes: + print_attrs(laneattrs) + return True + + def make_lanes(self, is_opp=False, n_lane_osm=0): + print 'make_lanes', is_opp, n_lane_osm + osmattrs = self._osmattrs + is_lanes_rigid = False + + if is_opp: + ind = 0 + if self._is_oneway: + self._lanes_opp = [] + return False + else: + ind = 1 + + lanes = [] + for i in range(n_lane_osm): + lanes.append(deepcopy(self._laneattrs_main)) + + # do busways + attrs = self._buswayattrs[ind] + if attrs['n_lane'] > 0: + print ' busways n_lane', attrs['n_lane'] + n_lane_assig = attrs['n_lane'] + n_lane = len(lanes) + + while n_lane_assig > 0: + if attrs['is_rightside']: + self.append_lane(lanes, attrs, is_rightside=True) + n_lane_assig -= 1 + if attrs['is_leftside']: + self.append_lane(lanes, attrs, is_leftside=True) + n_lane_assig -= 1 + + # do bikeways + attrs = self._bikewayattrs[ind] + if attrs['n_lane'] > 0: + print ' bikeways n_lane', attrs['n_lane'] + n_lane_assig = attrs['n_lane'] + n_lane = len(lanes) + + while n_lane_assig > 0: + if attrs['is_rightside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[0], attrs, is_rightside=True) + else: + self.append_lane(lanes, attrs, is_rightside=True) + n_lane_assig -= 1 + + if attrs['is_leftside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[-1], attrs, is_leftside=True) + else: + self.append_lane(lanes, attrs, is_leftside=True) + n_lane_assig -= 1 + + # do sidewalks + attrs = self._sidewalkattrs[ind] + + if attrs['n_lane'] > 0: + print ' sidewalks n_lane', attrs['n_lane'] + n_lane_assig = attrs['n_lane'] + n_lane = len(lanes) + # sidewalks are not considered lanes in osm + # so we append/prepend them + while n_lane_assig > 0: + if attrs['is_rightside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[0], attrs, is_rightside=True) + else: + self.append_lane(lanes, attrs, is_rightside=True) + n_lane_assig -= 1 + if attrs['is_leftside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[-1], attrs, is_leftside=True) + else: + self.append_lane(lanes, attrs, is_leftside=True) + n_lane_assig -= 1 + + # disallow pedestrians on other lanes + # + for laneattrs in lanes: + if ID_MODE_PED not in laneattrs['ids_modes_allow']: + self.disallow_on_lane(laneattrs, [ID_MODE_PED]) + + if is_opp: + self._lanes_opp = lanes + else: + self._lanes = lanes + print ' created %d lanes' % len(lanes) + # print ' lanes', lanes + for laneattrs in lanes: + print_attrs(laneattrs) + return True + + def get_speed_max(self, is_opp=False): + # TODO: go through lanes and get speed max + return self.speed_max + + def is_roundabout(self): + return self._osmattrs.get('junction', '') == 'roundabout' + + def configure_edge(self, id_edge, net, is_opp=False, is_remove_sidewalk=0): + # print ' id',id(self) + # print ' len(self._lanes)',len(self._lanes) + # print ' len(self._lanes_opp)',len(self._lanes_opp) + + osmattrs = self._osmattrs + edges = net.edges + if is_opp: + ind = 0 + lanes = np.array(self._lanes_opp) + else: + ind = 1 + lanes = np.array(self._lanes) + + print 'configure_edge', id_edge, net.edges.ids_sumo[id_edge], self.highway, 'is_opp', is_opp, 'n_lanes', len(lanes), 'is_remove_sidewalk', is_remove_sidewalk + + if self._is_oneway: # & (not self.is_roundabout()): + type_spread = 1 # centered + else: + type_spread = 0 # right spread + + wayattrs = self._sidewalkattrs[ind] + if (wayattrs['n_lane'] > 0) & (not is_remove_sidewalk): + width_sidewalk = max(wayattrs.get('width_leftside', -1), wayattrs.get('width_rightside', -1)) + else: + width_sidewalk = -1.0 + + # get max lane width + lanewidth = 0.0 + + # 'road': Road, + # 'path': Footpath, + # 'pedestrian': Footpath, + # 'footway': Footpath, + # 'stairs':Footpath, + # 'steps':Footpath, + # 'platform':Footpath, + + if self.highway not in ['residential', 'living_street', 'cycleway']: + inds_valid = [] + ind = 0 + ind_lastlane = len(lanes)-1 + for laneattrs in lanes: + # &lanes[-1]['is_sidewalk']: + if (ind == 0) & laneattrs['is_sidewalk'] & (is_remove_sidewalk == 2) & (ind_lastlane > 0): + print ' sidewalk removed on right side' + pass + # &lanes[0]['is_sidewalk']: + elif (ind == ind_lastlane) & laneattrs['is_sidewalk'] & (is_remove_sidewalk == 1) & (ind_lastlane > 0): + print ' sidewalk removed on left side' + pass + else: + inds_valid.append(ind) + if laneattrs['width'] > lanewidth: + lanewidth = laneattrs['width'] + + ind += 1 + else: + inds_valid = np.arange(len(lanes)) + + n_lane = len(inds_valid) + edges.types[id_edge] = self.highway + edges.nums_lanes[id_edge] = n_lane + edges.types_spread[id_edge] = type_spread + edges.speeds_max[id_edge] = self.get_speed_max(is_opp) + edges.priorities[id_edge] = self.get_priority(is_opp) + edges.names[id_edge] = osmattrs.get('name', '') + edges.widths_lanes_default[id_edge] = lanewidth + edges.widths_sidewalk[id_edge] = width_sidewalk + # edges.[id_edge] = + + # net.edges.set_row( id_edge, + # types_spread = type_spread, + # speeds_max = self.get_speed_max(is_opp), + # priorities = self.get_priority(is_opp), + # #'widths'=# will be done during update + # names = osmattrs.get('name',''), + # widths_lanes_default = lanewidth, + # widths_sidewalk = width_sidewalk, + # ) + + # add lanes + + if n_lane == 0: + print 'WARNING: no lane for this direction!!' + else: + print ' inds_valid', inds_valid + ids_lane = net.lanes.add_rows(n_lane) + + for id_lane, ind_lane, laneattrs in zip(ids_lane, xrange(n_lane), lanes[inds_valid]): + if len(laneattrs['ids_modes_allow']) == 0: + id_mode_main = self.id_mode + else: + id_mode_main = laneattrs['ids_modes_allow'][0] + + net.lanes.set_row(id_lane, + indexes=ind_lane, + widths=laneattrs['width'], + speeds_max=laneattrs['speed_max'], + #offsets_end = kwargs['offsets_end'], + #ids_modes_allow = laneattrs['ids_modes_allow'], + #ids_modes_disallow = laneattrs['ids_modes_disallow'], + ids_mode=id_mode_main, + ids_edge=id_edge, + ) + # must be done seperately!! + net.lanes.ids_modes_allow[id_lane] = laneattrs['ids_modes_allow'] + net.lanes.ids_modes_disallow[id_lane] = laneattrs['ids_modes_disallow'] + + edges.ids_lanes[id_edge] = list(ids_lane) + + +class Primary(Road): + + def config(self): + """ + Make defaults to be overridden + """ + Road.config(self) + self.highway = self._osmattrs.get('highway', 'primary') + # put 50km/h default speed limit + self.make_speed(50.0/3.6) + + self.n_lane = 2 + self.id_mode = ID_MODE_CAR + self.lanewidth = 3.5 + + self.ids_modes_pt_shared = self.parent.ids_modes_pt_shared + self.ids_modes_bike = self.parent.ids_modes_bike + self.ids_modes_moped = self.parent.ids_modes_moped + + def get_priority(self, is_opp=False): + """ + Returns priority of road. + + To be overridden. + """ + if is_opp: + lanes = self._lanes_opp + else: + lanes = self._lanes + + speed_max = self.get_speed_max() + n_lane = len(lanes) + # is_residential =... + if n_lane == 0: + return 0 + + elif n_lane <= 2: + if speed_max <= 51.0/3.6: + return 7 + elif speed_max <= 111.0/3.6: + return 8 + else: + return 9 + + elif n_lane == 3: + if speed_max <= 51.0/3.6: + return 7 + elif speed_max <= 91.0/3.6: + return 8 + elif speed_max <= 111.0/3.6: + return 9 + else: + return 10 + + elif n_lane > 3: + return 10 + + def make_lanes_rigid(self, is_opp=False, n_lane_osm=0): + print 'make_lanes_rigid', is_opp, n_lane_osm + osmattrs = self._osmattrs + + if is_opp: + ind = 0 + if self._is_oneway: + self._lanes_opp = [] + return False + else: + ind = 1 + + lanes = [] + for i in range(n_lane_osm): + lanes.append(deepcopy(self._laneattrs_main)) + + # if is_lanes_rigid: + # # respect given lane numbers for main modes, except footpath + # pass + # else: + + # do busways + attrs = self._buswayattrs[ind] + + if attrs['n_lane'] > 0: + print ' busways n_lane', attrs['n_lane'] + + n_lane = len(lanes) + + allowed, disallowed = self.get_laneaccess('bus', is_opp=is_opp) + if len(allowed) == 0: + allowed, disallowed = self.get_laneaccess('psv', is_opp=is_opp) + + n_allow = len(allowed) + if n_allow > 0: + for i, a, d in zip(xrange(n_allow), allowed, disallowed): + if ind < n_lane: + if a & (i < n_lane): + self.set_lane(lanes, attrs, i) + if d: + self.disallow_on_lane(lanes[i], attrs['ids_modes_disallow']) + + else: + n_lane_assig = attrs['n_lane'] + for i in range(n_lane): + if n_lane_assig > 0: + if attrs['is_rightside']: + self.merge_laneattrs(lanes[i], attrs, is_rightside=True) + n_lane_assig -= 1 + + if attrs['is_leftside']: + self.merge_laneattrs(lanes[n_lane-i-1], attrs, is_leftside=True) + n_lane_assig -= 1 + + # do bikeways + attrs = self._bikewayattrs[ind] + if attrs['n_lane'] > 0: + print ' bikeways n_lane', attrs['n_lane'] + + n_lane = len(lanes) + + allowed, disallowed = self.get_laneaccess('bicycle', is_opp=is_opp) + + n_allow = len(allowed) + if n_allow > 0: + for i, a, d in zip(xrange(n_allow), allowed, disallowed): + if i < n_lane: + if a & i < n_lane: + self.set_lane(lanes, attrs, i) + if d: + self.disallow_on_lane(lanes[i], attrs['ids_modes_disallow']) + + else: + n_lane_assig = attrs['n_lane'] + for i in range(n_lane): + if n_lane_assig > 0: + if attrs['is_rightside']: + if is_opp: + self.merge_laneattrs(lanes[i], attrs, is_rightside=True) + else: + # in a primary link require 2 lanes for cars + if n_lane_osm > 2: + self.merge_laneattrs(lanes[i], attrs, is_rightside=True) + else: + self.append_lane(lanes, attrs, is_rightside=True) + n_lane_assig -= 1 + + if attrs['is_leftside']: + self.merge_laneattrs(lanes[n_lane-i-1], attrs, is_leftside=True) + n_lane_assig -= 1 + + # do sidewalks + attrs = self._sidewalkattrs[ind] + if attrs['n_lane'] > 0: + print ' sidewalks n_lane', attrs['n_lane'] + n_lane_assig = attrs['n_lane'] + n_lane = len(lanes) + # sidewalks are not considered lanes in osm + # so we append/prepend them + while n_lane_assig > 0: + if attrs['is_rightside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[0], attrs, is_rightside=True) + else: + self.append_lane(lanes, attrs, is_rightside=True) + n_lane_assig -= 1 + + if attrs['is_leftside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[-1], attrs, is_leftside=True) + else: + self.append_lane(lanes, attrs, is_leftside=True) + n_lane_assig -= 1 + + # disallow pedestrians on other lanes + # + for laneattrs in lanes: + if ID_MODE_PED not in laneattrs['ids_modes_allow']: + self.disallow_on_lane(laneattrs, [ID_MODE_PED]) + + if is_opp: + self._lanes_opp = lanes + else: + self._lanes = lanes + print ' created %d lanes' % len(lanes) + # print ' lanes', lanes + for laneattrs in lanes: + print_attrs(laneattrs) + return True + + def make_lanes(self, is_opp=False, n_lane_osm=0): + print 'make_lanes primary', is_opp, n_lane_osm + osmattrs = self._osmattrs + #is_lanes_rigid = False + + if is_opp: + ind = 0 + if self._is_oneway: + self._lanes_opp = [] + return False + else: + ind = 1 + + lanes = [] + for i in range(n_lane_osm): + lanes.append(deepcopy(self._laneattrs_main)) + + # do busways + attrs = self._buswayattrs[ind] + if attrs['n_lane'] > 0: + print ' busways n_lane', attrs['n_lane'] + n_lane_assig = attrs['n_lane'] + n_lane = len(lanes) + + while n_lane_assig > 0: + if attrs['is_rightside']: + self.append_lane(lanes, attrs, is_rightside=True) + n_lane_assig -= 1 + if attrs['is_leftside']: + self.append_lane(lanes, attrs, is_leftside=True) + n_lane_assig -= 1 + + # do bikeways + attrs = self._bikewayattrs[ind] + if attrs['n_lane'] > 0: + print ' bikeways n_lane', attrs['n_lane'] + n_lane_assig = attrs['n_lane'] + n_lane = len(lanes) + + while n_lane_assig > 0: + if attrs['is_rightside']: + if is_opp: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[0], attrs, is_rightside=True) + else: + self.append_lane(lanes, attrs, is_rightside=True) + else: + # primary link specific: only merge if more than 2 lanes + if attrs['is_share'] & (len(lanes) > 2): + self.merge_laneattrs(lanes[0], attrs, is_rightside=True) + else: + self.append_lane(lanes, attrs, is_rightside=True) + n_lane_assig -= 1 + + if attrs['is_leftside']: + # primary link specific: only merge if more than 2 lanes + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[-1], attrs, is_leftside=True) + else: + self.append_lane(lanes, attrs, is_leftside=True) + n_lane_assig -= 1 + + # do sidewalks + attrs = self._sidewalkattrs[ind] + if attrs['n_lane'] > 0: + print ' sidewalks n_lane', attrs['n_lane'] + n_lane_assig = attrs['n_lane'] + n_lane = len(lanes) + # sidewalks are not considered lanes in osm + # so we append/prepend them + while n_lane_assig > 0: + if attrs['is_rightside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[0], attrs, is_rightside=True) + else: + self.append_lane(lanes, attrs, is_rightside=True) + n_lane_assig -= 1 + if attrs['is_leftside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[-1], attrs, is_leftside=True) + else: + self.append_lane(lanes, attrs, is_leftside=True) + n_lane_assig -= 1 + + # disallow pedestrians on other lanes + # + for laneattrs in lanes: + if ID_MODE_PED not in laneattrs['ids_modes_allow']: + self.disallow_on_lane(laneattrs, [ID_MODE_PED]) + + if is_opp: + self._lanes_opp = lanes + else: + self._lanes = lanes + print ' created %d lanes' % len(lanes) + # print ' lanes', lanes + for laneattrs in lanes: + print_attrs(laneattrs) + return True + + +class Motorway(Road): + + def config(self): + """ + Make defaults to be overridden + """ + Road.config(self) + self.highway = self._osmattrs.get('highway', 'motorway') + # put 50km/h default speed limit + self.make_speed(130.0/3.6) + + self.n_lane = 2 + self.id_mode = ID_MODE_CAR + self.lanewidth = 3.5 + + self.ids_modes_pt_shared = self.parent.ids_modes_pt_shared + self.ids_modes_bike = self.parent.ids_modes_bike + self.ids_modes_moped = self.parent.ids_modes_moped + + def get_priority(self, is_opp=False): + """ + Returns priority of road. + + To be overridden. + """ + if is_opp: + lanes = self._lanes_opp + else: + lanes = self._lanes + + speed_max = self.get_speed_max() + n_lane = len(lanes) + # is_residential =... + if n_lane == 0: + return 0 + + elif n_lane == 1: + return 9 + else: + return 10 + + def make_lanes_rigid(self, is_opp=False, n_lane_osm=0): + print 'make_lanes_rigid', is_opp, n_lane_osm + osmattrs = self._osmattrs + + if is_opp: + ind = 0 + if self._is_oneway: + self._lanes_opp = [] + return False + else: + ind = 1 + + lanes = [] + for i in range(n_lane_osm): + lanes.append(deepcopy(self._laneattrs_main)) + + # disallow pedestrians and bikes on all lanes + for laneattrs in lanes: + self.disallow_on_lane(laneattrs, [ID_MODE_PED, ID_MODE_BIKE]) + + if is_opp: + self._lanes_opp = lanes + else: + self._lanes = lanes + print ' created %d lanes' % len(lanes) + # print ' lanes', lanes + for laneattrs in lanes: + print_attrs(laneattrs) + return True + + def make_lanes(self, is_opp=False, n_lane_osm=0): + print 'make_lanes primary', is_opp, n_lane_osm + osmattrs = self._osmattrs + #is_lanes_rigid = False + + if is_opp: + ind = 0 + if self._is_oneway: + self._lanes_opp = [] + return False + else: + ind = 1 + + lanes = [] + for i in range(n_lane_osm): + lanes.append(deepcopy(self._laneattrs_main)) + + for laneattrs in lanes: + self.disallow_on_lane(laneattrs, [ID_MODE_PED, ID_MODE_BIKE]) + + if is_opp: + self._lanes_opp = lanes + else: + self._lanes = lanes + print ' created %d lanes' % len(lanes) + # print ' lanes', lanes + for laneattrs in lanes: + print_attrs(laneattrs) + return True + + +class Residential(Road): + + def config(self): + """ + Make defaults to be overridden + """ + Road.config(self) + # put 30km/h default speed limit + self.make_speed(30.0/3.6) + + self.ids_modes_pt_shared = self.parent.ids_modes_pt_shared + self.ids_modes_bike = self.parent.ids_modes_bike + self.ids_modes_moped = self.parent.ids_modes_moped + + def make_laneattrs_main(self): + Road.make_laneattrs_main(self) + self.make_laneattrs_main_accessrestrict() + + def get_priority(self, is_opp=False): + """ + Returns priority of road. + + To be overridden. + """ + if is_opp: + lanes = self._lanes_opp + else: + lanes = self._lanes + + speed_max = self.get_speed_max() + n_lane = len(lanes) + return 3 + + def make_sidewalkattrs(self): + print 'make_sidewalkattrs' + self.make_sidewalkattrs_smallroads() + + +class Footpath(Road): + def config(self): + """ + Make defaults to be overridden + """ + # print 'config' + # pass here either road type specific defaults + # or global defaults from parent process + self.id_mode = ID_MODE_PED + # highway=footway|path + self.highway = self._osmattrs.get('highway', 'footway') + + # Use footway=crossing for places where the footway crosses a street. + # Use footway=sidewalk + + self.footway = self._osmattrs.get('footway', '') + self.n_lane = 1 + + if self.footway == 'sidewalk': + lanewidth = self.parent.width_sidewalk + else: + lanewidth = self.parent.width_footpath + + # half lanewidth if segregated + if self._osmattrs.get('segregated', '') == 'yes': + lanewidth /= 2 + + self.lanewidth = lanewidth + self.lanewidth_bike = lanewidth + self.lanewidth_bus = self.parent.lanewidth_bus + #self.width_sidewalk = self.parent.width_sidewalk + #self.width_footpath = self.parent.width_footpath + + #self.ids_modes_pt_shared = self.parent.ids_modes_pt_shared + self.ids_modes_bike = self.parent.ids_modes_bike + self.ids_modes_pt_shared = self.parent.ids_modes_pt_shared + self.ids_modes_moped = self.parent.ids_modes_moped + + self.ids_modes_allow = [ID_MODE_PED] + self.ids_modes_disallow = [] + self.make_speed(self.parent.speed_max_ped) + + self.speed_max_bus = self.parent.speed_max_bus + self.speed_max_bike = self.parent.speed_max_bike + #self.speed_max_ped = self.parent.speed_max_ped + + def make_laneattrs_main(self): + Road.make_laneattrs_main(self) + self.make_laneattrs_main_accessrestrict() + self._laneattrs_main['is_sidewalk'] = True + + def get_priority(self, is_opp=False): + """ + Returns priority of road. + + To be overridden. + """ + if is_opp: + lanes = self._lanes_opp + else: + lanes = self._lanes + + speed_max = self.get_speed_max() + n_lane = len(lanes) + return 1 + + def make_oneway(self): + # print 'make_oneway' + osmattrs = self._osmattrs + + # default for footpath is oneway = yes + if osmattrs.get('oneway', 'yes') == 'no': + self._is_oneway = False + + else: + # check if really oneway + # we make oneway if only pedestrians use this edge + if (osmattrs.get('bicycle', '') in YES_OR_DESIGNATED)\ + | (osmattrs.get('route', '') == 'bicycle')\ + | (osmattrs.get('psv', 'no') in YES_OR_DESIGNATED)\ + | (osmattrs.get('moped', 'no') in YES_OR_DESIGNATED): + self._is_oneway = False + else: + self._is_oneway = True + + def make_sidewalkattrs(self): + self._sidewalkattrs = (deepcopy(LANEATTRS_DEFAULT), + deepcopy(LANEATTRS_DEFAULT)) + # pass + self._sidewalkattrs[0]['is_sidewalk'] = True + self._sidewalkattrs[1]['is_sidewalk'] = True + # but there will be no sidewalk of sidewalk + + def make_bikewayattrs(self): + print 'Footpath.make_bikewayattrs' + osmattrs = self._osmattrs + self._bikewayattrs = (deepcopy(LANEATTRS_DEFAULT), + deepcopy(LANEATTRS_DEFAULT)) + + width_left = self.lanewidth_bike + width_right = self.lanewidth_bike + + if osmattrs.get('oneway', 'no') == 'no': + # cycle lanes on bidir footpath (normal) + if (osmattrs.get('bicycle', '') in YES_OR_DESIGNATED) | (osmattrs.get('route', '') == 'bicycle'): + if osmattrs.get('segregated', '') == 'yes': + # bike lanes to the left of the footpath + self.make_bikelane(is_opp=False, is_rightside=False, width=width_right) + self.make_bikelane(is_opp=True, is_rightside=False, width=width_left) + # else: + # + # # bike lanes will be merged with the footpath + # self.make_bikelane(is_opp = False, width = width_right, ids_modes_allow =[ID_MODE_PED]) + # self.make_bikelane(is_opp = True, width = width_left, ids_modes_allow =[ID_MODE_PED]) + else: + if (osmattrs.get('bicycle', '') in YES_OR_DESIGNATED) | (osmattrs.get('route', '') == 'bicycle'): + if osmattrs.get('segregated', '') == 'yes': + # bike lanes to the left of the footpath + self.make_bikelane(is_opp=False, is_rightside=False, width=width_right) + + def make_lanes_rigid(self, is_opp=False, n_lane_osm=0): + print 'Footpath.make_lanes_rigid ped', is_opp, n_lane_osm + osmattrs = self._osmattrs + + if is_opp: + ind = 0 + if self._is_oneway: + self._lanes_opp = [] + return False + else: + ind = 1 + + lanes = [] + + n_other = self._bikewayattrs[ind]['n_lane']+self._buswayattrs[ind]['n_lane'] + if (not is_opp) | (n_other == 0): + # main footpath ony in main direction + n_lane_osm = max(n_lane_osm, 1) # guarantee that one lane is created + for i in range(n_lane_osm): + lanes.append(deepcopy(self._laneattrs_main)) + + # if is_lanes_rigid: + # # respect given lane numbers for main modes, except footpath + # pass + # else: + + # do busways + attrs = self._buswayattrs[ind] + + if attrs['n_lane'] > 0: + print ' busways n_lane', attrs['n_lane'] + + n_lane = len(lanes) + + allowed, disallowed = self.get_laneaccess('bus', is_opp=is_opp) + if len(allowed) == 0: + allowed, disallowed = self.get_laneaccess('psv', is_opp=is_opp) + + n_allow = len(allowed) + if n_allow > 0: + for i, a, d in zip(xrange(n_allow), allowed, disallowed): + if ind < n_lane: + if a & (i < n_lane): + self.set_lane(lanes, attrs, i) + if d: + self.disallow_on_lane(lanes[i], attrs['ids_modes_disallow']) + + else: + n_lane_assig = attrs['n_lane'] + for i in range(n_lane): + if n_lane_assig > 0: + if attrs['is_rightside']: + self.merge_laneattrs(lanes[i], attrs, is_rightside=True) + n_lane_assig -= 1 + + if attrs['is_leftside']: + self.merge_laneattrs(lanes[n_lane-i-1], attrs, is_leftside=True) + n_lane_assig -= 1 + + # do bikeways + attrs = self._bikewayattrs[ind] + if attrs['n_lane'] > 0: + print ' bikeways n_lane', attrs['n_lane'] + + n_lane = len(lanes) + + allowed, disallowed = self.get_laneaccess('bicycle', is_opp=is_opp) + + n_allow = len(allowed) + if n_allow > 0: + for i, a, d in zip(xrange(n_allow), allowed, disallowed): + if i < n_lane: + if a & i < n_lane: + self.set_lane(lanes, attrs, i) + if d: + self.disallow_on_lane(lanes[i], attrs['ids_modes_disallow']) + + else: + n_lane_assig = attrs['n_lane'] + for i in range(n_lane): + if n_lane_assig > 0: + if attrs['is_rightside']: + self.merge_laneattrs(lanes[i], attrs, is_rightside=True) + n_lane_assig -= 1 + + if attrs['is_leftside']: + self.merge_laneattrs(lanes[n_lane-i-1], attrs, is_leftside=True) + n_lane_assig -= 1 + + def make_lanes(self, is_opp=False, n_lane_osm=0): + print 'Footpath.make_lanes', is_opp, n_lane_osm, 'n_bikelane', len(self._bikewayattrs) + osmattrs = self._osmattrs + + print ' main lane attrs' + print_attrs(self._laneattrs_main) + + if is_opp: + ind = 0 + if self._is_oneway: + self._lanes_opp = [] + return False + else: + ind = 1 + + lanes = [] + n_other = self._bikewayattrs[ind]['n_lane']+self._buswayattrs[ind]['n_lane'] + if (not is_opp) | (n_other == 0): + n_lane_osm = max(n_lane_osm, 1) # guarantee that one lane is created + for i in range(n_lane_osm): + lanes.append(deepcopy(self._laneattrs_main)) + + # do busways + attrs = self._buswayattrs[ind] + if attrs['n_lane'] > 0: + print ' busways n_lane', attrs['n_lane'] + n_lane_assig = attrs['n_lane'] + n_lane = len(lanes) + + while n_lane_assig > 0: + if attrs['is_rightside']: + self.append_lane(lanes, attrs, is_rightside=True) + n_lane_assig -= 1 + if attrs['is_leftside']: + self.append_lane(lanes, attrs, is_leftside=True) + n_lane_assig -= 1 + + # do bikeways + + print ' bikewayattrs:' + attrs = self._bikewayattrs[ind] + print_attrs(attrs) + if attrs['n_lane'] > 0: + print ' bikeways n_lane', attrs['n_lane'] + n_lane_assig = attrs['n_lane'] + n_lane = len(lanes) + + while n_lane_assig > 0: + if attrs['is_rightside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[0], attrs, is_rightside=True) + else: + self.append_lane(lanes, attrs, is_rightside=True) + n_lane_assig -= 1 + + if attrs['is_leftside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[-1], attrs, is_leftside=True) + else: + self.append_lane(lanes, attrs, is_leftside=True) + n_lane_assig -= 1 + + if is_opp: + self._lanes_opp = lanes + else: + self._lanes = lanes + + print ' created %d lanes' % len(lanes) + # print ' lanes', lanes + for laneattrs in lanes: + print_attrs(laneattrs) + return True + + +class Cycleway(Road): + + def config(self): + """ + Make defaults to be overridden + """ + print 'config cycleway' + # pass here either road type specific defaults + # or global defaults from parent process + + self.highway = self._osmattrs.get('highway', 'cycleway') + + self.id_mode = ID_MODE_BIKE + self.n_lane = 1 + + # print ' width',self._osmattrs.get('width',self.parent.lanewidth_bike) + if self.is_oneway(): + width_default = self.parent.lanewidth_bike + else: + width_default = 2*self.parent.lanewidth_bike + + self.lanewidth = self.get_osmattr('width', is_float=True, default=width_default) + + # half lane width if bidir + if not self.is_oneway(): + self.lanewidth *= 0.5 + + #self.lanewidth_bike = self.parent.lanewidth_bike + #self.lanewidth_bus = self.parent.lanewidth_bus + self.width_sidewalk = self.parent.width_sidewalk + self.width_footpath = self.parent.width_footpath + + #self.ids_modes_pt_shared = self.parent.ids_modes_pt_shared + #self.ids_modes_bike = self.parent.ids_modes_bike + self.ids_modes_allow = self.parent.ids_modes_bike + self.ids_modes_disallow = [] + self.make_speed(self.parent.speed_max_bike) + + print ' ids_modes_allow', self.ids_modes_allow + #self.speed_max_bus = self.parent.speed_max_bus + #self.speed_max_bike = self.parent.speed_max_bike + self.speed_max_ped = self.parent.speed_max_ped + + def make_laneattrs_main(self): + Road.make_laneattrs_main(self) + # self.make_laneattrs_main_accessrestrict() + + def make_oneway(self): + # print 'make_oneway' + osmattrs = self._osmattrs + + # default for bikeway is oneway = no + if osmattrs.get('oneway', 'no') == 'no': + self._is_oneway = False + + else: + self._is_oneway = True + + def make_buswayattrs(self): + # print 'make_buswayattrs' + # self._buswayattrs = (LANEATTRS_DEFAULT.copy(), + # LANEATTRS_DEFAULT.copy()) + pass + + # def make_sidewalkattrs(self): + # self._sidewalkattrs = (deepcopy(LANEATTRS_DEFAULT), + # deepcopy(LANEATTRS_DEFAULT)) + # #pass + + def make_bikewayattrs(self): + pass + + def make_sidewalkattrs(self): + print 'make_sidewalkattrs' + # put sidewalks only if sidewalk attributes are given + return self.make_sidewalkattrs_largeroads() + + def make_lanes_rigid(self, is_opp=False, n_lane_osm=0): + print 'make_lanes_rigid cycle', is_opp, n_lane_osm + osmattrs = self._osmattrs + + if is_opp: + ind = 0 + if self._is_oneway: + self._lanes_opp = [] + return False + else: + ind = 1 + + lanes = [] + for i in range(n_lane_osm): + lanes.append(deepcopy(self._laneattrs_main)) + + # do sidewalks + attrs = self._sidewalkattrs[ind] + if attrs['n_lane'] > 0: + print ' sidewalks n_lane', attrs['n_lane'] + n_lane_assig = attrs['n_lane'] + n_lane = len(lanes) + # sidewalks are not considered lanes in osm + # so we append/prepend them + while n_lane_assig > 0: + if attrs['is_rightside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[0], attrs, is_rightside=True) + else: + self.append_lane(lanes, attrs, is_rightside=True) + n_lane_assig -= 1 + if attrs['is_leftside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[-1], attrs, is_leftside=True) + else: + self.append_lane(lanes, attrs, is_leftside=True) + n_lane_assig -= 1 + + # disallow pedestrians on other lanes + # + for laneattrs in lanes: + if ID_MODE_PED not in laneattrs['ids_modes_allow']: + self.disallow_on_lane(laneattrs, [ID_MODE_PED]) + + if is_opp: + self._lanes_opp = lanes + else: + self._lanes = lanes + print ' created %d lanes' % len(lanes) + # print ' lanes', lanes + for laneattrs in lanes: + print_attrs(laneattrs) + return True + + def make_lanes(self, is_opp=False, n_lane_osm=0): + print 'make_lanes cycle', is_opp, n_lane_osm + osmattrs = self._osmattrs + is_lanes_rigid = False + + if is_opp: + ind = 0 + if self._is_oneway: + self._lanes_opp = [] + return False + else: + ind = 1 + + lanes = [] + for i in range(n_lane_osm): + lanes.append(deepcopy(self._laneattrs_main)) + + # do sidewalks + attrs = self._sidewalkattrs[ind] + if attrs['n_lane'] > 0: + print ' sidewalks n_lane', attrs['n_lane'] + n_lane_assig = attrs['n_lane'] + n_lane = len(lanes) + # sidewalks are not considered lanes in osm + # so we append/prepend them + while n_lane_assig > 0: + if attrs['is_rightside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[0], attrs, is_rightside=True) + else: + self.append_lane(lanes, attrs, is_rightside=True) + n_lane_assig -= 1 + if attrs['is_leftside']: + if attrs['is_share'] & (len(lanes) > 0): + self.merge_laneattrs(lanes[-1], attrs, is_leftside=True) + else: + self.append_lane(lanes, attrs, is_leftside=True) + n_lane_assig -= 1 + + # disallow pedestrians on other lanes + # + for laneattrs in lanes: + if ID_MODE_PED not in laneattrs['ids_modes_allow']: + self.disallow_on_lane(laneattrs, [ID_MODE_PED]) + + if is_opp: + self._lanes_opp = lanes + else: + self._lanes = lanes + print ' created %d lanes' % len(lanes) + # print ' lanes', lanes + for laneattrs in lanes: + print_attrs(laneattrs) + return True + + def get_priority(self, is_opp=False): + """ + Returns priority of road. + + To be overridden. + """ + if is_opp: + lanes = self._lanes_opp + else: + lanes = self._lanes + + speed_max = self.get_speed_max() + n_lane = len(lanes) + return 2 + + +ROADCLASSES = {'road': Road, + 'path': Footpath, + 'pedestrian': Footpath, + 'footway': Footpath, + 'stairs': Footpath, + 'steps': Footpath, + 'platform': Footpath, + 'cycleway': Cycleway, + 'residential': Residential, + 'living_street': Residential, + 'primary': Primary, + 'primary_link': Primary, + 'motorway': Motorway, + 'trunk': Motorway, + 'motorway_link': Motorway, + 'trunk_link': Motorway, + 'primary_link': Primary, + } +OSMKEYS_SHARED = ('shared', 'share_lane', 'share_busway', 'share_cycleway') +OSMKEYS_SHARED_OPP = ('opposite_shared', 'opposite_share_lane', 'opposite_share_busway', 'opposite_share_cycleway') + + +class OxImporter(Process): + def __init__(self, scenario, + ident='oximporter', + name='OSMnx importer', + info='Import of network imported with the help of osmnx.', + logger=None, **kwargs): + + print 'OxImporter.__init__' + + self._init_common(ident, + parent=scenario, + name=name, + logger=logger, + info=info, + ) + + attrsman = self.set_attrsman(cm.Attrsman(self)) + + # self.id_mode = attrsman.add(am.AttrConf('id_mode', modechoices['bicycle'], + # groupnames = ['options'], + # choices = modechoices, + # name = 'Mode', + # info = 'Transport mode to be matched.', + # )) + + self.osmdatafilepaths = attrsman.add( + cm.AttrConf('osmdatafilepaths', kwargs.get('osmdatafilepaths', scenario.get_rootfilepath()), + groupnames=['options'], + perm='rw', + name='OSM data file(s)', + wildcards='Jason file (*.json)|*.json', + metatype='filepaths', + info="""One or several jason filepaths holding OSM related information.""", + )) + + self.nxnetworkpaths = attrsman.add( + cm.AttrConf('nxnetworkpaths', kwargs.get('nxnetworkpaths', scenario.get_rootfilepath()), + groupnames=['options'], + perm='rw', + name='Networkx file(s)', + wildcards='NetworkX file (*.obj)|*.obj', + metatype='filepaths', + info="""One or several network X filepaths containing topological information of simplified network.""", + )) + + self.n_lane = attrsman.add(cm.AttrConf('n_lane', 1, + groupnames=['options', 'osm'], + name='Default lane number', + info="Default lane number.", + )) + + self.speed_max = attrsman.add(cm.AttrConf('speed_max', 50.0/3.6, + groupnames=['options', 'osm'], + name='Default Max. speed', + info="General default maximum speed.", + unit='m/s', + )) + + self.speed_max_bus = attrsman.add(cm.AttrConf('speed_max_bus', 50.0/3.6, + groupnames=['options', 'osm'], + name='Default Max. bus speed', + info="Default maximum speed on busways.", + unit='m/s', + )) + + self.speed_max_bike = attrsman.add(cm.AttrConf('speed_max_bike', 20.0/3.6, + groupnames=['options', 'osm'], + name='Default Max. bike speed', + info="Default maximum speed on bikeways.", + unit='m/s', + )) + + self.speed_max_ped = attrsman.add(cm.AttrConf('speed_max_ped', 3.0/3.6, + groupnames=['options', 'osm'], + name='Default Max. ped. speed', + info="Default maximum speed on footpath or sidewalks.", + unit='m/s', + )) + + self.lanewidth = attrsman.add(cm.AttrConf('lanewidth', 3.25, + groupnames=['options', 'osm'], + name='Default lane', + info="Default lane width for standard lane.", + unit='m', + )) + + self.lanewidth_bike = attrsman.add(cm.AttrConf('lanewidth_bike', 1.5, + groupnames=['options', 'osm'], + name='Default bikeway width', + info="Default bikeway width.", + unit='m', + )) + + self.lanewidth_bus = attrsman.add(cm.AttrConf('lanewidth_bus', 3.5, + groupnames=['options', 'osm'], + name='Default busway width', + info="Default busway width.", + unit='m', + )) + + self.width_footpath = attrsman.add(cm.AttrConf('width_footpath', 1.5, + groupnames=['options', 'osm'], + name='Default footpath width', + info="Default footpath width.", + unit='m', + )) + + self.width_sidewalk = attrsman.add(cm.AttrConf('width_sidewalk', 1.0, + groupnames=['options', 'osm'], + name='Default sidewalk width', + info="Default sidewalk width.", + unit='m', + )) + + self.modes_pt_shared = attrsman.add(cm.AttrConf('modes_pt_shared', ['bus', 'taxi', 'emergency', 'bicycle'], + groupnames=['options', 'osm'], + name='Modes on PT reserved lanes', + info="Modes that are allowed on reserved lanes for public transport.", + perm='r', + )) + + self.modes_bike = attrsman.add(cm.AttrConf('modes_bike', ['bicycle', ], + groupnames=['options', 'osm'], + name='Modes on dedicated bike lanes', + info="Modes that are allowed on dedicated bike lanes.", + perm='r', + )) + + self.modes_moped = attrsman.add(cm.AttrConf('modes_moped', ['moped', ], + groupnames=['options', 'osm'], + name='Modes allowed on dedicated moped acess', + info="Modes that are allowed on lanes with dedicated moped access.", + perm='r', + )) + + self.is_simplify_footpath = attrsman.add(cm.AttrConf('is_simplify_footpath', True, + groupnames=['options', 'osm'], + name='Simplify footpath', + info="Simplify footpath by removing footpath parallel to roads and giving a sidewalk to roads instead. (Unsafe option)", + )) + + self.n_node_sidewalkremove = attrsman.add(cm.AttrConf('n_node_sidewalkremove', 8, + groupnames=['options', 'osm'], + name='Node number sidewalk remove', + info="Maximum number of nodes in a ring where inner sidewalks are removed. Used only with option 'Simplify footpath'", + unit='m', + )) + + self.ids_modes_moped = [] + for mode in self.modes_moped: + self.ids_modes_moped.append(MODES[mode]) + + self.ids_modes_bike = [] + for mode in self.modes_bike: + self.ids_modes_bike.append(MODES[mode]) + + self.ids_modes_pt_shared = [] + for mode in self.modes_pt_shared: + self.ids_modes_pt_shared.append(MODES[mode]) + + # def import_xnet(net, nodeshapefilepath, edgeshapefilepath, polyshapefilepath): + #import_nodeshapes(net, nodeshapefilepath) + + def get_scenario(self): + return self.parent + + def do(self): + print self.ident+'.do' + + print ' osmdatafilepaths', self.osmdatafilepaths + print ' nxnetworkpaths', self.nxnetworkpaths + net = self.get_scenario().net + self._net = net + self._map_id_edge_sumo_to_doubles = {} + self.edges_osm = {} + self.nodes_osm = {} + + projparams_target = net.get_projparams() + if projparams_target in ("", "!"): + projparams_target = None + + for filepath in self.osmdatafilepaths.split(','): + self.import_osmdata(json.loads(open(filepath).read())) + + for filepath in self.nxnetworkpaths.split(','): # filepathstring_to_filepathlist(self.nxnetworkpaths): + graphx = load_objfile(filepath.strip()) + self.import_nx(graphx, projparams=projparams_target) + + net.edges.update(is_update_lanes=True) + + return True + + def import_osmdata(self, osmdata): + edges_osm = self.edges_osm + nodes_osm = self.nodes_osm + for element in osmdata['elements']: + # {u'nodes': [5340543333L, 5340543332L], u'type': u'way', u'id': 553233159, u'tags': {u'highway': u'service', u'oneway': u'no', u'service': u'driveway', u'surface': u'asphalt', u'incline': u'up'}} + # {u'lat': 47.6038005, u'type': u'node', u'lon': 7.6006465, u'id': 453208, u'tags': {u'ref': u'69', u'name': u'Weil am Rhein / H\xfcningen', u'highway': u'motorway_junction'}} + # print ' parse element',element['id'],element['type'] + if element['type'] == 'way': + if element.has_key('tags'): + highway = element['tags'].get('highway', 'road') + else: + highway = 'road' + print ' '+70*'-' + print ' way', element['id'], type(element['id']), highway + edges_osm[str(element['id'])] = ROADCLASSES.get(highway, Road)(element, self) + print ' done with way', element['id'], id(self.edges_osm[str(element['id'])]) + + if element['type'] == 'node': + nodes_osm[element['id']] = element.get('tags', {}) + + print ' import_osmdata:done' + + # def get_id_edge_sumo(self, osmid): + # idmap = self._map_id_edge_sumo_to_doubles + # if idmap.has_key(osmid): + # idmap[osmid] +=1 + # else: + # idmap[osmid] = 0 + # return (osmid, idmap[osmid]) + # #return str(osmid)+'#'+str(idmap[osmid]) + + def get_edgenumber(self, osmid_dir): + idmap = self._map_id_edge_sumo_to_doubles + if idmap.has_key(osmid_dir): + idmap[osmid_dir] += 1 + else: + idmap[osmid_dir] = 0 + return idmap[osmid_dir] + + def get_id_edge_sumo(self, osmid_dir): + edgenumber = self.get_edgenumber(osmid_dir) + return osmid_dir+'#'+str(edgenumber) + + def get_id_edge_osm_from_id_sumo(self, id_sumo): + """ + Returns from id_sumo: + (id_osm, is_opp, num) + """ + data = id_sumo.split('#') + if data[0][0] == '-': + return data[0][1:], True, int(data[1]) + else: + return data[0], False, int(data[1]) + + def is_edge_eligible(self, id_osm, id_fromnode_sumo, id_tonode_sumo): + + # print 'is_edge_eligible',id_osm,type(id_osm),id_fromnode_sumo, id_tonode_sumo,self.edges_osm.has_key(id_osm),self._edgelookup.has_key(id_osm) + if not self.edges_osm.has_key(id_osm): + # for some reason, nx network has edges that are not in jason + return False + + edgelookup = self._edgelookup + + if edgelookup.has_key(id_osm): + # is reverse already in database + # print ' check',edgelookup[id_osm], (id_tonode_sumo, id_fromnode_sumo) in edgelookup[id_osm] + edgelookup[id_osm].add((id_fromnode_sumo, id_tonode_sumo)) + if (id_tonode_sumo, id_fromnode_sumo) in edgelookup[id_osm]: + return False + else: + return True + + else: + edgelookup[id_osm] = set([(id_fromnode_sumo, id_tonode_sumo)]) + return True + + def make_segment_edge_map(self): + """ + Generates a vertex matrix with line segments of all edges + and a map that maps each line segment to edge index. + """ + polylines = self._edgeshapes + n_edges = len(polylines) + inds = np.arange(n_edges) + #ids = inds+1 + print 'make_linevertices', n_edges + + linevertices = np.zeros((0, 2, 3), np.float32) + vertexinds = np.zeros((0, 2), np.int32) + polyinds = [] + + lineinds = [] + linebeginstyles = [] + lineendstyles = [] + + i = 0 + ind_line = 0 + + for ind in inds: + + # if is_laneshapes: + # polyline = laneshapes[ids_lanes[ind][0]] + # else: + polyline = polylines[ind] + + n_seg = len(polyline) + # print ' =======',n_seg#,polyline + + if n_seg > 1: + polyvinds = range(n_seg) + # print ' polyvinds\n',polyvinds + vi = np.zeros((2*n_seg-2), np.int32) + vi[0] = polyvinds[0] + vi[-1] = polyvinds[-1] + + # Important type conversion!! + v = np.zeros((2*n_seg-2, 3), np.float32) + v[0] = polyline[0] + v[-1] = polyline[-1] + if len(v) > 2: + + v[1:-1] = np.repeat(polyline[1:-1], 2, 0) + vi[1:-1] = np.repeat(polyvinds[1:-1], 2) + + n_lines = len(v)/2 + # print ' v\n',v + polyinds += n_lines*[ind] + lineinds.append(np.arange(ind_line, ind_line+n_lines)) + ind_line += n_lines + + else: + # empty polygon treatment + v = np.zeros((0, 3), np.float32) + vi = np.zeros((0), np.int32) + + linevertices = np.concatenate((linevertices, v.reshape((-1, 2, 3)))) + vertexinds = np.concatenate((vertexinds, vi.reshape((-1, 2)))) + # print ' linevertex\n',linevertices + i += 1 + + #self._segvertices = linevertices + self._edgeinds = np.array(polyinds, np.int32) + self._seginds = lineinds + self._segvertexinds = np.array(vertexinds, np.int32) + + self._x1 = linevertices[:, 0, 0] + self._y1 = linevertices[:, 0, 1] + + self._x2 = linevertices[:, 1, 0] + self._y2 = linevertices[:, 1, 1] + + def get_closest_edge_dist(self, p, ind_shape, n_best=0, d_min=0.5, alpha_min=1.0*np.pi/180, d_max=None): + """ + Returns edge id which is closest to point p. + Requires execution of make_segment_edge_map + """ + # print ' x1', x1 + # print ' x2', x2 + #halfwidths = 0.5*self.get_widths_array()[self._polyinds] + x1, y1, x2, y2 = self._x1, self._y1, self._x2, self._y2 + d2 = get_dist_point_to_segs(p[0:2], x1, y1, x2, y2, is_ending=True) + # print ' min(d2)=',np.min(d2),'argmin=',np.argmin(d2),self.get_ids(self._edgeinds[np.argmin(d2)]) + + d2[self._seginds[ind_shape]] = np.inf + #d2[d2<0.5] = np.inf + + # check side + v1 = np.concatenate(((x2-x1).reshape(1, -1), (y2-y1).reshape(1, -1)), 0) + v2 = np.concatenate(((p[0]-x1).reshape(1, -1), (p[1]-y1).reshape(1, -1)), 0) + angles = get_diff_angle_clockwise(v1, v2) + #d2[angles2): + print ' check edge id_edge_osm', ids_edge_sumo[ind], 'no cycleped', (road.highway not in ['cycleway', 'path', 'pedestrian', 'stairs', 'steps', 'platform']), 'has sidewalk', (road.has_sidewalks(False) | road.has_sidewalks(True)) + # if (road.has_sidewalks(False)|road.has_sidewalks(True))\ + # &(road.highway not in ['cycleway','path','pedestrian','stairs','steps','platform']): + if 1: # (road.highway not in ['path','pedestrian','stairs','steps','platform','footway']): + print ' add_edge', ids_edge_sumo[ind], 'id_fromnode', id_fromnode, 'id_tonode', id_tonode, 'ind', ind + + shapearray = np.array(shape, dtype=np.float32) + delta_out = shapearray[1]-shapearray[0] + delta_in = shapearray[-2]-shapearray[-1] + digraph.add_edge(id_fromnode, id_tonode, + id_edge_osm=id_edge_osm, + id_edge_sumo=ids_edge_sumo[ind], + ind=ind, + angle_out=np.arctan2(delta_out[0], delta_out[1]), + angle_in=np.arctan2(delta_in[0], delta_in[1]), + #road = road, + ) + + #graph.add_edge(id_tonode, id_fromnode, id_edge_osm= id_edge_osm) + #digraph.add_edge(id_fromnode, id_tonode ) + + # print ' graph.nodes()',graph.nodes() + for id_fromnode, tonodes in digraph.adj.items(): + print ' investigate id_fromnode', id_fromnode + # dictionary with id_nnode as key and outgoing angle as value + # if id_nnode is negative then the direction if from + # incoming edge from node -id_nnode + directiondata = [] + for id_tonode, edge in tonodes.items(): + # print ' id_tonode',id_tonode + directiondata.append((edge['angle_out'], id_tonode, edge['id_edge_sumo'])) + + for id_node1, id_node2, edge in digraph.in_edges(id_fromnode, data=True): + # print ' id_node1, id_node2',id_node1, id_node2 + directiondata.append((edge['angle_in'], -id_node1, edge['id_edge_sumo'])) + + directiondata.sort() + dirind_to_node = OrderedDict() + node_to_dirind = OrderedDict() + i = 0 + for angle, id_node, id_edge_sumo in directiondata: + print ' ', i, 'id_node', id_node, 'angle', angle, 'id_edge_sumo', id_edge_sumo + dirind_to_node[i] = id_node + node_to_dirind[id_node] = i + i += 1 + # + digraph.node[id_fromnode]['dirind_to_node'] = dirind_to_node + digraph.node[id_fromnode]['node_to_dirind'] = node_to_dirind + + # detect circular structures + for id_node in list(digraph.nodes_iter()): + + node = digraph.node[id_node] + print '\n find loops for node', id_node # ,node['dirind_to_node'] + for ind, id_nbnode in node['dirind_to_node'].iteritems(): + + if id_nbnode < 0: + # incoming + ids_node = [id_node, -id_nbnode] + ids_nodepairs = [(-id_nbnode, id_node)] + # else: + # # outgoing + # ids_nodepairs = [(id_node, id_nbnode)] + # ids_node = [id_node, id_nbnode] + + ids_nodepairs = get_loop(digraph, ids_node, ids_nodepairs, n_node_max=self.n_node_sidewalkremove) + + if len(ids_nodepairs) > 2: + + # coords of nodes..... + #inds_edge_main, dists,angles = self.get_closest_edge_dist(point, ind, n_best = 20, d_max = dist_min_detect_cross) + # for ind_edge_main, dist, angle in zip(inds_edge_main, dists,angles): + # id_edge_osm_main,is_opp, nr = self.get_id_edge_osm_from_id_sumo(ids_edge_sumo[ind_edge_main]) + + for id_node, ids_nodepair in zip(ids_node[1:], ids_nodepairs): + id_fromnode, id_tonone = ids_nodepair + edge = digraph[id_fromnode][id_tonone] + id_sumo = edge['id_edge_sumo'] + if id_tonone == id_node: + are_remove_sidewalk[id_sumo] = 1 # remove sidewalk from left + + else: + if are_remove_sidewalk.has_key(id_sumo): + pass + # if are_remove_sidewalk[id_sumo] == 1: + # # let remove from left + # pass + # else: + # # remove from right + # are_remove_sidewalk[id_sumo] = 2# remove sidewalk from right + else: + are_remove_sidewalk[id_sumo] = 2 # remove sidewalk from right + + print ' found edge', id_sumo, id_fromnode, id_tonone, id_node, 'is_remove_sidewalk', are_remove_sidewalk[id_sumo] + + def configure_roundabouts(self): + print 'configure_roundabouts' + nodes = self._net.nodes + roundabouts = [] + edges_osm = self.edges_osm + ids_edge_osm = self._ids_edge_osm + ids_edge_sumo = self._ids_edge_sumo + ids_tonode = self._ids_tonode + ids_fromnode = self._ids_fromnode + shapes = self._edgeshapes + are_remove_sidewalk = self.are_remove_sidewalk + alpha_crit = 90.0*np.pi/180.0 + + graph = nx.Graph() + digraph = nx.DiGraph() + #junctionnet = {} + for ind, id_edge_osm, shape, id_fromnode, id_tonode in zip(np.arange(len(ids_edge_osm)), ids_edge_osm, self._edgeshapes, ids_fromnode, ids_tonode): + road = edges_osm[id_edge_osm] + if road.is_roundabout(): # & (len(shape)>2): + graph.add_edge(id_fromnode, id_tonode, ind=ind) + digraph.add_edge(id_fromnode, id_tonode, ind=ind) + + # print ' graph.nodes()',graph.nodes() + #ids_node_junctions = [[]] + + for ids_node_junction_list in nx.cycle_basis(graph): + + if len(ids_node_junction_list) > 3: # at least 4 nodes for roundabout + # print ' ids_node_junction_list',ids_node_junction_list + ids_node_junction = np.array(ids_node_junction_list, dtype=np.int32) + + coords = nodes.coords[ids_node_junction] + center = np.mean(coords, 0) + deltas = coords-center + angles = np.arctan2(deltas[:, 0], deltas[:, 1]) + inds = np.argsort(angles, axis=0)[::-1] # reverse order + # print ' inds',inds + # print ' angels',angles[inds] + # print ' ids_node_junction',ids_node_junction[inds] + # print ' len(graph)',len(graph) + ids_node_ok = list(ids_node_junction[inds]) + ids_node_ok.append(ids_node_ok[0]) + #n_node = len(ids_node_ok) + # for ind in xrange(len(ids_node_ok)): + # if digraph.has_edge() + + ids_rbsedges_sumo = [] + for id_fromnode, id_tonode in zip(ids_node_ok[:-1], ids_node_ok[1:]): + + ind = graph[id_tonode][id_fromnode]['ind'] + if not digraph.has_edge(id_fromnode, id_tonode): + # print ' flip',ids_edge_sumo[ind] + # print ' shapes',shapes[ind] + # print ' shapes',shapes[ind][::-1] + ids_tonode[ind] = id_tonode + ids_fromnode[ind] = id_fromnode + shapes[ind][:] = shapes[ind][::-1] + + ids_rbsedges_sumo.append(ids_edge_sumo[ind]) + are_remove_sidewalk[ids_edge_sumo[ind]] = 1 # remove left sidewalk + + roundabouts.append((ids_rbsedges_sumo, ids_node_ok)) + + #data = np.concatenate((angles.reshape(-1,1), ids_node_junction).reshape(-1,1),0) + # graph.remove_nodes_from(ids_node_junction) + self._roundabouts = roundabouts + + def get_id_osm_maindir(self, id_osm): + if id_osm[0] == '-': + return id_osm[1:] + else: + return id_osm + + def check_consistency(self): + print 'check_consistency' + nodelookup = {} + + for ind, id_fromnode, id_tonode, id_edge_sumo in zip(np.arange(len(self._ids_edge_sumo)), self._ids_fromnode, self._ids_tonode, self._ids_edge_sumo): + ids_fromtonode = (id_fromnode, id_tonode) + if nodelookup.has_key(ids_fromtonode): + print ' WARNING: %s double edge to %s detected' % (id_edge_sumo, nodelookup[ids_fromtonode]), 'from', id_fromnode, 'to', id_tonode, 'id_edge_sumo', id_edge_sumo, nodelookup[ids_fromtonode] == id_edge_sumo + if nodelookup[ids_fromtonode] == id_edge_sumo: + # meand 2 edges with identical ID + self._are_edge_valid[ind] = False + + nodelookup[ids_fromtonode] = id_edge_sumo + + def configure_footpath(self): + + are_edge_valid = self._are_edge_valid + edges_osm = self.edges_osm + ids_edge_osm = self._ids_edge_osm + ids_edge_sumo = self._ids_edge_sumo + footpath_condig = ('footway', 'path', 'pedestrian') + footpath_nomerge = ('footway', 'path', 'pedestrian', 'stairs', 'steps', + 'platform', 'primary_link', 'secondary_link') + footpath_merge_cross = ('cycleway',) + prio_max = 7 + dist_min_detect = 15.0 + dist_min_detect_cross = 3.0 + dist_min_remove = 0.0 + + n_best = 10 + + length_max_cross = 30.0 + + alpha_crit = 30.0*np.pi/180.0 + alpha_crit_cross = 30.0*np.pi/180.0 + print 'configure_footpath alpha_crit', alpha_crit + #self.id_mode = ID_MODE_PED + # highway=footway|path + #self.highway = self._osmattrs.get('highway','footway') + + # Use footway=crossing for places where the footway crosses a street. + # Use footway=sidewalk + for ind, id_edge_osm, shape, length in zip(np.arange(len(ids_edge_osm)), ids_edge_osm, self._edgeshapes, self._length): + road = edges_osm[id_edge_osm] + + if road.highway in footpath_condig: + print ' check edge', ids_edge_sumo[ind], road.footway, (road.get_osmattr('tunnel') != 'yes'), (length > dist_min_remove), length + #(road.footway != 'crossing') (road.footway != 'sidewalk') + ids_osm_main = set() + is_remove = True + ip = 0 + + if 0: # (road.footway == 'sidewalk'): + # spacial sidewal merge. Sidewalks must be merged + # to a main road + for i in range(0, len(shape)): + point = shape[i] + is_foundmatch = False + inds_edge_main, dists, angles = self.get_closest_edge_dist( + point, ind, n_best=20, d_max=dist_min_detect) + #matchdata = {} + print ' check sidewalk point (%d/%d)' % (i+1, len(shape)) + for ind_edge_main, dist, angle in zip(inds_edge_main, dists, angles): + id_edge_osm_main, is_opp, nr = self.get_id_edge_osm_from_id_sumo( + ids_edge_sumo[ind_edge_main]) + road_main = edges_osm[id_edge_osm_main] + prio = road_main.get_priority(is_opp) + print ' check medge %s d=%.1fm al=%.1f' % (ids_edge_sumo[ind_edge_main], dist, angle/np.pi*180), prio, road_main.highway, (angle < alpha_crit), (dist < 2*dist_min_detect), (road_main.highway not in footpath_nomerge) + # print ' p1',shape[i-1],'pc',point,'p2',shape[i] + if (angle < 2*alpha_crit) & (dist < dist_min_detect) & (road_main.highway not in footpath_nomerge): + print ' add edge main edge %s' % ids_edge_sumo[ind_edge_main], (id_edge_osm_main, is_opp) + ids_osm_main.add((id_edge_osm_main, is_opp)) + is_foundmatch = True + break + + is_remove = len(ids_osm_main) > 0 + + elif 0: # (road.footway != 'crossing')|(length > length_max_cross): + # normal footpath merge + + if (road.get_osmattr('tunnel') != 'yes') & (length > dist_min_remove): + + for i in range(1, len(shape)): + point = shape[i-1]+0.5*(shape[i]-shape[i-1]) + is_foundmatch = False + inds_edge_main, dists, angles = self.get_closest_edge_dist( + point, ind, n_best=20, d_max=dist_min_detect) + print ' check footpath point (%d/%d)' % (i+1, len(shape)) + for ind_edge_main, dist, angle in zip(inds_edge_main, dists, angles): + id_edge_osm_main, is_opp, nr = self.get_id_edge_osm_from_id_sumo( + ids_edge_sumo[ind_edge_main]) + road_main = edges_osm[id_edge_osm_main] + prio = road_main.get_priority(is_opp) + print ' check medge %s d=%.1fm al=%.1f,%.2f' % (ids_edge_sumo[ind_edge_main], dist, angle/np.pi*180, angle), prio, road_main.highway, (angle < alpha_crit), (dist < dist_min_detect), (road_main.highway not in footpath_nomerge) + # print ' p1',shape[i-1],'pc',point,'p2',shape[i] + if (prio <= prio_max) & (angle < alpha_crit) & (dist < dist_min_detect) & (road_main.highway not in footpath_nomerge): + print ' add edge main edge %s' % ids_edge_sumo[ind_edge_main], (id_edge_osm_main, is_opp) + ids_osm_main.add((id_edge_osm_main, is_opp)) + is_foundmatch = True + break + + if not is_foundmatch: + ids_osm_main = set() + is_remove = False + break + else: + is_remove = False + + else: + # special merge at crossings + if (road.get_osmattr('tunnel') != 'yes'): + + for i in range(1, len(shape)): + point = shape[i-1]+0.5*(shape[i]-shape[i-1]) + is_foundmatch = False + inds_edge_main, dists, angles = self.get_closest_edge_dist( + point, ind, n_best=20, d_max=dist_min_detect_cross) + print ' check crossing point (%d/%d)' % (i+1, len(shape)) + for ind_edge_main, dist, angle in zip(inds_edge_main, dists, angles): + id_edge_osm_main, is_opp, nr = self.get_id_edge_osm_from_id_sumo( + ids_edge_sumo[ind_edge_main]) + road_main = edges_osm[id_edge_osm_main] + prio = road_main.get_priority(is_opp) + print ' check medge %s d=%.1fm al=%.1f' % (ids_edge_sumo[ind_edge_main], dist, angle/np.pi*180), prio, road_main.highway, (angle < alpha_crit_cross), (dist < dist_min_detect_cross), (road_main.highway in footpath_merge_cross) + # print ' p1',shape[i-1],'pc',point,'p2',shape[i] + # if (prio<=prio_max)&(((angle 0: + return int(id_osm_str.split(';')[0]) + else: + return int(id_osm_str) + else: + return id_osm_str + + def _get_osmid_from_nxattr(self, attrs): + id_osm_data = attrs['osmid'] + + if hasattr(id_osm_data, '__iter__'): + return str(id_osm_data[0]) + else: + return str(id_osm_data) + + def is_reverse(self, id_osm, id_fromnode, id_tonode): + """ + Method to detect whether osm edge got reversed in osmnx + with respect to OSM data. + """ + + ids_osmnode = self.edges_osm[id_osm].ids_osmnode + # print 'is_revese id_fromnode_sumo, id_tonode_sumo',id_fromnode, id_tonode,ids_osmnode + if id_fromnode in ids_osmnode: + ind_from = ids_osmnode.index(id_fromnode) + + else: + ind_from = -np.inf + + if id_tonode in ids_osmnode: + ind_to = ids_osmnode.index(id_tonode) + else: + ind_to = np.inf + # print ' ind_from',ind_from,'ind_to',ind_to,'return', ind_from > ind_to + return ind_from > ind_to + + def import_nx(self, graphx, projparams=None, offset=None, highway_bidir=['rail', ]): + """ + Import an networkx graph into net + """ + print 'import_nx' + net = self._net + edges_osm = self.edges_osm + nodes_osm = self.nodes_osm + idmap = self._map_id_edge_sumo_to_doubles + get_id_mode = net.modes.get_id_mode + + if not hasattr(graphx, 'adj'): + graphx.adj = graphx._adj + + if not hasattr(graphx, 'node'): + graphx.node = graphx._node + + # initialize main vectors + #n_nodes = len(graphx.adj) + #ids_nodes_sumo = np.zeros(n_nodes, dtype = np.object) + #ids_nodes_sumo = np.array(graphx.adj.keys(), dtype = np.int32) + gxnodes = graphx.node + nodes = net.nodes + edges = net.edges + n_node = len(graphx.adj) + ids_node = net.nodes.add_rows(n_node) + + id_sumonodetypes = nodes.types.choices + id_nodetype_default = id_sumonodetypes['priority'] + id_nodetype_tl = id_sumonodetypes['traffic_light'] + nodetypemap = {'motorway_junction': id_sumonodetypes['zipper'], + 'traffic_signals': id_sumonodetypes['traffic_light'], + 'crossing': id_sumonodetypes['priority'], + 'turning_circle': id_sumonodetypes['dead_end'], + 'turning_loop': id_sumonodetypes['dead_end'], + 'miniroundabout': id_sumonodetypes['priority'], + 'stop': id_sumonodetypes['allway_stop'], + } + + lonlats_node = np.zeros((n_node, 2), dtype=np.float32) + ids_node_sumo = np.zeros(n_node, dtype=np.object) + nodetypes = np.zeros(n_node, dtype=np.int32) + elevation = np.zeros(n_node, dtype=np.float32) + #nodetype = np.zeros(n_node, dtype = np.object) + + # for id_sumo, nodedict in zip(nodes.ids_sumo[ids_node],: + + #ids_node_sumo = np.zeros(n_node, dtype = np.int32) + + i_node = -1 + for id_fromnode, id_fromnode_sumo, outgoingdicts in zip(ids_node, graphx.adj.keys(), graphx.adj.values()): + i_node += 1 + #ids_node_sumo[i_node] = id_fromnode_sumo + print ' ', id_fromnode, id_fromnode_sumo, gxnodes[id_fromnode_sumo] # nodes.ids_sumo[id_fromnode] + lonlats_node[i_node] = [gxnodes[id_fromnode_sumo]['x'], gxnodes[id_fromnode_sumo]['y']] + ids_node_sumo[i_node] = str(id_fromnode_sumo) + elevation[i_node] = float(gxnodes[id_fromnode_sumo].get('elevation', 0.0)) + nxnodetype = gxnodes[id_fromnode_sumo].get('highway', 'default') + # if nxnodetype == 'crossing':... + # if nxnodetype = 'bus_stop' + # TODO:!!! pay attention to zipper nodes and check that there + # are only 2 incoming edges + nodetypes[i_node] = nodetypemap.get(nxnodetype, id_nodetype_default) + + nodes.ids_sumo[ids_node] = ids_node_sumo + nodes.types[ids_node] = nodetypes + nodes.types_tl[ids_node[nodetypes == id_nodetype_tl]] = nodes.types_tl.choices['static'] + + if projparams is None: + print ' take first node to estimate projection', (lonlats_node[0][0], lonlats_node[0][1]) + projparams = guess_utm_from_coord([lonlats_node[0][0], lonlats_node[0][1]]) + print ' projparams', projparams + proj = pyproj.Proj(projparams) + net.set_projparams(projparams) + + xx, yy = proj(lonlats_node[:, 0], lonlats_node[:, 1]) + zz = elevation + if offset == None: + offset = np.array([-np.min(xx), -np.min(yy)], dtype=np.float32) + offset3d = np.array([-np.min(xx), -np.min(yy), 0.0], dtype=np.float32) + net.set_offset(offset) + + # Format of Boundary box [MinX, MinY ,MaxX, MaxY ] + net.set_boundaries([0, 0, np.max(xx)+offset[0], np.max(yy)+offset[1]], + [np.min(lonlats_node[:, 0]), np.min(lonlats_node[:, 1]), np.max(lonlats_node[:, 0]), np.max(lonlats_node[:, 1])]) + + # print ' nodes.coords[ids_node].shape', nodes.coords[ids_node].shape + # print ' (xx+offset[0]).shape', (xx+offset[0]).shape + + #nodes.coords[ids_node][:,0] = xx+offset[0] + #nodes.coords[ids_node][:,1] = yy+offset[1] + + # print ' xx',np.array(xx, dtype = np.float32).reshape(-1,1).shape + # print ' yy',np.array(yy, dtype = np.float32).reshape(-1,1).shape + # print ' zz.reshape(-1,1)',zz.reshape(-1,1).shape + nodes.coords[ids_node] = np.concatenate((np.array(xx, dtype=np.float32).reshape(-1, 1), + np.array(yy, dtype=np.float32).reshape(-1, 1), + zz.reshape(-1, 1)), 1) + offset3d + + ids_edge_sumo = [] # np.zeros(n_edge, dtype = np.object) + ids_edge_osm = [] # np.zeros(n_edge, dtype = np.int32) + inds_edge_opp = [] # -1*np.ones(n_edge, dtype = np.int32) + + ids_fromnode = [] # np.zeros(n_edge, dtype = np.int32) + ids_tonode = [] # np.zeros(n_edge, dtype = np.int32) + #lengths = np.zeros(n_edge, dtype = np.float32) + shapes = [] # np.zeros(n_edge, dtype = np.object) + #names = np.zeros(n_edge, dtype = np.object) + # types_spread = np.zeros(n_edge, dtype = np.object) # 0=center, 1 = right + get_id_node = nodes.ids_sumo.get_id_from_index + i_edge = -1 + i_node = -1 + + # dictionary with id_osm as key and (id_fromnode,id_tonode) as value + # this is to prevent, that a return way with the same id_osm + # is being created + self._edgelookup = {} + + # debug + self._nodelookup = {} + + for id_fromnode, id_fromnode_sumo, outgoingdicts in zip(ids_node, graphx.adj.keys(), graphx.adj.values()): + i_node += 1 + # print ' id_fromnode_sumo',i_node, id_fromnode, id_fromnode_sumo + for id_tonode_sumo, edgedatalist in outgoingdicts.iteritems(): + + edgeattrs = edgedatalist[0] + + id_osm = self._get_osmid_from_nxattr(edgeattrs) + + if self.is_edge_eligible(id_osm, id_fromnode_sumo, id_tonode_sumo): + + id_tonode = get_id_node(str(id_tonode_sumo)) + + if edgeattrs.has_key('geometry'): + # print ' geometry',edgeattrs['geometry'] + lonlats = edgeattrs['geometry'].xy + xx, yy = proj(lonlats[0], lonlats[1]) + zz = np.zeros((len(xx), 1), dtype=np.float32) + # print ' xx',xx + # print ' yy',yy + # print ' zz',zz + shape1 = np.concatenate((np.array(xx, dtype=np.float32).reshape(-1, 1), + np.array(yy, dtype=np.float32).reshape(-1, 1), + zz), 1) + offset3d + + # elevation interpolation + # print ' shape1',shape1 + # print ' dists',np.sqrt(np.sum((shape1[1:,:]-shape1[:-1,:])**2,1)) + cumlength = np.cumsum(np.sqrt(np.sum((shape1[1:, :]-shape1[:-1, :])**2, 1))) + # print ' cumlength',cumlength + length = cumlength[-1] + vfrom, vto = nodes.coords[[id_fromnode, id_tonode]] + height_delta = vto[2]-vfrom[2] + height_offset = vfrom[2] + height = height_offset+cumlength/length*height_delta + + # print ' cumlength.shape',cumlength.shape + # print ' height_offset',height_offset + # print ' height_delta',height_delta + + # print ' height',height.shape,height + shape1[0, 2] = height_offset + shape1[1:, 2] = height + + else: + shape1 = nodes.coords[[id_fromnode, id_tonode]] + + # + # make foreward edge + + # print ' shape=\n',list(shape) + # print ' shape=\n',list(shape) + i_edge += 1 + ids_edge_osm.append(id_osm) + #edgenum = get_edgenumber(id_osm) + ids_edge_sumo.append(self.get_id_edge_sumo(id_osm)) + + road = edges_osm[id_osm] + + is_oneway = road.is_oneway() + print ' check id_osm', id_osm, 'is_oneway', is_oneway, "id_fromnode_sumo %s id_tonode_sumo %s" % (id_fromnode_sumo, id_tonode_sumo) + if is_oneway: + is_reverse = False + shapes.append(list(shape1)) + ids_fromnode.append(id_fromnode) + ids_tonode.append(id_tonode) + + else: + is_reverse = self.is_reverse(id_osm, id_fromnode_sumo, id_tonode_sumo) + print 'is_revese', is_reverse, edges_osm[id_osm].ids_osmnode + + # if (not is_oneway) & is_reverse:#self.is_reverse(id_osm, id_fromnode_sumo, id_tonode_sumo): + if is_reverse: + #shape1 = shape1[::-1] + shapes.append(list(shape1)[::-1]) + ids_fromnode.append(id_tonode) + ids_tonode.append(id_fromnode) + print ' created edge %s from' % ids_edge_sumo[-1], id_tonode_sumo, 'to', id_fromnode_sumo + #id_node_temp = id_fromnode + #id_fromnode = id_tonode + #id_tonode = id_node_temp + else: + shapes.append(list(shape1)) + ids_fromnode.append(id_fromnode) + ids_tonode.append(id_tonode) + print ' created edge %s from' % ids_edge_sumo[-1], id_fromnode_sumo, 'to', id_tonode_sumo + # ids_fromnode.append(id_fromnode) + # ids_tonode.append(id_tonode) + + # print ' id_osm,id(road)', id_osm, id(road), ids_edge_osm[i_edge] + + if not is_oneway: + # set edge for opposite direction + inds_edge_opp.append(i_edge + 1) # index of opposite edge + i_edge += 1 + if is_reverse: + shapes.append(list(shape1)) + ids_fromnode.append(id_fromnode) + ids_tonode.append(id_tonode) + else: + shapes.append(list(shape1)[::-1]) + ids_fromnode.append(id_tonode) + ids_tonode.append(id_fromnode) + + ids_edge_sumo.append(self.get_id_edge_sumo('-'+id_osm)) + ids_edge_osm.append(id_osm) + inds_edge_opp.append(-2) # mark that this is the opposite edge + print ' created reverse ids_edge_sumo', ids_edge_sumo[i_edge], 'from', ids_fromnode[-1], 'to', ids_tonode[-1] + + else: + inds_edge_opp.append(-1) + + self._are_edge_valid = np.ones(len(ids_edge_sumo), dtype=np.bool) + are_remove_sidewalk = {} # np.zeros(len(self._are_edge_valid), dtype = np.int32) + self.are_remove_sidewalk = are_remove_sidewalk + + # print ' inds_valid before',inds_valid + self._edgeshapes = np.array(shapes, dtype=np.object) + #ids_edge_osm_to_inds = {} + # for id_edge_osm, ind in zip(ids_edge_osm, np.arange(len(ids_edge_osm), dtype = np.int32)): + # ids_edge_osm_to_inds[id_edge_osm] = ind + #self._ids_edge_osm_to_inds = ids_edge_osm_to_inds + self._ids_edge_osm = np.array(ids_edge_osm, dtype=np.object) + self._ids_edge_sumo = np.array(ids_edge_sumo, dtype=np.object) + self._length = get_length_polypoints(self._edgeshapes) + + self._ids_fromnode = np.array(ids_fromnode, dtype=np.int32) + self._ids_tonode = np.array(ids_tonode, dtype=np.int32) + self.make_segment_edge_map() + + self.check_consistency() + self.configure_roundabouts() + + if self.is_simplify_footpath: + self.configure_sidewalks() + self.configure_footpath() + + inds_valid = np.flatnonzero(self._are_edge_valid) + n_edge = len(inds_valid) + #ids_edge_sumo_remove_sidewalk = self._ids_edge_sumo[are_remove_sidewalk] + + # print ' n_edge',n_edge,'of',len(ids_edge_sumo) + # print ' inds_valid',inds_valid + # print ' shapes', shapes + ids_edges = edges.multimake(self._ids_edge_sumo[inds_valid], + ids_fromnode=self._ids_fromnode[inds_valid], + ids_tonode=self._ids_tonode[inds_valid], + #lengths = lengths, + shapes=self._edgeshapes[inds_valid], + #names = names, + ) + + for id_edge, id_fromnode, id_tonode in zip(ids_edges, edges.ids_fromnode[ids_edges], edges.ids_tonode[ids_edges]): + nodes.add_outgoing(id_fromnode, id_edge) + nodes.add_incoming(id_tonode, id_edge) + + # check zipper nodes + id_zipper = id_sumonodetypes['zipper'] + for id_node, nodetype in zip(ids_node, nodes.types[ids_node]): + if nodetype == id_zipper: + ids_incoming = nodes.ids_incoming[id_node] + if ids_incoming is not None: + if len(ids_incoming) > 2: + nodes.types[id_node] = id_nodetype_default + else: + nodes.types[id_node] = id_nodetype_default + + roundabouts = net.roundabouts + for ids_rbedge_sumo, ids_rbnode in self._roundabouts: + # print ' ', + roundabouts.make(ids_edge=edges.ids_sumo.get_ids_from_indices(ids_rbedge_sumo), + ids_node=ids_rbnode, + ) + + # print ' shapes[0:9]',shapes[0:9] + # print ' edges.shapes[1:10]',edges.shapes[1:10] + # print ' edges.shapes.get_value()[0:9]',edges.shapes.get_value()[0:9] + #net.edges.update(is_update_lanes = False) + # enrich edges with osmattributes + # print ' ids_edge_osm',ids_edge_osm + inds = np.arange(len(ids_edges)) + for id_edge, id_edge_osm, ind_edge_opp in zip( + ids_edges, self._ids_edge_osm[inds_valid], + np.array(inds_edge_opp, dtype=np.int32)[inds_valid], + ): + + id_sumo = edges.ids_sumo[id_edge] + + if id_sumo[0] > '-': # it is not an opposite edge + road = edges_osm[id_edge_osm] + + print ' configure way id_edge_osm', id_edge_osm, id_sumo, are_remove_sidewalk.get(id_sumo, 0) + road.configure_edge(id_edge, net, is_remove_sidewalk=are_remove_sidewalk.get(id_sumo, 0)) + #id_edge_opp = self.get_id_edge_opp + id_sumo_opp = '-'+id_sumo + if edges.ids_sumo.has_index(id_sumo_opp): + print ' configure opposite way id_edge_osm', id_edge_osm, id_sumo_opp, are_remove_sidewalk.get(id_sumo_opp, 0) + road.configure_edge(edges.ids_sumo.get_id_from_index(id_sumo_opp), + net, is_opp=True, + is_remove_sidewalk=are_remove_sidewalk.get(id_sumo_opp, 0)) diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/network/osmnx_import.py sumo-1.12.0/tools/contributed/sumopy/coremodules/network/osmnx_import.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/network/osmnx_import.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/network/osmnx_import.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file osmnx_import.py # @author Joerg Schweizer -# @date +# @date 2012 import os diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/network/publictransportnet.py sumo-1.12.0/tools/contributed/sumopy/coremodules/network/publictransportnet.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/network/publictransportnet.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/network/publictransportnet.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,7 +14,7 @@ # @file publictransportnet.py # @author Joerg Schweizer -# @date +# @date 2012 import os import sys @@ -25,12 +25,26 @@ import numpy as np from collections import OrderedDict from coremodules.modules_common import * +#from coremodules.misc import netmatching import agilepy.lib_base.classman as cm import agilepy.lib_base.arrayman as am import agilepy.lib_base.xmlman as xm from agilepy.lib_base.geometry import * from agilepy.lib_base.processes import Process, CmlMixin #from coremodules.network.network import SumoIdsConf, MODES +from agilepy.lib_base.geometry import get_length_polypoints, get_dist_point_to_segs, get_diff_angle_clockwise + +try: + try: + import pyproj + except: + from mpl_toolkits.basemap import pyproj + +except: + pyproj = None + print 'Some of the functions cannot be executed because module pypro or mpl_toolkits.basemap is missing.' + print 'Please install these modules if you want to use it.' + # print __doc__ # example @@ -45,9 +59,12 @@ logger=logger, info='Provides pedestrian (or bike) access to public transport stops.', ) - attrsman = self.set_attrsman(cm.Attrsman(self)) + self.init_accessprovider(**kwargs) + + def init_accessprovider(self, **kwargs): + attrsman = self.get_attrsman() self.is_bikeaccess = attrsman.add(cm.AttrConf('is_bikeaccess', kwargs.get('is_bikeaccess', False), groupnames=['options'], perm='rw', @@ -59,6 +76,10 @@ def do(self): print 'StopAccessProvider.do' + + self.provide_access() + + def provide_access(self): edges = self.parent.edges nodes = self.parent.nodes lanes = self.parent.lanes @@ -86,21 +107,18 @@ # print ' Check access at stop %s lane %d. al='%(id_stop,id_lane) if lanes.get_accesslevel([id_lane], id_mode_ped) == -1: # no pedaccess - print ' add ped access at stop %s lane %d, ID edge SUMO "%s".' % ( - id_stop, id_lane, edges.ids_sumo[id_edge]) + print ' add ped access at stop %s lane %d, ID edge SUMO "%s".' % (id_stop, id_lane, edges.ids_sumo[id_edge]) lanes.add_access(id_lane, id_mode_ped) n_add_access += 1 if self.is_bikeaccess: if lanes.get_accesslevel([id_lane], id_mode_bike) == -1: - print ' add bike access at stop %s lane %d, ID edge SUMO "%s".' % ( - id_stop, id_lane, edges.ids_sumo[id_edge]) + print ' add bike access at stop %s lane %d, ID edge SUMO "%s".' % (id_stop, id_lane, edges.ids_sumo[id_edge]) lanes.add_access(id_lane, id_mode_bike) n_add_access += 1 else: - print 'WARNING: stop %s at edge %d, SUMO ID %s with without access lane.' % ( - id_stop, id_edge, edges.ids_sumo[id_edge]) + print 'WARNING: stop %s at edge %d, SUMO ID %s with without access lane.' % (id_stop, id_edge, edges.ids_sumo[id_edge]) # return False print ' Added access to %d stops' % n_add_access @@ -141,7 +159,7 @@ self.add_col(am.IdsArrayConf('ids_lane', net.lanes, name='ID Lane', - info='ID of lane for this parking position. ', + info='ID of lane for this stop. ', xmltag='lane', )) @@ -285,7 +303,12 @@ # print ' id_stop ',id_stop,coord # print ' ',np.sqrt(np.sum(coords-coord,1)**2) dists = np.sqrt(np.sum((coords-coord)**2, 1)) - inds_prox = dists <= dist_walk_los + inds_prox = (dists <= dist_walk_los) + + # exclude stop itself + ind_stop = ids_stop == id_stop + inds_prox[ind_stop] = False + # inds_prox[ind] = False # avoid putting stop itself stop_proximity[id_stop] = (dists[inds_prox], ids_stop[inds_prox]) ind += 1 @@ -338,7 +361,7 @@ #xmltag, xmltag_item, attrname_id = self.xmltag fd.write('\n' % encoding) indent = 0 - #fd.write(xm.begin('routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://sumo.sf.net/xsd/routes_file.xsd"',indent)) + #fd.write(xm.begin('routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.sf.net/xsd/routes_file.xsd"',indent)) fd.write(xm.begin('additional', indent)) diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/network/publictransportnet_wxgui.py sumo-1.12.0/tools/contributed/sumopy/coremodules/network/publictransportnet_wxgui.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/network/publictransportnet_wxgui.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/network/publictransportnet_wxgui.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,9 +14,10 @@ # @file publictransportnet_wxgui.py # @author Joerg Schweizer -# @date +# @date 2012 import wx +import os import agilepy.lib_base.classman as cm import agilepy.lib_base.arrayman as am from agilepy.lib_wx.ogleditor import * @@ -275,6 +276,11 @@ #bitmap = wx.ArtProvider.GetBitmap(wx.ART_DELETE,wx.ART_MENU), ) + menubar.append_item('network/public transport/import from GTFS...', + self.on_gtfsstop_importer, + bitmap=self.get_agileicon("Document_Import_24px.png"), + ) + menubar.append_item('network/public transport/provide stop access...', self.on_provide_stopaccess, ) @@ -298,8 +304,8 @@ dlg = wx.FileDialog( self._mainframe, message="Open stops XML file", - #defaultDir = self._net.get_workdirpath(), - defaultFile=defaultfilepath, + defaultDir=os.path.dirname(wildcards), + # defaultFile = = defaultfilepath, wildcard=wildcards, style=wx.OPEN | wx.CHANGE_DIR ) @@ -336,6 +342,34 @@ self._mainframe.browse_obj(self._net.ptstops) self._mainframe.refresh_moduleguis() + def on_gtfsstop_importer(self, event=None): + """ + Make sure, all public transport stops are accessible by foot or bike + from the road network. + """ + p = pt.GtfsStopImporter(self._net, logger=self._mainframe.get_logger()) + dlg = ProcessDialog(self._mainframe, p, immediate_apply=True) + + dlg.CenterOnScreen() + + # this does not return until the dialog is closed. + val = dlg.ShowModal() + # print ' val,val == wx.ID_OK',val,wx.ID_OK,wx.ID_CANCEL,val == wx.ID_CANCEL + # print ' status =',dlg.get_status() + if dlg.get_status() != 'success': # val == wx.ID_CANCEL: + print ">>>>>>>>>Unsuccessful\n" + dlg.Destroy() + + if dlg.get_status() == 'success': + print ">>>>>>>>>successful\n" + # apply current widget values to scenario instance + dlg.apply() + dlg.Destroy() + # self._mainframe.browse_obj(self._net.stops) + self._mainframe.refresh_moduleguis() + #self._is_needs_refresh = True + # self.refresh_widgets() + def on_provide_stopaccess(self, event=None): """ Make sure, all public transport stops are accessible by foot or bike diff -Nru sumo-1.11.0/tools/contributed/sumopy/coremodules/network/routing.py sumo-1.12.0/tools/contributed/sumopy/coremodules/network/routing.py --- sumo-1.11.0/tools/contributed/sumopy/coremodules/network/routing.py 2021-11-22 20:09:36.000000000 +0000 +++ sumo-1.12.0/tools/contributed/sumopy/coremodules/network/routing.py 2022-01-24 20:43:50.000000000 +0000 @@ -1,7 +1,7 @@ # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -# Copyright (C) 2016-2021 German Aerospace Center (DLR) and others. +# Copyright (C) 2016-2022 German Aerospace Center (DLR) and others. # SUMOPy module -# Copyright (C) 2012-2017 University of Bologna - DICAM +# Copyright (C) 2012-2021 University of Bologna - DICAM # 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/ @@ -14,12 +14,19 @@ # @file routing.py # @author Joerg Schweizer -# @date +# @date 2012 import os import numpy as np -from agilepy.lib_base.processes import Process, CmlMixin, ff, call + +import agilepy.lib_base.classman as cm +import agilepy.lib_base.arrayman as am +import agilepy.lib_base.xmlman as xm +#from agilepy.lib_base.misc import get_inversemap +#from agilepy.lib_base.geometry import find_area +from agilepy.lib_base.processes import Process, CmlMixin, ff, call, P, filepathlist_to_filepathstring, Options +#from coremodules.network.network import SumoIdsConf class priorityDictionary(dict): @@ -142,7 +149,7 @@ P = {} # est.dist. of non-final vert. - if weights[id_edge_start] < 0: + if np.isnan(weights[id_edge_start]): print ' no access id_edge_start, weights', id_edge_start, weights[id_edge_start] return ([], {}, {}) @@ -176,10 +183,9 @@ newstate += '= 0, D[e] + weights[id_edge] < cost_limit, id_edge not in D, (id_edge not in Q or weight_tot < Q[id_edge]), newstate + print ' id_bedge', id_edge, 'w=%.2f,w_tot=%.2f' % (weights[id_edge], weight_tot), weights[id_edge] >= 0, D[e] + weights[id_edge] < cost_limit, id_edge not in D, (id_edge not in Q or weight_tot < Q[id_edge]), newstate - if weights[id_edge] >= 0: # edge accessible? + if not np.isnan(weights[id_edge]): # edge accessible? weight_tot = D[e] + weights[id_edge] if weight_tot < cost_limit: if id_edge not in D and (id_edge not in Q or weight_tot < Q[id_edge]): @@ -200,6 +206,34 @@ return (ids_origin, D, P) # returns in tree with all reachable destinations +def get_edges_orig_from_tree(id_edge_dest, tree): + """Returns a list of edge origins with destination edge id_edge_dest + from a tree in dictionary form""" + # print 'get_edges_orig_from_tree id_edge_dest',id_edge_dest + ids_orig = [] + ids_edge = [id_edge_dest] + is_cont = True + ids_edge_from = np.array(tree.keys(), dtype=np.int32) + ids_edge_to = np.array(tree.values(), dtype=np.int32) + if id_edge_dest not in ids_edge_to: + return ids_orig + while len(ids_edge) > 0: + # print ' ids_edge',ids_edge + ids_edge_new = [] + for id_edge in ids_edge: + inds = np.flatnonzero(ids_edge_to == id_edge) + # print ' id_edge',id_edge,'inds',inds + if len(inds) == 0: + ids_orig.append(id_edge) + # print ' ids_orig',ids_orig + else: + ids_edge_new += ids_edge_from[inds].tolist() + + ids_edge = ids_edge_new + + return set(ids_orig) + + def edgedijkstra(id_edge_start, ids_edge_target=None, weights=None, fstar=None): """ @@ -217,7 +251,7 @@ P = {} # est.dist. of non-final vert. - if weights[id_edge_start] < 0: + if np.isnan(weights[id_edge_start]): print ' WARNING in edgedijkstra: no access id_edge_start, weights', id_edge_start, weights[id_edge_start] return ({}, {}) @@ -236,7 +270,7 @@ print 'routes = \n', P return (None, P) for id_edge in fstar[e]: - if weights[id_edge] >= 0: # edge accessible? + if not np.isnan(weights[id_edge]): # edge accessible? weight_tot = D[e] + weights[id_edge] if id_edge not in D and (id_edge not in Q or weight_tot < Q[id_edge]): Q[id_edge] = weight_tot @@ -244,13 +278,47 @@ return (D, P) # returns in tree with all reachable destinations +def get_mincostroute_edge2edges(id_rootedge, ids_targetedge, D=None, P=None, + weights=None, fstar=None): + """ + Returns costs and shortest paths from rootedge to a list of targetedges. + D, P could be precalculated for rootnode with function dijkstraPlainEdge + + + """ + if D is None: + D, P = edgedijkstra(id_rootedge, set(ids_targetedge), + weights=weights, fstar=fstar) + routes = [] + costs = [] + for id_targetedge in ids_targetedge: + if P.has_key(id_targetedge): + route = [id_targetedge] + e = id_targetedge + while e != id_rootedge: + id_edge = P[e] + route.append(id_edge) + e = id_edge + # route.append(e) + route.reverse() + routes.append(route) + costs.append(D[id_targetedge]) + else: + # this target edge has not been reached + routes.append([]) + costs.append(-1.0) + + return costs, routes + + def get_mincostroute_edge2edge(id_rootedge, id_targetedge, D=None, P=None, weights=None, fstar=None): """ Returns cost and shortest path from rootedge to a specific targetedge. - D, P must be precalculated for rootnode with function dijkstraPlainEdge + D, P could be precalculated for rootnode with function dijkstraPlainEdge """ + # print 'get_mincostroute_edge2edge',id_rootedge, id_targetedge if D is None: D, P = edgedijkstra(id_rootedge, set([id_targetedge, ]), weights=weights, fstar=fstar) @@ -261,6 +329,7 @@ e = id_targetedge while e != id_rootedge: + # print ' follow',e id_edge = P[e] route.append(id_edge) e = id_edge @@ -292,13 +361,19 @@ return D[id_targetnode], route -def duaroute(tripfilepath, netfilepath, routefilepath, options='-v --ignore-errors'): +def duaroute(tripfilepath, netfilepath, routefilepath, weightfilepath=None, + weightattribute='traveltime', + options='-v --ignore-errors'): """ Simple shortes path duaoute function """ # do not use options: --repair --remove-loops - cmd = 'duarouter '+options+' --trip-files %s --net-file %s --output-file %s'\ + cmd = 'duarouter '+options+' --route-files %s --net-file %s --output-file %s'\ % (ff(tripfilepath), ff(netfilepath), ff(routefilepath)) + + if weightfilepath is not None: + cmd += " --weight-files %s --weight-attribute %s" % (ff(weightfilepath), weightattribute) + return call(cmd) @@ -322,53 +397,10 @@ class RouterMixin(CmlMixin, Process): - def init_tripsrouter(self, ident, net, - trips, - netfilepath=None, - outfilepath=None, - name='Duarouter', - info='Generates routes from trips, flows or previous routes', - is_export_net=True, - logger=None, cml='duarouter'): - - self._init_common(ident, name=name, - parent=net, - logger=logger, - info=info, - ) - - self.init_cml(cml) # pass main shell command - self.is_export_net = is_export_net - self._trips = trips - - if netfilepath is None: - netfilepath = net.get_filepath() - - self.add_option('netfilepath', netfilepath, - groupnames=['_private'], - cml='--net-file', - perm='r', - name='Net file', - wildcards='Net XML files (*.net.xml)|*.net.xml', - metatype='filepath', - info='SUMO Net file in XML format.', - ) - - if outfilepath is None: - outfilepath = trips.get_routefilepath() - - self.add_option('outfilepath', outfilepath, - groupnames=['_private'], - cml='--output-file', - perm='r', - name='Out routefile', - wildcards='Route XML files (*.rou.xml)|*.rou.xml', - metatype='filepath', - info='Output file of the routing process, which is a SUMO route file in XML format.', - ) def init_options_time(self, **kwargs): optiongroup = 'time' + self.add_option('time_begin', kwargs.get('time_begin', -1), groupnames=[optiongroup, 'options', ], name='Start time', @@ -379,7 +411,7 @@ is_enabled=lambda self: self.time_begin >= 0.0, ) - self.add_option('time_end', kwargs.get('time_end', -1), + self.add_option('time_end', kwargs.get('time_end', kwargs.get('time_end', -1)), groupnames=[optiongroup, 'options', ], name='End time', perm='rw', @@ -415,6 +447,13 @@ groupnames=[optiongroup, 'options', ], perm='rw', ) + attrsman = self.get_attrsman() + self.is_update_current_routes = attrsman.add(cm.AttrConf('is_update_current_routes', kwargs.get('is_update_current_routes', True), + groupnames=['options', 'misc'], + perm='rw', + name='Update current routes', + info="Update current routes and or generate current routes if inexistent. If disabeled, new alternative routes are created.", + )) def init_options_processing_dua(self, **kwargs): optiongroup = 'processing' @@ -459,7 +498,7 @@ perm='rw', ) - self.add_option('is_repair_to', kwargs.get('is_repair_from', False), + self.add_option('is_repair_to', kwargs.get('is_repair_to', False), name='Repair end', info='Tries to correct an invalid destination edge by using the last usable edge instead.', cml='--repair.to', @@ -475,16 +514,16 @@ perm='rw', ) - # --weights.interpolate Interpolate edge weights at interval boundaries; default: false - # --weight-period
        \n') addfile.close() @@ -242,30 +316,31 @@ ptstopsfilepath=None, polyfilepath=None, logfilepath='', + cmlfilepath=None, # write command line into this file instead of executing sumo **kwargs): + #self.scenario = scenario + self._cmlfilepath = cmlfilepath self._init_common('sumo', parent=scenario, name='SUMO', logger=logger, info='SUMO micro simulation of scenario.', ) + + # if results is None: + # self._results = Simresults(scenario=scenario) + # else: self._results = results + rootname = scenario.get_rootfilename() rootdirpath = scenario.get_workdirpath() self.configfilepath = os.path.join(rootdirpath, rootname+'.netc.xml') - # if simresults is None: - # self.simresults = Simresults(scenario=scenario) - self.init_cml('xxx', is_run_background=is_run_background, is_nohup=is_nohup) # pass main shell command attrsman = self.get_attrsman() - # print '\nSumo.__init__',kwargs - - #self.scenario = scenario - #self.settings = scenario.settings self.guimode = attrsman.add(cm.AttrConf('guimode', guimode, groupnames=['options', 'misc'], - choices=['sumopy', 'sumopy+map', 'native', 'openscene', 'nogui'], + choices=['sumopy', 'sumopy+map', 'native', 'nogui'], # 'openscene'??? name='GUI mode', perm='rw', info='Gui mode: sumopy = sumopy style, sumopy+map = sumopy theme with backround map, native = Native SUMO gui, openscene = Open street graph, nogui = run without gui window' @@ -281,6 +356,7 @@ perm='rw', info='Start time of simulation in seconds after midnight.', unit='s', + cml='--begin', # no prefix )) self.simtime_end = attrsman.add(cm.AttrConf('simtime_end', kwargs.get('simtime_end', simtime_end_default), @@ -289,25 +365,15 @@ perm='rw', info='End time of simulation in seconds after midnight.', unit='s', + cml='--end', # no prefix )) - self.time_warmup = attrsman.add(cm.AttrConf('time_warmup', kwargs.get('time_warmup', 0.0), - groupnames=['options', 'timing'], - name='Warmup time', - perm='rw', - info='Start recording results after this time.', - metatype='time', - unit='s', - )) - - self.time_step = attrsman.add(cm.AttrConf('time_step', kwargs.get('time_step', 0.2), - groupnames=['options', 'timing'], - name='Time step', - perm='rw', - info='Basic simulation time step (1s by default).', - metatype='time', - unit='s', - )) + self.is_dynaroute = attrsman.add(cm.AttrConf('is_dynaroute', kwargs.get('is_dynaroute', False), + groupnames=['options', 'timing'], + name='Dynamic routing', + perm='rw', + info='Routing is always performed during the simulation on vehicle dearture time, based on current edge travel times. This option corrisponds to the so called one shot assignment.', + )) self.time_to_teleport = attrsman.add(cm.AttrConf('time_to_teleport', kwargs.get('time_to_teleport', -1), groupnames=['options', 'timing'], @@ -318,8 +384,16 @@ + '-1 means no teleporting takes place', metatype='time', unit='s', + cml='--time-to-teleport', )) + self._init_attributes_basic(scenario, **kwargs) + + # print '\nSumo.__init__',kwargs + + #self.scenario = scenario + #self.settings = scenario.settings + self.time_sample = attrsman.add(cm.AttrConf('time_sample', kwargs.get('time_sample', 60), groupnames=['options', 'timing'], name='Output sample time', @@ -329,59 +403,14 @@ unit='s', )) - self.is_dynaroute = attrsman.add(cm.AttrConf('is_dynaroute', kwargs.get('is_dynaroute', False), - groupnames=['options', 'timing'], - name='Dynamic routing', - perm='rw', - info='Routing is always performed during the simulation, based on current edge travel times. This option corrisponds to the so called one shot assignment.', - )) - - # print ' ',scenario.demand.vtypes.lanechangemodel.get_value() - if scenario.demand.vtypes.lanechangemodel.get_value() in ['SL2015', ]: - width_sublanes_default = 1.0 - else: - width_sublanes_default = -1.0 - - self.width_sublanes = attrsman.add(cm.AttrConf('width_sublanes', kwargs.get('width_sublanes', width_sublanes_default), - groupnames=['options', 'edges'], - #cml = '--lateral-resolution', - perm='rw', - name='Sublane width', - unit='m', - info='Width of sublanes. Should be less than lane width. If negative the sublanes are disabeled.', - is_enabled=lambda self: self.width_sublanes > 0, - )) - - self.pedestrian_model = attrsman.add(cm.AttrConf('pedestrian_model', kwargs.get('pedestrian_model', 'striping'), - groupnames=['options', 'parameters'], - name='Pedestrian Model', - choices=['striping', 'nonInteracting', 'None'], - perm='rw', - info='Type of Pedestrian model.', - )) - - self.width_pedestrian_striping = attrsman.add(cm.AttrConf('width_pedestrian_striping', kwargs.get('width_pedestrian_striping', 0.35), - groupnames=['options', 'parameters'], - name='Ped. stripe width', - unit='m', - perm='rw', - info="Width of parallel stripes for segmenting a sidewalk (meters) for use with model 'striping'", - )) - - self.slowdownfactor_pedestrian_striping = attrsman.add(cm.AttrConf('slowdownfactor_pedestrian_striping', kwargs.get('slowdownfactor_pedestrian_striping', 0.2), - groupnames=['options', 'parameters'], - name='Ped. slowdown', - perm='rw', - info="Factor for random slow-downs [0,1] for use with model 'striping'", - )) - - self.jamtime_pedestrian_striping = attrsman.add(cm.AttrConf('jamtime_pedestrian_striping', kwargs.get('jamtime_pedestrian_striping', 10), - groupnames=['options', 'parameters'], - name='Ped. jamtime', - unit='s', - perm='rw', - info="Factor for random slow-downs [0,1] for use with model 'striping'", - )) + self.time_warmup = attrsman.add(cm.AttrConf('time_warmup', kwargs.get('time_warmup', 0.0), + groupnames=['options', 'timing'], + name='Warmup time', + perm='rw', + info='Start recording results after this time. It currently work with edgeresults, connectionresults and virtualpersonresults', + metatype='time', + unit='s', + )) self.is_edgedata = attrsman.add(cm.AttrConf('is_edgedata', kwargs.get('is_edgedata', False), groupnames=['options', 'output'], @@ -401,9 +430,16 @@ groupnames=['options', 'output'], name='Output trip data', perm='rw', - info='If set, generate detailed data for all trips.' + info='If set, generate detailed data for all completed trips.' )) + self.is_tripdata_unfinished = attrsman.add(cm.AttrConf('is_tripdata_unfinished', kwargs.get('is_tripdata_unfinished', False), + groupnames=['options', 'output'], + name='Include unfinished trip data', + perm='rw', + info='If set, also unfinished trip data is collected.' + )) + self.is_edgenoise = attrsman.add(cm.AttrConf('is_edgenoise', kwargs.get('is_edgenoise', False), groupnames=['options', 'output'], name='Output edge noise', @@ -418,6 +454,27 @@ info='If set, generate emission information for all edges.' )) + self.is_electricenergy = attrsman.add(cm.AttrConf('is_electricenergy', kwargs.get('is_electricenergy', False), + groupnames=['options', 'output'], + name='Output electric energy', + perm='rw', + info='If set, record energy data for vehicles with electric drive.' + )) + + self.is_fcd = attrsman.add(cm.AttrConf('is_fcd', kwargs.get('is_fcd', False), + groupnames=['options', 'output'], + name='Output vehicle trajectories', + perm='rw', + info='If set, record vehicle trajectories and speed for each timestep. This means SUMO FCD output is generated. Attention, this option will eat up a tremendous amount of disk space.' + )) + + self.is_summary = attrsman.add(cm.AttrConf('is_summary', kwargs.get('is_summary', False), + groupnames=['options', 'output'], + name='Output summary', + perm='rw', + info='If set, generate summary data of simulation steps.' + )) + outfile_prefix = kwargs.get('outfile_prefix', 'out') self.routesdatapath = attrsman.add(cm.AttrConf('routesdatapath', os.path.join(rootdirpath, rootname+'.'+outfile_prefix+'.roudata.xml'), groupnames=['outputfiles', '_private'], @@ -483,48 +540,102 @@ reader='interval', )) - # self.is_ignore_accidents = attrsman.add(cm.AttrConf( 'is_ignore_accidents', kwargs.get('is_ignore_accidents',False), - # name = 'ignore accidents', - # perm = 'rw', - # groupnames = ['options','misc'], - # info = 'Ignore accidents.', - # )) + self.electricenergypath = attrsman.add(cm.AttrConf('electricenergypath', os.path.join(rootdirpath, rootname+'.'+outfile_prefix+'.electricenergy.xml'), + groupnames=['outputfiles', '_private'], + perm='r', + name='Electrical energy file', + wildcards='Electrical energy XML files (*.electricenergy.xml)|*.electricenergy.xml', + metatype='filepath', + info="""SUMO xml file with edge emission data.""", + attrnames_data=['Consum', 'energyCharged', + 'energyChargedInTransit', 'energyChargedStopped'], + attrnames_averaged=['speed', ], + element='vehicle', + id_type='vehicle', + reader='interval', + )) - self.is_collission_check_junctions = attrsman.add(cm.AttrConf('is_collission_check_junctions', kwargs.get('is_collission_check_junctions', True), - name='Collission check junctions', - perm='rw', - groupnames=['options', 'misc'], - info='Perform collission check at junctions.', - )) + self.filepath_output_fcd = attrsman.add(cm.AttrConf('filepath_output_fcd', os.path.join(rootdirpath, rootname+'.'+outfile_prefix+'.fcd.xml'), + groupnames=['outputfiles', '_private'], + perm='r', + name='Trajectory file', + wildcards='Trajectory XML files (*.fcd.xml)|*.fcd.xml', + metatype='filepath', + info="""SUMO xml file with edge emission data.""", + attrnames_data=['x', 'y', 'angle', ], + attrnames_averaged=['speed', ], + element='vehicle', + id_type='vehicle', + reader='interval', + )) + + self.summarypath = attrsman.add(cm.AttrConf('summarypath', os.path.join(rootdirpath, rootname+'.'+outfile_prefix+'.electricenergysum.xml'), + groupnames=['_private'], + perm='r', + name='Simulation summary file', + wildcards='Simulation summary XML files (*.xml)|*.xml', + metatype='filepath', + info="""SUMO xml file with summary data on simulatin steps.""", + )) - self.collission_action = attrsman.add(cm.AttrConf('collission_action', kwargs.get('collission_action', 'warn'), - name='Collission action', - choices=['none', 'warn', 'teleport', 'remove'], - perm='rw', - groupnames=['options', 'misc'], - info='Specifioes what to do when a collission occurs.', - )) + self.is_rerouting = attrsman.add(cm.AttrConf('is_rerouting', kwargs.get('is_rerouting', False), + groupnames=['options', 'rerouting'], + name='Rerouting enabled', + perm='rw', + info='Enable rerouting of vehicles during the simulation.' + )) - self.is_exclude_emptyedges = attrsman.add(cm.AttrConf('is_exclude_emptyedges', kwargs.get('is_exclude_emptyedges', True), - name='No empty edges', + self.probability_rerouting = attrsman.add(cm.AttrConf('probability_rerouting', kwargs.get('probability_rerouting', 0.25), + groupnames=['options', 'rerouting'], + name='Rerouting probability', perm='rw', - groupnames=['options', 'misc'], - info='Excludes empty edges from being sampled.', + info='The probability for a vehicle to have a routing device.' )) - self.is_exclude_emptylanes = attrsman.add(cm.AttrConf('is_exclude_emptylanes', kwargs.get('is_exclude_emptylanes', True), - name='No empty lanes', - perm='rw', - groupnames=['options', 'misc'], - info='Excludes empty edges from being sampled.', - )) + self.is_deterministic_rerouting = attrsman.add(cm.AttrConf('is_deterministic_rerouting', kwargs.get('is_deterministic_rerouting', False), + groupnames=['options', 'rerouting'], + name='Deterministic rerouting', + perm='rw', + info='The devices are set deterministic using a fraction of 1000 (with the defined probability).' + )) + + self.period_rerouting = attrsman.add(cm.AttrConf('period_rerouting', kwargs.get('period_rerouting', 180), + groupnames=['options', 'rerouting'], + name='Rerouting period', + perm='rw', + info='The period with which the vehicle shall be rerouted.', + unit='s', + )) - self.seed = attrsman.add(cm.AttrConf('seed', kwargs.get('seed', 0), - name='Seed', - perm='rw', - groupnames=['options', 'misc'], - info='Random seed.', - )) + self.preperiod_rerouting = attrsman.add(cm.AttrConf('preperiod_rerouting', kwargs.get('preperiod_rerouting', 180), + groupnames=['options', 'rerouting'], + name='Rerouting pre-period', + perm='rw', + info='The rerouting period before insertion/depart.', + unit='s', + )) + self.adaptationinterval_rerouting = attrsman.add(cm.AttrConf('adaptationinterval_rerouting', kwargs.get('adaptationinterval_rerouting', 180), + groupnames=['options', 'rerouting'], + name='adaptation interval edge weight', + perm='rw', + info='The interval for updating the edge weights. Short update times means a large computational burden.', + unit='s', + )) + self.adaptationweight_rerouting = attrsman.add(cm.AttrConf('adaptationweight_rerouting', kwargs.get('adaptationweight_rerouting', 0.0), + groupnames=['options', 'rerouting'], + name='Adaptation weight for rerouting', + perm='rw', + info='The weight of prior edge weights for exponential averaging from [0, 1]. Disabeled for 0.0.' + )) + + self.adaptationsteps_rerouting = attrsman.add(cm.AttrConf('adaptationsteps_rerouting', kwargs.get('adaptationsteps_rerouting', 10), + groupnames=['options', 'rerouting'], + name='Adaptation steps for rerouting', + perm='rw', + info='The number of adaptation steps for edge weights averaging (enable for values > 0).' + )) + + self._init_special(**kwargs) self.is_include_poly = attrsman.add(cm.AttrConf('is_include_poly', kwargs.get('is_include_poly', True), name='Include buildings?', @@ -657,11 +768,112 @@ # print ' is_export_poly,is_include_poly, filepath_poly',is_export_poly, self.is_include_poly, self.polyfilepath - self._init_special(**kwargs) - if is_runnow: self.run() + def _init_attributes_basic(self, scenario, optionprefix='', **kwargs): + attrsman = self.get_attrsman() + + if optionprefix == '': + optionprefix_nice = '' + prefixgroups = [] + else: + optionprefix_nice = optionprefix.title()+': ' + prefixgroups = [optionprefix] + + self.time_step = attrsman.add(cm.AttrConf('time_step', kwargs.get('time_step', 0.2), + groupnames=['options', 'timing']+prefixgroups, + name=optionprefix_nice+'Time step', + perm='rw', + info='Basic simulation time step (1s by default).', + metatype='time', + unit='s', + cml=optionprefix+'--step-length', + )) + + self.is_ballistic_integrator = attrsman.add(cm.AttrConf('is_ballistic_integrator', kwargs.get('is_ballistic_integrator', False), + groupnames=['options', 'timing']+prefixgroups, + name=optionprefix_nice+'Ballistic integrator', + perm='rw', + info='Whether to use ballistic method for the positional update of vehicles (default is a semi-implicit Euler method).', + cml=optionprefix+'--step-method.ballistic', + )) + + # print ' ',scenario.demand.vtypes.lanechangemodel.get_value() + if scenario.demand.vtypes.lanechangemodel.get_value() in ['SL2015', ]: + width_sublanes_default = 1.0 + else: + width_sublanes_default = -1.0 + + self.width_sublanes = attrsman.add(cm.AttrConf('width_sublanes', kwargs.get('width_sublanes', width_sublanes_default), + groupnames=['options', 'edges']+prefixgroups, + cml=optionprefix+'--lateral-resolution', + perm='rw', + name=optionprefix_nice+'Sublane width', + unit='m', + info='Width of sublanes. Should be less than lane width. If negative the sublanes are disabeled.', + is_enabled=lambda self: self.width_sublanes > 0, + )) + + # + # --max-depart-delay